diff --git a/build.js b/build.js index 48e762e8d..1857cf35f 100755 --- a/build.js +++ b/build.js @@ -512,10 +512,10 @@ source = source.replace(getMethodAssignments(source), function(match) { var indent = /^ *(?=lodash\.)/m.exec(match)[0]; return match + [ - '', '', '// add functions to `lodash.prototype`', - 'mixin(lodash);' + 'mixin(lodash);', + '' ].join('\n' + indent); }); @@ -543,8 +543,9 @@ } // add quotes to commands with spaces or equals signs commands = _.map(commands, function(command) { - var separator = (command.match(/[= ]/) || [''])[0]; + var separator = command.match(/[= ]/); if (separator) { + separator = separator[0]; var pair = command.split(separator); command = pair[0] + separator + '"' + pair[1] + '"'; } @@ -691,7 +692,7 @@ return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*')); }) // remove unneeded horizontal rule comment separators - .replace(/(\{\n)\s*\/\*-+\*\/\n/g, '$1'); + .replace(/(\{\n)\s*\/\*-+\*\/\n|\n *\/\*-+\*\/\n(\s*\})/gm, '$1$2'); } /** @@ -891,7 +892,8 @@ * @returns {String} Returns the `isArguments` fallback. */ function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!support\.argsClass|!isArguments)[\s\S]+?\n *};\n\1}/) || [''])[0]; + var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!support\.argsClass|!isArguments)[\s\S]+?\n *};\n\1}/); + return result ? result[0] : ''; } /** @@ -915,7 +917,8 @@ * @returns {String} Returns the `isFunction` fallback. */ function getIsFunctionFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?\n *};\n\1}/) || [''])[0]; + var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?\n *};\n\1}/); + return result ? result[0] : ''; } /** @@ -926,7 +929,8 @@ * @returns {String} Returns the `isArguments` fallback. */ function getCreateObjectFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!nativeCreate)[\s\S]+?\n *};\n\1}/) || [''])[0]; + var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!nativeCreate)[\s\S]+?\n *};\n\1}/); + return result ? result[0] : ''; } /** @@ -937,7 +941,8 @@ * @returns {String} Returns the `iteratorTemplate`. */ function getIteratorTemplate(source) { - return (source.match(/^( *)var iteratorTemplate *= *[\s\S]+?\n\1.+?;\n/m) || [''])[0]; + var result = source.match(/^( *)var iteratorTemplate *= *[\s\S]+?\n\1.+?;\n/m); + return result ? result[0] : ''; } /** @@ -948,7 +953,13 @@ * @returns {String} Returns the method assignments snippet. */ function getMethodAssignments(source) { - return (source.match(/\/\*-+\*\/\n(?:\s*\/\/.*)*\s*lodash\.\w+ *=[\s\S]+?lodash\.VERSION *=.+/) || [''])[0]; + var result = source.match(RegExp( + '/\\*-+\\*/\\n' + + '(?:\\s*//.*)*\\s*lodash\\.\\w+ *=[\\s\\S]+?\\n' + + '(?=\\s*/\\*-+\\*/\\n\\s*' + multilineComment + ' *lodash\\.VERSION *=)' + )); + + return result ? result[0] : ''; } /** @@ -980,6 +991,22 @@ ) || methodName; } + /** + * Gets the `support` object assignment snippet from `source`. + * + * @private + * @param {String} source The source to inspect. + * @returns {String} Returns the `support` snippet. + */ + function getSupport(source) { + var result = source.match(RegExp( + multilineComment + + '( *)var support *=[\\s\\S]+?\n\\1}\\(1\\)\\);\\n' + , 'm')); + + return result ? result[0] : ''; + } + /** * Creates a sorted array of all variables defined outside of Lo-Dash methods. * @@ -1293,7 +1320,6 @@ return source; } - /** * Removes the `Object.keys` object iteration optimization from `source`. * @@ -1332,18 +1358,64 @@ } /** - * Removes all `support.argsObject` references from `source`. + * Removes all `runInContext` references from `source`. * * @private * @param {String} source The source to process. * @returns {String} Returns the modified source. */ - function removeSupportArgsObject(source) { - source = removeSupportProp(source, 'argsObject'); + function removeRunInContext(source) { + // replace reference in `reThis` assignment + source = source.replace(/\btest\(runInContext\)/, 'test(function() { return this; })'); - // remove `argsAreObjects` from `_.isEqual` - source = source.replace(matchFunction(source, 'isEqual'), function(match) { - return match.replace(/!support.\argsObject[^:]+:\s*/g, ''); + // remove function scaffolding, leaving most of its content + source = source.replace(matchFunction(source, 'runInContext'), function(match) { + return match + .replace(/^[\s\S]+?function runInContext[\s\S]+?context *= *context.+| *return lodash[\s\S]+$/g, '') + .replace(/^ {4}/gm, ' '); + }); + + // cleanup adjusted source + source = source + .replace(/\bcontext\b/g, 'window') + .replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var Array *=[\s\S]+?;\n/, '') + .replace(/(return *|= *)_([;)])/g, '$1lodash$2') + .replace(/^ *var _ *=.+\n+/m, ''); + + return source; + } + + /** + * Removes all `setImmediate` references from `source`. + * + * @private + * @param {String} source The source to process. + * @returns {String} Returns the modified source. + */ + function removeSetImmediate(source) { + // remove the `setImmediate` fork of `_.defer`. + source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/, ''); + + return source; + } + + /** + * Removes all `support` object references from `source`. + * + * @private + * @param {String} source The source to process. + * @returns {String} Returns the modified source. + */ + function removeSupport(source) { + source = source.replace(getSupport(source), ''); + + _.each([ + removeSupportArgsClass, removeSupportArgsObject, removeSupportEnumErrorProps, + removeSupportEnumPrototypes, removeSupportNodeClass, removeSupportNonEnumArgs, + removeSupportNonEnumShadows, removeSupportOwnLast, removeSupportSpliceObjects, + removeSupportUnindexedChars + ], function(func) { + source = func(source); }); return source; @@ -1379,6 +1451,24 @@ return source; } + /** + * Removes all `support.argsObject` references from `source`. + * + * @private + * @param {String} source The source to process. + * @returns {String} Returns the modified source. + */ + function removeSupportArgsObject(source) { + source = removeSupportProp(source, 'argsObject'); + + // remove `argsAreObjects` from `_.isEqual` + source = source.replace(matchFunction(source, 'isEqual'), function(match) { + return match.replace(/!support.\argsObject[^:]+:\s*/g, ''); + }); + + return source; + } + /** * Removes all `support.enumErrorProps` references from `source`. * @@ -1399,7 +1489,6 @@ return source; } - /** * Removes all `support.enumPrototypes` references from `source`. * @@ -1572,48 +1661,6 @@ return source; } - /** - * Removes all `runInContext` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeRunInContext(source) { - // replace reference in `reThis` assignment - source = source.replace(/\btest\(runInContext\)/, 'test(function() { return this; })'); - - // remove function scaffolding, leaving most of its content - source = source.replace(matchFunction(source, 'runInContext'), function(match) { - return match - .replace(/^[\s\S]+?function runInContext[\s\S]+?context *= *context.+| *return lodash[\s\S]+$/g, '') - .replace(/^ {4}/gm, ' '); - }); - - // cleanup adjusted source - source = source - .replace(/\bcontext\b/g, 'window') - .replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var Array *=[\s\S]+?;\n/, '') - .replace(/(return *|= *)_([;)])/g, '$1lodash$2') - .replace(/^ *var _ *=.+\n+/m, ''); - - return source; - } - - /** - * Removes all `setImmediate` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeSetImmediate(source) { - // remove the `setImmediate` fork of `_.defer`. - source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/, ''); - - return source; - } - /** * Removes a given property from the `support` object in `source`. * @@ -1623,15 +1670,17 @@ * @returns {String} Returns the modified source. */ function removeSupportProp(source, propName) { - return source.replace(RegExp( - multilineComment + - // match a `try` block - '(?: *try\\b.+\\n)?' + - // match the `support` property assignment - ' *support\\.' + propName + ' *=.+\\n' + - // match `catch` block - '(?:( *).+?catch\\b[\\s\\S]+?\\n\\1}\\n)?' - ), ''); + return source.replace(getSupport(source), function(match) { + return match.replace(RegExp( + multilineComment + + // match a `try` block + '(?: *try\\b.+\\n)?' + + // match the `support` property assignment + ' *support\\.' + propName + ' *=.+\\n' + + // match `catch` block + '(?:( *).+?catch\\b[\\s\\S]+?\\n\\1}\\n)?' + ), ''); + }); } /** @@ -3199,7 +3248,7 @@ _.each(['assign', 'createCallback', 'forIn', 'forOwn', 'isPlainObject', 'unzip', 'zipObject'], function(methodName) { if (!useLodashMethod(methodName)) { - modified = modified.replace(RegExp('^(?: *//.*\\s*)* *lodash\\.' + methodName + ' *=.+\\n', 'm'), ''); + modified = modified.replace(RegExp('^(?: *//.*\\s*)* *lodash\\.' + methodName + ' *=[\\s\\S]+?;\\n', 'm'), ''); } }); @@ -3321,6 +3370,7 @@ } if (isRemoved(source, 'isArguments')) { source = replaceSupportProp(source, 'argsClass', 'true'); + source = removeIsArgumentsFallback(source); } if (isRemoved(source, 'isArguments', 'isEmpty')) { source = removeSupportArgsClass(source); @@ -3428,30 +3478,33 @@ } // remove code used to resolve unneeded `support` properties - source = source.replace(/^ *\(function[\s\S]+?\n(( *)var ctor *= *function[\s\S]+?(?:\n *for.+)+\n)([\s\S]+?)}\(1\)\);\n/m, function(match, setup, indent, body) { - var modified = setup; - if (!/support\.spliceObjects *=(?! *(?:false|true))/.test(match)) { - modified = modified.replace(/^ *object *=.+\n/m, ''); - } - if (!/support\.enumPrototypes *=(?! *(?:false|true))/.test(match) && - !/support\.nonEnumShadows *=(?! *(?:false|true))/.test(match) && - !/support\.ownLast *=(?! *(?:false|true))/.test(match)) { - modified = modified - .replace(/\bctor *=.+\s+/, '') - .replace(/^ *ctor\.prototype.+\s+.+\n/m, '') - .replace(/(?:,\n)? *props *=[^;=]+/, '') - .replace(/^ *for *\((?=prop)/, '$&var ') - } - if (!/support\.nonEnumArgs *=(?! *(?:false|true))/.test(match)) { - modified = modified.replace(/^ *for *\(.+? arguments.+\n/m, ''); - } - // cleanup the empty var statement - modified = modified.replace(/^ *var;\n/m, ''); + source = source.replace(getSupport(source), function(match) { + return match.replace(/^ *\(function[\s\S]+?\n(( *)var ctor *=[\s\S]+?(?:\n *for.+)+\n)([\s\S]+?)}\(1\)\);\n/m, function(match, setup, indent, body) { + var modified = setup; - // if no setup then remove IIFE - return /^\s*$/.test(modified) - ? body.replace(RegExp('^' + indent, 'gm'), indent.slice(0, -2)) - : match.replace(setup, modified); + if (!/support\.spliceObjects *=(?! *(?:false|true))/.test(body)) { + modified = modified.replace(/^ *object *=.+\n/m, ''); + } + if (!/support\.enumPrototypes *=(?! *(?:false|true))/.test(body) && + !/support\.nonEnumShadows *=(?! *(?:false|true))/.test(body) && + !/support\.ownLast *=(?! *(?:false|true))/.test(body)) { + modified = modified + .replace(/\bctor *=.+\s+/, '') + .replace(/^ *ctor\.prototype.+\s+.+\n/m, '') + .replace(/(?:,\n)? *props *=[^;=]+/, '') + .replace(/^ *for *\((?=prop)/, '$&var ') + } + if (!/support\.nonEnumArgs *=(?! *(?:false|true))/.test(body)) { + modified = modified.replace(/^ *for *\(.+? arguments.+\n/m, ''); + } + // cleanup the empty var statement + modified = modified.replace(/^ *var;\n/m, ''); + + // if no setup then remove IIFE + return /^\s*$/.test(modified) + ? body.replace(RegExp('^' + indent, 'gm'), indent.slice(0, -2)) + : match.replace(setup, modified); + }); }); // remove unused variables @@ -3471,7 +3524,7 @@ varNames.shift(); } else { - while (!useMap[varNames[0]]) { + while (varNames.length && !useMap[varNames[0]]) { source = removeVar(source, varNames[0]); varNames.shift(); } diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 253a3174c..f6b46b3d0 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -4386,6 +4386,9 @@ lodash.take = first; lodash.head = first; + // add functions to `lodash.prototype` + mixin(lodash); + /*--------------------------------------------------------------------------*/ /** @@ -4397,9 +4400,6 @@ */ lodash.VERSION = '1.3.1'; - // add functions to `lodash.prototype` - mixin(lodash); - // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; lodash.prototype.value = wrapperValueOf; diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 7d6d54a92..c8923adeb 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -4,32 +4,32 @@ * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;!function(n){function t(n,t){var r;if(n&>[typeof n])for(r in n)if(Et.call(n,r)&&t(n[r],r,n)===nt)break}function r(n,t){var r;if(n&>[typeof n])for(r in n)if(t(n[r],r,n)===nt)break}function e(n){var t,r=[];if(!n||!gt[typeof n])return r;for(t in n)Et.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n.length;++rt||typeof n=="undefined")return 1;if(ne&&(e=r,u=n)});else for(;++ou&&(u=r);return u}function D(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++rarguments.length;r=J(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++iarguments.length;if(typeof u!="number")var i=Vt(n),u=i.length;return t=J(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Y,n[a]):t(r,n[a],a,f)}),r}function $(n,r,e){var u;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++er(u,i)&&o.push(i)}return o}function C(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=-1;for(t=J(t,r);++or?Tt(0,e+r):r||0}else if(r)return r=W(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=X){var e=0,u=-1,o=n?n.length:0;for(t=J(t,r);++u>>1,r(n[e])o(f,c))&&(r&&f.push(c),a.push(e))}return a}function H(n,t){return Pt.fastBind||Bt&&2"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,it="[object Arguments]",at="[object Array]",ft="[object Boolean]",ct="[object Date]",lt="[object Number]",pt="[object Object]",st="[object RegExp]",vt="[object String]",gt={"boolean":Y,"function":Q,object:Q,number:Y,string:Y,undefined:Y},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=gt[typeof exports]&&exports,mt=gt[typeof module]&&module&&module.exports==yt&&module,_t=gt[typeof global]&&global; -!_t||_t.global!==_t&&_t.window!==_t||(n=_t);var dt=[],_t=Object.prototype,bt=n._,jt=RegExp("^"+(_t.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wt=Math.ceil,At=n.clearTimeout,xt=dt.concat,Ot=Math.floor,Et=_t.hasOwnProperty,St=dt.push,Nt=n.setTimeout,kt=_t.toString,Bt=jt.test(Bt=kt.bind)&&Bt,Ft=jt.test(Ft=Object.create)&&Ft,qt=jt.test(qt=Array.isArray)&&qt,Rt=n.isFinite,Dt=n.isNaN,Mt=jt.test(Mt=Object.keys)&&Mt,Tt=Math.max,$t=Math.min,It=Math.random,zt=dt.slice,_t=jt.test(n.attachEvent),Ct=Bt&&!/\n|true/.test(Bt+_t); -c.prototype=f.prototype;var Pt={};!function(){var n={0:1,length:1};Pt.fastBind=Bt&&!Ct,Pt.spliceObjects=(dt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ft||(p=function(n){if(A(n)){a.prototype=n;var t=new a;a.prototype=X}return t||{}}),h(arguments)||(h=function(n){return n?Et.call(n,"callee"):Y});var Ut=qt||function(n){return n?typeof n=="object"&&kt.call(n)==at:Y},Vt=Mt?function(n){return A(n)?Mt(n):[] -}:e,Wt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=d(Wt);w(/x/)&&(w=function(n){return typeof n=="function"&&"[object Function]"==kt.call(n)}),f.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=H,f.bindAll=function(n){for(var t=1u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},f.invert=d,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},f.keys=Vt,f.map=q,f.max=R,f.memoize=function(n,t){var r={};return function(){var e=tt+(t?t.apply(this,arguments):arguments[0]);return Et.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0; -if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),rt(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=X,r)}},f.pairs=function(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++tr?0:r);++tr?Tt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=L,f.noConflict=function(){return n._=bt,this -},f.random=function(n,t){n==X&&t==X&&(t=1),n=+n||0,t==X?(t=n,n=0):t=+t||0;var r=It();return n%1||t%1?n+$t(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Ot(r*(t-n+1))},f.reduce=M,f.reduceRight=T,f.result=function(n,t){var r=n?n[t]:X;return w(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Vt(n).length},f.some=$,f.sortedIndex=W,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=m({},r,e);var u=0,o="__p+='",e=r.variable;n.replace(RegExp((r.escape||et).source+"|"+(r.interpolate||et).source+"|"+(r.evaluate||et).source+"|$","g"),function(t,r,e,a,f){return o+=n.slice(u,f).replace(ot,i),r&&(o+="'+_['escape']("+r+")+'"),a&&(o+="';"+a+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t -}),o+="';\n",e||(e="obj",o="with("+e+"||{}){"+o+"}"),o="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(f)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},f.unescape=function(n){return n==X?"":(n+"").replace(rt,g)},f.uniqueId=function(n){var t=++Z+"";return n?n+t:t},f.all=N,f.any=$,f.detect=B,f.findWhere=function(n,t){return I(n,t,Q)},f.foldl=M,f.foldr=T,f.include=S,f.inject=M,f.first=C,f.last=function(n,t,r){if(n){var e=0,u=n.length; -if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[u-1];return zt.call(n,Tt(0,u-e))}},f.take=C,f.head=C,f.VERSION="1.3.1",L(f),f.prototype.chain=function(){return this.__chain__=Q,this},f.prototype.value=function(){return this.__wrapped__},F("pop push reverse shift sort splice unshift".split(" "),function(n){var t=dt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Pt.spliceObjects&&0===n.length&&delete n[0],this}}),F(["concat","join","slice"],function(n){var t=dt[n]; -f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Q),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):yt&&!yt.nodeType?mt?(mt.exports=f)._=f:yt._=f:n._=f}(this); \ No newline at end of file +;!function(n){function r(n,r,t){t=(t||0)-1;for(var e=n.length;++tr||typeof n=="undefined")return 1;if(ne&&(e=t,u=n)}); +else for(;++ou&&(u=t);return u}function k(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++targuments.length;r=W(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length;if(typeof u!="number")var i=$r(n),u=i.length;return r=W(r,e,4),N(n,function(e,a,f){a=i?i[--u]:--u,t=o?(o=!1,n[a]):r(t,n[a],a,f) +}),t}function D(n,r,t){var e;r=W(r,t),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++tt(u,i)&&o.push(i)}return o}function $(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&null!=r){var o=-1;for(r=W(r,t);++oe?Fr(0,u+e):e||0}else if(e)return e=P(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function C(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=W(r,t);++u>>1,t(n[e])o(f,l))&&(t&&f.push(l),a.push(e))}return a}function V(n,r){return Mr.fastBind||xr&&2"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,nr="[object Arguments]",rr="[object Array]",tr="[object Boolean]",er="[object Date]",ur="[object Number]",or="[object Object]",ir="[object RegExp]",ar="[object String]",fr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},cr=fr[typeof exports]&&exports,pr=fr[typeof module]&&module&&module.exports==cr&&module,sr=fr[typeof global]&&global; +!sr||sr.global!==sr&&sr.window!==sr||(n=sr);var vr=[],sr=Object.prototype,gr=n._,hr=RegExp("^"+(sr.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),yr=Math.ceil,mr=n.clearTimeout,_r=vr.concat,dr=Math.floor,br=sr.hasOwnProperty,jr=vr.push,wr=n.setTimeout,Ar=sr.toString,xr=hr.test(xr=Ar.bind)&&xr,Or=hr.test(Or=Object.create)&&Or,Er=hr.test(Er=Array.isArray)&&Er,Sr=n.isFinite,Nr=n.isNaN,Br=hr.test(Br=Object.keys)&&Br,Fr=Math.max,kr=Math.min,qr=Math.random,Rr=vr.slice,sr=hr.test(n.attachEvent),Dr=xr&&!/\n|true/.test(xr+sr); +i.prototype=o.prototype;var Mr={};!function(){var n={0:1,length:1};Mr.fastBind=xr&&!Dr,Mr.spliceObjects=(vr.splice.call(n,0,1),!n[0])}(1),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Or||(f=function(n){if(b(n)){u.prototype=n;var r=new u;u.prototype=null}return r||{}}),s(arguments)||(s=function(n){return n?br.call(n,"callee"):!1});var Tr=Er||function(n){return n?typeof n=="object"&&Ar.call(n)==rr:!1},Er=function(n){var r,t=[]; +if(!n||!fr[typeof n])return t;for(r in n)br.call(n,r)&&t.push(r);return t},$r=Br?function(n){return b(n)?Br(n):[]}:Er,Ir={"&":"&","<":"<",">":">",'"':""","'":"'"},zr=y(Ir),Cr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(r(n[t],t,n)===K)break;return n},Pr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(br.call(n,t)&&r(n[t],t,n)===K)break;return n};d(/x/)&&(d=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)}),o.after=function(n,r){return 1>n?r():function(){return 1>--n?r.apply(this,arguments):void 0 +}},o.bind=V,o.bindAll=function(n){for(var r=1u(i,a)){for(var f=t;--f;)if(0>u(r[f],a))continue n;i.push(a)}}return i},o.invert=y,o.invoke=function(n,r){var t=Rr.call(arguments,2),e=-1,u=typeof r=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0); +return N(n,function(n){i[++e]=(u?r:n[r]).apply(n,t)}),i},o.keys=$r,o.map=B,o.max=F,o.memoize=function(n,r){var t={};return function(){var e=L+(r?r.apply(this,arguments):arguments[0]);return br.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},o.min=function(n,r,t){var e=1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=W(r,t),N(n,function(n,t,o){t=r(n,t,o),tr(t,u)&&(e[u]=n) +}),e},o.once=function(n){var r,t;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},o.pairs=function(n){for(var r=-1,t=$r(n),e=t.length,u=Array(e);++rt?0:t);++rt?Fr(0,e+t):kr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=H,o.noConflict=function(){return n._=gr,this},o.random=function(n,r){null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0;var t=qr();return n%1||r%1?n+kr(t*(r-n+parseFloat("1e-"+((t+"").length-1))),r):n+dr(t*(r-n+1))},o.reduce=q,o.reduceRight=R,o.result=function(n,r){var t=n?n[r]:null; +return d(t)?n[r]():t},o.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:$r(n).length},o.some=D,o.sortedIndex=P,o.template=function(n,r,t){var u=o.templateSettings;n||(n=""),t=g({},t,u);var i=0,a="__p+='",u=t.variable;n.replace(RegExp((t.escape||X).source+"|"+(t.interpolate||X).source+"|"+(t.evaluate||X).source+"|$","g"),function(r,t,u,o,f){return a+=n.slice(i,f).replace(Z,e),t&&(a+="'+_['escape']("+t+")+'"),o&&(a+="';"+o+";__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),i=f+r.length,r +}),a+="';\n",u||(u="obj",a="with("+u+"||{}){"+a+"}"),a="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var f=Function("_","return "+a)(o)}catch(l){throw l.source=a,l}return r?f(r):(f.source=a,f)},o.unescape=function(n){return null==n?"":(n+"").replace(Q,p)},o.uniqueId=function(n){var r=++J+"";return n?n+r:r},o.all=O,o.any=D,o.detect=S,o.findWhere=function(n,r){return M(n,r,!0)},o.foldl=q,o.foldr=R,o.include=x,o.inject=q,o.first=$,o.last=function(n,r,t){if(n){var e=0,u=n.length; +if(typeof r!="number"&&null!=r){var o=u;for(r=W(r,t);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n[u-1];return Rr.call(n,Fr(0,u-e))}},o.take=$,o.head=$,H(o),o.VERSION="1.3.1",o.prototype.chain=function(){return this.__chain__=!0,this},o.prototype.value=function(){return this.__wrapped__},N("pop push reverse shift sort splice unshift".split(" "),function(n){var r=vr[n];o.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!Mr.spliceObjects&&0===n.length&&delete n[0],this +}}),N(["concat","join","slice"],function(n){var r=vr[n];o.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=o, define(function(){return o})):cr&&!cr.nodeType?pr?(pr.exports=o)._=o:cr._=o:n._=o}(this); \ No newline at end of file