lodash-rails 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,56 +1,58 @@
1
1
  /**
2
2
  * @license
3
- * Lo-Dash 2.2.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
3
+ * Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
4
4
  * Build: `lodash -o ./dist/lodash.compat.js`
5
5
  */
6
- ;(function(){function n(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 t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=!0
7
- }}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[0|r/2],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return!1;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Z[n]}function i(){return y.pop()||[]}function l(){return m.pop()||{k:null,l:null,m:null,"false":!1,n:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,o:null}
8
- }function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(){}function p(n){n.length=0,y.length<j&&y.push(n)}function s(n){var t=n.l;t&&s(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,m.length<j&&m.push(n)}function g(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function h(e){function y(n){return n&&typeof n=="object"&&!Je(n)&&de.call(n,"__wrapped__")?n:new m(n)}function m(n,t){this.__chain__=!!t,this.__wrapped__=n
9
- }function j(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!bt(n))return n;var a=ke.call(n);if(!U[a]||!We.nodeClass&&f(n))return n;var l=qe[a];switch(a){case z:case q:return new l(+n);case G:case H:return new l(n);case M:return o=l(n.source,I.exec(n)),o.lastIndex=n.lastIndex,o}if(a=Je(n),t){var c=!r;r||(r=i()),u||(u=i());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=a?l(n.length):{}}else o=a?g(n):er({},n);return a&&(de.call(n,"index")&&(o.index=n.index),de.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?tr:or)(n,function(n,a){o[a]=j(n,t,e,r,u)
10
- }),c&&(p(r),p(u)),o):o}function Z(n,t,e){if(typeof n!="function")return Ht;if(typeof t=="undefined")return n;var r=n.__bindData__||We.funcNames&&!n.name;if(typeof r=="undefined"){var u=P&&ye.call(n);We.funcNames||!u||A.test(u)||(r=!0),(We.funcNames||!r)&&(r=!We.funcDecomp||P.test(u),Ge(n,r))}if(true!==r&&r&&1&r[1])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)
11
- }}return Gt(n,t)}function tt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(Je(a)||vt(a))){t||(a=tt(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function et(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&&Y[typeof n]||t&&Y[typeof t]))return!1;if(null==n||null==t)return n===t;var l=ke.call(n),c=ke.call(t);
12
- if(l==L&&(l=J),c==L&&(c=J),l!=c)return!1;switch(l){case z:case q:return+n==+t;case G:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case M:case H:return n==oe(t)}if(c=l==T,!c){if(de.call(n,"__wrapped__")||de.call(t,"__wrapped__"))return et(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(l!=J||!We.nodeClass&&(f(n)||f(t)))return!1;var l=!We.argsObject&&vt(n)?re:n.constructor,s=!We.argsObject&&vt(t)?re:t.constructor;if(l!=s&&!(_t(l)&&l instanceof l&&_t(s)&&s instanceof s))return!1}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;
13
- var g=0,a=!0;if(u.push(n),o.push(t),c){if(l=n.length,g=t.length,a=g==n.length,!a&&!r)return a;for(;g--;)if(c=l,s=t[g],r)for(;c--&&!(a=et(n[c],s,e,r,u,o)););else if(!(a=et(n[g],s,e,r,u,o)))break;return a}return ur(t,function(t,i,l){return de.call(l,i)?(g++,a=de.call(n,i)&&et(n[i],t,e,r,u,o)):void 0}),a&&!r&&ur(n,function(n,t,e){return de.call(e,t)?a=-1<--g:void 0}),s&&(p(u),p(o)),a}function ut(n,t,e,r,u){(Je(t)?St:or)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=Je(t))||ar(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
14
- break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?Je(f)?f:[]:ar(f)?f:{}),r.push(t),u.push(f),c||ut(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function at(e,r,u){var a=-1,l=st(),f=e?e.length:0,c=[],g=!r&&f>=w&&l===n,h=u||g?i():c;if(g){var v=o(h);v?(l=t,h=v):(g=!1,h=u?h:(p(h),c))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),c.push(v))}return g?(p(h.k),s(h)):u&&p(h),c}function it(n){return function(t,e,r){var u={};
15
- if(e=y.createCallback(e,r,3),Je(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else tr(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function lt(n,t,e,r,u,o){var a=1&t,i=2&t,l=4&t,f=8&t,c=16&t,p=32&t,s=n;if(!i&&!_t(n))throw new ae;c&&!e.length&&(t&=-17,c=e=!1),p&&!r.length&&(t&=-33,p=r=!1);var g=n&&n.__bindData__;if(g)return!a||1&g[1]||(g[4]=u),!a&&1&g[1]&&(t|=8),!l||4&g[1]||(g[5]=o),c&&be.apply(g[2]||(g[2]=[]),e),p&&be.apply(g[3]||(g[3]=[]),r),g[1]|=t,lt.apply(null,g);if(!a||i||l||p||!(We.fastBind||Se&&c))v=function(){var g=arguments,h=a?u:this;
16
- return(l||c||p)&&(g=Le.call(g),c&&Ee.apply(g,e),p&&be.apply(g,r),l&&g.length<o)?(t|=16,lt(n,f?t:-4&t,g,null,u,o)):(i&&(n=h[s]),this instanceof v?(h=ct(n.prototype),g=n.apply(h,g),bt(g)?g:h):n.apply(h,g))};else{if(c){var h=[u];be.apply(h,e)}var v=c?Se.apply(n,h):Se.call(n,u)}return Ge(v,Le.call(arguments)),v}function ft(){X.h=$,X.b=X.c=X.g=X.i="",X.e="t",X.j=!0;for(var n,t=0;n=arguments[t];t++)for(var e in n)X[e]=n[e];t=X.a,X.d=/^[^,]+/.exec(t)[0],n=ne,t="return function("+t+"){",e=X;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";
17
- e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",We.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):We.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),We.enumPrototypes&&(r+="var G=typeof t=='function';"),We.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(We.enumPrototypes&&u.push('!(G&&n=="prototype")'),We.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.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+=e.g+";",u.length&&(r+="}"),r+="}";
18
- else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",We.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='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||We.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(Z,K,le,de,_,vt,Je,jt,X.f,fe,Y,Ke,H,ce,ke)
19
- }function ct(n){return bt(n)?Ie(n):{}}function pt(n){return Xe[n]}function st(){var t=(t=y.indexOf)===Lt?n:t;return t}function gt(n){var t,e;return!n||ke.call(n)!=J||(t=n.constructor,_t(t)&&!(t instanceof t))||!We.argsClass&&vt(n)||!We.nodeClass&&f(n)?!1:We.ownLast?(ur(n,function(n,t,r){return e=de.call(r,t),!1}),false!==e):(ur(n,function(n,t){e=t}),typeof e=="undefined"||de.call(n,e))}function ht(n){return Ye[n]}function vt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ke.call(n)==L||!1
20
- }function yt(n,t,e){var r=He(n),u=r.length;for(t=Z(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function mt(n){var t=[];return ur(n,function(n,e){_t(n)&&t.push(e)}),t.sort()}function dt(n){for(var t=-1,e=He(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function _t(n){return typeof n=="function"}function bt(n){return!(!n||!Y[typeof n])}function wt(n){return typeof n=="number"||ke.call(n)==G}function jt(n){return typeof n=="string"||ke.call(n)==H}function xt(n){for(var t=-1,e=He(n),r=e.length,u=Xt(r);++t<r;)u[t]=n[e[t]];
21
- return u}function Ct(n,t,e){var r=-1,u=st(),o=n?n.length:0,a=!1;return e=(0>e?Pe(0,o+e):e)||0,Je(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(jt(n)?n.indexOf(t,e):u(n,t,e)):tr(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function kt(n,t,e){var r=!0;if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else tr(n,function(n,e,u){return r=!!t(n,e,u)});return r}function Et(n,t,e){var r=[];if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
22
- t(o,e,n)&&r.push(o)}}else tr(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Ot(n,t,e){if(t=y.createCallback(t,e,3),!Je(n)){var r;return tr(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function St(n,t,e){if(t&&typeof e=="undefined"&&Je(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else tr(n,t,e);return n}function It(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:Z(t,e,3),Je(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=He(n),u=o.length;
23
- else We.unindexedChars&&jt(n)&&(r=n.split(""));tr(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function At(n,t,e){var r=-1,u=n?n.length:0,o=Xt(typeof u=="number"?u:0);if(t=y.createCallback(t,e,3),Je(n))for(;++r<u;)o[r]=t(n[r],r,n);else tr(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Nt(n,t,e){var u=-1/0,o=u;if(!t&&Je(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&jt(n)?r:y.createCallback(t,e,3),tr(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o
24
- }function Bt(n,t,e,r){var u=3>arguments.length;if(t=Z(t,r,4),Je(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else tr(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)});return e}function Dt(n,t,e,r){var u=3>arguments.length;return t=Z(t,r,4),It(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Pt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return St(n,function(n){var e=Vt(++t);r[t]=r[e],r[e]=n}),r}function Rt(n,t,e){var r;if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else tr(n,function(n,e,u){return!(r=t(n,e,u))
25
- });return!!r}function Ft(e){var r=-1,u=st(),a=e?e.length:0,i=tt(arguments,!0,!0,1),l=[],f=a>=w&&u===n;if(f){var c=o(i);c?(u=t,i=c):f=!1}for(;++r<a;)c=e[r],0>u(i,c)&&l.push(c);return f&&s(i),l}function $t(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return g(n,0,Re(Pe(0,r),u))}function Lt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Pe(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;
26
- return n(t,e,r)}function Tt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Pe(0,t);return g(n,r)}function zt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?y.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function qt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(e=y.createCallback(e,r,3)),at(n,t,e)}function Kt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Nt(cr(n,"length")):0,r=Xt(0>e?0:e);++t<e;)r[t]=cr(n,t);
27
- return r}function Wt(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 Gt(n,t){return 2<arguments.length?lt(n,17,Le.call(arguments,2),null,t):lt(n,1,null,null,t)}function Jt(n,t,e){function r(){c&&he(c),a=c=p=v,(h||g!==t)&&(s=_e(),i=n.apply(f,o))}function u(){var e=t-(_e()-l);0<e?c=xe(u,e):(a&&he(a),e=p,a=c=p=v,e&&(s=_e(),i=n.apply(f,o)))}var o,a,i,l,f,c,p,s=0,g=!1,h=!0;if(!_t(n))throw new ae;if(t=Pe(0,t)||0,true===e)var y=!0,h=!1;else bt(e)&&(y=e.leading,g="maxWait"in e&&(Pe(t,e.maxWait)||0),h="trailing"in e?e.trailing:h);
28
- return function(){if(o=arguments,l=_e(),f=this,p=h&&(c||!y),false===g)var e=y&&!c;else{a||y||(s=l);var v=g-(l-s);0<v?a||(a=xe(r,v)):(a&&(a=he(a)),s=l,i=n.apply(f,o))}return c||t===g||(c=xe(u,t)),e&&(i=n.apply(f,o)),i}}function Mt(n){if(!_t(n))throw new ae;var t=Le.call(arguments,1);return xe(function(){n.apply(v,t)},1)}function Ht(n){return n}function Ut(n,t){var e=n,r=!t||_t(e);t||(e=m,t=n,n=y),St(mt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return be.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)
29
- })})}function Vt(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r=$e(),e||n%1||t%1?Re(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+ve(r*(t-n+1))}function Qt(){return this.__wrapped__}e=e?ot.defaults(nt.Object(),e,ot.pick(nt,F)):nt;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,ne=e.Function,te=e.Math,ee=e.Number,re=e.Object,ue=e.RegExp,oe=e.String,ae=e.TypeError,ie=[],le=e.Error.prototype,fe=re.prototype,ce=oe.prototype,pe=e._,se=ue("^"+oe(fe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ge=te.ceil,he=e.clearTimeout,ve=te.floor,ye=ne.prototype.toString,me=se.test(me=re.getPrototypeOf)&&me,de=fe.hasOwnProperty,_e=se.test(_e=Zt.now)&&_e||function(){return+new Zt
30
- },be=ie.push,we=fe.propertyIsEnumerable,je=e.setImmediate,xe=e.setTimeout,Ce=ie.splice,ke=fe.toString,Ee=ie.unshift,Oe=function(){try{var n={},t=se.test(t=re.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Se=se.test(Se=ke.bind)&&Se,Ie=se.test(Ie=re.create)&&Ie,Ae=se.test(Ae=Xt.isArray)&&Ae,Ne=e.isFinite,Be=e.isNaN,De=se.test(De=re.keys)&&De,Pe=te.max,Re=te.min,Fe=e.parseInt,$e=te.random,Le=ie.slice,Te=se.test(e.attachEvent),ze=Se&&!/\n|true/.test(Se+Te),qe={};qe[T]=Xt,qe[z]=Yt,qe[q]=Zt,qe[W]=ne,qe[J]=re,qe[G]=ee,qe[M]=ue,qe[H]=oe;
31
- var Ke={};Ke[T]=Ke[q]=Ke[G]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ke[z]=Ke[H]={constructor:!0,toString:!0,valueOf:!0},Ke[K]=Ke[W]=Ke[M]={constructor:!0,toString:!0},Ke[J]={constructor:!0},function(){for(var n=$.length;n--;){var t,e=$[n];for(t in Ke)de.call(Ke,t)&&!de.call(Ke[t],e)&&(Ke[t][e]=!1)}}(),m.prototype=y.prototype;var We=y.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};for(var u in new n)r.push(u);for(u in arguments);We.argsClass=ke.call(arguments)==L,We.argsObject=arguments.constructor==re&&!(arguments instanceof Xt),We.enumErrorProps=we.call(le,"message")||we.call(le,"name"),We.enumPrototypes=we.call(n,"prototype"),We.fastBind=Se&&!ze,We.funcDecomp=!se.test(e.p)&&P.test(h),We.funcNames=typeof ne.name=="string",We.nonEnumArgs=0!=u,We.nonEnumShadows=!/valueOf/.test(r),We.ownLast="x"!=r[0],We.spliceObjects=(ie.splice.call(t,0,1),!t[0]),We.unindexedChars="xx"!="x"[0]+re("x")[0];
32
- try{We.nodeClass=!(ke.call(document)==J&&!({toString:0}+""))}catch(o){We.nodeClass=!0}}(1),y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:y}},Ie||(ct=function(n){if(bt(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}});var Ge=Oe?function(n,t){Q.value=t,Oe(n,"__bindData__",Q)}:c;We.argsClass||(vt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&de.call(n,"callee")||!1});var Je=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ke.call(n)==T||!1
33
- },Me=ft({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),He=De?function(n){return bt(n)?We.enumPrototypes&&typeof n=="function"||We.nonEnumArgs&&n.length&&vt(n)?Me(n):De(n):[]}:Me,Ue={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:He,g:"if(e(t[n],n,g)===false)return E"},Ve={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:He,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Qe={i:"if(!B[typeof t])return E;"+Ue.i,b:!1},Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ye=dt(Xe),Ze=ue("("+He(Ye).join("|")+")","g"),nr=ue("["+He(Xe).join("")+"]","g"),tr=ft(Ue),er=ft(Ve,{i:Ve.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]"}),rr=ft(Ve),ur=ft(Ue,Qe,{j:!1}),or=ft(Ue,Qe);
34
- _t(/x/)&&(_t=function(n){return typeof n=="function"&&ke.call(n)==W});var ar=me?function(n){if(!n||ke.call(n)!=J||!We.argsClass&&vt(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=me(t))&&me(e);return e?n==e||me(n)==e:gt(n)}:gt,ir=it(function(n,t,e){de.call(n,e)?n[e]++:n[e]=1}),lr=it(function(n,t,e){(de.call(n,e)?n[e]:n[e]=[]).push(t)}),fr=it(function(n,t,e){n[e]=t}),cr=At;ze&&rt&&typeof je=="function"&&(Mt=function(n){if(!_t(n))throw new ae;return je.apply(e,arguments)});var pr=8==Fe(x+"08")?Fe:function(n,t){return Fe(jt(n)?n.replace(B,""):n,t||0)
35
- };return y.after=function(n,t){if(!_t(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},y.assign=er,y.at=function(n){var t=arguments,e=-1,r=tt(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);for(We.unindexedChars&&jt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},y.bind=Gt,y.bindAll=function(n){for(var t=1<arguments.length?tt(arguments,!0,!1,1):mt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=lt(n[u],1,null,null,n)}return n},y.bindKey=function(n,t){return 2<arguments.length?lt(t,19,Le.call(arguments,2),null,n):lt(t,3,null,null,n)
36
- },y.chain=function(n){return n=new m(n),n.__chain__=!0,n},y.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},y.compose=function(){for(var n=arguments,t=n.length;t--;)if(!_t(n[t]))throw new ae;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},y.countBy=ir,y.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return Z(n,t,e);if("object"!=r)return function(t){return t[n]};var u=He(n),o=u[0],a=n[o];
37
- return 1!=u.length||a!==a||bt(a)?function(t){for(var e=u.length,r=!1;e--&&(r=et(t[u[e]],n[u[e]],null,!0)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},y.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,lt(n,4,null,null,null,t)},y.debounce=Jt,y.defaults=rr,y.defer=Mt,y.delay=function(n,t){if(!_t(n))throw new ae;var e=Le.call(arguments,2);return xe(function(){n.apply(v,e)},t)},y.difference=Ft,y.filter=Et,y.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(n=At(n,e,r)),tt(n,t)
38
- },y.forEach=St,y.forEachRight=It,y.forIn=ur,y.forInRight=function(n,t,e){var r=[];ur(n,function(n,t){r.push(t,n)});var u=r.length;for(t=Z(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},y.forOwn=or,y.forOwnRight=yt,y.functions=mt,y.groupBy=lr,y.indexBy=fr,y.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return g(n,0,Re(Pe(0,u-r),u))},y.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,c=st(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
39
- l[a]=c===n&&(y?y.length:0)>=w&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):c(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):c(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&s(m);return p(l),p(v),h},y.invert=dt,y.invoke=function(n,t){var e=Le.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Xt(typeof o=="number"?o:0);return St(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},y.keys=He,y.map=At,y.max=Nt,y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
40
- return de.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!_t(n))throw new ae;return e.cache={},e},y.merge=function(n){var t=arguments,e=2;if(!bt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Z(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Le.call(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ut(n,t[u],r,o,a);return p(o),p(a),n},y.min=function(n,t,e){var u=1/0,o=u;if(!t&&Je(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&jt(n)?r:y.createCallback(t,e,3),tr(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
41
- });return o},y.omit=function(n,t,e){var r=st(),u=typeof t=="function",o={};if(u)t=y.createCallback(t,e,3);else var a=tt(arguments,!0,!1,1);return ur(n,function(n,e,i){(u?!t(n,e,i):0>r(a,e))&&(o[e]=n)}),o},y.once=function(n){var t,e;if(!_t(n))throw new ae;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},y.pairs=function(n){for(var t=-1,e=He(n),r=e.length,u=Xt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},y.partial=function(n){return lt(n,16,Le.call(arguments,1))},y.partialRight=function(n){return lt(n,32,null,Le.call(arguments,1))
42
- },y.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=tt(arguments,!0,!1,1),a=bt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=y.createCallback(t,e,3),ur(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},y.pluck=cr,y.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&&(Ce.call(n,o--,1),u--);return n},y.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Pe(0,ge((t-n)/(e||1)));
43
- for(var u=Xt(t);++r<t;)u[r]=n,n+=e;return u},y.reject=function(n,t,e){return t=y.createCallback(t,e,3),Et(n,function(n,e,r){return!t(n,e,r)})},y.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=y.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Ce.call(n,r--,1),u--);return o},y.rest=Tt,y.shuffle=Pt,y.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=Xt(typeof o=="number"?o:0);for(t=y.createCallback(t,e,3),St(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,s(n);
44
- return a},y.tap=function(n,t){return t(n),n},y.throttle=function(n,t,e){var r=!0,u=!0;if(!_t(n))throw new ae;return false===e?r=!1:bt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),V.leading=r,V.maxWait=t,V.trailing=u,Jt(n,t,V)},y.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Xt(n);for(t=Z(t,e,1);++r<n;)u[r]=t(r);return u},y.toArray=function(n){return n&&typeof n.length=="number"?We.unindexedChars&&jt(n)?n.split(""):g(n):xt(n)},y.transform=function(n,t,e,r){var u=Je(n);return t=Z(t,r,4),null==e&&(u?e=[]:(r=n&&n.constructor,e=ct(r&&r.prototype))),(u?tr:or)(n,function(n,r,u){return t(e,n,r,u)
45
- }),e},y.union=function(){return at(tt(arguments,!0,!0))},y.uniq=qt,y.values=xt,y.where=Et,y.without=function(n){return Ft(n,Le.call(arguments,1))},y.wrap=function(n,t){if(!_t(t))throw new ae;return function(){var e=[n];return be.apply(e,arguments),t.apply(this,e)}},y.zip=Kt,y.zipObject=Wt,y.collect=At,y.drop=Tt,y.each=St,y.q=It,y.extend=er,y.methods=mt,y.object=Wt,y.select=Et,y.tail=Tt,y.unique=qt,y.unzip=Kt,Ut(y),y.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),j(n,t,typeof e=="function"&&Z(e,r,1))
46
- },y.cloneDeep=function(n,t,e){return j(n,!0,typeof t=="function"&&Z(t,e,1))},y.contains=Ct,y.escape=function(n){return null==n?"":oe(n).replace(nr,pt)},y.every=kt,y.find=Ot,y.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=y.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},y.findKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),or(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.findLast=function(n,t,e){var r;return t=y.createCallback(t,e,3),It(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0
47
- }),r},y.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=y.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},y.findLastKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),yt(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.has=function(n,t){return n?de.call(n,t):!1},y.identity=Ht,y.indexOf=Lt,y.isArguments=vt,y.isArray=Je,y.isBoolean=function(n){return true===n||false===n||ke.call(n)==z},y.isDate=function(n){return n?typeof n=="object"&&ke.call(n)==q:!1},y.isElement=function(n){return n?1===n.nodeType:!1
48
- },y.isEmpty=function(n){var t=!0;if(!n)return t;var e=ke.call(n),r=n.length;return e==T||e==H||(We.argsClass?e==L:vt(n))||e==J&&typeof r=="number"&&_t(n.splice)?!r:(or(n,function(){return t=!1}),t)},y.isEqual=function(n,t,e,r){return et(n,t,typeof e=="function"&&Z(e,r,2))},y.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},y.isFunction=_t,y.isNaN=function(n){return wt(n)&&n!=+n},y.isNull=function(n){return null===n},y.isNumber=wt,y.isObject=bt,y.isPlainObject=ar,y.isRegExp=function(n){return n&&Y[typeof n]?ke.call(n)==M:!1
49
- },y.isString=jt,y.isUndefined=function(n){return typeof n=="undefined"},y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Pe(0,r+e):Re(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},y.mixin=Ut,y.noConflict=function(){return e._=pe,this},y.parseInt=pr,y.random=Vt,y.reduce=Bt,y.reduceRight=Dt,y.result=function(n,t){if(n){var e=n[t];return _t(e)?n[t]():e}},y.runInContext=h,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:He(n).length},y.some=Rt,y.sortedIndex=zt,y.template=function(n,t,e){var r=y.templateSettings;
50
- n||(n=""),e=rr({},e,r);var u,o=rr({},e.imports,r.imports),r=He(o),o=xt(o),i=0,l=e.interpolate||D,f="__p+='",l=ue((e.escape||D).source+"|"+l.source+"|"+(l===N?S:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(R,a),e&&(f+="'+__e("+e+")+'"),l&&(u=!0,f+="';"+l+";__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';\n",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(C,""):f).replace(E,"$1").replace(O,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";
51
- try{var c=ne(r,"return "+f).apply(v,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.unescape=function(n){return null==n?"":oe(n).replace(Ze,ht)},y.uniqueId=function(n){var t=++d;return oe(null==n?"":n)+t},y.all=kt,y.any=Rt,y.detect=Ot,y.findWhere=Ot,y.foldl=Bt,y.foldr=Dt,y.include=Ct,y.inject=Bt,or(y,function(n,t){y.prototype[t]||(y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return be.apply(t,arguments),t=n.apply(y,t),e?new m(t,e):t})}),y.first=$t,y.last=function(n,t,e){var r=0,u=n?n.length:0;
52
- if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return g(n,Pe(0,u-r))},y.sample=function(n,t,e){var r=n?n.length:0;return typeof r!="number"?n=xt(n):We.unindexedChars&&jt(n)&&(n=n.split("")),null==t||e?n?n[Vt(r-1)]:v:(n=Pt(n),n.length=Re(Pe(0,t),n.length),n)},y.take=$t,y.head=$t,or(y,function(n,t){var e="sample"!==t;y.prototype[t]||(y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new m(o,u):o
53
- })}),y.VERSION="2.2.1",y.prototype.chain=function(){return this.__chain__=!0,this},y.prototype.toString=function(){return oe(this.__wrapped__)},y.prototype.value=Qt,y.prototype.valueOf=Qt,tr(["join","pop","shift"],function(n){var t=ie[n];y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new m(e,n):e}}),tr(["push","reverse","sort","unshift"],function(n){var t=ie[n];y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tr(["concat","slice","splice"],function(n){var t=ie[n];
54
- y.prototype[n]=function(){return new m(t.apply(this.__wrapped__,arguments),this.__chain__)}}),We.spliceObjects||tr(["pop","shift","splice"],function(n){var t=ie[n],e="splice"==n;y.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 m(u,n):u}}),y}var v,y=[],m=[],d=0,_={},b=+new Date+"",w=75,j=40,x=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",C=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,O=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,I=/\w*$/,A=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,B=RegExp("^["+x+"]*0+(?=.$)"),D=/($^)/,P=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),L="[object Arguments]",T="[object Array]",z="[object Boolean]",q="[object Date]",K="[object Error]",W="[object Function]",G="[object Number]",J="[object Object]",M="[object RegExp]",H="[object String]",U={};
55
- U[W]=!1,U[L]=U[T]=U[z]=U[q]=U[G]=U[J]=U[M]=U[H]=!0;var V={leading:!1,maxWait:0,trailing:!1},Q={configurable:!1,enumerable:!1,value:null,writable:!1},X={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},nt=Y[typeof window]&&window||this,tt=Y[typeof exports]&&exports&&!exports.nodeType&&exports,et=Y[typeof module]&&module&&!module.nodeType&&module,rt=et&&et.exports===tt&&tt,ut=Y[typeof global]&&global;
56
- !ut||ut.global!==ut&&ut.window!==ut||(nt=ut);var ot=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(nt._=ot, define(function(){return ot})):tt&&et?rt?(et.exports=ot)._=ot:tt._=ot:nt._=ot}).call(this);
6
+ ;(function(){function n(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 t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
7
+ }}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
8
+ }function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function g(e){function v(n){return n&&typeof n=="object"&&!We(n)&&je.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n
9
+ }function w(n){function t(){if(r){var n=r.slice();Ce.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return Ct(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return Ke(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!Ct(n))return n;var a=ve.call(n);if(!H[a]||!qe.nodeClass&&f(n))return n;var l=Te[a];switch(a){case T:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o
10
+ }if(a=We(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):nr({},n);return a&&(je.call(n,"index")&&(o.index=n.index),je.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Ze:rr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return Ct(n)?Ae(n):{}}function tt(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(qe.funcNames&&(r=!n.name),r=r||!qe.funcDecomp,!r)){var u=_e.call(n);
11
+ qe.funcNames||(r=!I.test(u)),r||(r=B.test(u),Ke(n,r))}if(false===r||true!==r&&1&r[1])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 Ht(n,t)}function ot(n){function t(){var n=l?a:this;if(u){var h=u.slice();Ce.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&Ce.apply(h,o),c&&h.length<i)?(r|=16,ot([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),Ct(h)?h:n):e.apply(n,h))
12
+ }var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return Ke(t,n),t}function at(e,r){var u=-1,a=yt(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function it(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(We(a)||bt(a))){t||(a=it(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o
13
+ }function lt(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 false;if(null==n||null==t)return n===t;var l=ve.call(n),p=ve.call(t);if(l==$&&(l=G),p==$&&(p=G),l!=p)return false;switch(l){case T:case z:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==le(t)}if(p=l==L,!p){var s=je.call(n,"__wrapped__"),g=je.call(t,"__wrapped__");if(s||g)return lt(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);
14
+ if(l!=G||!qe.nodeClass&&(f(n)||f(t)))return false;if(l=!qe.argsObject&&bt(n)?ae:n.constructor,s=!qe.argsObject&&bt(t)?ae:t.constructor,l!=s&&!(xt(l)&&l instanceof l&&xt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;var h=0,a=true;if(u.push(n),o.push(t),p){if(l=n.length,h=t.length,a=h==n.length,!a&&!r)return a;for(;h--;)if(p=l,s=t[h],r)for(;p--&&!(a=lt(n[p],s,e,r,u,o)););else if(!(a=lt(n[h],s,e,r,u,o)))break;return a
15
+ }return er(t,function(t,i,l){return je.call(l,i)?(h++,a=je.call(n,i)&&lt(n[i],t,e,r,u,o)):void 0}),a&&!r&&er(n,function(n,t,e){return je.call(e,t)?a=-1<--h:void 0}),s&&(c(u),c(o)),a}function ft(n,t,e,r,u){(We(t)?Nt:rr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=We(t))||ur(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?We(f)?f:[]:ur(f)?f:{}),r.push(t),u.push(f),c||ft(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);
16
+ n[o]=f})}function ct(n,t){return n+be(Le()*(t-n+1))}function pt(e,r,u){var a=-1,l=yt(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;if(g){var v=o(h);v?(l=t,h=v):(g=false,h=u?h:(c(h),s))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function st(n){return function(t,e,r){var u={};if(e=v.createCallback(e,r,3),We(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Ze(t,function(t,r,o){n(u,t,e(t,r,o),o)
17
+ });return u}}function gt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||xt(n)))throw new fe;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&Ce.apply(c[2]||(c[2]=[]),e),f&&Ce.apply(c[3]||(c[3]=[]),r),c[1]|=t,gt.apply(null,c)):(1==t||17===t?w:ot)([n,t,e,r,u,o])}function ht(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];
18
+ t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=re,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",qe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):qe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),qe.enumPrototypes&&(r+="var G=typeof t=='function';"),qe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(qe.enumPrototypes&&u.push('!(G&&n=="prototype")'),qe.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.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+=e.g+";",u.length&&(r+="}"),r+="}";
19
+ else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",qe.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='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||qe.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,pe,je,d,bt,We,Et,Q.f,se,X,ze,M,ge,ve)
20
+ }function vt(n){return Ve[n]}function yt(){var t=(t=v.indexOf)===qt?n:t;return t}function mt(n){var t,e;return!n||ve.call(n)!=G||(t=n.constructor,xt(t)&&!(t instanceof t))||!qe.argsClass&&bt(n)||!qe.nodeClass&&f(n)?false:qe.ownLast?(er(n,function(n,t,r){return e=je.call(r,t),false}),false!==e):(er(n,function(n,t){e=t}),typeof e=="undefined"||je.call(n,e))}function dt(n){return Qe[n]}function bt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false}function _t(n,t,e){var r=Je(n),u=r.length;
21
+ for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function wt(n){var t=[];return er(n,function(n,e){xt(n)&&t.push(e)}),t.sort()}function jt(n){for(var t=-1,e=Je(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function xt(n){return typeof n=="function"}function Ct(n){return!(!n||!X[typeof n])}function kt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Et(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==M||false}function Ot(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];
22
+ return u}function St(n,t,e){var r=-1,u=yt(),o=n?n.length:0,a=false;return e=(0>e?Re(0,o+e):e)||0,We(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(Et(n)?n.indexOf(t,e):u(n,t,e)):Ze(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function It(n,t,e){var r=true;if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ze(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
23
+ t(o,e,n)&&r.push(o)}}else Ze(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Dt(n,t,e){if(t=v.createCallback(t,e,3),!We(n)){var r;return Ze(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Nt(n,t,e){if(t&&typeof e=="undefined"&&We(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Ze(n,t,e);return n}function Bt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),We(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=Je(n),u=o.length;
24
+ else qe.unindexedChars&&Et(n)&&(r=n.split(""));Ze(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Pt(n,t,e){var r=-1,u=n?n.length:0,o=ne(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),We(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ze(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Rt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)
25
+ });return o}function Ft(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),We(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ze(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=v.createCallback(t,r,4),Bt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Lt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Nt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function Tt(n,t,e){var r;if(t=v.createCallback(t,e,3),We(n)){e=-1;
26
+ for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ze(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Fe(Re(0,r),u))}function qt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Re(0,u+r):r||0}else if(r)return r=Wt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
27
+ for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Re(0,t);return s(n,r)}function Wt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Gt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),pt(n,t,e)}function Jt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Rt(lr(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=lr(n,t);
28
+ return r}function Mt(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 Ht(n,t){return 2<arguments.length?gt(n,17,s(arguments,2),null,t):gt(n,1,null,null,t)}function Ut(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!xt(n))throw new fe;if(t=Re(0,t)||0,true===e)var g=true,s=false;else Ct(e)&&(g=e.leading,p="maxWait"in e&&(Re(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(xe()-a);0<e?l=Ee(v,e):(u&&de(u),e=f,u=l=f=h,e&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null)))
29
+ },y=function(){l&&de(l),u=l=f=h,(s||p!==t)&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=xe(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);var h=p-(a-c),m=0>=h;m?(u&&(u=de(u)),c=a,o=n.apply(i,r)):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){if(!xt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||xt(e);
30
+ t||(e=y,t=n,n=v),Nt(wt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e._,ve=se.toString,ye=ie("^"+le(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),me=ue.ceil,de=e.clearTimeout,be=ue.floor,_e=re.prototype.toString,we=ye.test(we=ae.getPrototypeOf)&&we,je=se.hasOwnProperty,xe=ye.test(xe=ee.now)&&xe||function(){return+new ee
31
+ },Ce=ce.push,ke=se.propertyIsEnumerable,Ee=e.setTimeout,Oe=ce.splice,Se=typeof(Se=rt&&et&&rt.setImmediate)=="function"&&!ye.test(Se)&&Se,Ie=function(){try{var n={},t=ye.test(t=ae.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ae=ye.test(Ae=ae.create)&&Ae,De=ye.test(De=ne.isArray)&&De,Ne=e.isFinite,Be=e.isNaN,Pe=ye.test(Pe=ae.keys)&&Pe,Re=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,Te={};Te[L]=ne,Te[T]=te,Te[z]=ee,Te[K]=re,Te[G]=ae,Te[W]=oe,Te[J]=ie,Te[M]=le;var ze={};ze[L]=ze[z]=ze[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},ze[T]=ze[M]={constructor:true,toString:true,valueOf:true},ze[q]=ze[K]=ze[J]={constructor:true,toString:true},ze[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
32
+ for(t in ze)je.call(ze,t)&&!je.call(ze[t],e)&&(ze[t][e]=false)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=ve.call(arguments)==$,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.enumErrorProps=ke.call(pe,"message")||ke.call(pe,"name"),qe.enumPrototypes=ke.call(n,"prototype"),qe.funcDecomp=!ye.test(e.WinRTError)&&B.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0];
33
+ try{qe.nodeClass=!(ve.call(document)==G&&!({toString:0}+""))}catch(o){qe.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:v}},Ae||(nt=function(){function n(){}return function(t){if(Ct(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Ke=Ie?function(n,t){V.value=t,Ie(n,"__bindData__",V)}:Yt;qe.argsClass||(bt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&je.call(n,"callee")&&!ke.call(n,"callee")||false
34
+ });var We=De||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==L||false},Ge=ht({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Je=Pe?function(n){return Ct(n)?qe.enumPrototypes&&typeof n=="function"||qe.nonEnumArgs&&n.length&&bt(n)?Ge(n):Pe(n):[]}:Ge,Me={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Je,g:"if(e(t[n],n,g)===false)return E"},He={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:Je,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Ue={i:"if(!B[typeof t])return E;"+Me.i,b:false},Ve={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qe=jt(Ve),Xe=ie("("+Je(Qe).join("|")+")","g"),Ye=ie("["+Je(Ve).join("")+"]","g"),Ze=ht(Me),nr=ht(He,{i:He.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]"}),tr=ht(He),er=ht(Me,Ue,{j:false}),rr=ht(Me,Ue);
35
+ xt(/x/)&&(xt=function(n){return typeof n=="function"&&ve.call(n)==K});var ur=we?function(n){if(!n||ve.call(n)!=G||!qe.argsClass&&bt(n))return false;var t=n.valueOf,e=typeof t=="function"&&(e=we(t))&&we(e);return e?n==e||we(n)==e:mt(n)}:mt,or=st(function(n,t,e){je.call(n,e)?n[e]++:n[e]=1}),ar=st(function(n,t,e){(je.call(n,e)?n[e]:n[e]=[]).push(t)}),ir=st(function(n,t,e){n[e]=t}),lr=Pt;Se&&(Vt=function(n){if(!xt(n))throw new fe;return Se.apply(e,arguments)});var fr=8==$e(j+"08")?$e:function(n,t){return $e(Et(n)?n.replace(D,""):n,t||0)
36
+ };return v.after=function(n,t){if(!xt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=nr,v.at=function(n){var t=arguments,e=-1,r=it(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);for(qe.unindexedChars&&Et(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Ht,v.bindAll=function(n){for(var t=1<arguments.length?it(arguments,true,false,1):wt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=gt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?gt(t,19,s(arguments,2),null,n):gt(t,3,null,null,n)
37
+ },v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.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},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!xt(n[t]))throw new fe;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.countBy=or,v.create=function(n,t){var e=nt(n);return t?nr(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);if("object"!=r)return function(t){return t[n]
38
+ };var u=Je(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Ct(a)?function(t){for(var e=u.length,r=false;e--&&(r=lt(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,gt(n,4,null,null,null,t)},v.debounce=Ut,v.defaults=tr,v.defer=Vt,v.delay=function(n,t){if(!xt(n))throw new fe;var e=s(arguments,2);return Ee(function(){n.apply(h,e)},t)},v.difference=function(n){return at(n,it(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Pt(n,e,r)),it(n,t)
39
+ },v.forEach=Nt,v.forEachRight=Bt,v.forIn=er,v.forInRight=function(n,t,e){var r=[];er(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=rr,v.forOwnRight=_t,v.functions=wt,v.groupBy=ar,v.indexBy=ir,v.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Fe(Re(0,u-r),u))},v.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,s=yt(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
40
+ l[a]=s===n&&(y?y.length:0)>=_&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):s(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&p(m);return c(l),c(v),h},v.invert=jt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=ne(typeof o=="number"?o:0);return Nt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=Je,v.map=Pt,v.max=Rt,v.memoize=function(n,t){if(!xt(n))throw new fe;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
41
+ return je.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ct(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ft(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];
42
+ i<o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];er(n,function(n,t){u.push(t)});for(var u=at(u,it(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!xt(n))throw new fe;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)
43
+ }},v.pairs=function(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},v.partial=function(n){return gt(n,16,s(arguments,1))},v.partialRight=function(n){return gt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=it(arguments,true,false,1),a=Ct(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=lr,v.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&&(Oe.call(n,o--,1),u--);
44
+ return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Re(0,me((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Oe.call(n,r--,1),u--);return o},v.rest=Kt,v.shuffle=Lt,v.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=ne(typeof o=="number"?o:0);
45
+ for(t=v.createCallback(t,e,3),Nt(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,p(n);return a},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!xt(n))throw new fe;return false===e?r=false:Ct(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),U.leading=r,U.maxWait=t,U.trailing=u,Ut(n,t,U)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?qe.unindexedChars&&Et(n)?n.split(""):s(n):Ot(n)
46
+ },v.transform=function(n,t,e,r){var u=We(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Ze:rr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return pt(it(arguments,true,true))},v.uniq=Gt,v.values=Ot,v.where=At,v.without=function(n){return at(n,s(arguments,1))},v.wrap=function(n,t){return gt(t,16,[n])},v.zip=Jt,v.zipObject=Mt,v.collect=Pt,v.drop=Kt,v.each=Nt,v.eachRight=Bt,v.extend=nr,v.methods=wt,v.object=Mt,v.select=At,v.tail=Kt,v.unique=Gt,v.unzip=Jt,Xt(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))
47
+ },v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=St,v.escape=function(n){return null==n?"":le(n).replace(Ye,vt)},v.every=It,v.find=Dt,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),rr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Bt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0
48
+ }),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),_t(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?je.call(n,t):false},v.identity=Qt,v.indexOf=qt,v.isArguments=bt,v.isArray=We,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==T||false},v.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false
49
+ },v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==L||e==M||(qe.argsClass?e==$:bt(n))||e==G&&typeof r=="number"&&xt(n.splice)?!r:(rr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return lt(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},v.isFunction=xt,v.isNaN=function(n){return kt(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=kt,v.isObject=Ct,v.isPlainObject=ur,v.isRegExp=function(n){return n&&X[typeof n]&&ve.call(n)==J||false
50
+ },v.isString=Et,v.isUndefined=function(n){return typeof n=="undefined"},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Re(0,r+e):Fe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Xt,v.noConflict=function(){return e._=he,this},v.noop=Yt,v.parseInt=fr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Le(),Fe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)
51
+ },v.reduce=Ft,v.reduceRight=$t,v.result=function(n,t){if(n){var e=n[t];return xt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Je(n).length},v.some=Tt,v.sortedIndex=Wt,v.template=function(n,t,e){var r=v.templateSettings;n=le(n||""),e=tr({},e,r);var u,o=tr({},e.imports,r.imports),r=Je(o),o=Ot(o),i=0,l=e.interpolate||N,f="__p+='",l=ie((e.escape||N).source+"|"+l.source+"|"+(l===A?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
52
+ }),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=re(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":le(n).replace(Xe,dt)},v.uniqueId=function(n){var t=++m;return le(null==n?"":n)+t
53
+ },v.all=It,v.any=Tt,v.detect=Dt,v.findWhere=Dt,v.foldl=Ft,v.foldr=$t,v.include=St,v.inject=Ft,rr(v,function(n,t){v.prototype[t]||(v.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return Ce.apply(t,arguments),t=n.apply(v,t),e?new y(t,e):t})}),v.first=zt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Re(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Ot(n):qe.unindexedChars&&Et(n)&&(n=n.split("")),null==t||e?n?n[ct(0,n.length-1)]:h:(n=Lt(n),n.length=Fe(Re(0,t),n.length),n)
54
+ },v.take=zt,v.head=zt,rr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.3.0",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return le(this.__wrapped__)},v.prototype.value=Zt,v.prototype.valueOf=Zt,Ze(["join","pop","shift"],function(n){var t=ce[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
55
+ return n?new y(e,n):e}}),Ze(["push","reverse","sort","unshift"],function(n){var t=ce[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(n){var t=ce[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),qe.spliceObjects||Ze(["pop","shift","splice"],function(n){var t=ce[n],e="splice"==n;v.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 y(u,n):u
56
+ }}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,I=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),$="[object Arguments]",L="[object Array]",T="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",H={};
57
+ H[K]=false,H[$]=H[L]=H[T]=H[z]=H[W]=H[G]=H[J]=H[M]=true;var U={leading:false,maxWait:0,trailing:false},V={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
58
+ !rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Lo-Dash 2.2.1 (Custom Build) <http://lodash.com/>
3
+ * Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
4
4
  * Build: `lodash modern -o ./dist/lodash.js`
5
5
  * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
6
6
  * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
@@ -55,7 +55,7 @@
55
55
  var reFlags = /\w*$/;
56
56
 
57
57
  /** Used to detected named functions */
58
- var reFuncName = /^function[ \n\r\t]+\w/;
58
+ var reFuncName = /^\s*function[ \n\r\t]+\w/;
59
59
 
60
60
  /** Used to match "interpolate" template delimiters */
61
61
  var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -353,15 +353,6 @@
353
353
  };
354
354
  }
355
355
 
356
- /**
357
- * A no-operation function.
358
- *
359
- * @private
360
- */
361
- function noop() {
362
- // no operation performed
363
- }
364
-
365
356
  /**
366
357
  * Releases the given array back to the array pool.
367
358
  *
@@ -464,11 +455,14 @@
464
455
  /** Used to restore the original `_` reference in `noConflict` */
465
456
  var oldDash = context._;
466
457
 
458
+ /** Used to resolve the internal [[Class]] of values */
459
+ var toString = objectProto.toString;
460
+
467
461
  /** Used to detect if a method is native */
468
462
  var reNative = RegExp('^' +
469
- String(objectProto.valueOf)
463
+ String(toString)
470
464
  .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
471
- .replace(/valueOf|for [^\]]+/g, '.+?') + '$'
465
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
472
466
  );
473
467
 
474
468
  /** Native method shortcuts */
@@ -480,13 +474,16 @@
480
474
  hasOwnProperty = objectProto.hasOwnProperty,
481
475
  now = reNative.test(now = Date.now) && now || function() { return +new Date; },
482
476
  push = arrayRef.push,
483
- setImmediate = context.setImmediate,
484
477
  setTimeout = context.setTimeout,
485
- splice = arrayRef.splice,
486
- toString = objectProto.toString,
487
- unshift = arrayRef.unshift;
478
+ splice = arrayRef.splice;
479
+
480
+ /** Used to detect `setImmediate` in Node.js */
481
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
482
+ !reNative.test(setImmediate) && setImmediate;
488
483
 
484
+ /** Used to set meta data on functions */
489
485
  var defineProperty = (function() {
486
+ // IE 8 only accepts DOM elements
490
487
  try {
491
488
  var o = {},
492
489
  func = reNative.test(func = Object.defineProperty) && func,
@@ -496,8 +493,7 @@
496
493
  }());
497
494
 
498
495
  /* Native method shortcuts for methods with the same name as other `lodash` methods */
499
- var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
500
- nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
496
+ var nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
501
497
  nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
502
498
  nativeIsFinite = context.isFinite,
503
499
  nativeIsNaN = context.isNaN,
@@ -505,12 +501,7 @@
505
501
  nativeMax = Math.max,
506
502
  nativeMin = Math.min,
507
503
  nativeParseInt = context.parseInt,
508
- nativeRandom = Math.random,
509
- nativeSlice = arrayRef.slice;
510
-
511
- /** Detect various environments */
512
- var isIeOpera = reNative.test(context.attachEvent),
513
- isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
504
+ nativeRandom = Math.random;
514
505
 
515
506
  /** Used to lookup a built-in constructor by [[Class]] */
516
507
  var ctorByClass = {};
@@ -538,15 +529,16 @@
538
529
  *
539
530
  * The chainable wrapper functions are:
540
531
  * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
541
- * `compose`, `concat`, `countBy`, `createCallback`, `curry`, `debounce`,
542
- * `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`,
543
- * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
544
- * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
545
- * `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, `once`, `pairs`,
546
- * `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, `range`, `reject`,
547
- * `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
548
- * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
549
- * `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
532
+ * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`,
533
+ * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`,
534
+ * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
535
+ * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
536
+ * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
537
+ * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`,
538
+ * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
539
+ * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`,
540
+ * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`,
541
+ * and `zip`
550
542
  *
551
543
  * The non-chainable wrapper functions are:
552
544
  * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`,
@@ -620,14 +612,6 @@
620
612
  */
621
613
  var support = lodash.support = {};
622
614
 
623
- /**
624
- * Detect if `Function#bind` exists and is inferred to be fast (all but V8).
625
- *
626
- * @memberOf _.support
627
- * @type boolean
628
- */
629
- support.fastBind = nativeBind && !isV8;
630
-
631
615
  /**
632
616
  * Detect if functions can be decompiled by `Function#toString`
633
617
  * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
@@ -708,19 +692,53 @@
708
692
 
709
693
  /*--------------------------------------------------------------------------*/
710
694
 
695
+ /**
696
+ * The base implementation of `_.bind` that creates the bound function and
697
+ * sets its meta data.
698
+ *
699
+ * @private
700
+ * @param {Array} bindData The bind data array.
701
+ * @returns {Function} Returns the new bound function.
702
+ */
703
+ function baseBind(bindData) {
704
+ var func = bindData[0],
705
+ partialArgs = bindData[2],
706
+ thisArg = bindData[4];
707
+
708
+ function bound() {
709
+ // `Function#bind` spec
710
+ // http://es5.github.io/#x15.3.4.5
711
+ if (partialArgs) {
712
+ var args = partialArgs.slice();
713
+ push.apply(args, arguments);
714
+ }
715
+ // mimic the constructor's `return` behavior
716
+ // http://es5.github.io/#x13.2.2
717
+ if (this instanceof bound) {
718
+ // ensure `new bound` is an instance of `func`
719
+ var thisBinding = baseCreate(func.prototype),
720
+ result = func.apply(thisBinding, args || arguments);
721
+ return isObject(result) ? result : thisBinding;
722
+ }
723
+ return func.apply(thisArg, args || arguments);
724
+ }
725
+ setBindData(bound, bindData);
726
+ return bound;
727
+ }
728
+
711
729
  /**
712
730
  * The base implementation of `_.clone` without argument juggling or support
713
731
  * for `thisArg` binding.
714
732
  *
715
733
  * @private
716
734
  * @param {*} value The value to clone.
717
- * @param {boolean} [deep=false] Specify a deep clone.
735
+ * @param {boolean} [isDeep=false] Specify a deep clone.
718
736
  * @param {Function} [callback] The function to customize cloning values.
719
737
  * @param {Array} [stackA=[]] Tracks traversed source objects.
720
738
  * @param {Array} [stackB=[]] Associates clones with source counterparts.
721
739
  * @returns {*} Returns the cloned value.
722
740
  */
723
- function baseClone(value, deep, callback, stackA, stackB) {
741
+ function baseClone(value, isDeep, callback, stackA, stackB) {
724
742
  if (callback) {
725
743
  var result = callback(value);
726
744
  if (typeof result != 'undefined') {
@@ -753,7 +771,7 @@
753
771
  return value;
754
772
  }
755
773
  var isArr = isArray(value);
756
- if (deep) {
774
+ if (isDeep) {
757
775
  // check for circular references and return corresponding clone
758
776
  var initedStack = !stackA;
759
777
  stackA || (stackA = getArray());
@@ -780,7 +798,7 @@
780
798
  }
781
799
  }
782
800
  // exit for shallow clone
783
- if (!deep) {
801
+ if (!isDeep) {
784
802
  return result;
785
803
  }
786
804
  // add the source value to the stack of traversed objects
@@ -790,7 +808,7 @@
790
808
 
791
809
  // recursively populate clone (susceptible to call stack limits)
792
810
  (isArr ? forEach : forOwn)(value, function(objValue, key) {
793
- result[key] = baseClone(objValue, deep, callback, stackA, stackB);
811
+ result[key] = baseClone(objValue, isDeep, callback, stackA, stackB);
794
812
  });
795
813
 
796
814
  if (initedStack) {
@@ -800,6 +818,32 @@
800
818
  return result;
801
819
  }
802
820
 
821
+ /**
822
+ * The base implementation of `_.create` without support for assigning
823
+ * properties to the created object.
824
+ *
825
+ * @private
826
+ * @param {Object} prototype The object to inherit from.
827
+ * @returns {Object} Returns the new object.
828
+ */
829
+ function baseCreate(prototype, properties) {
830
+ return isObject(prototype) ? nativeCreate(prototype) : {};
831
+ }
832
+ // fallback for browsers without `Object.create`
833
+ if (!nativeCreate) {
834
+ baseCreate = (function() {
835
+ function Object() {}
836
+ return function(prototype) {
837
+ if (isObject(prototype)) {
838
+ Object.prototype = prototype;
839
+ var result = new Object;
840
+ Object.prototype = null;
841
+ }
842
+ return result || context.Object();
843
+ };
844
+ }());
845
+ }
846
+
803
847
  /**
804
848
  * The base implementation of `_.createCallback` without support for creating
805
849
  * "_.pluck" or "_.where" style callbacks.
@@ -814,24 +858,30 @@
814
858
  if (typeof func != 'function') {
815
859
  return identity;
816
860
  }
817
- // exit early if there is no `thisArg`
818
- if (typeof thisArg == 'undefined') {
861
+ // exit early for no `thisArg` or already bound by `Function#bind`
862
+ if (typeof thisArg == 'undefined' || !('prototype' in func)) {
819
863
  return func;
820
864
  }
821
- var bindData = func.__bindData__ || (support.funcNames && !func.name);
865
+ var bindData = func.__bindData__;
822
866
  if (typeof bindData == 'undefined') {
823
- var source = reThis && fnToString.call(func);
824
- if (!support.funcNames && source && !reFuncName.test(source)) {
825
- bindData = true;
867
+ if (support.funcNames) {
868
+ bindData = !func.name;
826
869
  }
827
- if (support.funcNames || !bindData) {
828
- // checks if `func` references the `this` keyword and stores the result
829
- bindData = !support.funcDecomp || reThis.test(source);
830
- setBindData(func, bindData);
870
+ bindData = bindData || !support.funcDecomp;
871
+ if (!bindData) {
872
+ var source = fnToString.call(func);
873
+ if (!support.funcNames) {
874
+ bindData = !reFuncName.test(source);
875
+ }
876
+ if (!bindData) {
877
+ // checks if `func` references the `this` keyword and stores the result
878
+ bindData = reThis.test(source);
879
+ setBindData(func, bindData);
880
+ }
831
881
  }
832
882
  }
833
883
  // exit early if there are no `this` references or `func` is bound
834
- if (bindData !== true && (bindData && bindData[1] & 1)) {
884
+ if (bindData === false || (bindData !== true && bindData[1] & 1)) {
835
885
  return func;
836
886
  }
837
887
  switch (argCount) {
@@ -851,6 +901,96 @@
851
901
  return bind(func, thisArg);
852
902
  }
853
903
 
904
+ /**
905
+ * The base implementation of `createWrapper` that creates the wrapper and
906
+ * sets its meta data.
907
+ *
908
+ * @private
909
+ * @param {Array} bindData The bind data array.
910
+ * @returns {Function} Returns the new function.
911
+ */
912
+ function baseCreateWrapper(bindData) {
913
+ var func = bindData[0],
914
+ bitmask = bindData[1],
915
+ partialArgs = bindData[2],
916
+ partialRightArgs = bindData[3],
917
+ thisArg = bindData[4],
918
+ arity = bindData[5];
919
+
920
+ var isBind = bitmask & 1,
921
+ isBindKey = bitmask & 2,
922
+ isCurry = bitmask & 4,
923
+ isCurryBound = bitmask & 8,
924
+ key = func;
925
+
926
+ function bound() {
927
+ var thisBinding = isBind ? thisArg : this;
928
+ if (partialArgs) {
929
+ var args = partialArgs.slice();
930
+ push.apply(args, arguments);
931
+ }
932
+ if (partialRightArgs || isCurry) {
933
+ args || (args = slice(arguments));
934
+ if (partialRightArgs) {
935
+ push.apply(args, partialRightArgs);
936
+ }
937
+ if (isCurry && args.length < arity) {
938
+ bitmask |= 16 & ~32;
939
+ return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
940
+ }
941
+ }
942
+ args || (args = arguments);
943
+ if (isBindKey) {
944
+ func = thisBinding[key];
945
+ }
946
+ if (this instanceof bound) {
947
+ thisBinding = baseCreate(func.prototype);
948
+ var result = func.apply(thisBinding, args);
949
+ return isObject(result) ? result : thisBinding;
950
+ }
951
+ return func.apply(thisBinding, args);
952
+ }
953
+ setBindData(bound, bindData);
954
+ return bound;
955
+ }
956
+
957
+ /**
958
+ * The base implementation of `_.difference` that accepts a single array
959
+ * of values to exclude.
960
+ *
961
+ * @private
962
+ * @param {Array} array The array to process.
963
+ * @param {Array} [values] The array of values to exclude.
964
+ * @returns {Array} Returns a new array of filtered values.
965
+ */
966
+ function baseDifference(array, values) {
967
+ var index = -1,
968
+ indexOf = getIndexOf(),
969
+ length = array ? array.length : 0,
970
+ isLarge = length >= largeArraySize && indexOf === baseIndexOf,
971
+ result = [];
972
+
973
+ if (isLarge) {
974
+ var cache = createCache(values);
975
+ if (cache) {
976
+ indexOf = cacheIndexOf;
977
+ values = cache;
978
+ } else {
979
+ isLarge = false;
980
+ }
981
+ }
982
+ while (++index < length) {
983
+ var value = array[index];
984
+ if (indexOf(values, value) < 0) {
985
+ result.push(value);
986
+ }
987
+ }
988
+ if (isLarge) {
989
+ releaseObject(values);
990
+ }
991
+ return result;
992
+ }
993
+
854
994
  /**
855
995
  * The base implementation of `_.flatten` without support for callback
856
996
  * shorthands or `thisArg` binding.
@@ -858,11 +998,11 @@
858
998
  * @private
859
999
  * @param {Array} array The array to flatten.
860
1000
  * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
861
- * @param {boolean} [isArgArrays=false] A flag to restrict flattening to arrays and `arguments` objects.
1001
+ * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects.
862
1002
  * @param {number} [fromIndex=0] The index to start from.
863
1003
  * @returns {Array} Returns a new flattened array.
864
1004
  */
865
- function baseFlatten(array, isShallow, isArgArrays, fromIndex) {
1005
+ function baseFlatten(array, isShallow, isStrict, fromIndex) {
866
1006
  var index = (fromIndex || 0) - 1,
867
1007
  length = array ? array.length : 0,
868
1008
  result = [];
@@ -874,7 +1014,7 @@
874
1014
  && (isArray(value) || isArguments(value))) {
875
1015
  // recursively flatten arrays (susceptible to call stack limits)
876
1016
  if (!isShallow) {
877
- value = baseFlatten(value, isShallow, isArgArrays);
1017
+ value = baseFlatten(value, isShallow, isStrict);
878
1018
  }
879
1019
  var valIndex = -1,
880
1020
  valLength = value.length,
@@ -884,7 +1024,7 @@
884
1024
  while (++valIndex < valLength) {
885
1025
  result[resIndex++] = value[valIndex];
886
1026
  }
887
- } else if (!isArgArrays) {
1027
+ } else if (!isStrict) {
888
1028
  result.push(value);
889
1029
  }
890
1030
  }
@@ -967,8 +1107,11 @@
967
1107
  var isArr = className == arrayClass;
968
1108
  if (!isArr) {
969
1109
  // unwrap any `lodash` wrapped values
970
- if (hasOwnProperty.call(a, '__wrapped__ ') || hasOwnProperty.call(b, '__wrapped__')) {
971
- return baseIsEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, isWhere, stackA, stackB);
1110
+ var aWrapped = hasOwnProperty.call(a, '__wrapped__'),
1111
+ bWrapped = hasOwnProperty.call(b, '__wrapped__');
1112
+
1113
+ if (aWrapped || bWrapped) {
1114
+ return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB);
972
1115
  }
973
1116
  // exit for functions and DOM nodes
974
1117
  if (className != objectClass) {
@@ -979,10 +1122,10 @@
979
1122
  ctorB = b.constructor;
980
1123
 
981
1124
  // non `Object` object instances with different constructors are not equal
982
- if (ctorA != ctorB && !(
983
- isFunction(ctorA) && ctorA instanceof ctorA &&
984
- isFunction(ctorB) && ctorB instanceof ctorB
985
- )) {
1125
+ if (ctorA != ctorB &&
1126
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
1127
+ ('constructor' in a && 'constructor' in b)
1128
+ ) {
986
1129
  return false;
987
1130
  }
988
1131
  }
@@ -1125,6 +1268,19 @@
1125
1268
  });
1126
1269
  }
1127
1270
 
1271
+ /**
1272
+ * The base implementation of `_.random` without argument juggling or support
1273
+ * for returning floating-point numbers.
1274
+ *
1275
+ * @private
1276
+ * @param {number} min The minimum possible value.
1277
+ * @param {number} max The maximum possible value.
1278
+ * @returns {number} Returns a random number.
1279
+ */
1280
+ function baseRandom(min, max) {
1281
+ return min + floor(nativeRandom() * (max - min + 1));
1282
+ }
1283
+
1128
1284
  /**
1129
1285
  * The base implementation of `_.uniq` without support for callback shorthands
1130
1286
  * or `thisArg` binding.
@@ -1229,16 +1385,15 @@
1229
1385
  * provided to the new function.
1230
1386
  * @param {*} [thisArg] The `this` binding of `func`.
1231
1387
  * @param {number} [arity] The arity of `func`.
1232
- * @returns {Function} Returns the new bound function.
1388
+ * @returns {Function} Returns the new function.
1233
1389
  */
1234
- function createBound(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
1390
+ function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
1235
1391
  var isBind = bitmask & 1,
1236
1392
  isBindKey = bitmask & 2,
1237
1393
  isCurry = bitmask & 4,
1238
1394
  isCurryBound = bitmask & 8,
1239
1395
  isPartial = bitmask & 16,
1240
- isPartialRight = bitmask & 32,
1241
- key = func;
1396
+ isPartialRight = bitmask & 32;
1242
1397
 
1243
1398
  if (!isBindKey && !isFunction(func)) {
1244
1399
  throw new TypeError;
@@ -1252,96 +1407,36 @@
1252
1407
  isPartialRight = partialRightArgs = false;
1253
1408
  }
1254
1409
  var bindData = func && func.__bindData__;
1255
- if (bindData) {
1410
+ if (bindData && bindData !== true) {
1411
+ bindData = bindData.slice();
1412
+
1413
+ // set `thisBinding` is not previously bound
1256
1414
  if (isBind && !(bindData[1] & 1)) {
1257
1415
  bindData[4] = thisArg;
1258
1416
  }
1417
+ // set if previously bound but not currently (subsequent curried functions)
1259
1418
  if (!isBind && bindData[1] & 1) {
1260
1419
  bitmask |= 8;
1261
1420
  }
1421
+ // set curried arity if not yet set
1262
1422
  if (isCurry && !(bindData[1] & 4)) {
1263
1423
  bindData[5] = arity;
1264
1424
  }
1425
+ // append partial left arguments
1265
1426
  if (isPartial) {
1266
1427
  push.apply(bindData[2] || (bindData[2] = []), partialArgs);
1267
1428
  }
1429
+ // append partial right arguments
1268
1430
  if (isPartialRight) {
1269
1431
  push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
1270
1432
  }
1433
+ // merge flags
1271
1434
  bindData[1] |= bitmask;
1272
- return createBound.apply(null, bindData);
1273
- }
1274
- // use `Function#bind` if it exists and is fast
1275
- // (in V8 `Function#bind` is slower except when partially applied)
1276
- if (isBind && !(isBindKey || isCurry || isPartialRight) &&
1277
- (support.fastBind || (nativeBind && isPartial))) {
1278
- if (isPartial) {
1279
- var args = [thisArg];
1280
- push.apply(args, partialArgs);
1281
- }
1282
- var bound = isPartial
1283
- ? nativeBind.apply(func, args)
1284
- : nativeBind.call(func, thisArg);
1285
- }
1286
- else {
1287
- bound = function() {
1288
- // `Function#bind` spec
1289
- // http://es5.github.io/#x15.3.4.5
1290
- var args = arguments,
1291
- thisBinding = isBind ? thisArg : this;
1292
-
1293
- if (isCurry || isPartial || isPartialRight) {
1294
- args = nativeSlice.call(args);
1295
- if (isPartial) {
1296
- unshift.apply(args, partialArgs);
1297
- }
1298
- if (isPartialRight) {
1299
- push.apply(args, partialRightArgs);
1300
- }
1301
- if (isCurry && args.length < arity) {
1302
- bitmask |= 16 & ~32;
1303
- return createBound(func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity);
1304
- }
1305
- }
1306
- if (isBindKey) {
1307
- func = thisBinding[key];
1308
- }
1309
- if (this instanceof bound) {
1310
- // ensure `new bound` is an instance of `func`
1311
- thisBinding = createObject(func.prototype);
1312
-
1313
- // mimic the constructor's `return` behavior
1314
- // http://es5.github.io/#x13.2.2
1315
- var result = func.apply(thisBinding, args);
1316
- return isObject(result) ? result : thisBinding;
1317
- }
1318
- return func.apply(thisBinding, args);
1319
- };
1435
+ return createWrapper.apply(null, bindData);
1320
1436
  }
1321
- setBindData(bound, nativeSlice.call(arguments));
1322
- return bound;
1323
- }
1324
-
1325
- /**
1326
- * Creates a new object with the specified `prototype`.
1327
- *
1328
- * @private
1329
- * @param {Object} prototype The prototype object.
1330
- * @returns {Object} Returns the new object.
1331
- */
1332
- function createObject(prototype) {
1333
- return isObject(prototype) ? nativeCreate(prototype) : {};
1334
- }
1335
- // fallback for browsers without `Object.create`
1336
- if (!nativeCreate) {
1337
- createObject = function(prototype) {
1338
- if (isObject(prototype)) {
1339
- noop.prototype = prototype;
1340
- var result = new noop;
1341
- noop.prototype = null;
1342
- }
1343
- return result || {};
1344
- };
1437
+ // fast path for `_.bind`
1438
+ var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
1439
+ return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
1345
1440
  }
1346
1441
 
1347
1442
  /**
@@ -1373,7 +1468,7 @@
1373
1468
  *
1374
1469
  * @private
1375
1470
  * @param {Function} func The function to set data on.
1376
- * @param {*} value The value to set.
1471
+ * @param {Array} value The data array to set.
1377
1472
  */
1378
1473
  var setBindData = !defineProperty ? noop : function(func, value) {
1379
1474
  descriptor.value = value;
@@ -1549,16 +1644,16 @@
1549
1644
  * @returns {Object} Returns the destination object.
1550
1645
  * @example
1551
1646
  *
1552
- * _.assign({ 'name': 'moe' }, { 'age': 40 });
1553
- * // => { 'name': 'moe', 'age': 40 }
1647
+ * _.assign({ 'name': 'fred' }, { 'employer': 'slate' });
1648
+ * // => { 'name': 'fred', 'employer': 'slate' }
1554
1649
  *
1555
1650
  * var defaults = _.partialRight(_.assign, function(a, b) {
1556
1651
  * return typeof a == 'undefined' ? b : a;
1557
1652
  * });
1558
1653
  *
1559
- * var food = { 'name': 'apple' };
1560
- * defaults(food, { 'name': 'banana', 'type': 'fruit' });
1561
- * // => { 'name': 'apple', 'type': 'fruit' }
1654
+ * var object = { 'name': 'barney' };
1655
+ * defaults(object, { 'name': 'fred', 'employer': 'slate' });
1656
+ * // => { 'name': 'barney', 'employer': 'slate' }
1562
1657
  */
1563
1658
  var assign = function(object, source, guard) {
1564
1659
  var index, iterable = object, result = iterable;
@@ -1588,7 +1683,7 @@
1588
1683
  };
1589
1684
 
1590
1685
  /**
1591
- * Creates a clone of `value`. If `deep` is `true` nested objects will also
1686
+ * Creates a clone of `value`. If `isDeep` is `true` nested objects will also
1592
1687
  * be cloned, otherwise they will be assigned by reference. If a callback
1593
1688
  * is provided it will be executed to produce the cloned values. If the
1594
1689
  * callback returns `undefined` cloning will be handled by the method instead.
@@ -1598,23 +1693,23 @@
1598
1693
  * @memberOf _
1599
1694
  * @category Objects
1600
1695
  * @param {*} value The value to clone.
1601
- * @param {boolean} [deep=false] Specify a deep clone.
1696
+ * @param {boolean} [isDeep=false] Specify a deep clone.
1602
1697
  * @param {Function} [callback] The function to customize cloning values.
1603
1698
  * @param {*} [thisArg] The `this` binding of `callback`.
1604
1699
  * @returns {*} Returns the cloned value.
1605
1700
  * @example
1606
1701
  *
1607
- * var stooges = [
1608
- * { 'name': 'moe', 'age': 40 },
1609
- * { 'name': 'larry', 'age': 50 }
1702
+ * var characters = [
1703
+ * { 'name': 'barney', 'age': 36 },
1704
+ * { 'name': 'fred', 'age': 40 }
1610
1705
  * ];
1611
1706
  *
1612
- * var shallow = _.clone(stooges);
1613
- * shallow[0] === stooges[0];
1707
+ * var shallow = _.clone(characters);
1708
+ * shallow[0] === characters[0];
1614
1709
  * // => true
1615
1710
  *
1616
- * var deep = _.clone(stooges, true);
1617
- * deep[0] === stooges[0];
1711
+ * var deep = _.clone(characters, true);
1712
+ * deep[0] === characters[0];
1618
1713
  * // => false
1619
1714
  *
1620
1715
  * _.mixin({
@@ -1627,15 +1722,15 @@
1627
1722
  * clone.childNodes.length;
1628
1723
  * // => 0
1629
1724
  */
1630
- function clone(value, deep, callback, thisArg) {
1725
+ function clone(value, isDeep, callback, thisArg) {
1631
1726
  // allows working with "Collections" methods without using their `index`
1632
- // and `collection` arguments for `deep` and `callback`
1633
- if (typeof deep != 'boolean' && deep != null) {
1727
+ // and `collection` arguments for `isDeep` and `callback`
1728
+ if (typeof isDeep != 'boolean' && isDeep != null) {
1634
1729
  thisArg = callback;
1635
- callback = deep;
1636
- deep = false;
1730
+ callback = isDeep;
1731
+ isDeep = false;
1637
1732
  }
1638
- return baseClone(value, deep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
1733
+ return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
1639
1734
  }
1640
1735
 
1641
1736
  /**
@@ -1658,13 +1753,13 @@
1658
1753
  * @returns {*} Returns the deep cloned value.
1659
1754
  * @example
1660
1755
  *
1661
- * var stooges = [
1662
- * { 'name': 'moe', 'age': 40 },
1663
- * { 'name': 'larry', 'age': 50 }
1756
+ * var characters = [
1757
+ * { 'name': 'barney', 'age': 36 },
1758
+ * { 'name': 'fred', 'age': 40 }
1664
1759
  * ];
1665
1760
  *
1666
- * var deep = _.cloneDeep(stooges);
1667
- * deep[0] === stooges[0];
1761
+ * var deep = _.cloneDeep(characters);
1762
+ * deep[0] === characters[0];
1668
1763
  * // => false
1669
1764
  *
1670
1765
  * var view = {
@@ -1683,6 +1778,42 @@
1683
1778
  return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
1684
1779
  }
1685
1780
 
1781
+ /**
1782
+ * Creates an object that inherits from the given `prototype` object. If a
1783
+ * `properties` object is provided its own enumerable properties are assigned
1784
+ * to the created object.
1785
+ *
1786
+ * @static
1787
+ * @memberOf _
1788
+ * @category Objects
1789
+ * @param {Object} prototype The object to inherit from.
1790
+ * @param {Object} [properties] The properties to assign to the object.
1791
+ * @returns {Object} Returns the new object.
1792
+ * @example
1793
+ *
1794
+ * function Shape() {
1795
+ * this.x = 0;
1796
+ * this.y = 0;
1797
+ * }
1798
+ *
1799
+ * function Circle() {
1800
+ * Shape.call(this);
1801
+ * }
1802
+ *
1803
+ * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
1804
+ *
1805
+ * var circle = new Circle;
1806
+ * circle instanceof Circle;
1807
+ * // => true
1808
+ *
1809
+ * circle instanceof Shape;
1810
+ * // => true
1811
+ */
1812
+ function create(prototype, properties) {
1813
+ var result = baseCreate(prototype);
1814
+ return properties ? assign(result, properties) : result;
1815
+ }
1816
+
1686
1817
  /**
1687
1818
  * Assigns own enumerable properties of source object(s) to the destination
1688
1819
  * object for all destination properties that resolve to `undefined`. Once a
@@ -1699,9 +1830,9 @@
1699
1830
  * @returns {Object} Returns the destination object.
1700
1831
  * @example
1701
1832
  *
1702
- * var food = { 'name': 'apple' };
1703
- * _.defaults(food, { 'name': 'banana', 'type': 'fruit' });
1704
- * // => { 'name': 'apple', 'type': 'fruit' }
1833
+ * var object = { 'name': 'barney' };
1834
+ * _.defaults(object, { 'name': 'fred', 'employer': 'slate' });
1835
+ * // => { 'name': 'barney', 'employer': 'slate' }
1705
1836
  */
1706
1837
  var defaults = function(object, source, guard) {
1707
1838
  var index, iterable = object, result = iterable;
@@ -1729,6 +1860,13 @@
1729
1860
  * This method is like `_.findIndex` except that it returns the key of the
1730
1861
  * first element that passes the callback check, instead of the element itself.
1731
1862
  *
1863
+ * If a property name is provided for `callback` the created "_.pluck" style
1864
+ * callback will return the property value of the given element.
1865
+ *
1866
+ * If an object is provided for `callback` the created "_.where" style callback
1867
+ * will return `true` for elements that have the properties of the given object,
1868
+ * else `false`.
1869
+ *
1732
1870
  * @static
1733
1871
  * @memberOf _
1734
1872
  * @category Objects
@@ -1740,10 +1878,24 @@
1740
1878
  * @returns {string|undefined} Returns the key of the found element, else `undefined`.
1741
1879
  * @example
1742
1880
  *
1743
- * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
1744
- * return num % 2 == 0;
1881
+ * var characters = {
1882
+ * 'barney': { 'age': 36, 'blocked': false },
1883
+ * 'fred': { 'age': 40, 'blocked': true },
1884
+ * 'pebbles': { 'age': 1, 'blocked': false }
1885
+ * };
1886
+ *
1887
+ * _.findKey(characters, function(chr) {
1888
+ * return chr.age < 40;
1745
1889
  * });
1746
- * // => 'b' (property order is not guaranteed across environments)
1890
+ * // => 'barney' (property order is not guaranteed across environments)
1891
+ *
1892
+ * // using "_.where" callback shorthand
1893
+ * _.findKey(characters, { 'age': 1 });
1894
+ * // => 'pebbles'
1895
+ *
1896
+ * // using "_.pluck" callback shorthand
1897
+ * _.findKey(characters, 'blocked');
1898
+ * // => 'fred'
1747
1899
  */
1748
1900
  function findKey(object, callback, thisArg) {
1749
1901
  var result;
@@ -1761,6 +1913,13 @@
1761
1913
  * This method is like `_.findKey` except that it iterates over elements
1762
1914
  * of a `collection` in the opposite order.
1763
1915
  *
1916
+ * If a property name is provided for `callback` the created "_.pluck" style
1917
+ * callback will return the property value of the given element.
1918
+ *
1919
+ * If an object is provided for `callback` the created "_.where" style callback
1920
+ * will return `true` for elements that have the properties of the given object,
1921
+ * else `false`.
1922
+ *
1764
1923
  * @static
1765
1924
  * @memberOf _
1766
1925
  * @category Objects
@@ -1772,10 +1931,24 @@
1772
1931
  * @returns {string|undefined} Returns the key of the found element, else `undefined`.
1773
1932
  * @example
1774
1933
  *
1775
- * _.findLastKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
1776
- * return num % 2 == 1;
1934
+ * var characters = {
1935
+ * 'barney': { 'age': 36, 'blocked': true },
1936
+ * 'fred': { 'age': 40, 'blocked': false },
1937
+ * 'pebbles': { 'age': 1, 'blocked': true }
1938
+ * };
1939
+ *
1940
+ * _.findLastKey(characters, function(chr) {
1941
+ * return chr.age < 40;
1777
1942
  * });
1778
- * // => returns `c`, assuming `_.findKey` returns `a`
1943
+ * // => returns `pebbles`, assuming `_.findKey` returns `barney`
1944
+ *
1945
+ * // using "_.where" callback shorthand
1946
+ * _.findLastKey(characters, { 'age': 40 });
1947
+ * // => 'fred'
1948
+ *
1949
+ * // using "_.pluck" callback shorthand
1950
+ * _.findLastKey(characters, 'blocked');
1951
+ * // => 'pebbles'
1779
1952
  */
1780
1953
  function findLastKey(object, callback, thisArg) {
1781
1954
  var result;
@@ -1805,18 +1978,20 @@
1805
1978
  * @returns {Object} Returns `object`.
1806
1979
  * @example
1807
1980
  *
1808
- * function Dog(name) {
1809
- * this.name = name;
1981
+ * function Shape() {
1982
+ * this.x = 0;
1983
+ * this.y = 0;
1810
1984
  * }
1811
1985
  *
1812
- * Dog.prototype.bark = function() {
1813
- * console.log('Woof, woof!');
1986
+ * Shape.prototype.move = function(x, y) {
1987
+ * this.x += x;
1988
+ * this.y += y;
1814
1989
  * };
1815
1990
  *
1816
- * _.forIn(new Dog('Dagny'), function(value, key) {
1991
+ * _.forIn(new Shape, function(value, key) {
1817
1992
  * console.log(key);
1818
1993
  * });
1819
- * // => logs 'bark' and 'name' (property order is not guaranteed across environments)
1994
+ * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments)
1820
1995
  */
1821
1996
  var forIn = function(collection, callback, thisArg) {
1822
1997
  var index, iterable = collection, result = iterable;
@@ -1842,18 +2017,20 @@
1842
2017
  * @returns {Object} Returns `object`.
1843
2018
  * @example
1844
2019
  *
1845
- * function Dog(name) {
1846
- * this.name = name;
2020
+ * function Shape() {
2021
+ * this.x = 0;
2022
+ * this.y = 0;
1847
2023
  * }
1848
2024
  *
1849
- * Dog.prototype.bark = function() {
1850
- * console.log('Woof, woof!');
2025
+ * Shape.prototype.move = function(x, y) {
2026
+ * this.x += x;
2027
+ * this.y += y;
1851
2028
  * };
1852
2029
  *
1853
- * _.forInRight(new Dog('Dagny'), function(value, key) {
2030
+ * _.forInRight(new Shape, function(value, key) {
1854
2031
  * console.log(key);
1855
2032
  * });
1856
- * // => logs 'name' and 'bark' assuming `_.forIn ` logs 'bark' and 'name'
2033
+ * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move'
1857
2034
  */
1858
2035
  function forInRight(object, callback, thisArg) {
1859
2036
  var pairs = [];
@@ -1995,8 +2172,8 @@
1995
2172
  * @returns {Object} Returns the created inverted object.
1996
2173
  * @example
1997
2174
  *
1998
- * _.invert({ 'first': 'moe', 'second': 'larry' });
1999
- * // => { 'moe': 'first', 'larry': 'second' }
2175
+ * _.invert({ 'first': 'fred', 'second': 'barney' });
2176
+ * // => { 'fred': 'first', 'barney': 'second' }
2000
2177
  */
2001
2178
  function invert(object) {
2002
2179
  var index = -1,
@@ -2025,7 +2202,8 @@
2025
2202
  * // => false
2026
2203
  */
2027
2204
  function isBoolean(value) {
2028
- return value === true || value === false || toString.call(value) == boolClass;
2205
+ return value === true || value === false ||
2206
+ value && typeof value == 'object' && toString.call(value) == boolClass || false;
2029
2207
  }
2030
2208
 
2031
2209
  /**
@@ -2042,7 +2220,7 @@
2042
2220
  * // => true
2043
2221
  */
2044
2222
  function isDate(value) {
2045
- return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false;
2223
+ return value && typeof value == 'object' && toString.call(value) == dateClass || false;
2046
2224
  }
2047
2225
 
2048
2226
  /**
@@ -2059,7 +2237,7 @@
2059
2237
  * // => true
2060
2238
  */
2061
2239
  function isElement(value) {
2062
- return value ? value.nodeType === 1 : false;
2240
+ return value && value.nodeType === 1 || false;
2063
2241
  }
2064
2242
 
2065
2243
  /**
@@ -2118,13 +2296,13 @@
2118
2296
  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2119
2297
  * @example
2120
2298
  *
2121
- * var moe = { 'name': 'moe', 'age': 40 };
2122
- * var copy = { 'name': 'moe', 'age': 40 };
2299
+ * var object = { 'name': 'fred' };
2300
+ * var copy = { 'name': 'fred' };
2123
2301
  *
2124
- * moe == copy;
2302
+ * object == copy;
2125
2303
  * // => false
2126
2304
  *
2127
- * _.isEqual(moe, copy);
2305
+ * _.isEqual(object, copy);
2128
2306
  * // => true
2129
2307
  *
2130
2308
  * var words = ['hello', 'goodbye'];
@@ -2287,7 +2465,8 @@
2287
2465
  * // => true
2288
2466
  */
2289
2467
  function isNumber(value) {
2290
- return typeof value == 'number' || toString.call(value) == numberClass;
2468
+ return typeof value == 'number' ||
2469
+ value && typeof value == 'object' && toString.call(value) == numberClass || false;
2291
2470
  }
2292
2471
 
2293
2472
  /**
@@ -2300,18 +2479,18 @@
2300
2479
  * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
2301
2480
  * @example
2302
2481
  *
2303
- * function Stooge(name, age) {
2304
- * this.name = name;
2305
- * this.age = age;
2482
+ * function Shape() {
2483
+ * this.x = 0;
2484
+ * this.y = 0;
2306
2485
  * }
2307
2486
  *
2308
- * _.isPlainObject(new Stooge('moe', 40));
2487
+ * _.isPlainObject(new Shape);
2309
2488
  * // => false
2310
2489
  *
2311
2490
  * _.isPlainObject([1, 2, 3]);
2312
2491
  * // => false
2313
2492
  *
2314
- * _.isPlainObject({ 'name': 'moe', 'age': 40 });
2493
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
2315
2494
  * // => true
2316
2495
  */
2317
2496
  var isPlainObject = function(value) {
@@ -2336,11 +2515,11 @@
2336
2515
  * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`.
2337
2516
  * @example
2338
2517
  *
2339
- * _.isRegExp(/moe/);
2518
+ * _.isRegExp(/fred/);
2340
2519
  * // => true
2341
2520
  */
2342
2521
  function isRegExp(value) {
2343
- return value ? (typeof value == 'object' && toString.call(value) == regexpClass) : false;
2522
+ return value && typeof value == 'object' && toString.call(value) == regexpClass || false;
2344
2523
  }
2345
2524
 
2346
2525
  /**
@@ -2353,11 +2532,12 @@
2353
2532
  * @returns {boolean} Returns `true` if the `value` is a string, else `false`.
2354
2533
  * @example
2355
2534
  *
2356
- * _.isString('moe');
2535
+ * _.isString('fred');
2357
2536
  * // => true
2358
2537
  */
2359
2538
  function isString(value) {
2360
- return typeof value == 'string' || toString.call(value) == stringClass;
2539
+ return typeof value == 'string' ||
2540
+ value && typeof value == 'object' && toString.call(value) == stringClass || false;
2361
2541
  }
2362
2542
 
2363
2543
  /**
@@ -2397,21 +2577,21 @@
2397
2577
  * @example
2398
2578
  *
2399
2579
  * var names = {
2400
- * 'stooges': [
2401
- * { 'name': 'moe' },
2402
- * { 'name': 'larry' }
2580
+ * 'characters': [
2581
+ * { 'name': 'barney' },
2582
+ * { 'name': 'fred' }
2403
2583
  * ]
2404
2584
  * };
2405
2585
  *
2406
2586
  * var ages = {
2407
- * 'stooges': [
2408
- * { 'age': 40 },
2409
- * { 'age': 50 }
2587
+ * 'characters': [
2588
+ * { 'age': 36 },
2589
+ * { 'age': 40 }
2410
2590
  * ]
2411
2591
  * };
2412
2592
  *
2413
2593
  * _.merge(names, ages);
2414
- * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] }
2594
+ * // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] }
2415
2595
  *
2416
2596
  * var food = {
2417
2597
  * 'fruits': ['apple'],
@@ -2435,6 +2615,7 @@
2435
2615
  if (!isObject(object)) {
2436
2616
  return object;
2437
2617
  }
2618
+
2438
2619
  // allows working with `_.reduce` and `_.reduceRight` without using
2439
2620
  // their `index` and `collection` arguments
2440
2621
  if (typeof args[2] != 'number') {
@@ -2445,7 +2626,7 @@
2445
2626
  } else if (length > 2 && typeof args[length - 1] == 'function') {
2446
2627
  callback = args[--length];
2447
2628
  }
2448
- var sources = nativeSlice.call(arguments, 1, length),
2629
+ var sources = slice(arguments, 1, length),
2449
2630
  index = -1,
2450
2631
  stackA = getArray(),
2451
2632
  stackB = getArray();
@@ -2476,32 +2657,38 @@
2476
2657
  * @returns {Object} Returns an object without the omitted properties.
2477
2658
  * @example
2478
2659
  *
2479
- * _.omit({ 'name': 'moe', 'age': 40 }, 'age');
2480
- * // => { 'name': 'moe' }
2660
+ * _.omit({ 'name': 'fred', 'age': 40 }, 'age');
2661
+ * // => { 'name': 'fred' }
2481
2662
  *
2482
- * _.omit({ 'name': 'moe', 'age': 40 }, function(value) {
2663
+ * _.omit({ 'name': 'fred', 'age': 40 }, function(value) {
2483
2664
  * return typeof value == 'number';
2484
2665
  * });
2485
- * // => { 'name': 'moe' }
2666
+ * // => { 'name': 'fred' }
2486
2667
  */
2487
2668
  function omit(object, callback, thisArg) {
2488
- var indexOf = getIndexOf(),
2489
- isFunc = typeof callback == 'function',
2490
- result = {};
2669
+ var result = {};
2670
+ if (typeof callback != 'function') {
2671
+ var props = [];
2672
+ forIn(object, function(value, key) {
2673
+ props.push(key);
2674
+ });
2675
+ props = baseDifference(props, baseFlatten(arguments, true, false, 1));
2491
2676
 
2492
- if (isFunc) {
2493
- callback = lodash.createCallback(callback, thisArg, 3);
2677
+ var index = -1,
2678
+ length = props.length;
2679
+
2680
+ while (++index < length) {
2681
+ var key = props[index];
2682
+ result[key] = object[key];
2683
+ }
2494
2684
  } else {
2495
- var props = baseFlatten(arguments, true, false, 1);
2685
+ callback = lodash.createCallback(callback, thisArg, 3);
2686
+ forIn(object, function(value, key, object) {
2687
+ if (!callback(value, key, object)) {
2688
+ result[key] = value;
2689
+ }
2690
+ });
2496
2691
  }
2497
- forIn(object, function(value, key, object) {
2498
- if (isFunc
2499
- ? !callback(value, key, object)
2500
- : indexOf(props, key) < 0
2501
- ) {
2502
- result[key] = value;
2503
- }
2504
- });
2505
2692
  return result;
2506
2693
  }
2507
2694
 
@@ -2516,8 +2703,8 @@
2516
2703
  * @returns {Array} Returns new array of key-value pairs.
2517
2704
  * @example
2518
2705
  *
2519
- * _.pairs({ 'moe': 30, 'larry': 40 });
2520
- * // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)
2706
+ * _.pairs({ 'barney': 36, 'fred': 40 });
2707
+ * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments)
2521
2708
  */
2522
2709
  function pairs(object) {
2523
2710
  var index = -1,
@@ -2551,13 +2738,13 @@
2551
2738
  * @returns {Object} Returns an object composed of the picked properties.
2552
2739
  * @example
2553
2740
  *
2554
- * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name');
2555
- * // => { 'name': 'moe' }
2741
+ * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name');
2742
+ * // => { 'name': 'fred' }
2556
2743
  *
2557
- * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) {
2744
+ * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) {
2558
2745
  * return key.charAt(0) != '_';
2559
2746
  * });
2560
- * // => { 'name': 'moe' }
2747
+ * // => { 'name': 'fred' }
2561
2748
  */
2562
2749
  function pick(object, callback, thisArg) {
2563
2750
  var result = {};
@@ -2594,7 +2781,7 @@
2594
2781
  * @static
2595
2782
  * @memberOf _
2596
2783
  * @category Objects
2597
- * @param {Array|Object} collection The collection to iterate over.
2784
+ * @param {Array|Object} object The object to iterate over.
2598
2785
  * @param {Function} [callback=identity] The function called per iteration.
2599
2786
  * @param {*} [accumulator] The custom accumulator value.
2600
2787
  * @param {*} [thisArg] The `this` binding of `callback`.
@@ -2616,8 +2803,6 @@
2616
2803
  */
2617
2804
  function transform(object, callback, accumulator, thisArg) {
2618
2805
  var isArr = isArray(object);
2619
- callback = baseCreateCallback(callback, thisArg, 4);
2620
-
2621
2806
  if (accumulator == null) {
2622
2807
  if (isArr) {
2623
2808
  accumulator = [];
@@ -2625,12 +2810,15 @@
2625
2810
  var ctor = object && object.constructor,
2626
2811
  proto = ctor && ctor.prototype;
2627
2812
 
2628
- accumulator = createObject(proto);
2813
+ accumulator = baseCreate(proto);
2629
2814
  }
2630
2815
  }
2631
- (isArr ? forEach : forOwn)(object, function(value, index, object) {
2632
- return callback(accumulator, value, index, object);
2633
- });
2816
+ if (callback) {
2817
+ callback = lodash.createCallback(callback, thisArg, 4);
2818
+ (isArr ? forEach : forOwn)(object, function(value, index, object) {
2819
+ return callback(accumulator, value, index, object);
2820
+ });
2821
+ }
2634
2822
  return accumulator;
2635
2823
  }
2636
2824
 
@@ -2679,8 +2867,8 @@
2679
2867
  * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]);
2680
2868
  * // => ['a', 'c', 'e']
2681
2869
  *
2682
- * _.at(['moe', 'larry', 'curly'], 0, 2);
2683
- * // => ['moe', 'curly']
2870
+ * _.at(['fred', 'barney', 'pebbles'], 0, 2);
2871
+ * // => ['fred', 'pebbles']
2684
2872
  */
2685
2873
  function at(collection) {
2686
2874
  var args = arguments,
@@ -2716,10 +2904,10 @@
2716
2904
  * _.contains([1, 2, 3], 1, 2);
2717
2905
  * // => false
2718
2906
  *
2719
- * _.contains({ 'name': 'moe', 'age': 40 }, 'moe');
2907
+ * _.contains({ 'name': 'fred', 'age': 40 }, 'fred');
2720
2908
  * // => true
2721
2909
  *
2722
- * _.contains('curly', 'ur');
2910
+ * _.contains('pebbles', 'eb');
2723
2911
  * // => true
2724
2912
  */
2725
2913
  function contains(collection, target, fromIndex) {
@@ -2806,20 +2994,20 @@
2806
2994
  * else `false`.
2807
2995
  * @example
2808
2996
  *
2809
- * _.every([true, 1, null, 'yes'], Boolean);
2997
+ * _.every([true, 1, null, 'yes']);
2810
2998
  * // => false
2811
2999
  *
2812
- * var stooges = [
2813
- * { 'name': 'moe', 'age': 40 },
2814
- * { 'name': 'larry', 'age': 50 }
3000
+ * var characters = [
3001
+ * { 'name': 'barney', 'age': 36 },
3002
+ * { 'name': 'fred', 'age': 40 }
2815
3003
  * ];
2816
3004
  *
2817
3005
  * // using "_.pluck" callback shorthand
2818
- * _.every(stooges, 'age');
3006
+ * _.every(characters, 'age');
2819
3007
  * // => true
2820
3008
  *
2821
3009
  * // using "_.where" callback shorthand
2822
- * _.every(stooges, { 'age': 50 });
3010
+ * _.every(characters, { 'age': 36 });
2823
3011
  * // => false
2824
3012
  */
2825
3013
  function every(collection, callback, thisArg) {
@@ -2870,18 +3058,18 @@
2870
3058
  * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
2871
3059
  * // => [2, 4, 6]
2872
3060
  *
2873
- * var food = [
2874
- * { 'name': 'apple', 'organic': false, 'type': 'fruit' },
2875
- * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
3061
+ * var characters = [
3062
+ * { 'name': 'barney', 'age': 36, 'blocked': false },
3063
+ * { 'name': 'fred', 'age': 40, 'blocked': true }
2876
3064
  * ];
2877
3065
  *
2878
3066
  * // using "_.pluck" callback shorthand
2879
- * _.filter(food, 'organic');
2880
- * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
3067
+ * _.filter(characters, 'blocked');
3068
+ * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
2881
3069
  *
2882
3070
  * // using "_.where" callback shorthand
2883
- * _.filter(food, { 'type': 'fruit' });
2884
- * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
3071
+ * _.filter(characters, { 'age': 36 });
3072
+ * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
2885
3073
  */
2886
3074
  function filter(collection, callback, thisArg) {
2887
3075
  var result = [];
@@ -2931,24 +3119,24 @@
2931
3119
  * @returns {*} Returns the found element, else `undefined`.
2932
3120
  * @example
2933
3121
  *
2934
- * _.find([1, 2, 3, 4], function(num) {
2935
- * return num % 2 == 0;
2936
- * });
2937
- * // => 2
2938
- *
2939
- * var food = [
2940
- * { 'name': 'apple', 'organic': false, 'type': 'fruit' },
2941
- * { 'name': 'banana', 'organic': true, 'type': 'fruit' },
2942
- * { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
3122
+ * var characters = [
3123
+ * { 'name': 'barney', 'age': 36, 'blocked': false },
3124
+ * { 'name': 'fred', 'age': 40, 'blocked': true },
3125
+ * { 'name': 'pebbles', 'age': 1, 'blocked': false }
2943
3126
  * ];
2944
3127
  *
3128
+ * _.find(characters, function(chr) {
3129
+ * return chr.age < 40;
3130
+ * });
3131
+ * // => { 'name': 'barney', 'age': 36, 'blocked': false }
3132
+ *
2945
3133
  * // using "_.where" callback shorthand
2946
- * _.find(food, { 'type': 'vegetable' });
2947
- * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
3134
+ * _.find(characters, { 'age': 1 });
3135
+ * // => { 'name': 'pebbles', 'age': 1, 'blocked': false }
2948
3136
  *
2949
3137
  * // using "_.pluck" callback shorthand
2950
- * _.find(food, 'organic');
2951
- * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
3138
+ * _.find(characters, 'blocked');
3139
+ * // => { 'name': 'fred', 'age': 40, 'blocked': true }
2952
3140
  */
2953
3141
  function find(collection, callback, thisArg) {
2954
3142
  callback = lodash.createCallback(callback, thisArg, 3);
@@ -3013,6 +3201,10 @@
3013
3201
  * (value, index|key, collection). Callbacks may exit iteration early by
3014
3202
  * explicitly returning `false`.
3015
3203
  *
3204
+ * Note: As with other "Collections" methods, objects with a `length` property
3205
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
3206
+ * may be used for object iteration.
3207
+ *
3016
3208
  * @static
3017
3209
  * @memberOf _
3018
3210
  * @alias each
@@ -3158,7 +3350,7 @@
3158
3350
  * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
3159
3351
  * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
3160
3352
  *
3161
- * _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);
3353
+ * _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String);
3162
3354
  * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
3163
3355
  */
3164
3356
  var indexBy = createAggregator(function(result, value, key) {
@@ -3188,7 +3380,7 @@
3188
3380
  * // => [['1', '2', '3'], ['4', '5', '6']]
3189
3381
  */
3190
3382
  function invoke(collection, methodName) {
3191
- var args = nativeSlice.call(arguments, 2),
3383
+ var args = slice(arguments, 2),
3192
3384
  index = -1,
3193
3385
  isFunc = typeof methodName == 'function',
3194
3386
  length = collection ? collection.length : 0,
@@ -3230,14 +3422,14 @@
3230
3422
  * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
3231
3423
  * // => [3, 6, 9] (property order is not guaranteed across environments)
3232
3424
  *
3233
- * var stooges = [
3234
- * { 'name': 'moe', 'age': 40 },
3235
- * { 'name': 'larry', 'age': 50 }
3425
+ * var characters = [
3426
+ * { 'name': 'barney', 'age': 36 },
3427
+ * { 'name': 'fred', 'age': 40 }
3236
3428
  * ];
3237
3429
  *
3238
3430
  * // using "_.pluck" callback shorthand
3239
- * _.map(stooges, 'name');
3240
- * // => ['moe', 'larry']
3431
+ * _.map(characters, 'name');
3432
+ * // => ['barney', 'fred']
3241
3433
  */
3242
3434
  function map(collection, callback, thisArg) {
3243
3435
  var index = -1,
@@ -3286,23 +3478,28 @@
3286
3478
  * _.max([4, 2, 8, 6]);
3287
3479
  * // => 8
3288
3480
  *
3289
- * var stooges = [
3290
- * { 'name': 'moe', 'age': 40 },
3291
- * { 'name': 'larry', 'age': 50 }
3481
+ * var characters = [
3482
+ * { 'name': 'barney', 'age': 36 },
3483
+ * { 'name': 'fred', 'age': 40 }
3292
3484
  * ];
3293
3485
  *
3294
- * _.max(stooges, function(stooge) { return stooge.age; });
3295
- * // => { 'name': 'larry', 'age': 50 };
3486
+ * _.max(characters, function(chr) { return chr.age; });
3487
+ * // => { 'name': 'fred', 'age': 40 };
3296
3488
  *
3297
3489
  * // using "_.pluck" callback shorthand
3298
- * _.max(stooges, 'age');
3299
- * // => { 'name': 'larry', 'age': 50 };
3490
+ * _.max(characters, 'age');
3491
+ * // => { 'name': 'fred', 'age': 40 };
3300
3492
  */
3301
3493
  function max(collection, callback, thisArg) {
3302
3494
  var computed = -Infinity,
3303
3495
  result = computed;
3304
3496
 
3305
- if (!callback && isArray(collection)) {
3497
+ // allows working with functions like `_.map` without using
3498
+ // their `index` argument as a callback
3499
+ if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
3500
+ callback = null;
3501
+ }
3502
+ if (callback == null && isArray(collection)) {
3306
3503
  var index = -1,
3307
3504
  length = collection.length;
3308
3505
 
@@ -3313,7 +3510,7 @@
3313
3510
  }
3314
3511
  }
3315
3512
  } else {
3316
- callback = (!callback && isString(collection))
3513
+ callback = (callback == null && isString(collection))
3317
3514
  ? charAtCallback
3318
3515
  : lodash.createCallback(callback, thisArg, 3);
3319
3516
 
@@ -3356,23 +3553,28 @@
3356
3553
  * _.min([4, 2, 8, 6]);
3357
3554
  * // => 2
3358
3555
  *
3359
- * var stooges = [
3360
- * { 'name': 'moe', 'age': 40 },
3361
- * { 'name': 'larry', 'age': 50 }
3556
+ * var characters = [
3557
+ * { 'name': 'barney', 'age': 36 },
3558
+ * { 'name': 'fred', 'age': 40 }
3362
3559
  * ];
3363
3560
  *
3364
- * _.min(stooges, function(stooge) { return stooge.age; });
3365
- * // => { 'name': 'moe', 'age': 40 };
3561
+ * _.min(characters, function(chr) { return chr.age; });
3562
+ * // => { 'name': 'barney', 'age': 36 };
3366
3563
  *
3367
3564
  * // using "_.pluck" callback shorthand
3368
- * _.min(stooges, 'age');
3369
- * // => { 'name': 'moe', 'age': 40 };
3565
+ * _.min(characters, 'age');
3566
+ * // => { 'name': 'barney', 'age': 36 };
3370
3567
  */
3371
3568
  function min(collection, callback, thisArg) {
3372
3569
  var computed = Infinity,
3373
3570
  result = computed;
3374
3571
 
3375
- if (!callback && isArray(collection)) {
3572
+ // allows working with functions like `_.map` without using
3573
+ // their `index` argument as a callback
3574
+ if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
3575
+ callback = null;
3576
+ }
3577
+ if (callback == null && isArray(collection)) {
3376
3578
  var index = -1,
3377
3579
  length = collection.length;
3378
3580
 
@@ -3383,7 +3585,7 @@
3383
3585
  }
3384
3586
  }
3385
3587
  } else {
3386
- callback = (!callback && isString(collection))
3588
+ callback = (callback == null && isString(collection))
3387
3589
  ? charAtCallback
3388
3590
  : lodash.createCallback(callback, thisArg, 3);
3389
3591
 
@@ -3399,7 +3601,7 @@
3399
3601
  }
3400
3602
 
3401
3603
  /**
3402
- * Retrieves the value of a specified property from all elements in the `collection`.
3604
+ * Retrieves the value of a specified property from all elements in the collection.
3403
3605
  *
3404
3606
  * @static
3405
3607
  * @memberOf _
@@ -3410,13 +3612,13 @@
3410
3612
  * @returns {Array} Returns a new array of property values.
3411
3613
  * @example
3412
3614
  *
3413
- * var stooges = [
3414
- * { 'name': 'moe', 'age': 40 },
3415
- * { 'name': 'larry', 'age': 50 }
3615
+ * var characters = [
3616
+ * { 'name': 'barney', 'age': 36 },
3617
+ * { 'name': 'fred', 'age': 40 }
3416
3618
  * ];
3417
3619
  *
3418
- * _.pluck(stooges, 'name');
3419
- * // => ['moe', 'larry']
3620
+ * _.pluck(characters, 'name');
3621
+ * // => ['barney', 'fred']
3420
3622
  */
3421
3623
  function pluck(collection, property) {
3422
3624
  var index = -1,
@@ -3464,7 +3666,7 @@
3464
3666
  function reduce(collection, callback, accumulator, thisArg) {
3465
3667
  if (!collection) return accumulator;
3466
3668
  var noaccum = arguments.length < 3;
3467
- callback = baseCreateCallback(callback, thisArg, 4);
3669
+ callback = lodash.createCallback(callback, thisArg, 4);
3468
3670
 
3469
3671
  var index = -1,
3470
3672
  length = collection.length;
@@ -3507,7 +3709,7 @@
3507
3709
  */
3508
3710
  function reduceRight(collection, callback, accumulator, thisArg) {
3509
3711
  var noaccum = arguments.length < 3;
3510
- callback = baseCreateCallback(callback, thisArg, 4);
3712
+ callback = lodash.createCallback(callback, thisArg, 4);
3511
3713
  forEachRight(collection, function(value, index, collection) {
3512
3714
  accumulator = noaccum
3513
3715
  ? (noaccum = false, value)
@@ -3541,18 +3743,18 @@
3541
3743
  * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
3542
3744
  * // => [1, 3, 5]
3543
3745
  *
3544
- * var food = [
3545
- * { 'name': 'apple', 'organic': false, 'type': 'fruit' },
3546
- * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
3746
+ * var characters = [
3747
+ * { 'name': 'barney', 'age': 36, 'blocked': false },
3748
+ * { 'name': 'fred', 'age': 40, 'blocked': true }
3547
3749
  * ];
3548
3750
  *
3549
3751
  * // using "_.pluck" callback shorthand
3550
- * _.reject(food, 'organic');
3551
- * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
3752
+ * _.reject(characters, 'blocked');
3753
+ * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
3552
3754
  *
3553
3755
  * // using "_.where" callback shorthand
3554
- * _.reject(food, { 'type': 'fruit' });
3555
- * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
3756
+ * _.reject(characters, { 'age': 36 });
3757
+ * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
3556
3758
  */
3557
3759
  function reject(collection, callback, thisArg) {
3558
3760
  callback = lodash.createCallback(callback, thisArg, 3);
@@ -3569,8 +3771,8 @@
3569
3771
  * @category Collections
3570
3772
  * @param {Array|Object|string} collection The collection to sample.
3571
3773
  * @param {number} [n] The number of elements to sample.
3572
- * @param- {Object} [guard] Allows working with functions, like `_.map`,
3573
- * without using their `key` and `object` arguments as sources.
3774
+ * @param- {Object} [guard] Allows working with functions like `_.map`
3775
+ * without using their `index` arguments as `n`.
3574
3776
  * @returns {Array} Returns the random sample(s) of `collection`.
3575
3777
  * @example
3576
3778
  *
@@ -3581,12 +3783,11 @@
3581
3783
  * // => [3, 1]
3582
3784
  */
3583
3785
  function sample(collection, n, guard) {
3584
- var length = collection ? collection.length : 0;
3585
- if (typeof length != 'number') {
3786
+ if (collection && typeof collection.length != 'number') {
3586
3787
  collection = values(collection);
3587
3788
  }
3588
3789
  if (n == null || guard) {
3589
- return collection ? collection[random(length - 1)] : undefined;
3790
+ return collection ? collection[baseRandom(0, collection.length - 1)] : undefined;
3590
3791
  }
3591
3792
  var result = shuffle(collection);
3592
3793
  result.length = nativeMin(nativeMax(0, n), result.length);
@@ -3613,7 +3814,7 @@
3613
3814
  result = Array(typeof length == 'number' ? length : 0);
3614
3815
 
3615
3816
  forEach(collection, function(value) {
3616
- var rand = random(++index);
3817
+ var rand = baseRandom(0, ++index);
3617
3818
  result[index] = result[rand];
3618
3819
  result[rand] = value;
3619
3820
  });
@@ -3637,7 +3838,7 @@
3637
3838
  * _.size({ 'one': 1, 'two': 2, 'three': 3 });
3638
3839
  * // => 3
3639
3840
  *
3640
- * _.size('curly');
3841
+ * _.size('pebbles');
3641
3842
  * // => 5
3642
3843
  */
3643
3844
  function size(collection) {
@@ -3674,17 +3875,17 @@
3674
3875
  * _.some([null, 0, 'yes', false], Boolean);
3675
3876
  * // => true
3676
3877
  *
3677
- * var food = [
3678
- * { 'name': 'apple', 'organic': false, 'type': 'fruit' },
3679
- * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
3878
+ * var characters = [
3879
+ * { 'name': 'barney', 'age': 36, 'blocked': false },
3880
+ * { 'name': 'fred', 'age': 40, 'blocked': true }
3680
3881
  * ];
3681
3882
  *
3682
3883
  * // using "_.pluck" callback shorthand
3683
- * _.some(food, 'organic');
3884
+ * _.some(characters, 'blocked');
3684
3885
  * // => true
3685
3886
  *
3686
3887
  * // using "_.where" callback shorthand
3687
- * _.some(food, { 'type': 'meat' });
3888
+ * _.some(characters, { 'age': 1 });
3688
3889
  * // => false
3689
3890
  */
3690
3891
  function some(collection, callback, thisArg) {
@@ -3800,16 +4001,16 @@
3800
4001
  * @returns {Array} Returns a new array of elements that have the given properties.
3801
4002
  * @example
3802
4003
  *
3803
- * var stooges = [
3804
- * { 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },
3805
- * { 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }
4004
+ * var characters = [
4005
+ * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] },
4006
+ * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
3806
4007
  * ];
3807
4008
  *
3808
- * _.where(stooges, { 'age': 40 });
3809
- * // => [{ 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }]
4009
+ * _.where(characters, { 'age': 36 });
4010
+ * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
3810
4011
  *
3811
- * _.where(stooges, { 'quotes': ['Poifect!'] });
3812
- * // => [{ 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }]
4012
+ * _.where(characters, { 'pets': ['dino'] });
4013
+ * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }]
3813
4014
  */
3814
4015
  var where = filter;
3815
4016
 
@@ -3851,7 +4052,7 @@
3851
4052
  * @memberOf _
3852
4053
  * @category Arrays
3853
4054
  * @param {Array} array The array to process.
3854
- * @param {...Array} [array] The arrays of values to exclude.
4055
+ * @param {...Array} [values] The arrays of values to exclude.
3855
4056
  * @returns {Array} Returns a new array of filtered values.
3856
4057
  * @example
3857
4058
  *
@@ -3859,39 +4060,20 @@
3859
4060
  * // => [1, 3, 4]
3860
4061
  */
3861
4062
  function difference(array) {
3862
- var index = -1,
3863
- indexOf = getIndexOf(),
3864
- length = array ? array.length : 0,
3865
- seen = baseFlatten(arguments, true, true, 1),
3866
- result = [];
3867
-
3868
- var isLarge = length >= largeArraySize && indexOf === baseIndexOf;
3869
-
3870
- if (isLarge) {
3871
- var cache = createCache(seen);
3872
- if (cache) {
3873
- indexOf = cacheIndexOf;
3874
- seen = cache;
3875
- } else {
3876
- isLarge = false;
3877
- }
3878
- }
3879
- while (++index < length) {
3880
- var value = array[index];
3881
- if (indexOf(seen, value) < 0) {
3882
- result.push(value);
3883
- }
3884
- }
3885
- if (isLarge) {
3886
- releaseObject(seen);
3887
- }
3888
- return result;
4063
+ return baseDifference(array, baseFlatten(arguments, true, true, 1));
3889
4064
  }
3890
4065
 
3891
4066
  /**
3892
4067
  * This method is like `_.find` except that it returns the index of the first
3893
4068
  * element that passes the callback check, instead of the element itself.
3894
4069
  *
4070
+ * If a property name is provided for `callback` the created "_.pluck" style
4071
+ * callback will return the property value of the given element.
4072
+ *
4073
+ * If an object is provided for `callback` the created "_.where" style callback
4074
+ * will return `true` for elements that have the properties of the given object,
4075
+ * else `false`.
4076
+ *
3895
4077
  * @static
3896
4078
  * @memberOf _
3897
4079
  * @category Arrays
@@ -3903,9 +4085,23 @@
3903
4085
  * @returns {number} Returns the index of the found element, else `-1`.
3904
4086
  * @example
3905
4087
  *
3906
- * _.findIndex(['apple', 'banana', 'beet'], function(food) {
3907
- * return /^b/.test(food);
4088
+ * var characters = [
4089
+ * { 'name': 'barney', 'age': 36, 'blocked': false },
4090
+ * { 'name': 'fred', 'age': 40, 'blocked': true },
4091
+ * { 'name': 'pebbles', 'age': 1, 'blocked': false }
4092
+ * ];
4093
+ *
4094
+ * _.findIndex(characters, function(chr) {
4095
+ * return chr.age < 20;
3908
4096
  * });
4097
+ * // => 2
4098
+ *
4099
+ * // using "_.where" callback shorthand
4100
+ * _.findIndex(characters, { 'age': 36 });
4101
+ * // => 0
4102
+ *
4103
+ * // using "_.pluck" callback shorthand
4104
+ * _.findIndex(characters, 'blocked');
3909
4105
  * // => 1
3910
4106
  */
3911
4107
  function findIndex(array, callback, thisArg) {
@@ -3925,6 +4121,13 @@
3925
4121
  * This method is like `_.findIndex` except that it iterates over elements
3926
4122
  * of a `collection` from right to left.
3927
4123
  *
4124
+ * If a property name is provided for `callback` the created "_.pluck" style
4125
+ * callback will return the property value of the given element.
4126
+ *
4127
+ * If an object is provided for `callback` the created "_.where" style callback
4128
+ * will return `true` for elements that have the properties of the given object,
4129
+ * else `false`.
4130
+ *
3928
4131
  * @static
3929
4132
  * @memberOf _
3930
4133
  * @category Arrays
@@ -3936,9 +4139,23 @@
3936
4139
  * @returns {number} Returns the index of the found element, else `-1`.
3937
4140
  * @example
3938
4141
  *
3939
- * _.findLastIndex(['apple', 'banana', 'beet'], function(food) {
3940
- * return /^b/.test(food);
4142
+ * var characters = [
4143
+ * { 'name': 'barney', 'age': 36, 'blocked': true },
4144
+ * { 'name': 'fred', 'age': 40, 'blocked': false },
4145
+ * { 'name': 'pebbles', 'age': 1, 'blocked': true }
4146
+ * ];
4147
+ *
4148
+ * _.findLastIndex(characters, function(chr) {
4149
+ * return chr.age > 30;
3941
4150
  * });
4151
+ * // => 1
4152
+ *
4153
+ * // using "_.where" callback shorthand
4154
+ * _.findLastIndex(characters, { 'age': 36 });
4155
+ * // => 0
4156
+ *
4157
+ * // using "_.pluck" callback shorthand
4158
+ * _.findLastIndex(characters, 'blocked');
3942
4159
  * // => 2
3943
4160
  */
3944
4161
  function findLastIndex(array, callback, thisArg) {
@@ -3989,24 +4206,19 @@
3989
4206
  * });
3990
4207
  * // => [1, 2]
3991
4208
  *
3992
- * var food = [
3993
- * { 'name': 'banana', 'organic': true },
3994
- * { 'name': 'beet', 'organic': false },
4209
+ * var characters = [
4210
+ * { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
4211
+ * { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
4212
+ * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
3995
4213
  * ];
3996
4214
  *
3997
4215
  * // using "_.pluck" callback shorthand
3998
- * _.first(food, 'organic');
3999
- * // => [{ 'name': 'banana', 'organic': true }]
4000
- *
4001
- * var food = [
4002
- * { 'name': 'apple', 'type': 'fruit' },
4003
- * { 'name': 'banana', 'type': 'fruit' },
4004
- * { 'name': 'beet', 'type': 'vegetable' }
4005
- * ];
4216
+ * _.first(characters, 'blocked');
4217
+ * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }]
4006
4218
  *
4007
4219
  * // using "_.where" callback shorthand
4008
- * _.first(food, { 'type': 'fruit' });
4009
- * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
4220
+ * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name');
4221
+ * // => ['barney', 'fred']
4010
4222
  */
4011
4223
  function first(array, callback, thisArg) {
4012
4224
  var n = 0,
@@ -4059,20 +4271,20 @@
4059
4271
  * _.flatten([1, [2], [3, [[4]]]], true);
4060
4272
  * // => [1, 2, 3, [[4]]];
4061
4273
  *
4062
- * var stooges = [
4063
- * { 'name': 'curly', 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },
4064
- * { 'name': 'moe', 'quotes': ['Spread out!', 'You knucklehead!'] }
4274
+ * var characters = [
4275
+ * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] },
4276
+ * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
4065
4277
  * ];
4066
4278
  *
4067
4279
  * // using "_.pluck" callback shorthand
4068
- * _.flatten(stooges, 'quotes');
4069
- * // => ['Oh, a wise guy, eh?', 'Poifect!', 'Spread out!', 'You knucklehead!']
4280
+ * _.flatten(characters, 'pets');
4281
+ * // => ['hoppy', 'baby puss', 'dino']
4070
4282
  */
4071
4283
  function flatten(array, isShallow, callback, thisArg) {
4072
4284
  // juggle arguments
4073
4285
  if (typeof isShallow != 'boolean' && isShallow != null) {
4074
4286
  thisArg = callback;
4075
- callback = !(thisArg && thisArg[isShallow] === array) ? isShallow : null;
4287
+ callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow;
4076
4288
  isShallow = false;
4077
4289
  }
4078
4290
  if (callback != null) {
@@ -4152,24 +4364,19 @@
4152
4364
  * });
4153
4365
  * // => [1]
4154
4366
  *
4155
- * var food = [
4156
- * { 'name': 'beet', 'organic': false },
4157
- * { 'name': 'carrot', 'organic': true }
4367
+ * var characters = [
4368
+ * { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
4369
+ * { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
4370
+ * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
4158
4371
  * ];
4159
4372
  *
4160
4373
  * // using "_.pluck" callback shorthand
4161
- * _.initial(food, 'organic');
4162
- * // => [{ 'name': 'beet', 'organic': false }]
4163
- *
4164
- * var food = [
4165
- * { 'name': 'banana', 'type': 'fruit' },
4166
- * { 'name': 'beet', 'type': 'vegetable' },
4167
- * { 'name': 'carrot', 'type': 'vegetable' }
4168
- * ];
4374
+ * _.initial(characters, 'blocked');
4375
+ * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }]
4169
4376
  *
4170
4377
  * // using "_.where" callback shorthand
4171
- * _.initial(food, { 'type': 'vegetable' });
4172
- * // => [{ 'name': 'banana', 'type': 'fruit' }]
4378
+ * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name');
4379
+ * // => ['barney', 'fred']
4173
4380
  */
4174
4381
  function initial(array, callback, thisArg) {
4175
4382
  var n = 0,
@@ -4282,24 +4489,19 @@
4282
4489
  * });
4283
4490
  * // => [2, 3]
4284
4491
  *
4285
- * var food = [
4286
- * { 'name': 'beet', 'organic': false },
4287
- * { 'name': 'carrot', 'organic': true }
4492
+ * var characters = [
4493
+ * { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
4494
+ * { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
4495
+ * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
4288
4496
  * ];
4289
4497
  *
4290
4498
  * // using "_.pluck" callback shorthand
4291
- * _.last(food, 'organic');
4292
- * // => [{ 'name': 'carrot', 'organic': true }]
4293
- *
4294
- * var food = [
4295
- * { 'name': 'banana', 'type': 'fruit' },
4296
- * { 'name': 'beet', 'type': 'vegetable' },
4297
- * { 'name': 'carrot', 'type': 'vegetable' }
4298
- * ];
4499
+ * _.pluck(_.last(characters, 'blocked'), 'name');
4500
+ * // => ['fred', 'pebbles']
4299
4501
  *
4300
4502
  * // using "_.where" callback shorthand
4301
- * _.last(food, { 'type': 'vegetable' });
4302
- * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
4503
+ * _.last(characters, { 'employer': 'na' });
4504
+ * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
4303
4505
  */
4304
4506
  function last(array, callback, thisArg) {
4305
4507
  var n = 0,
@@ -4325,6 +4527,13 @@
4325
4527
  * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
4326
4528
  * as the offset from the end of the collection.
4327
4529
  *
4530
+ * If a property name is provided for `callback` the created "_.pluck" style
4531
+ * callback will return the property value of the given element.
4532
+ *
4533
+ * If an object is provided for `callback` the created "_.where" style callback
4534
+ * will return `true` for elements that have the properties of the given object,
4535
+ * else `false`.
4536
+ *
4328
4537
  * @static
4329
4538
  * @memberOf _
4330
4539
  * @category Arrays
@@ -4403,17 +4612,17 @@
4403
4612
  * @returns {Array} Returns a new range array.
4404
4613
  * @example
4405
4614
  *
4406
- * _.range(10);
4407
- * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
4615
+ * _.range(4);
4616
+ * // => [0, 1, 2, 3]
4408
4617
  *
4409
- * _.range(1, 11);
4410
- * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
4618
+ * _.range(1, 5);
4619
+ * // => [1, 2, 3, 4]
4411
4620
  *
4412
- * _.range(0, 30, 5);
4413
- * // => [0, 5, 10, 15, 20, 25]
4621
+ * _.range(0, 20, 5);
4622
+ * // => [0, 5, 10, 15]
4414
4623
  *
4415
- * _.range(0, -10, -1);
4416
- * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
4624
+ * _.range(0, -4, -1);
4625
+ * // => [0, -1, -2, -3]
4417
4626
  *
4418
4627
  * _.range(1, 4, 0);
4419
4628
  * // => [1, 1, 1]
@@ -4429,7 +4638,7 @@
4429
4638
  end = start;
4430
4639
  start = 0;
4431
4640
  }
4432
- // use `Array(length)` so engines, like Chakra and V8, avoid slower modes
4641
+ // use `Array(length)` so engines like Chakra and V8 avoid slower modes
4433
4642
  // http://youtu.be/XAqIpGU8ZZk#t=17m25s
4434
4643
  var index = -1,
4435
4644
  length = nativeMax(0, ceil((end - start) / (step || 1))),
@@ -4529,24 +4738,19 @@
4529
4738
  * });
4530
4739
  * // => [3]
4531
4740
  *
4532
- * var food = [
4533
- * { 'name': 'banana', 'organic': true },
4534
- * { 'name': 'beet', 'organic': false },
4741
+ * var characters = [
4742
+ * { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
4743
+ * { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
4744
+ * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
4535
4745
  * ];
4536
4746
  *
4537
4747
  * // using "_.pluck" callback shorthand
4538
- * _.rest(food, 'organic');
4539
- * // => [{ 'name': 'beet', 'organic': false }]
4540
- *
4541
- * var food = [
4542
- * { 'name': 'apple', 'type': 'fruit' },
4543
- * { 'name': 'banana', 'type': 'fruit' },
4544
- * { 'name': 'beet', 'type': 'vegetable' }
4545
- * ];
4748
+ * _.pluck(_.rest(characters, 'blocked'), 'name');
4749
+ * // => ['fred', 'pebbles']
4546
4750
  *
4547
4751
  * // using "_.where" callback shorthand
4548
- * _.rest(food, { 'type': 'fruit' });
4549
- * // => [{ 'name': 'beet', 'type': 'vegetable' }]
4752
+ * _.rest(characters, { 'employer': 'slate' });
4753
+ * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
4550
4754
  */
4551
4755
  function rest(array, callback, thisArg) {
4552
4756
  if (typeof callback != 'number' && callback != null) {
@@ -4695,7 +4899,7 @@
4695
4899
  // juggle arguments
4696
4900
  if (typeof isSorted != 'boolean' && isSorted != null) {
4697
4901
  thisArg = callback;
4698
- callback = !(thisArg && thisArg[isSorted] === array) ? isSorted : null;
4902
+ callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted;
4699
4903
  isSorted = false;
4700
4904
  }
4701
4905
  if (callback != null) {
@@ -4720,7 +4924,7 @@
4720
4924
  * // => [2, 3, 4]
4721
4925
  */
4722
4926
  function without(array) {
4723
- return difference(array, nativeSlice.call(arguments, 1));
4927
+ return baseDifference(array, slice(arguments, 1));
4724
4928
  }
4725
4929
 
4726
4930
  /**
@@ -4736,8 +4940,8 @@
4736
4940
  * @returns {Array} Returns a new array of grouped elements.
4737
4941
  * @example
4738
4942
  *
4739
- * _.zip(['moe', 'larry'], [30, 40], [true, false]);
4740
- * // => [['moe', 30, true], ['larry', 40, false]]
4943
+ * _.zip(['fred', 'barney'], [30, 40], [true, false]);
4944
+ * // => [['fred', 30, true], ['barney', 40, false]]
4741
4945
  */
4742
4946
  function zip() {
4743
4947
  var array = arguments.length > 1 ? arguments : arguments[0],
@@ -4766,8 +4970,8 @@
4766
4970
  * corresponding values.
4767
4971
  * @example
4768
4972
  *
4769
- * _.zipObject(['moe', 'larry'], [30, 40]);
4770
- * // => { 'moe': 30, 'larry': 40 }
4973
+ * _.zipObject(['fred', 'barney'], [30, 40]);
4974
+ * // => { 'fred': 30, 'barney': 40 }
4771
4975
  */
4772
4976
  function zipObject(keys, values) {
4773
4977
  var index = -1,
@@ -4840,14 +5044,14 @@
4840
5044
  * return greeting + ' ' + this.name;
4841
5045
  * };
4842
5046
  *
4843
- * func = _.bind(func, { 'name': 'moe' }, 'hi');
5047
+ * func = _.bind(func, { 'name': 'fred' }, 'hi');
4844
5048
  * func();
4845
- * // => 'hi moe'
5049
+ * // => 'hi fred'
4846
5050
  */
4847
5051
  function bind(func, thisArg) {
4848
5052
  return arguments.length > 2
4849
- ? createBound(func, 17, nativeSlice.call(arguments, 2), null, thisArg)
4850
- : createBound(func, 1, null, null, thisArg);
5053
+ ? createWrapper(func, 17, slice(arguments, 2), null, thisArg)
5054
+ : createWrapper(func, 1, null, null, thisArg);
4851
5055
  }
4852
5056
 
4853
5057
  /**
@@ -4881,7 +5085,7 @@
4881
5085
 
4882
5086
  while (++index < length) {
4883
5087
  var key = funcs[index];
4884
- object[key] = createBound(object[key], 1, null, null, object);
5088
+ object[key] = createWrapper(object[key], 1, null, null, object);
4885
5089
  }
4886
5090
  return object;
4887
5091
  }
@@ -4903,7 +5107,7 @@
4903
5107
  * @example
4904
5108
  *
4905
5109
  * var object = {
4906
- * 'name': 'moe',
5110
+ * 'name': 'fred',
4907
5111
  * 'greet': function(greeting) {
4908
5112
  * return greeting + ' ' + this.name;
4909
5113
  * }
@@ -4911,19 +5115,19 @@
4911
5115
  *
4912
5116
  * var func = _.bindKey(object, 'greet', 'hi');
4913
5117
  * func();
4914
- * // => 'hi moe'
5118
+ * // => 'hi fred'
4915
5119
  *
4916
5120
  * object.greet = function(greeting) {
4917
- * return greeting + ', ' + this.name + '!';
5121
+ * return greeting + 'ya ' + this.name + '!';
4918
5122
  * };
4919
5123
  *
4920
5124
  * func();
4921
- * // => 'hi, moe!'
5125
+ * // => 'hiya fred!'
4922
5126
  */
4923
5127
  function bindKey(object, key) {
4924
5128
  return arguments.length > 2
4925
- ? createBound(key, 19, nativeSlice.call(arguments, 2), null, object)
4926
- : createBound(key, 3, null, null, object);
5129
+ ? createWrapper(key, 19, slice(arguments, 2), null, object)
5130
+ : createWrapper(key, 3, null, null, object);
4927
5131
  }
4928
5132
 
4929
5133
  /**
@@ -4940,7 +5144,7 @@
4940
5144
  * @example
4941
5145
  *
4942
5146
  * var realNameMap = {
4943
- * 'curly': 'jerome'
5147
+ * 'pebbles': 'penelope'
4944
5148
  * };
4945
5149
  *
4946
5150
  * var format = function(name) {
@@ -4953,8 +5157,8 @@
4953
5157
  * };
4954
5158
  *
4955
5159
  * var welcome = _.compose(greet, format);
4956
- * welcome('curly');
4957
- * // => 'Hiya Jerome!'
5160
+ * welcome('pebbles');
5161
+ * // => 'Hiya Penelope!'
4958
5162
  */
4959
5163
  function compose() {
4960
5164
  var funcs = arguments,
@@ -4991,9 +5195,9 @@
4991
5195
  * @returns {Function} Returns a callback function.
4992
5196
  * @example
4993
5197
  *
4994
- * var stooges = [
4995
- * { 'name': 'moe', 'age': 40 },
4996
- * { 'name': 'larry', 'age': 50 }
5198
+ * var characters = [
5199
+ * { 'name': 'barney', 'age': 36 },
5200
+ * { 'name': 'fred', 'age': 40 }
4997
5201
  * ];
4998
5202
  *
4999
5203
  * // wrap to create custom callback shorthands
@@ -5004,8 +5208,8 @@
5004
5208
  * };
5005
5209
  * });
5006
5210
  *
5007
- * _.filter(stooges, 'age__gt45');
5008
- * // => [{ 'name': 'larry', 'age': 50 }]
5211
+ * _.filter(characters, 'age__gt38');
5212
+ * // => [{ 'name': 'fred', 'age': 40 }]
5009
5213
  */
5010
5214
  function createCallback(func, thisArg, argCount) {
5011
5215
  var type = typeof func;
@@ -5074,7 +5278,7 @@
5074
5278
  */
5075
5279
  function curry(func, arity) {
5076
5280
  arity = typeof arity == 'number' ? arity : (+arity || func.length);
5077
- return createBound(func, 4, null, null, null, arity);
5281
+ return createWrapper(func, 4, null, null, null, arity);
5078
5282
  }
5079
5283
 
5080
5284
  /**
@@ -5151,6 +5355,9 @@
5151
5355
  if (isCalled) {
5152
5356
  lastCalled = now();
5153
5357
  result = func.apply(thisArg, args);
5358
+ if (!timeoutId && !maxTimeoutId) {
5359
+ args = thisArg = null;
5360
+ }
5154
5361
  }
5155
5362
  } else {
5156
5363
  timeoutId = setTimeout(delayed, remaining);
@@ -5165,6 +5372,9 @@
5165
5372
  if (trailing || (maxWait !== wait)) {
5166
5373
  lastCalled = now();
5167
5374
  result = func.apply(thisArg, args);
5375
+ if (!timeoutId && !maxTimeoutId) {
5376
+ args = thisArg = null;
5377
+ }
5168
5378
  }
5169
5379
  };
5170
5380
 
@@ -5180,8 +5390,10 @@
5180
5390
  if (!maxTimeoutId && !leading) {
5181
5391
  lastCalled = stamp;
5182
5392
  }
5183
- var remaining = maxWait - (stamp - lastCalled);
5184
- if (remaining <= 0) {
5393
+ var remaining = maxWait - (stamp - lastCalled),
5394
+ isCalled = remaining <= 0;
5395
+
5396
+ if (isCalled) {
5185
5397
  if (maxTimeoutId) {
5186
5398
  maxTimeoutId = clearTimeout(maxTimeoutId);
5187
5399
  }
@@ -5192,12 +5404,19 @@
5192
5404
  maxTimeoutId = setTimeout(maxDelayed, remaining);
5193
5405
  }
5194
5406
  }
5195
- if (!timeoutId && wait !== maxWait) {
5407
+ if (isCalled && timeoutId) {
5408
+ timeoutId = clearTimeout(timeoutId);
5409
+ }
5410
+ else if (!timeoutId && wait !== maxWait) {
5196
5411
  timeoutId = setTimeout(delayed, wait);
5197
5412
  }
5198
5413
  if (leadingCall) {
5414
+ isCalled = true;
5199
5415
  result = func.apply(thisArg, args);
5200
5416
  }
5417
+ if (isCalled && !timeoutId && !maxTimeoutId) {
5418
+ args = thisArg = null;
5419
+ }
5201
5420
  return result;
5202
5421
  };
5203
5422
  }
@@ -5221,11 +5440,11 @@
5221
5440
  if (!isFunction(func)) {
5222
5441
  throw new TypeError;
5223
5442
  }
5224
- var args = nativeSlice.call(arguments, 1);
5443
+ var args = slice(arguments, 1);
5225
5444
  return setTimeout(function() { func.apply(undefined, args); }, 1);
5226
5445
  }
5227
5446
  // use `setImmediate` if available in Node.js
5228
- if (isV8 && moduleExports && typeof setImmediate == 'function') {
5447
+ if (setImmediate) {
5229
5448
  defer = function(func) {
5230
5449
  if (!isFunction(func)) {
5231
5450
  throw new TypeError;
@@ -5255,7 +5474,7 @@
5255
5474
  if (!isFunction(func)) {
5256
5475
  throw new TypeError;
5257
5476
  }
5258
- var args = nativeSlice.call(arguments, 2);
5477
+ var args = slice(arguments, 2);
5259
5478
  return setTimeout(function() { func.apply(undefined, args); }, wait);
5260
5479
  }
5261
5480
 
@@ -5279,19 +5498,22 @@
5279
5498
  * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
5280
5499
  * });
5281
5500
  *
5501
+ * fibonacci(9)
5502
+ * // => 34
5503
+ *
5282
5504
  * var data = {
5283
- * 'moe': { 'name': 'moe', 'age': 40 },
5284
- * 'curly': { 'name': 'curly', 'age': 60 }
5505
+ * 'fred': { 'name': 'fred', 'age': 40 },
5506
+ * 'pebbles': { 'name': 'pebbles', 'age': 1 }
5285
5507
  * };
5286
5508
  *
5287
5509
  * // modifying the result cache
5288
- * var stooge = _.memoize(function(name) { return data[name]; }, _.identity);
5289
- * stooge('curly');
5290
- * // => { 'name': 'curly', 'age': 60 }
5510
+ * var get = _.memoize(function(name) { return data[name]; }, _.identity);
5511
+ * get('pebbles');
5512
+ * // => { 'name': 'pebbles', 'age': 1 }
5291
5513
  *
5292
- * stooge.cache.curly.name = 'jerome';
5293
- * stooge('curly');
5294
- * // => { 'name': 'jerome', 'age': 60 }
5514
+ * get.cache.pebbles.name = 'penelope';
5515
+ * get('pebbles');
5516
+ * // => { 'name': 'penelope', 'age': 1 }
5295
5517
  */
5296
5518
  function memoize(func, resolver) {
5297
5519
  if (!isFunction(func)) {
@@ -5361,11 +5583,11 @@
5361
5583
  *
5362
5584
  * var greet = function(greeting, name) { return greeting + ' ' + name; };
5363
5585
  * var hi = _.partial(greet, 'hi');
5364
- * hi('moe');
5365
- * // => 'hi moe'
5586
+ * hi('fred');
5587
+ * // => 'hi fred'
5366
5588
  */
5367
5589
  function partial(func) {
5368
- return createBound(func, 16, nativeSlice.call(arguments, 1));
5590
+ return createWrapper(func, 16, slice(arguments, 1));
5369
5591
  }
5370
5592
 
5371
5593
  /**
@@ -5396,7 +5618,7 @@
5396
5618
  * // => { '_': _, 'jq': $ }
5397
5619
  */
5398
5620
  function partialRight(func) {
5399
- return createBound(func, 32, null, nativeSlice.call(arguments, 1));
5621
+ return createWrapper(func, 32, null, slice(arguments, 1));
5400
5622
  }
5401
5623
 
5402
5624
  /**
@@ -5447,8 +5669,7 @@
5447
5669
  debounceOptions.maxWait = wait;
5448
5670
  debounceOptions.trailing = trailing;
5449
5671
 
5450
- var result = debounce(func, wait, debounceOptions);
5451
- return result;
5672
+ return debounce(func, wait, debounceOptions);
5452
5673
  }
5453
5674
 
5454
5675
  /**
@@ -5465,22 +5686,15 @@
5465
5686
  * @returns {Function} Returns the new function.
5466
5687
  * @example
5467
5688
  *
5468
- * var hello = function(name) { return 'hello ' + name; };
5469
- * hello = _.wrap(hello, function(func) {
5470
- * return 'before, ' + func('moe') + ', after';
5689
+ * var p = _.wrap(_.escape, function(func, text) {
5690
+ * return '<p>' + func(text) + '</p>';
5471
5691
  * });
5472
- * hello();
5473
- * // => 'before, hello moe, after'
5692
+ *
5693
+ * p('Fred, Wilma, & Pebbles');
5694
+ * // => '<p>Fred, Wilma, &amp; Pebbles</p>'
5474
5695
  */
5475
5696
  function wrap(value, wrapper) {
5476
- if (!isFunction(wrapper)) {
5477
- throw new TypeError;
5478
- }
5479
- return function() {
5480
- var args = [value];
5481
- push.apply(args, arguments);
5482
- return wrapper.apply(this, args);
5483
- };
5697
+ return createWrapper(wrapper, 16, [value]);
5484
5698
  }
5485
5699
 
5486
5700
  /*--------------------------------------------------------------------------*/
@@ -5496,8 +5710,8 @@
5496
5710
  * @returns {string} Returns the escaped string.
5497
5711
  * @example
5498
5712
  *
5499
- * _.escape('Moe, Larry & Curly');
5500
- * // => 'Moe, Larry &amp; Curly'
5713
+ * _.escape('Fred, Wilma, & Pebbles');
5714
+ * // => 'Fred, Wilma, &amp; Pebbles'
5501
5715
  */
5502
5716
  function escape(string) {
5503
5717
  return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);
@@ -5513,8 +5727,8 @@
5513
5727
  * @returns {*} Returns `value`.
5514
5728
  * @example
5515
5729
  *
5516
- * var moe = { 'name': 'moe' };
5517
- * moe === _.identity(moe);
5730
+ * var object = { 'name': 'fred' };
5731
+ * _.identity(object) === object;
5518
5732
  * // => true
5519
5733
  */
5520
5734
  function identity(value) {
@@ -5538,11 +5752,11 @@
5538
5752
  * }
5539
5753
  * });
5540
5754
  *
5541
- * _.capitalize('moe');
5542
- * // => 'Moe'
5755
+ * _.capitalize('fred');
5756
+ * // => 'Fred'
5543
5757
  *
5544
- * _('moe').capitalize();
5545
- * // => 'Moe'
5758
+ * _('fred').capitalize();
5759
+ * // => 'Fred'
5546
5760
  */
5547
5761
  function mixin(object, source) {
5548
5762
  var ctor = object,
@@ -5590,6 +5804,22 @@
5590
5804
  return this;
5591
5805
  }
5592
5806
 
5807
+ /**
5808
+ * A no-operation function.
5809
+ *
5810
+ * @static
5811
+ * @memberOf _
5812
+ * @category Utilities
5813
+ * @example
5814
+ *
5815
+ * var object = { 'name': 'fred' };
5816
+ * _.noop(object) === undefined;
5817
+ * // => true
5818
+ */
5819
+ function noop() {
5820
+ // no operation performed
5821
+ }
5822
+
5593
5823
  /**
5594
5824
  * Converts the given value into an integer of the specified radix.
5595
5825
  * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
@@ -5610,7 +5840,7 @@
5610
5840
  * // => 8
5611
5841
  */
5612
5842
  var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) {
5613
- // Firefox and Opera still follow the ES3 specified implementation of `parseInt`
5843
+ // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt`
5614
5844
  return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
5615
5845
  };
5616
5846
 
@@ -5665,10 +5895,11 @@
5665
5895
  } else {
5666
5896
  max = +max || 0;
5667
5897
  }
5668
- var rand = nativeRandom();
5669
- return (floating || min % 1 || max % 1)
5670
- ? nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max)
5671
- : min + floor(rand * (max - min + 1));
5898
+ if (floating || min % 1 || max % 1) {
5899
+ var rand = nativeRandom();
5900
+ return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max);
5901
+ }
5902
+ return baseRandom(min, max);
5672
5903
  }
5673
5904
 
5674
5905
  /**
@@ -5713,7 +5944,7 @@
5713
5944
  * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
5714
5945
  *
5715
5946
  * For more information on precompiling templates see:
5716
- * http://lodash.com/#custom-builds
5947
+ * http://lodash.com/custom-builds
5717
5948
  *
5718
5949
  * For more information on Chrome extension sandboxes see:
5719
5950
  * http://developer.chrome.com/stable/extensions/sandboxingEval.html
@@ -5736,8 +5967,8 @@
5736
5967
  *
5737
5968
  * // using the "interpolate" delimiter to create a compiled template
5738
5969
  * var compiled = _.template('hello <%= name %>');
5739
- * compiled({ 'name': 'moe' });
5740
- * // => 'hello moe'
5970
+ * compiled({ 'name': 'fred' });
5971
+ * // => 'hello fred'
5741
5972
  *
5742
5973
  * // using the "escape" delimiter to escape HTML in data property values
5743
5974
  * _.template('<b><%- value %></b>', { 'value': '<script>' });
@@ -5745,16 +5976,16 @@
5745
5976
  *
5746
5977
  * // using the "evaluate" delimiter to generate HTML
5747
5978
  * var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';
5748
- * _.template(list, { 'people': ['moe', 'larry'] });
5749
- * // => '<li>moe</li><li>larry</li>'
5979
+ * _.template(list, { 'people': ['fred', 'barney'] });
5980
+ * // => '<li>fred</li><li>barney</li>'
5750
5981
  *
5751
5982
  * // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
5752
- * _.template('hello ${ name }', { 'name': 'curly' });
5753
- * // => 'hello curly'
5983
+ * _.template('hello ${ name }', { 'name': 'pebbles' });
5984
+ * // => 'hello pebbles'
5754
5985
  *
5755
5986
  * // using the internal `print` function in "evaluate" delimiters
5756
- * _.template('<% print("hello " + name); %>!', { 'name': 'larry' });
5757
- * // => 'hello larry!'
5987
+ * _.template('<% print("hello " + name); %>!', { 'name': 'barney' });
5988
+ * // => 'hello barney!'
5758
5989
  *
5759
5990
  * // using a custom template delimiters
5760
5991
  * _.templateSettings = {
@@ -5766,8 +5997,8 @@
5766
5997
  *
5767
5998
  * // using the `imports` option to import jQuery
5768
5999
  * var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
5769
- * _.template(list, { 'people': ['moe', 'larry'] }, { 'imports': { '$': jQuery } });
5770
- * // => '<li>moe</li><li>larry</li>'
6000
+ * _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
6001
+ * // => '<li>fred</li><li>barney</li>'
5771
6002
  *
5772
6003
  * // using the `sourceURL` option to specify a custom sourceURL for the template
5773
6004
  * var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
@@ -5797,7 +6028,7 @@
5797
6028
  // and Laura Doktorova's doT.js
5798
6029
  // https://github.com/olado/doT
5799
6030
  var settings = lodash.templateSettings;
5800
- text || (text = '');
6031
+ text = String(text || '');
5801
6032
 
5802
6033
  // avoid missing dependencies when `iteratorTemplate` is not defined
5803
6034
  options = defaults({}, options, settings);
@@ -5938,8 +6169,8 @@
5938
6169
  * @returns {string} Returns the unescaped string.
5939
6170
  * @example
5940
6171
  *
5941
- * _.unescape('Moe, Larry &amp; Curly');
5942
- * // => 'Moe, Larry & Curly'
6172
+ * _.unescape('Fred, Barney &amp; Pebbles');
6173
+ * // => 'Fred, Barney & Pebbles'
5943
6174
  */
5944
6175
  function unescape(string) {
5945
6176
  return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
@@ -5979,18 +6210,18 @@
5979
6210
  * @returns {Object} Returns the wrapper object.
5980
6211
  * @example
5981
6212
  *
5982
- * var stooges = [
5983
- * { 'name': 'moe', 'age': 40 },
5984
- * { 'name': 'larry', 'age': 50 },
5985
- * { 'name': 'curly', 'age': 60 }
6213
+ * var characters = [
6214
+ * { 'name': 'barney', 'age': 36 },
6215
+ * { 'name': 'fred', 'age': 40 },
6216
+ * { 'name': 'pebbles', 'age': 1 }
5986
6217
  * ];
5987
6218
  *
5988
- * var youngest = _.chain(stooges)
6219
+ * var youngest = _.chain(characters)
5989
6220
  * .sortBy('age')
5990
- * .map(function(stooge) { return stooge.name + ' is ' + stooge.age; })
6221
+ * .map(function(chr) { return chr.name + ' is ' + chr.age; })
5991
6222
  * .first()
5992
6223
  * .value();
5993
- * // => 'moe is 40'
6224
+ * // => 'pebbles is 1'
5994
6225
  */
5995
6226
  function chain(value) {
5996
6227
  value = new lodashWrapper(value);
@@ -6013,12 +6244,10 @@
6013
6244
  * @example
6014
6245
  *
6015
6246
  * _([1, 2, 3, 4])
6016
- * .filter(function(num) { return num % 2 == 0; })
6017
- * .tap(function(array) { console.log(array); })
6018
- * .map(function(num) { return num * num; })
6247
+ * .tap(function(array) { array.pop(); })
6248
+ * .reverse()
6019
6249
  * .value();
6020
- * // => // [2, 4] (logged)
6021
- * // => [4, 16]
6250
+ * // => [3, 2, 1]
6022
6251
  */
6023
6252
  function tap(value, interceptor) {
6024
6253
  interceptor(value);
@@ -6034,21 +6263,21 @@
6034
6263
  * @returns {*} Returns the wrapper object.
6035
6264
  * @example
6036
6265
  *
6037
- * var stooges = [
6038
- * { 'name': 'moe', 'age': 40 },
6039
- * { 'name': 'larry', 'age': 50 }
6266
+ * var characters = [
6267
+ * { 'name': 'barney', 'age': 36 },
6268
+ * { 'name': 'fred', 'age': 40 }
6040
6269
  * ];
6041
6270
  *
6042
6271
  * // without explicit chaining
6043
- * _(stooges).first();
6044
- * // => { 'name': 'moe', 'age': 40 }
6272
+ * _(characters).first();
6273
+ * // => { 'name': 'barney', 'age': 36 }
6045
6274
  *
6046
6275
  * // with explicit chaining
6047
- * _(stooges).chain()
6276
+ * _(characters).chain()
6048
6277
  * .first()
6049
6278
  * .pick('age')
6050
6279
  * .value()
6051
- * // => { 'age': 40 }
6280
+ * // => { 'age': 36 }
6052
6281
  */
6053
6282
  function wrapperChain() {
6054
6283
  this.__chain__ = true;
@@ -6101,6 +6330,7 @@
6101
6330
  lodash.compact = compact;
6102
6331
  lodash.compose = compose;
6103
6332
  lodash.countBy = countBy;
6333
+ lodash.create = create;
6104
6334
  lodash.createCallback = createCallback;
6105
6335
  lodash.curry = curry;
6106
6336
  lodash.debounce = debounce;
@@ -6210,6 +6440,7 @@
6210
6440
  lodash.lastIndexOf = lastIndexOf;
6211
6441
  lodash.mixin = mixin;
6212
6442
  lodash.noConflict = noConflict;
6443
+ lodash.noop = noop;
6213
6444
  lodash.parseInt = parseInt;
6214
6445
  lodash.random = random;
6215
6446
  lodash.reduce = reduce;
@@ -6282,7 +6513,7 @@
6282
6513
  * @memberOf _
6283
6514
  * @type string
6284
6515
  */
6285
- lodash.VERSION = '2.2.1';
6516
+ lodash.VERSION = '2.3.0';
6286
6517
 
6287
6518
  // add "Chaining" functions to the wrapper
6288
6519
  lodash.prototype.chain = wrapperChain;
@@ -6328,7 +6559,7 @@
6328
6559
  // expose Lo-Dash
6329
6560
  var _ = runInContext();
6330
6561
 
6331
- // some AMD build optimizers, like r.js, check for condition patterns like the following:
6562
+ // some AMD build optimizers like r.js check for condition patterns like the following:
6332
6563
  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
6333
6564
  // Expose Lo-Dash to the global object even when an AMD loader is present in
6334
6565
  // case Lo-Dash was injected by a third-party script and not intended to be