00001
00009 ;(function() {
00010
00012 var undefined;
00013
00015 var VERSION = '4.17.4';
00016
00018 var LARGE_ARRAY_SIZE = 200;
00019
00021 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
00022 FUNC_ERROR_TEXT = 'Expected a function';
00023
00025 var HASH_UNDEFINED = '__lodash_hash_undefined__';
00026
00028 var MAX_MEMOIZE_SIZE = 500;
00029
00031 var PLACEHOLDER = '__lodash_placeholder__';
00032
00034 var CLONE_DEEP_FLAG = 1,
00035 CLONE_FLAT_FLAG = 2,
00036 CLONE_SYMBOLS_FLAG = 4;
00037
00039 var COMPARE_PARTIAL_FLAG = 1,
00040 COMPARE_UNORDERED_FLAG = 2;
00041
00043 var WRAP_BIND_FLAG = 1,
00044 WRAP_BIND_KEY_FLAG = 2,
00045 WRAP_CURRY_BOUND_FLAG = 4,
00046 WRAP_CURRY_FLAG = 8,
00047 WRAP_CURRY_RIGHT_FLAG = 16,
00048 WRAP_PARTIAL_FLAG = 32,
00049 WRAP_PARTIAL_RIGHT_FLAG = 64,
00050 WRAP_ARY_FLAG = 128,
00051 WRAP_REARG_FLAG = 256,
00052 WRAP_FLIP_FLAG = 512;
00053
00055 var DEFAULT_TRUNC_LENGTH = 30,
00056 DEFAULT_TRUNC_OMISSION = '...';
00057
00059 var HOT_COUNT = 800,
00060 HOT_SPAN = 16;
00061
00063 var LAZY_FILTER_FLAG = 1,
00064 LAZY_MAP_FLAG = 2,
00065 LAZY_WHILE_FLAG = 3;
00066
00068 var INFINITY = 1 / 0,
00069 MAX_SAFE_INTEGER = 9007199254740991,
00070 MAX_INTEGER = 1.7976931348623157e+308,
00071 NAN = 0 / 0;
00072
00074 var MAX_ARRAY_LENGTH = 4294967295,
00075 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
00076 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
00077
00079 var wrapFlags = [
00080 ['ary', WRAP_ARY_FLAG],
00081 ['bind', WRAP_BIND_FLAG],
00082 ['bindKey', WRAP_BIND_KEY_FLAG],
00083 ['curry', WRAP_CURRY_FLAG],
00084 ['curryRight', WRAP_CURRY_RIGHT_FLAG],
00085 ['flip', WRAP_FLIP_FLAG],
00086 ['partial', WRAP_PARTIAL_FLAG],
00087 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
00088 ['rearg', WRAP_REARG_FLAG]
00089 ];
00090
00092 var argsTag = '[object Arguments]',
00093 arrayTag = '[object Array]',
00094 asyncTag = '[object AsyncFunction]',
00095 boolTag = '[object Boolean]',
00096 dateTag = '[object Date]',
00097 domExcTag = '[object DOMException]',
00098 errorTag = '[object Error]',
00099 funcTag = '[object Function]',
00100 genTag = '[object GeneratorFunction]',
00101 mapTag = '[object Map]',
00102 numberTag = '[object Number]',
00103 nullTag = '[object Null]',
00104 objectTag = '[object Object]',
00105 promiseTag = '[object Promise]',
00106 proxyTag = '[object Proxy]',
00107 regexpTag = '[object RegExp]',
00108 setTag = '[object Set]',
00109 stringTag = '[object String]',
00110 symbolTag = '[object Symbol]',
00111 undefinedTag = '[object Undefined]',
00112 weakMapTag = '[object WeakMap]',
00113 weakSetTag = '[object WeakSet]';
00114
00115 var arrayBufferTag = '[object ArrayBuffer]',
00116 dataViewTag = '[object DataView]',
00117 float32Tag = '[object Float32Array]',
00118 float64Tag = '[object Float64Array]',
00119 int8Tag = '[object Int8Array]',
00120 int16Tag = '[object Int16Array]',
00121 int32Tag = '[object Int32Array]',
00122 uint8Tag = '[object Uint8Array]',
00123 uint8ClampedTag = '[object Uint8ClampedArray]',
00124 uint16Tag = '[object Uint16Array]',
00125 uint32Tag = '[object Uint32Array]';
00126
00128 var reEmptyStringLeading = /\b__p \+= '';/g,
00129 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
00130 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
00131
00133 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
00134 reUnescapedHtml = /[&<>"']/g,
00135 reHasEscapedHtml = RegExp(reEscapedHtml.source),
00136 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
00137
00139 var reEscape = /<%-([\s\S]+?)%>/g,
00140 reEvaluate = /<%([\s\S]+?)%>/g,
00141 reInterpolate = /<%=([\s\S]+?)%>/g;
00142
00144 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
00145 reIsPlainProp = /^\w*$/,
00146 reLeadingDot = /^\./,
00147 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
00148
00153 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
00154 reHasRegExpChar = RegExp(reRegExpChar.source);
00155
00157 var reTrim = /^\s+|\s+$/g,
00158 reTrimStart = /^\s+/,
00159 reTrimEnd = /\s+$/;
00160
00162 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
00163 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
00164 reSplitDetails = /,? & /;
00165
00167 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
00168
00170 var reEscapeChar = /\\(\\)?/g;
00171
00176 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
00177
00179 var reFlags = /\w*$/;
00180
00182 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
00183
00185 var reIsBinary = /^0b[01]+$/i;
00186
00188 var reIsHostCtor = /^\[object .+?Constructor\]$/;
00189
00191 var reIsOctal = /^0o[0-7]+$/i;
00192
00194 var reIsUint = /^(?:0|[1-9]\d*)$/;
00195
00197 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
00198
00200 var reNoMatch = /($^)/;
00201
00203 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
00204
00206 var rsAstralRange = '\\ud800-\\udfff',
00207 rsComboMarksRange = '\\u0300-\\u036f',
00208 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
00209 rsComboSymbolsRange = '\\u20d0-\\u20ff',
00210 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
00211 rsDingbatRange = '\\u2700-\\u27bf',
00212 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
00213 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
00214 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
00215 rsPunctuationRange = '\\u2000-\\u206f',
00216 rsSpaceRange = ' \\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',
00217 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
00218 rsVarRange = '\\ufe0e\\ufe0f',
00219 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
00220
00222 var rsApos = "['\u2019]",
00223 rsAstral = '[' + rsAstralRange + ']',
00224 rsBreak = '[' + rsBreakRange + ']',
00225 rsCombo = '[' + rsComboRange + ']',
00226 rsDigits = '\\d+',
00227 rsDingbat = '[' + rsDingbatRange + ']',
00228 rsLower = '[' + rsLowerRange + ']',
00229 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
00230 rsFitz = '\\ud83c[\\udffb-\\udfff]',
00231 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
00232 rsNonAstral = '[^' + rsAstralRange + ']',
00233 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
00234 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
00235 rsUpper = '[' + rsUpperRange + ']',
00236 rsZWJ = '\\u200d';
00237
00239 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
00240 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
00241 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
00242 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
00243 reOptMod = rsModifier + '?',
00244 rsOptVar = '[' + rsVarRange + ']?',
00245 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
00246 rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
00247 rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
00248 rsSeq = rsOptVar + reOptMod + rsOptJoin,
00249 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
00250 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
00251
00253 var reApos = RegExp(rsApos, 'g');
00254
00259 var reComboMark = RegExp(rsCombo, 'g');
00260
00262 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
00263
00265 var reUnicodeWord = RegExp([
00266 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
00267 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
00268 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
00269 rsUpper + '+' + rsOptContrUpper,
00270 rsOrdUpper,
00271 rsOrdLower,
00272 rsDigits,
00273 rsEmoji
00274 ].join('|'), 'g');
00275
00277 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
00278
00280 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
00281
00283 var contextProps = [
00284 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
00285 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
00286 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
00287 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
00288 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
00289 ];
00290
00292 var templateCounter = -1;
00293
00295 var typedArrayTags = {};
00296 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
00297 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
00298 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
00299 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
00300 typedArrayTags[uint32Tag] = true;
00301 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
00302 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
00303 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
00304 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
00305 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
00306 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
00307 typedArrayTags[setTag] = typedArrayTags[stringTag] =
00308 typedArrayTags[weakMapTag] = false;
00309
00311 var cloneableTags = {};
00312 cloneableTags[argsTag] = cloneableTags[arrayTag] =
00313 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
00314 cloneableTags[boolTag] = cloneableTags[dateTag] =
00315 cloneableTags[float32Tag] = cloneableTags[float64Tag] =
00316 cloneableTags[int8Tag] = cloneableTags[int16Tag] =
00317 cloneableTags[int32Tag] = cloneableTags[mapTag] =
00318 cloneableTags[numberTag] = cloneableTags[objectTag] =
00319 cloneableTags[regexpTag] = cloneableTags[setTag] =
00320 cloneableTags[stringTag] = cloneableTags[symbolTag] =
00321 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
00322 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
00323 cloneableTags[errorTag] = cloneableTags[funcTag] =
00324 cloneableTags[weakMapTag] = false;
00325
00327 var deburredLetters = {
00328 // Latin-1 Supplement block.
00329 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
00330 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
00331 '\xc7': 'C', '\xe7': 'c',
00332 '\xd0': 'D', '\xf0': 'd',
00333 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
00334 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
00335 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
00336 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
00337 '\xd1': 'N', '\xf1': 'n',
00338 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
00339 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
00340 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
00341 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
00342 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
00343 '\xc6': 'Ae', '\xe6': 'ae',
00344 '\xde': 'Th', '\xfe': 'th',
00345 '\xdf': 'ss',
00346 // Latin Extended-A block.
00347 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
00348 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
00349 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
00350 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
00351 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
00352 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
00353 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
00354 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
00355 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
00356 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
00357 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
00358 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
00359 '\u0134': 'J', '\u0135': 'j',
00360 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
00361 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
00362 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
00363 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
00364 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
00365 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
00366 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
00367 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
00368 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
00369 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
00370 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
00371 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
00372 '\u0163': 't', '\u0165': 't', '\u0167': 't',
00373 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
00374 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
00375 '\u0174': 'W', '\u0175': 'w',
00376 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
00377 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
00378 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
00379 '\u0132': 'IJ', '\u0133': 'ij',
00380 '\u0152': 'Oe', '\u0153': 'oe',
00381 '\u0149': "'n", '\u017f': 's'
00382 };
00383
00385 var htmlEscapes = {
00386 '&': '&',
00387 '<': '<',
00388 '>': '>',
00389 '"': '"',
00390 "'": '''
00391 };
00392
00394 var htmlUnescapes = {
00395 '&': '&',
00396 '<': '<',
00397 '>': '>',
00398 '"': '"',
00399 ''': "'"
00400 };
00401
00403 var stringEscapes = {
00404 '\\': '\\',
00405 "'": "'",
00406 '\n': 'n',
00407 '\r': 'r',
00408 '\u2028': 'u2028',
00409 '\u2029': 'u2029'
00410 };
00411
00413 var freeParseFloat = parseFloat,
00414 freeParseInt = parseInt;
00415
00417 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
00418
00420 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
00421
00423 var root = freeGlobal || freeSelf || Function('return this')();
00424
00426 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
00427
00429 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
00430
00432 var moduleExports = freeModule && freeModule.exports === freeExports;
00433
00435 var freeProcess = moduleExports && freeGlobal.process;
00436
00438 var nodeUtil = (function() {
00439 try {
00440 return freeProcess && freeProcess.binding && freeProcess.binding('util');
00441 } catch (e) {}
00442 }());
00443
00444 /* Node.js helper references. */
00445 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
00446 nodeIsDate = nodeUtil && nodeUtil.isDate,
00447 nodeIsMap = nodeUtil && nodeUtil.isMap,
00448 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
00449 nodeIsSet = nodeUtil && nodeUtil.isSet,
00450 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
00451
00452 /*--------------------------------------------------------------------------*/
00453
00462 function addMapEntry(map, pair) {
00463 // Don't return `map.set` because it's not chainable in IE 11.
00464 map.set(pair[0], pair[1]);
00465 return map;
00466 }
00467
00476 function addSetEntry(set, value) {
00477 // Don't return `set.add` because it's not chainable in IE 11.
00478 set.add(value);
00479 return set;
00480 }
00481
00492 function apply(func, thisArg, args) {
00493 switch (args.length) {
00494 case 0: return func.call(thisArg);
00495 case 1: return func.call(thisArg, args[0]);
00496 case 2: return func.call(thisArg, args[0], args[1]);
00497 case 3: return func.call(thisArg, args[0], args[1], args[2]);
00498 }
00499 return func.apply(thisArg, args);
00500 }
00501
00512 function arrayAggregator(array, setter, iteratee, accumulator) {
00513 var index = -1,
00514 length = array == null ? 0 : array.length;
00515
00516 while (++index < length) {
00517 var value = array[index];
00518 setter(accumulator, value, iteratee(value), array);
00519 }
00520 return accumulator;
00521 }
00522
00532 function arrayEach(array, iteratee) {
00533 var index = -1,
00534 length = array == null ? 0 : array.length;
00535
00536 while (++index < length) {
00537 if (iteratee(array[index], index, array) === false) {
00538 break;
00539 }
00540 }
00541 return array;
00542 }
00543
00553 function arrayEachRight(array, iteratee) {
00554 var length = array == null ? 0 : array.length;
00555
00556 while (length--) {
00557 if (iteratee(array[length], length, array) === false) {
00558 break;
00559 }
00560 }
00561 return array;
00562 }
00563
00574 function arrayEvery(array, predicate) {
00575 var index = -1,
00576 length = array == null ? 0 : array.length;
00577
00578 while (++index < length) {
00579 if (!predicate(array[index], index, array)) {
00580 return false;
00581 }
00582 }
00583 return true;
00584 }
00585
00595 function arrayFilter(array, predicate) {
00596 var index = -1,
00597 length = array == null ? 0 : array.length,
00598 resIndex = 0,
00599 result = [];
00600
00601 while (++index < length) {
00602 var value = array[index];
00603 if (predicate(value, index, array)) {
00604 result[resIndex++] = value;
00605 }
00606 }
00607 return result;
00608 }
00609
00619 function arrayIncludes(array, value) {
00620 var length = array == null ? 0 : array.length;
00621 return !!length && baseIndexOf(array, value, 0) > -1;
00622 }
00623
00633 function arrayIncludesWith(array, value, comparator) {
00634 var index = -1,
00635 length = array == null ? 0 : array.length;
00636
00637 while (++index < length) {
00638 if (comparator(value, array[index])) {
00639 return true;
00640 }
00641 }
00642 return false;
00643 }
00644
00654 function arrayMap(array, iteratee) {
00655 var index = -1,
00656 length = array == null ? 0 : array.length,
00657 result = Array(length);
00658
00659 while (++index < length) {
00660 result[index] = iteratee(array[index], index, array);
00661 }
00662 return result;
00663 }
00664
00673 function arrayPush(array, values) {
00674 var index = -1,
00675 length = values.length,
00676 offset = array.length;
00677
00678 while (++index < length) {
00679 array[offset + index] = values[index];
00680 }
00681 return array;
00682 }
00683
00696 function arrayReduce(array, iteratee, accumulator, initAccum) {
00697 var index = -1,
00698 length = array == null ? 0 : array.length;
00699
00700 if (initAccum && length) {
00701 accumulator = array[++index];
00702 }
00703 while (++index < length) {
00704 accumulator = iteratee(accumulator, array[index], index, array);
00705 }
00706 return accumulator;
00707 }
00708
00721 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
00722 var length = array == null ? 0 : array.length;
00723 if (initAccum && length) {
00724 accumulator = array[--length];
00725 }
00726 while (length--) {
00727 accumulator = iteratee(accumulator, array[length], length, array);
00728 }
00729 return accumulator;
00730 }
00731
00742 function arraySome(array, predicate) {
00743 var index = -1,
00744 length = array == null ? 0 : array.length;
00745
00746 while (++index < length) {
00747 if (predicate(array[index], index, array)) {
00748 return true;
00749 }
00750 }
00751 return false;
00752 }
00753
00761 var asciiSize = baseProperty('length');
00762
00770 function asciiToArray(string) {
00771 return string.split('');
00772 }
00773
00781 function asciiWords(string) {
00782 return string.match(reAsciiWord) || [];
00783 }
00784
00796 function baseFindKey(collection, predicate, eachFunc) {
00797 var result;
00798 eachFunc(collection, function(value, key, collection) {
00799 if (predicate(value, key, collection)) {
00800 result = key;
00801 return false;
00802 }
00803 });
00804 return result;
00805 }
00806
00818 function baseFindIndex(array, predicate, fromIndex, fromRight) {
00819 var length = array.length,
00820 index = fromIndex + (fromRight ? 1 : -1);
00821
00822 while ((fromRight ? index-- : ++index < length)) {
00823 if (predicate(array[index], index, array)) {
00824 return index;
00825 }
00826 }
00827 return -1;
00828 }
00829
00839 function baseIndexOf(array, value, fromIndex) {
00840 return value === value
00841 ? strictIndexOf(array, value, fromIndex)
00842 : baseFindIndex(array, baseIsNaN, fromIndex);
00843 }
00844
00855 function baseIndexOfWith(array, value, fromIndex, comparator) {
00856 var index = fromIndex - 1,
00857 length = array.length;
00858
00859 while (++index < length) {
00860 if (comparator(array[index], value)) {
00861 return index;
00862 }
00863 }
00864 return -1;
00865 }
00866
00874 function baseIsNaN(value) {
00875 return value !== value;
00876 }
00877
00887 function baseMean(array, iteratee) {
00888 var length = array == null ? 0 : array.length;
00889 return length ? (baseSum(array, iteratee) / length) : NAN;
00890 }
00891
00899 function baseProperty(key) {
00900 return function(object) {
00901 return object == null ? undefined : object[key];
00902 };
00903 }
00904
00912 function basePropertyOf(object) {
00913 return function(key) {
00914 return object == null ? undefined : object[key];
00915 };
00916 }
00917
00931 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
00932 eachFunc(collection, function(value, index, collection) {
00933 accumulator = initAccum
00934 ? (initAccum = false, value)
00935 : iteratee(accumulator, value, index, collection);
00936 });
00937 return accumulator;
00938 }
00939
00950 function baseSortBy(array, comparer) {
00951 var length = array.length;
00952
00953 array.sort(comparer);
00954 while (length--) {
00955 array[length] = array[length].value;
00956 }
00957 return array;
00958 }
00959
00969 function baseSum(array, iteratee) {
00970 var result,
00971 index = -1,
00972 length = array.length;
00973
00974 while (++index < length) {
00975 var current = iteratee(array[index]);
00976 if (current !== undefined) {
00977 result = result === undefined ? current : (result + current);
00978 }
00979 }
00980 return result;
00981 }
00982
00992 function baseTimes(n, iteratee) {
00993 var index = -1,
00994 result = Array(n);
00995
00996 while (++index < n) {
00997 result[index] = iteratee(index);
00998 }
00999 return result;
01000 }
01001
01011 function baseToPairs(object, props) {
01012 return arrayMap(props, function(key) {
01013 return [key, object[key]];
01014 });
01015 }
01016
01024 function baseUnary(func) {
01025 return function(value) {
01026 return func(value);
01027 };
01028 }
01029
01040 function baseValues(object, props) {
01041 return arrayMap(props, function(key) {
01042 return object[key];
01043 });
01044 }
01045
01054 function cacheHas(cache, key) {
01055 return cache.has(key);
01056 }
01057
01067 function charsStartIndex(strSymbols, chrSymbols) {
01068 var index = -1,
01069 length = strSymbols.length;
01070
01071 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
01072 return index;
01073 }
01074
01084 function charsEndIndex(strSymbols, chrSymbols) {
01085 var index = strSymbols.length;
01086
01087 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
01088 return index;
01089 }
01090
01099 function countHolders(array, placeholder) {
01100 var length = array.length,
01101 result = 0;
01102
01103 while (length--) {
01104 if (array[length] === placeholder) {
01105 ++result;
01106 }
01107 }
01108 return result;
01109 }
01110
01119 var deburrLetter = basePropertyOf(deburredLetters);
01120
01128 var escapeHtmlChar = basePropertyOf(htmlEscapes);
01129
01137 function escapeStringChar(chr) {
01138 return '\\' + stringEscapes[chr];
01139 }
01140
01149 function getValue(object, key) {
01150 return object == null ? undefined : object[key];
01151 }
01152
01160 function hasUnicode(string) {
01161 return reHasUnicode.test(string);
01162 }
01163
01171 function hasUnicodeWord(string) {
01172 return reHasUnicodeWord.test(string);
01173 }
01174
01182 function iteratorToArray(iterator) {
01183 var data,
01184 result = [];
01185
01186 while (!(data = iterator.next()).done) {
01187 result.push(data.value);
01188 }
01189 return result;
01190 }
01191
01199 function mapToArray(map) {
01200 var index = -1,
01201 result = Array(map.size);
01202
01203 map.forEach(function(value, key) {
01204 result[++index] = [key, value];
01205 });
01206 return result;
01207 }
01208
01217 function overArg(func, transform) {
01218 return function(arg) {
01219 return func(transform(arg));
01220 };
01221 }
01222
01232 function replaceHolders(array, placeholder) {
01233 var index = -1,
01234 length = array.length,
01235 resIndex = 0,
01236 result = [];
01237
01238 while (++index < length) {
01239 var value = array[index];
01240 if (value === placeholder || value === PLACEHOLDER) {
01241 array[index] = PLACEHOLDER;
01242 result[resIndex++] = index;
01243 }
01244 }
01245 return result;
01246 }
01247
01255 function setToArray(set) {
01256 var index = -1,
01257 result = Array(set.size);
01258
01259 set.forEach(function(value) {
01260 result[++index] = value;
01261 });
01262 return result;
01263 }
01264
01272 function setToPairs(set) {
01273 var index = -1,
01274 result = Array(set.size);
01275
01276 set.forEach(function(value) {
01277 result[++index] = [value, value];
01278 });
01279 return result;
01280 }
01281
01292 function strictIndexOf(array, value, fromIndex) {
01293 var index = fromIndex - 1,
01294 length = array.length;
01295
01296 while (++index < length) {
01297 if (array[index] === value) {
01298 return index;
01299 }
01300 }
01301 return -1;
01302 }
01303
01314 function strictLastIndexOf(array, value, fromIndex) {
01315 var index = fromIndex + 1;
01316 while (index--) {
01317 if (array[index] === value) {
01318 return index;
01319 }
01320 }
01321 return index;
01322 }
01323
01331 function stringSize(string) {
01332 return hasUnicode(string)
01333 ? unicodeSize(string)
01334 : asciiSize(string);
01335 }
01336
01344 function stringToArray(string) {
01345 return hasUnicode(string)
01346 ? unicodeToArray(string)
01347 : asciiToArray(string);
01348 }
01349
01357 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
01358
01366 function unicodeSize(string) {
01367 var result = reUnicode.lastIndex = 0;
01368 while (reUnicode.test(string)) {
01369 ++result;
01370 }
01371 return result;
01372 }
01373
01381 function unicodeToArray(string) {
01382 return string.match(reUnicode) || [];
01383 }
01384
01392 function unicodeWords(string) {
01393 return string.match(reUnicodeWord) || [];
01394 }
01395
01396 /*--------------------------------------------------------------------------*/
01397
01427 var runInContext = (function runInContext(context) {
01428 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
01429
01431 var Array = context.Array,
01432 Date = context.Date,
01433 Error = context.Error,
01434 Function = context.Function,
01435 Math = context.Math,
01436 Object = context.Object,
01437 RegExp = context.RegExp,
01438 String = context.String,
01439 TypeError = context.TypeError;
01440
01442 var arrayProto = Array.prototype,
01443 funcProto = Function.prototype,
01444 objectProto = Object.prototype;
01445
01447 var coreJsData = context['__core-js_shared__'];
01448
01450 var funcToString = funcProto.toString;
01451
01453 var hasOwnProperty = objectProto.hasOwnProperty;
01454
01456 var idCounter = 0;
01457
01459 var maskSrcKey = (function() {
01460 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
01461 return uid ? ('Symbol(src)_1.' + uid) : '';
01462 }());
01463
01469 var nativeObjectToString = objectProto.toString;
01470
01472 var objectCtorString = funcToString.call(Object);
01473
01475 var oldDash = root._;
01476
01478 var reIsNative = RegExp('^' +
01479 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
01480 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
01481 );
01482
01484 var Buffer = moduleExports ? context.Buffer : undefined,
01485 Symbol = context.Symbol,
01486 Uint8Array = context.Uint8Array,
01487 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
01488 getPrototype = overArg(Object.getPrototypeOf, Object),
01489 objectCreate = Object.create,
01490 propertyIsEnumerable = objectProto.propertyIsEnumerable,
01491 splice = arrayProto.splice,
01492 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
01493 symIterator = Symbol ? Symbol.iterator : undefined,
01494 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
01495
01496 var defineProperty = (function() {
01497 try {
01498 var func = getNative(Object, 'defineProperty');
01499 func({}, '', {});
01500 return func;
01501 } catch (e) {}
01502 }());
01503
01505 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
01506 ctxNow = Date && Date.now !== root.Date.now && Date.now,
01507 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
01508
01509
01510 var nativeCeil = Math.ceil,
01511 nativeFloor = Math.floor,
01512 nativeGetSymbols = Object.getOwnPropertySymbols,
01513 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
01514 nativeIsFinite = context.isFinite,
01515 nativeJoin = arrayProto.join,
01516 nativeKeys = overArg(Object.keys, Object),
01517 nativeMax = Math.max,
01518 nativeMin = Math.min,
01519 nativeNow = Date.now,
01520 nativeParseInt = context.parseInt,
01521 nativeRandom = Math.random,
01522 nativeReverse = arrayProto.reverse;
01523
01524
01525 var DataView = getNative(context, 'DataView'),
01526 Map = getNative(context, 'Map'),
01527 Promise = getNative(context, 'Promise'),
01528 Set = getNative(context, 'Set'),
01529 WeakMap = getNative(context, 'WeakMap'),
01530 nativeCreate = getNative(Object, 'create');
01531
01533 var metaMap = WeakMap && new WeakMap;
01534
01536 var realNames = {};
01537
01539 var dataViewCtorString = toSource(DataView),
01540 mapCtorString = toSource(Map),
01541 promiseCtorString = toSource(Promise),
01542 setCtorString = toSource(Set),
01543 weakMapCtorString = toSource(WeakMap);
01544
01546 var symbolProto = Symbol ? Symbol.prototype : undefined,
01547 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
01548 symbolToString = symbolProto ? symbolProto.toString : undefined;
01549
01550
01551
01669 function lodash(value) {
01670 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
01671 if (value instanceof LodashWrapper) {
01672 return value;
01673 }
01674 if (hasOwnProperty.call(value, '__wrapped__')) {
01675 return wrapperClone(value);
01676 }
01677 }
01678 return new LodashWrapper(value);
01679 }
01680
01689 var baseCreate = (function() {
01690 function object() {}
01691 return function(proto) {
01692 if (!isObject(proto)) {
01693 return {};
01694 }
01695 if (objectCreate) {
01696 return objectCreate(proto);
01697 }
01698 object.prototype = proto;
01699 var result = new object;
01700 object.prototype = undefined;
01701 return result;
01702 };
01703 }());
01704
01710 function baseLodash() {
01711
01712 }
01713
01721 function LodashWrapper(value, chainAll) {
01722 this.__wrapped__ = value;
01723 this.__actions__ = [];
01724 this.__chain__ = !!chainAll;
01725 this.__index__ = 0;
01726 this.__values__ = undefined;
01727 }
01728
01738 lodash.templateSettings = {
01739
01746 'escape': reEscape,
01747
01754 'evaluate': reEvaluate,
01755
01762 'interpolate': reInterpolate,
01763
01770 'variable': '',
01771
01778 'imports': {
01779
01786 '_': lodash
01787 }
01788 };
01789
01790
01791 lodash.prototype = baseLodash.prototype;
01792 lodash.prototype.constructor = lodash;
01793
01794 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
01795 LodashWrapper.prototype.constructor = LodashWrapper;
01796
01797
01798
01806 function LazyWrapper(value) {
01807 this.__wrapped__ = value;
01808 this.__actions__ = [];
01809 this.__dir__ = 1;
01810 this.__filtered__ = false;
01811 this.__iteratees__ = [];
01812 this.__takeCount__ = MAX_ARRAY_LENGTH;
01813 this.__views__ = [];
01814 }
01815
01824 function lazyClone() {
01825 var result = new LazyWrapper(this.__wrapped__);
01826 result.__actions__ = copyArray(this.__actions__);
01827 result.__dir__ = this.__dir__;
01828 result.__filtered__ = this.__filtered__;
01829 result.__iteratees__ = copyArray(this.__iteratees__);
01830 result.__takeCount__ = this.__takeCount__;
01831 result.__views__ = copyArray(this.__views__);
01832 return result;
01833 }
01834
01843 function lazyReverse() {
01844 if (this.__filtered__) {
01845 var result = new LazyWrapper(this);
01846 result.__dir__ = -1;
01847 result.__filtered__ = true;
01848 } else {
01849 result = this.clone();
01850 result.__dir__ *= -1;
01851 }
01852 return result;
01853 }
01854
01863 function lazyValue() {
01864 var array = this.__wrapped__.value(),
01865 dir = this.__dir__,
01866 isArr = isArray(array),
01867 isRight = dir < 0,
01868 arrLength = isArr ? array.length : 0,
01869 view = getView(0, arrLength, this.__views__),
01870 start = view.start,
01871 end = view.end,
01872 length = end - start,
01873 index = isRight ? end : (start - 1),
01874 iteratees = this.__iteratees__,
01875 iterLength = iteratees.length,
01876 resIndex = 0,
01877 takeCount = nativeMin(length, this.__takeCount__);
01878
01879 if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
01880 return baseWrapperValue(array, this.__actions__);
01881 }
01882 var result = [];
01883
01884 outer:
01885 while (length-- && resIndex < takeCount) {
01886 index += dir;
01887
01888 var iterIndex = -1,
01889 value = array[index];
01890
01891 while (++iterIndex < iterLength) {
01892 var data = iteratees[iterIndex],
01893 iteratee = data.iteratee,
01894 type = data.type,
01895 computed = iteratee(value);
01896
01897 if (type == LAZY_MAP_FLAG) {
01898 value = computed;
01899 } else if (!computed) {
01900 if (type == LAZY_FILTER_FLAG) {
01901 continue outer;
01902 } else {
01903 break outer;
01904 }
01905 }
01906 }
01907 result[resIndex++] = value;
01908 }
01909 return result;
01910 }
01911
01912
01913 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
01914 LazyWrapper.prototype.constructor = LazyWrapper;
01915
01916
01917
01925 function Hash(entries) {
01926 var index = -1,
01927 length = entries == null ? 0 : entries.length;
01928
01929 this.clear();
01930 while (++index < length) {
01931 var entry = entries[index];
01932 this.set(entry[0], entry[1]);
01933 }
01934 }
01935
01943 function hashClear() {
01944 this.__data__ = nativeCreate ? nativeCreate(null) : {};
01945 this.size = 0;
01946 }
01947
01958 function hashDelete(key) {
01959 var result = this.has(key) && delete this.__data__[key];
01960 this.size -= result ? 1 : 0;
01961 return result;
01962 }
01963
01973 function hashGet(key) {
01974 var data = this.__data__;
01975 if (nativeCreate) {
01976 var result = data[key];
01977 return result === HASH_UNDEFINED ? undefined : result;
01978 }
01979 return hasOwnProperty.call(data, key) ? data[key] : undefined;
01980 }
01981
01991 function hashHas(key) {
01992 var data = this.__data__;
01993 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
01994 }
01995
02006 function hashSet(key, value) {
02007 var data = this.__data__;
02008 this.size += this.has(key) ? 0 : 1;
02009 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
02010 return this;
02011 }
02012
02013
02014 Hash.prototype.clear = hashClear;
02015 Hash.prototype['delete'] = hashDelete;
02016 Hash.prototype.get = hashGet;
02017 Hash.prototype.has = hashHas;
02018 Hash.prototype.set = hashSet;
02019
02020
02021
02029 function ListCache(entries) {
02030 var index = -1,
02031 length = entries == null ? 0 : entries.length;
02032
02033 this.clear();
02034 while (++index < length) {
02035 var entry = entries[index];
02036 this.set(entry[0], entry[1]);
02037 }
02038 }
02039
02047 function listCacheClear() {
02048 this.__data__ = [];
02049 this.size = 0;
02050 }
02051
02061 function listCacheDelete(key) {
02062 var data = this.__data__,
02063 index = assocIndexOf(data, key);
02064
02065 if (index < 0) {
02066 return false;
02067 }
02068 var lastIndex = data.length - 1;
02069 if (index == lastIndex) {
02070 data.pop();
02071 } else {
02072 splice.call(data, index, 1);
02073 }
02074 --this.size;
02075 return true;
02076 }
02077
02087 function listCacheGet(key) {
02088 var data = this.__data__,
02089 index = assocIndexOf(data, key);
02090
02091 return index < 0 ? undefined : data[index][1];
02092 }
02093
02103 function listCacheHas(key) {
02104 return assocIndexOf(this.__data__, key) > -1;
02105 }
02106
02117 function listCacheSet(key, value) {
02118 var data = this.__data__,
02119 index = assocIndexOf(data, key);
02120
02121 if (index < 0) {
02122 ++this.size;
02123 data.push([key, value]);
02124 } else {
02125 data[index][1] = value;
02126 }
02127 return this;
02128 }
02129
02130
02131 ListCache.prototype.clear = listCacheClear;
02132 ListCache.prototype['delete'] = listCacheDelete;
02133 ListCache.prototype.get = listCacheGet;
02134 ListCache.prototype.has = listCacheHas;
02135 ListCache.prototype.set = listCacheSet;
02136
02137
02138
02146 function MapCache(entries) {
02147 var index = -1,
02148 length = entries == null ? 0 : entries.length;
02149
02150 this.clear();
02151 while (++index < length) {
02152 var entry = entries[index];
02153 this.set(entry[0], entry[1]);
02154 }
02155 }
02156
02164 function mapCacheClear() {
02165 this.size = 0;
02166 this.__data__ = {
02167 'hash': new Hash,
02168 'map': new (Map || ListCache),
02169 'string': new Hash
02170 };
02171 }
02172
02182 function mapCacheDelete(key) {
02183 var result = getMapData(this, key)['delete'](key);
02184 this.size -= result ? 1 : 0;
02185 return result;
02186 }
02187
02197 function mapCacheGet(key) {
02198 return getMapData(this, key).get(key);
02199 }
02200
02210 function mapCacheHas(key) {
02211 return getMapData(this, key).has(key);
02212 }
02213
02224 function mapCacheSet(key, value) {
02225 var data = getMapData(this, key),
02226 size = data.size;
02227
02228 data.set(key, value);
02229 this.size += data.size == size ? 0 : 1;
02230 return this;
02231 }
02232
02233
02234 MapCache.prototype.clear = mapCacheClear;
02235 MapCache.prototype['delete'] = mapCacheDelete;
02236 MapCache.prototype.get = mapCacheGet;
02237 MapCache.prototype.has = mapCacheHas;
02238 MapCache.prototype.set = mapCacheSet;
02239
02240
02241
02250 function SetCache(values) {
02251 var index = -1,
02252 length = values == null ? 0 : values.length;
02253
02254 this.__data__ = new MapCache;
02255 while (++index < length) {
02256 this.add(values[index]);
02257 }
02258 }
02259
02270 function setCacheAdd(value) {
02271 this.__data__.set(value, HASH_UNDEFINED);
02272 return this;
02273 }
02274
02284 function setCacheHas(value) {
02285 return this.__data__.has(value);
02286 }
02287
02288
02289 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
02290 SetCache.prototype.has = setCacheHas;
02291
02292
02293
02301 function Stack(entries) {
02302 var data = this.__data__ = new ListCache(entries);
02303 this.size = data.size;
02304 }
02305
02313 function stackClear() {
02314 this.__data__ = new ListCache;
02315 this.size = 0;
02316 }
02317
02327 function stackDelete(key) {
02328 var data = this.__data__,
02329 result = data['delete'](key);
02330
02331 this.size = data.size;
02332 return result;
02333 }
02334
02344 function stackGet(key) {
02345 return this.__data__.get(key);
02346 }
02347
02357 function stackHas(key) {
02358 return this.__data__.has(key);
02359 }
02360
02371 function stackSet(key, value) {
02372 var data = this.__data__;
02373 if (data instanceof ListCache) {
02374 var pairs = data.__data__;
02375 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
02376 pairs.push([key, value]);
02377 this.size = ++data.size;
02378 return this;
02379 }
02380 data = this.__data__ = new MapCache(pairs);
02381 }
02382 data.set(key, value);
02383 this.size = data.size;
02384 return this;
02385 }
02386
02387
02388 Stack.prototype.clear = stackClear;
02389 Stack.prototype['delete'] = stackDelete;
02390 Stack.prototype.get = stackGet;
02391 Stack.prototype.has = stackHas;
02392 Stack.prototype.set = stackSet;
02393
02394
02395
02404 function arrayLikeKeys(value, inherited) {
02405 var isArr = isArray(value),
02406 isArg = !isArr && isArguments(value),
02407 isBuff = !isArr && !isArg && isBuffer(value),
02408 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
02409 skipIndexes = isArr || isArg || isBuff || isType,
02410 result = skipIndexes ? baseTimes(value.length, String) : [],
02411 length = result.length;
02412
02413 for (var key in value) {
02414 if ((inherited || hasOwnProperty.call(value, key)) &&
02415 !(skipIndexes && (
02416
02417 key == 'length' ||
02418
02419 (isBuff && (key == 'offset' || key == 'parent')) ||
02420
02421 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
02422
02423 isIndex(key, length)
02424 ))) {
02425 result.push(key);
02426 }
02427 }
02428 return result;
02429 }
02430
02438 function arraySample(array) {
02439 var length = array.length;
02440 return length ? array[baseRandom(0, length - 1)] : undefined;
02441 }
02442
02451 function arraySampleSize(array, n) {
02452 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
02453 }
02454
02462 function arrayShuffle(array) {
02463 return shuffleSelf(copyArray(array));
02464 }
02465
02475 function assignMergeValue(object, key, value) {
02476 if ((value !== undefined && !eq(object[key], value)) ||
02477 (value === undefined && !(key in object))) {
02478 baseAssignValue(object, key, value);
02479 }
02480 }
02481
02492 function assignValue(object, key, value) {
02493 var objValue = object[key];
02494 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
02495 (value === undefined && !(key in object))) {
02496 baseAssignValue(object, key, value);
02497 }
02498 }
02499
02508 function assocIndexOf(array, key) {
02509 var length = array.length;
02510 while (length--) {
02511 if (eq(array[length][0], key)) {
02512 return length;
02513 }
02514 }
02515 return -1;
02516 }
02517
02529 function baseAggregator(collection, setter, iteratee, accumulator) {
02530 baseEach(collection, function(value, key, collection) {
02531 setter(accumulator, value, iteratee(value), collection);
02532 });
02533 return accumulator;
02534 }
02535
02545 function baseAssign(object, source) {
02546 return object && copyObject(source, keys(source), object);
02547 }
02548
02558 function baseAssignIn(object, source) {
02559 return object && copyObject(source, keysIn(source), object);
02560 }
02561
02571 function baseAssignValue(object, key, value) {
02572 if (key == '__proto__' && defineProperty) {
02573 defineProperty(object, key, {
02574 'configurable': true,
02575 'enumerable': true,
02576 'value': value,
02577 'writable': true
02578 });
02579 } else {
02580 object[key] = value;
02581 }
02582 }
02583
02592 function baseAt(object, paths) {
02593 var index = -1,
02594 length = paths.length,
02595 result = Array(length),
02596 skip = object == null;
02597
02598 while (++index < length) {
02599 result[index] = skip ? undefined : get(object, paths[index]);
02600 }
02601 return result;
02602 }
02603
02613 function baseClamp(number, lower, upper) {
02614 if (number === number) {
02615 if (upper !== undefined) {
02616 number = number <= upper ? number : upper;
02617 }
02618 if (lower !== undefined) {
02619 number = number >= lower ? number : lower;
02620 }
02621 }
02622 return number;
02623 }
02624
02641 function baseClone(value, bitmask, customizer, key, object, stack) {
02642 var result,
02643 isDeep = bitmask & CLONE_DEEP_FLAG,
02644 isFlat = bitmask & CLONE_FLAT_FLAG,
02645 isFull = bitmask & CLONE_SYMBOLS_FLAG;
02646
02647 if (customizer) {
02648 result = object ? customizer(value, key, object, stack) : customizer(value);
02649 }
02650 if (result !== undefined) {
02651 return result;
02652 }
02653 if (!isObject(value)) {
02654 return value;
02655 }
02656 var isArr = isArray(value);
02657 if (isArr) {
02658 result = initCloneArray(value);
02659 if (!isDeep) {
02660 return copyArray(value, result);
02661 }
02662 } else {
02663 var tag = getTag(value),
02664 isFunc = tag == funcTag || tag == genTag;
02665
02666 if (isBuffer(value)) {
02667 return cloneBuffer(value, isDeep);
02668 }
02669 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
02670 result = (isFlat || isFunc) ? {} : initCloneObject(value);
02671 if (!isDeep) {
02672 return isFlat
02673 ? copySymbolsIn(value, baseAssignIn(result, value))
02674 : copySymbols(value, baseAssign(result, value));
02675 }
02676 } else {
02677 if (!cloneableTags[tag]) {
02678 return object ? value : {};
02679 }
02680 result = initCloneByTag(value, tag, baseClone, isDeep);
02681 }
02682 }
02683
02684 stack || (stack = new Stack);
02685 var stacked = stack.get(value);
02686 if (stacked) {
02687 return stacked;
02688 }
02689 stack.set(value, result);
02690
02691 var keysFunc = isFull
02692 ? (isFlat ? getAllKeysIn : getAllKeys)
02693 : (isFlat ? keysIn : keys);
02694
02695 var props = isArr ? undefined : keysFunc(value);
02696 arrayEach(props || value, function(subValue, key) {
02697 if (props) {
02698 key = subValue;
02699 subValue = value[key];
02700 }
02701
02702 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
02703 });
02704 return result;
02705 }
02706
02714 function baseConforms(source) {
02715 var props = keys(source);
02716 return function(object) {
02717 return baseConformsTo(object, source, props);
02718 };
02719 }
02720
02729 function baseConformsTo(object, source, props) {
02730 var length = props.length;
02731 if (object == null) {
02732 return !length;
02733 }
02734 object = Object(object);
02735 while (length--) {
02736 var key = props[length],
02737 predicate = source[key],
02738 value = object[key];
02739
02740 if ((value === undefined && !(key in object)) || !predicate(value)) {
02741 return false;
02742 }
02743 }
02744 return true;
02745 }
02746
02757 function baseDelay(func, wait, args) {
02758 if (typeof func != 'function') {
02759 throw new TypeError(FUNC_ERROR_TEXT);
02760 }
02761 return setTimeout(function() { func.apply(undefined, args); }, wait);
02762 }
02763
02775 function baseDifference(array, values, iteratee, comparator) {
02776 var index = -1,
02777 includes = arrayIncludes,
02778 isCommon = true,
02779 length = array.length,
02780 result = [],
02781 valuesLength = values.length;
02782
02783 if (!length) {
02784 return result;
02785 }
02786 if (iteratee) {
02787 values = arrayMap(values, baseUnary(iteratee));
02788 }
02789 if (comparator) {
02790 includes = arrayIncludesWith;
02791 isCommon = false;
02792 }
02793 else if (values.length >= LARGE_ARRAY_SIZE) {
02794 includes = cacheHas;
02795 isCommon = false;
02796 values = new SetCache(values);
02797 }
02798 outer:
02799 while (++index < length) {
02800 var value = array[index],
02801 computed = iteratee == null ? value : iteratee(value);
02802
02803 value = (comparator || value !== 0) ? value : 0;
02804 if (isCommon && computed === computed) {
02805 var valuesIndex = valuesLength;
02806 while (valuesIndex--) {
02807 if (values[valuesIndex] === computed) {
02808 continue outer;
02809 }
02810 }
02811 result.push(value);
02812 }
02813 else if (!includes(values, computed, comparator)) {
02814 result.push(value);
02815 }
02816 }
02817 return result;
02818 }
02819
02828 var baseEach = createBaseEach(baseForOwn);
02829
02838 var baseEachRight = createBaseEach(baseForOwnRight, true);
02839
02849 function baseEvery(collection, predicate) {
02850 var result = true;
02851 baseEach(collection, function(value, index, collection) {
02852 result = !!predicate(value, index, collection);
02853 return result;
02854 });
02855 return result;
02856 }
02857
02868 function baseExtremum(array, iteratee, comparator) {
02869 var index = -1,
02870 length = array.length;
02871
02872 while (++index < length) {
02873 var value = array[index],
02874 current = iteratee(value);
02875
02876 if (current != null && (computed === undefined
02877 ? (current === current && !isSymbol(current))
02878 : comparator(current, computed)
02879 )) {
02880 var computed = current,
02881 result = value;
02882 }
02883 }
02884 return result;
02885 }
02886
02897 function baseFill(array, value, start, end) {
02898 var length = array.length;
02899
02900 start = toInteger(start);
02901 if (start < 0) {
02902 start = -start > length ? 0 : (length + start);
02903 }
02904 end = (end === undefined || end > length) ? length : toInteger(end);
02905 if (end < 0) {
02906 end += length;
02907 }
02908 end = start > end ? 0 : toLength(end);
02909 while (start < end) {
02910 array[start++] = value;
02911 }
02912 return array;
02913 }
02914
02923 function baseFilter(collection, predicate) {
02924 var result = [];
02925 baseEach(collection, function(value, index, collection) {
02926 if (predicate(value, index, collection)) {
02927 result.push(value);
02928 }
02929 });
02930 return result;
02931 }
02932
02944 function baseFlatten(array, depth, predicate, isStrict, result) {
02945 var index = -1,
02946 length = array.length;
02947
02948 predicate || (predicate = isFlattenable);
02949 result || (result = []);
02950
02951 while (++index < length) {
02952 var value = array[index];
02953 if (depth > 0 && predicate(value)) {
02954 if (depth > 1) {
02955
02956 baseFlatten(value, depth - 1, predicate, isStrict, result);
02957 } else {
02958 arrayPush(result, value);
02959 }
02960 } else if (!isStrict) {
02961 result[result.length] = value;
02962 }
02963 }
02964 return result;
02965 }
02966
02978 var baseFor = createBaseFor();
02979
02990 var baseForRight = createBaseFor(true);
02991
03000 function baseForOwn(object, iteratee) {
03001 return object && baseFor(object, iteratee, keys);
03002 }
03003
03012 function baseForOwnRight(object, iteratee) {
03013 return object && baseForRight(object, iteratee, keys);
03014 }
03015
03025 function baseFunctions(object, props) {
03026 return arrayFilter(props, function(key) {
03027 return isFunction(object[key]);
03028 });
03029 }
03030
03039 function baseGet(object, path) {
03040 path = castPath(path, object);
03041
03042 var index = 0,
03043 length = path.length;
03044
03045 while (object != null && index < length) {
03046 object = object[toKey(path[index++])];
03047 }
03048 return (index && index == length) ? object : undefined;
03049 }
03050
03062 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
03063 var result = keysFunc(object);
03064 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
03065 }
03066
03074 function baseGetTag(value) {
03075 if (value == null) {
03076 return value === undefined ? undefinedTag : nullTag;
03077 }
03078 return (symToStringTag && symToStringTag in Object(value))
03079 ? getRawTag(value)
03080 : objectToString(value);
03081 }
03082
03092 function baseGt(value, other) {
03093 return value > other;
03094 }
03095
03104 function baseHas(object, key) {
03105 return object != null && hasOwnProperty.call(object, key);
03106 }
03107
03116 function baseHasIn(object, key) {
03117 return object != null && key in Object(object);
03118 }
03119
03129 function baseInRange(number, start, end) {
03130 return number >= nativeMin(start, end) && number < nativeMax(start, end);
03131 }
03132
03143 function baseIntersection(arrays, iteratee, comparator) {
03144 var includes = comparator ? arrayIncludesWith : arrayIncludes,
03145 length = arrays[0].length,
03146 othLength = arrays.length,
03147 othIndex = othLength,
03148 caches = Array(othLength),
03149 maxLength = Infinity,
03150 result = [];
03151
03152 while (othIndex--) {
03153 var array = arrays[othIndex];
03154 if (othIndex && iteratee) {
03155 array = arrayMap(array, baseUnary(iteratee));
03156 }
03157 maxLength = nativeMin(array.length, maxLength);
03158 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
03159 ? new SetCache(othIndex && array)
03160 : undefined;
03161 }
03162 array = arrays[0];
03163
03164 var index = -1,
03165 seen = caches[0];
03166
03167 outer:
03168 while (++index < length && result.length < maxLength) {
03169 var value = array[index],
03170 computed = iteratee ? iteratee(value) : value;
03171
03172 value = (comparator || value !== 0) ? value : 0;
03173 if (!(seen
03174 ? cacheHas(seen, computed)
03175 : includes(result, computed, comparator)
03176 )) {
03177 othIndex = othLength;
03178 while (--othIndex) {
03179 var cache = caches[othIndex];
03180 if (!(cache
03181 ? cacheHas(cache, computed)
03182 : includes(arrays[othIndex], computed, comparator))
03183 ) {
03184 continue outer;
03185 }
03186 }
03187 if (seen) {
03188 seen.push(computed);
03189 }
03190 result.push(value);
03191 }
03192 }
03193 return result;
03194 }
03195
03207 function baseInverter(object, setter, iteratee, accumulator) {
03208 baseForOwn(object, function(value, key, object) {
03209 setter(accumulator, iteratee(value), key, object);
03210 });
03211 return accumulator;
03212 }
03213
03224 function baseInvoke(object, path, args) {
03225 path = castPath(path, object);
03226 object = parent(object, path);
03227 var func = object == null ? object : object[toKey(last(path))];
03228 return func == null ? undefined : apply(func, object, args);
03229 }
03230
03238 function baseIsArguments(value) {
03239 return isObjectLike(value) && baseGetTag(value) == argsTag;
03240 }
03241
03249 function baseIsArrayBuffer(value) {
03250 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
03251 }
03252
03260 function baseIsDate(value) {
03261 return isObjectLike(value) && baseGetTag(value) == dateTag;
03262 }
03263
03278 function baseIsEqual(value, other, bitmask, customizer, stack) {
03279 if (value === other) {
03280 return true;
03281 }
03282 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
03283 return value !== value && other !== other;
03284 }
03285 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
03286 }
03287
03302 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
03303 var objIsArr = isArray(object),
03304 othIsArr = isArray(other),
03305 objTag = objIsArr ? arrayTag : getTag(object),
03306 othTag = othIsArr ? arrayTag : getTag(other);
03307
03308 objTag = objTag == argsTag ? objectTag : objTag;
03309 othTag = othTag == argsTag ? objectTag : othTag;
03310
03311 var objIsObj = objTag == objectTag,
03312 othIsObj = othTag == objectTag,
03313 isSameTag = objTag == othTag;
03314
03315 if (isSameTag && isBuffer(object)) {
03316 if (!isBuffer(other)) {
03317 return false;
03318 }
03319 objIsArr = true;
03320 objIsObj = false;
03321 }
03322 if (isSameTag && !objIsObj) {
03323 stack || (stack = new Stack);
03324 return (objIsArr || isTypedArray(object))
03325 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
03326 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
03327 }
03328 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
03329 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
03330 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
03331
03332 if (objIsWrapped || othIsWrapped) {
03333 var objUnwrapped = objIsWrapped ? object.value() : object,
03334 othUnwrapped = othIsWrapped ? other.value() : other;
03335
03336 stack || (stack = new Stack);
03337 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
03338 }
03339 }
03340 if (!isSameTag) {
03341 return false;
03342 }
03343 stack || (stack = new Stack);
03344 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
03345 }
03346
03354 function baseIsMap(value) {
03355 return isObjectLike(value) && getTag(value) == mapTag;
03356 }
03357
03368 function baseIsMatch(object, source, matchData, customizer) {
03369 var index = matchData.length,
03370 length = index,
03371 noCustomizer = !customizer;
03372
03373 if (object == null) {
03374 return !length;
03375 }
03376 object = Object(object);
03377 while (index--) {
03378 var data = matchData[index];
03379 if ((noCustomizer && data[2])
03380 ? data[1] !== object[data[0]]
03381 : !(data[0] in object)
03382 ) {
03383 return false;
03384 }
03385 }
03386 while (++index < length) {
03387 data = matchData[index];
03388 var key = data[0],
03389 objValue = object[key],
03390 srcValue = data[1];
03391
03392 if (noCustomizer && data[2]) {
03393 if (objValue === undefined && !(key in object)) {
03394 return false;
03395 }
03396 } else {
03397 var stack = new Stack;
03398 if (customizer) {
03399 var result = customizer(objValue, srcValue, key, object, source, stack);
03400 }
03401 if (!(result === undefined
03402 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
03403 : result
03404 )) {
03405 return false;
03406 }
03407 }
03408 }
03409 return true;
03410 }
03411
03420 function baseIsNative(value) {
03421 if (!isObject(value) || isMasked(value)) {
03422 return false;
03423 }
03424 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
03425 return pattern.test(toSource(value));
03426 }
03427
03435 function baseIsRegExp(value) {
03436 return isObjectLike(value) && baseGetTag(value) == regexpTag;
03437 }
03438
03446 function baseIsSet(value) {
03447 return isObjectLike(value) && getTag(value) == setTag;
03448 }
03449
03457 function baseIsTypedArray(value) {
03458 return isObjectLike(value) &&
03459 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
03460 }
03461
03469 function baseIteratee(value) {
03470
03471
03472 if (typeof value == 'function') {
03473 return value;
03474 }
03475 if (value == null) {
03476 return identity;
03477 }
03478 if (typeof value == 'object') {
03479 return isArray(value)
03480 ? baseMatchesProperty(value[0], value[1])
03481 : baseMatches(value);
03482 }
03483 return property(value);
03484 }
03485
03493 function baseKeys(object) {
03494 if (!isPrototype(object)) {
03495 return nativeKeys(object);
03496 }
03497 var result = [];
03498 for (var key in Object(object)) {
03499 if (hasOwnProperty.call(object, key) && key != 'constructor') {
03500 result.push(key);
03501 }
03502 }
03503 return result;
03504 }
03505
03513 function baseKeysIn(object) {
03514 if (!isObject(object)) {
03515 return nativeKeysIn(object);
03516 }
03517 var isProto = isPrototype(object),
03518 result = [];
03519
03520 for (var key in object) {
03521 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
03522 result.push(key);
03523 }
03524 }
03525 return result;
03526 }
03527
03537 function baseLt(value, other) {
03538 return value < other;
03539 }
03540
03549 function baseMap(collection, iteratee) {
03550 var index = -1,
03551 result = isArrayLike(collection) ? Array(collection.length) : [];
03552
03553 baseEach(collection, function(value, key, collection) {
03554 result[++index] = iteratee(value, key, collection);
03555 });
03556 return result;
03557 }
03558
03566 function baseMatches(source) {
03567 var matchData = getMatchData(source);
03568 if (matchData.length == 1 && matchData[0][2]) {
03569 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
03570 }
03571 return function(object) {
03572 return object === source || baseIsMatch(object, source, matchData);
03573 };
03574 }
03575
03584 function baseMatchesProperty(path, srcValue) {
03585 if (isKey(path) && isStrictComparable(srcValue)) {
03586 return matchesStrictComparable(toKey(path), srcValue);
03587 }
03588 return function(object) {
03589 var objValue = get(object, path);
03590 return (objValue === undefined && objValue === srcValue)
03591 ? hasIn(object, path)
03592 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
03593 };
03594 }
03595
03607 function baseMerge(object, source, srcIndex, customizer, stack) {
03608 if (object === source) {
03609 return;
03610 }
03611 baseFor(source, function(srcValue, key) {
03612 if (isObject(srcValue)) {
03613 stack || (stack = new Stack);
03614 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
03615 }
03616 else {
03617 var newValue = customizer
03618 ? customizer(object[key], srcValue, (key + ''), object, source, stack)
03619 : undefined;
03620
03621 if (newValue === undefined) {
03622 newValue = srcValue;
03623 }
03624 assignMergeValue(object, key, newValue);
03625 }
03626 }, keysIn);
03627 }
03628
03644 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
03645 var objValue = object[key],
03646 srcValue = source[key],
03647 stacked = stack.get(srcValue);
03648
03649 if (stacked) {
03650 assignMergeValue(object, key, stacked);
03651 return;
03652 }
03653 var newValue = customizer
03654 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
03655 : undefined;
03656
03657 var isCommon = newValue === undefined;
03658
03659 if (isCommon) {
03660 var isArr = isArray(srcValue),
03661 isBuff = !isArr && isBuffer(srcValue),
03662 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
03663
03664 newValue = srcValue;
03665 if (isArr || isBuff || isTyped) {
03666 if (isArray(objValue)) {
03667 newValue = objValue;
03668 }
03669 else if (isArrayLikeObject(objValue)) {
03670 newValue = copyArray(objValue);
03671 }
03672 else if (isBuff) {
03673 isCommon = false;
03674 newValue = cloneBuffer(srcValue, true);
03675 }
03676 else if (isTyped) {
03677 isCommon = false;
03678 newValue = cloneTypedArray(srcValue, true);
03679 }
03680 else {
03681 newValue = [];
03682 }
03683 }
03684 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
03685 newValue = objValue;
03686 if (isArguments(objValue)) {
03687 newValue = toPlainObject(objValue);
03688 }
03689 else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
03690 newValue = initCloneObject(srcValue);
03691 }
03692 }
03693 else {
03694 isCommon = false;
03695 }
03696 }
03697 if (isCommon) {
03698
03699 stack.set(srcValue, newValue);
03700 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
03701 stack['delete'](srcValue);
03702 }
03703 assignMergeValue(object, key, newValue);
03704 }
03705
03714 function baseNth(array, n) {
03715 var length = array.length;
03716 if (!length) {
03717 return;
03718 }
03719 n += n < 0 ? length : 0;
03720 return isIndex(n, length) ? array[n] : undefined;
03721 }
03722
03732 function baseOrderBy(collection, iteratees, orders) {
03733 var index = -1;
03734 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
03735
03736 var result = baseMap(collection, function(value, key, collection) {
03737 var criteria = arrayMap(iteratees, function(iteratee) {
03738 return iteratee(value);
03739 });
03740 return { 'criteria': criteria, 'index': ++index, 'value': value };
03741 });
03742
03743 return baseSortBy(result, function(object, other) {
03744 return compareMultiple(object, other, orders);
03745 });
03746 }
03747
03757 function basePick(object, paths) {
03758 return basePickBy(object, paths, function(value, path) {
03759 return hasIn(object, path);
03760 });
03761 }
03762
03772 function basePickBy(object, paths, predicate) {
03773 var index = -1,
03774 length = paths.length,
03775 result = {};
03776
03777 while (++index < length) {
03778 var path = paths[index],
03779 value = baseGet(object, path);
03780
03781 if (predicate(value, path)) {
03782 baseSet(result, castPath(path, object), value);
03783 }
03784 }
03785 return result;
03786 }
03787
03795 function basePropertyDeep(path) {
03796 return function(object) {
03797 return baseGet(object, path);
03798 };
03799 }
03800
03812 function basePullAll(array, values, iteratee, comparator) {
03813 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
03814 index = -1,
03815 length = values.length,
03816 seen = array;
03817
03818 if (array === values) {
03819 values = copyArray(values);
03820 }
03821 if (iteratee) {
03822 seen = arrayMap(array, baseUnary(iteratee));
03823 }
03824 while (++index < length) {
03825 var fromIndex = 0,
03826 value = values[index],
03827 computed = iteratee ? iteratee(value) : value;
03828
03829 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
03830 if (seen !== array) {
03831 splice.call(seen, fromIndex, 1);
03832 }
03833 splice.call(array, fromIndex, 1);
03834 }
03835 }
03836 return array;
03837 }
03838
03848 function basePullAt(array, indexes) {
03849 var length = array ? indexes.length : 0,
03850 lastIndex = length - 1;
03851
03852 while (length--) {
03853 var index = indexes[length];
03854 if (length == lastIndex || index !== previous) {
03855 var previous = index;
03856 if (isIndex(index)) {
03857 splice.call(array, index, 1);
03858 } else {
03859 baseUnset(array, index);
03860 }
03861 }
03862 }
03863 return array;
03864 }
03865
03875 function baseRandom(lower, upper) {
03876 return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
03877 }
03878
03890 function baseRange(start, end, step, fromRight) {
03891 var index = -1,
03892 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
03893 result = Array(length);
03894
03895 while (length--) {
03896 result[fromRight ? length : ++index] = start;
03897 start += step;
03898 }
03899 return result;
03900 }
03901
03910 function baseRepeat(string, n) {
03911 var result = '';
03912 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
03913 return result;
03914 }
03915
03916
03917 do {
03918 if (n % 2) {
03919 result += string;
03920 }
03921 n = nativeFloor(n / 2);
03922 if (n) {
03923 string += string;
03924 }
03925 } while (n);
03926
03927 return result;
03928 }
03929
03938 function baseRest(func, start) {
03939 return setToString(overRest(func, start, identity), func + '');
03940 }
03941
03949 function baseSample(collection) {
03950 return arraySample(values(collection));
03951 }
03952
03961 function baseSampleSize(collection, n) {
03962 var array = values(collection);
03963 return shuffleSelf(array, baseClamp(n, 0, array.length));
03964 }
03965
03976 function baseSet(object, path, value, customizer) {
03977 if (!isObject(object)) {
03978 return object;
03979 }
03980 path = castPath(path, object);
03981
03982 var index = -1,
03983 length = path.length,
03984 lastIndex = length - 1,
03985 nested = object;
03986
03987 while (nested != null && ++index < length) {
03988 var key = toKey(path[index]),
03989 newValue = value;
03990
03991 if (index != lastIndex) {
03992 var objValue = nested[key];
03993 newValue = customizer ? customizer(objValue, key, nested) : undefined;
03994 if (newValue === undefined) {
03995 newValue = isObject(objValue)
03996 ? objValue
03997 : (isIndex(path[index + 1]) ? [] : {});
03998 }
03999 }
04000 assignValue(nested, key, newValue);
04001 nested = nested[key];
04002 }
04003 return object;
04004 }
04005
04014 var baseSetData = !metaMap ? identity : function(func, data) {
04015 metaMap.set(func, data);
04016 return func;
04017 };
04018
04027 var baseSetToString = !defineProperty ? identity : function(func, string) {
04028 return defineProperty(func, 'toString', {
04029 'configurable': true,
04030 'enumerable': false,
04031 'value': constant(string),
04032 'writable': true
04033 });
04034 };
04035
04043 function baseShuffle(collection) {
04044 return shuffleSelf(values(collection));
04045 }
04046
04056 function baseSlice(array, start, end) {
04057 var index = -1,
04058 length = array.length;
04059
04060 if (start < 0) {
04061 start = -start > length ? 0 : (length + start);
04062 }
04063 end = end > length ? length : end;
04064 if (end < 0) {
04065 end += length;
04066 }
04067 length = start > end ? 0 : ((end - start) >>> 0);
04068 start >>>= 0;
04069
04070 var result = Array(length);
04071 while (++index < length) {
04072 result[index] = array[index + start];
04073 }
04074 return result;
04075 }
04076
04086 function baseSome(collection, predicate) {
04087 var result;
04088
04089 baseEach(collection, function(value, index, collection) {
04090 result = predicate(value, index, collection);
04091 return !result;
04092 });
04093 return !!result;
04094 }
04095
04108 function baseSortedIndex(array, value, retHighest) {
04109 var low = 0,
04110 high = array == null ? low : array.length;
04111
04112 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
04113 while (low < high) {
04114 var mid = (low + high) >>> 1,
04115 computed = array[mid];
04116
04117 if (computed !== null && !isSymbol(computed) &&
04118 (retHighest ? (computed <= value) : (computed < value))) {
04119 low = mid + 1;
04120 } else {
04121 high = mid;
04122 }
04123 }
04124 return high;
04125 }
04126 return baseSortedIndexBy(array, value, identity, retHighest);
04127 }
04128
04142 function baseSortedIndexBy(array, value, iteratee, retHighest) {
04143 value = iteratee(value);
04144
04145 var low = 0,
04146 high = array == null ? 0 : array.length,
04147 valIsNaN = value !== value,
04148 valIsNull = value === null,
04149 valIsSymbol = isSymbol(value),
04150 valIsUndefined = value === undefined;
04151
04152 while (low < high) {
04153 var mid = nativeFloor((low + high) / 2),
04154 computed = iteratee(array[mid]),
04155 othIsDefined = computed !== undefined,
04156 othIsNull = computed === null,
04157 othIsReflexive = computed === computed,
04158 othIsSymbol = isSymbol(computed);
04159
04160 if (valIsNaN) {
04161 var setLow = retHighest || othIsReflexive;
04162 } else if (valIsUndefined) {
04163 setLow = othIsReflexive && (retHighest || othIsDefined);
04164 } else if (valIsNull) {
04165 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
04166 } else if (valIsSymbol) {
04167 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
04168 } else if (othIsNull || othIsSymbol) {
04169 setLow = false;
04170 } else {
04171 setLow = retHighest ? (computed <= value) : (computed < value);
04172 }
04173 if (setLow) {
04174 low = mid + 1;
04175 } else {
04176 high = mid;
04177 }
04178 }
04179 return nativeMin(high, MAX_ARRAY_INDEX);
04180 }
04181
04191 function baseSortedUniq(array, iteratee) {
04192 var index = -1,
04193 length = array.length,
04194 resIndex = 0,
04195 result = [];
04196
04197 while (++index < length) {
04198 var value = array[index],
04199 computed = iteratee ? iteratee(value) : value;
04200
04201 if (!index || !eq(computed, seen)) {
04202 var seen = computed;
04203 result[resIndex++] = value === 0 ? 0 : value;
04204 }
04205 }
04206 return result;
04207 }
04208
04217 function baseToNumber(value) {
04218 if (typeof value == 'number') {
04219 return value;
04220 }
04221 if (isSymbol(value)) {
04222 return NAN;
04223 }
04224 return +value;
04225 }
04226
04235 function baseToString(value) {
04236
04237 if (typeof value == 'string') {
04238 return value;
04239 }
04240 if (isArray(value)) {
04241
04242 return arrayMap(value, baseToString) + '';
04243 }
04244 if (isSymbol(value)) {
04245 return symbolToString ? symbolToString.call(value) : '';
04246 }
04247 var result = (value + '');
04248 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
04249 }
04250
04260 function baseUniq(array, iteratee, comparator) {
04261 var index = -1,
04262 includes = arrayIncludes,
04263 length = array.length,
04264 isCommon = true,
04265 result = [],
04266 seen = result;
04267
04268 if (comparator) {
04269 isCommon = false;
04270 includes = arrayIncludesWith;
04271 }
04272 else if (length >= LARGE_ARRAY_SIZE) {
04273 var set = iteratee ? null : createSet(array);
04274 if (set) {
04275 return setToArray(set);
04276 }
04277 isCommon = false;
04278 includes = cacheHas;
04279 seen = new SetCache;
04280 }
04281 else {
04282 seen = iteratee ? [] : result;
04283 }
04284 outer:
04285 while (++index < length) {
04286 var value = array[index],
04287 computed = iteratee ? iteratee(value) : value;
04288
04289 value = (comparator || value !== 0) ? value : 0;
04290 if (isCommon && computed === computed) {
04291 var seenIndex = seen.length;
04292 while (seenIndex--) {
04293 if (seen[seenIndex] === computed) {
04294 continue outer;
04295 }
04296 }
04297 if (iteratee) {
04298 seen.push(computed);
04299 }
04300 result.push(value);
04301 }
04302 else if (!includes(seen, computed, comparator)) {
04303 if (seen !== result) {
04304 seen.push(computed);
04305 }
04306 result.push(value);
04307 }
04308 }
04309 return result;
04310 }
04311
04320 function baseUnset(object, path) {
04321 path = castPath(path, object);
04322 object = parent(object, path);
04323 return object == null || delete object[toKey(last(path))];
04324 }
04325
04336 function baseUpdate(object, path, updater, customizer) {
04337 return baseSet(object, path, updater(baseGet(object, path)), customizer);
04338 }
04339
04351 function baseWhile(array, predicate, isDrop, fromRight) {
04352 var length = array.length,
04353 index = fromRight ? length : -1;
04354
04355 while ((fromRight ? index-- : ++index < length) &&
04356 predicate(array[index], index, array)) {}
04357
04358 return isDrop
04359 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
04360 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
04361 }
04362
04373 function baseWrapperValue(value, actions) {
04374 var result = value;
04375 if (result instanceof LazyWrapper) {
04376 result = result.value();
04377 }
04378 return arrayReduce(actions, function(result, action) {
04379 return action.func.apply(action.thisArg, arrayPush([result], action.args));
04380 }, result);
04381 }
04382
04393 function baseXor(arrays, iteratee, comparator) {
04394 var length = arrays.length;
04395 if (length < 2) {
04396 return length ? baseUniq(arrays[0]) : [];
04397 }
04398 var index = -1,
04399 result = Array(length);
04400
04401 while (++index < length) {
04402 var array = arrays[index],
04403 othIndex = -1;
04404
04405 while (++othIndex < length) {
04406 if (othIndex != index) {
04407 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
04408 }
04409 }
04410 }
04411 return baseUniq(baseFlatten(result, 1), iteratee, comparator);
04412 }
04413
04423 function baseZipObject(props, values, assignFunc) {
04424 var index = -1,
04425 length = props.length,
04426 valsLength = values.length,
04427 result = {};
04428
04429 while (++index < length) {
04430 var value = index < valsLength ? values[index] : undefined;
04431 assignFunc(result, props[index], value);
04432 }
04433 return result;
04434 }
04435
04443 function castArrayLikeObject(value) {
04444 return isArrayLikeObject(value) ? value : [];
04445 }
04446
04454 function castFunction(value) {
04455 return typeof value == 'function' ? value : identity;
04456 }
04457
04466 function castPath(value, object) {
04467 if (isArray(value)) {
04468 return value;
04469 }
04470 return isKey(value, object) ? [value] : stringToPath(toString(value));
04471 }
04472
04482 var castRest = baseRest;
04483
04493 function castSlice(array, start, end) {
04494 var length = array.length;
04495 end = end === undefined ? length : end;
04496 return (!start && end >= length) ? array : baseSlice(array, start, end);
04497 }
04498
04505 var clearTimeout = ctxClearTimeout || function(id) {
04506 return root.clearTimeout(id);
04507 };
04508
04517 function cloneBuffer(buffer, isDeep) {
04518 if (isDeep) {
04519 return buffer.slice();
04520 }
04521 var length = buffer.length,
04522 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
04523
04524 buffer.copy(result);
04525 return result;
04526 }
04527
04535 function cloneArrayBuffer(arrayBuffer) {
04536 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
04537 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
04538 return result;
04539 }
04540
04549 function cloneDataView(dataView, isDeep) {
04550 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
04551 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
04552 }
04553
04563 function cloneMap(map, isDeep, cloneFunc) {
04564 var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
04565 return arrayReduce(array, addMapEntry, new map.constructor);
04566 }
04567
04575 function cloneRegExp(regexp) {
04576 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
04577 result.lastIndex = regexp.lastIndex;
04578 return result;
04579 }
04580
04590 function cloneSet(set, isDeep, cloneFunc) {
04591 var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
04592 return arrayReduce(array, addSetEntry, new set.constructor);
04593 }
04594
04602 function cloneSymbol(symbol) {
04603 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
04604 }
04605
04614 function cloneTypedArray(typedArray, isDeep) {
04615 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
04616 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
04617 }
04618
04627 function compareAscending(value, other) {
04628 if (value !== other) {
04629 var valIsDefined = value !== undefined,
04630 valIsNull = value === null,
04631 valIsReflexive = value === value,
04632 valIsSymbol = isSymbol(value);
04633
04634 var othIsDefined = other !== undefined,
04635 othIsNull = other === null,
04636 othIsReflexive = other === other,
04637 othIsSymbol = isSymbol(other);
04638
04639 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
04640 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
04641 (valIsNull && othIsDefined && othIsReflexive) ||
04642 (!valIsDefined && othIsReflexive) ||
04643 !valIsReflexive) {
04644 return 1;
04645 }
04646 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
04647 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
04648 (othIsNull && valIsDefined && valIsReflexive) ||
04649 (!othIsDefined && valIsReflexive) ||
04650 !othIsReflexive) {
04651 return -1;
04652 }
04653 }
04654 return 0;
04655 }
04656
04671 function compareMultiple(object, other, orders) {
04672 var index = -1,
04673 objCriteria = object.criteria,
04674 othCriteria = other.criteria,
04675 length = objCriteria.length,
04676 ordersLength = orders.length;
04677
04678 while (++index < length) {
04679 var result = compareAscending(objCriteria[index], othCriteria[index]);
04680 if (result) {
04681 if (index >= ordersLength) {
04682 return result;
04683 }
04684 var order = orders[index];
04685 return result * (order == 'desc' ? -1 : 1);
04686 }
04687 }
04688
04689
04690
04691
04692
04693
04694
04695 return object.index - other.index;
04696 }
04697
04709 function composeArgs(args, partials, holders, isCurried) {
04710 var argsIndex = -1,
04711 argsLength = args.length,
04712 holdersLength = holders.length,
04713 leftIndex = -1,
04714 leftLength = partials.length,
04715 rangeLength = nativeMax(argsLength - holdersLength, 0),
04716 result = Array(leftLength + rangeLength),
04717 isUncurried = !isCurried;
04718
04719 while (++leftIndex < leftLength) {
04720 result[leftIndex] = partials[leftIndex];
04721 }
04722 while (++argsIndex < holdersLength) {
04723 if (isUncurried || argsIndex < argsLength) {
04724 result[holders[argsIndex]] = args[argsIndex];
04725 }
04726 }
04727 while (rangeLength--) {
04728 result[leftIndex++] = args[argsIndex++];
04729 }
04730 return result;
04731 }
04732
04744 function composeArgsRight(args, partials, holders, isCurried) {
04745 var argsIndex = -1,
04746 argsLength = args.length,
04747 holdersIndex = -1,
04748 holdersLength = holders.length,
04749 rightIndex = -1,
04750 rightLength = partials.length,
04751 rangeLength = nativeMax(argsLength - holdersLength, 0),
04752 result = Array(rangeLength + rightLength),
04753 isUncurried = !isCurried;
04754
04755 while (++argsIndex < rangeLength) {
04756 result[argsIndex] = args[argsIndex];
04757 }
04758 var offset = argsIndex;
04759 while (++rightIndex < rightLength) {
04760 result[offset + rightIndex] = partials[rightIndex];
04761 }
04762 while (++holdersIndex < holdersLength) {
04763 if (isUncurried || argsIndex < argsLength) {
04764 result[offset + holders[holdersIndex]] = args[argsIndex++];
04765 }
04766 }
04767 return result;
04768 }
04769
04778 function copyArray(source, array) {
04779 var index = -1,
04780 length = source.length;
04781
04782 array || (array = Array(length));
04783 while (++index < length) {
04784 array[index] = source[index];
04785 }
04786 return array;
04787 }
04788
04799 function copyObject(source, props, object, customizer) {
04800 var isNew = !object;
04801 object || (object = {});
04802
04803 var index = -1,
04804 length = props.length;
04805
04806 while (++index < length) {
04807 var key = props[index];
04808
04809 var newValue = customizer
04810 ? customizer(object[key], source[key], key, object, source)
04811 : undefined;
04812
04813 if (newValue === undefined) {
04814 newValue = source[key];
04815 }
04816 if (isNew) {
04817 baseAssignValue(object, key, newValue);
04818 } else {
04819 assignValue(object, key, newValue);
04820 }
04821 }
04822 return object;
04823 }
04824
04833 function copySymbols(source, object) {
04834 return copyObject(source, getSymbols(source), object);
04835 }
04836
04845 function copySymbolsIn(source, object) {
04846 return copyObject(source, getSymbolsIn(source), object);
04847 }
04848
04857 function createAggregator(setter, initializer) {
04858 return function(collection, iteratee) {
04859 var func = isArray(collection) ? arrayAggregator : baseAggregator,
04860 accumulator = initializer ? initializer() : {};
04861
04862 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
04863 };
04864 }
04865
04873 function createAssigner(assigner) {
04874 return baseRest(function(object, sources) {
04875 var index = -1,
04876 length = sources.length,
04877 customizer = length > 1 ? sources[length - 1] : undefined,
04878 guard = length > 2 ? sources[2] : undefined;
04879
04880 customizer = (assigner.length > 3 && typeof customizer == 'function')
04881 ? (length--, customizer)
04882 : undefined;
04883
04884 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
04885 customizer = length < 3 ? undefined : customizer;
04886 length = 1;
04887 }
04888 object = Object(object);
04889 while (++index < length) {
04890 var source = sources[index];
04891 if (source) {
04892 assigner(object, source, index, customizer);
04893 }
04894 }
04895 return object;
04896 });
04897 }
04898
04907 function createBaseEach(eachFunc, fromRight) {
04908 return function(collection, iteratee) {
04909 if (collection == null) {
04910 return collection;
04911 }
04912 if (!isArrayLike(collection)) {
04913 return eachFunc(collection, iteratee);
04914 }
04915 var length = collection.length,
04916 index = fromRight ? length : -1,
04917 iterable = Object(collection);
04918
04919 while ((fromRight ? index-- : ++index < length)) {
04920 if (iteratee(iterable[index], index, iterable) === false) {
04921 break;
04922 }
04923 }
04924 return collection;
04925 };
04926 }
04927
04935 function createBaseFor(fromRight) {
04936 return function(object, iteratee, keysFunc) {
04937 var index = -1,
04938 iterable = Object(object),
04939 props = keysFunc(object),
04940 length = props.length;
04941
04942 while (length--) {
04943 var key = props[fromRight ? length : ++index];
04944 if (iteratee(iterable[key], key, iterable) === false) {
04945 break;
04946 }
04947 }
04948 return object;
04949 };
04950 }
04951
04962 function createBind(func, bitmask, thisArg) {
04963 var isBind = bitmask & WRAP_BIND_FLAG,
04964 Ctor = createCtor(func);
04965
04966 function wrapper() {
04967 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
04968 return fn.apply(isBind ? thisArg : this, arguments);
04969 }
04970 return wrapper;
04971 }
04972
04980 function createCaseFirst(methodName) {
04981 return function(string) {
04982 string = toString(string);
04983
04984 var strSymbols = hasUnicode(string)
04985 ? stringToArray(string)
04986 : undefined;
04987
04988 var chr = strSymbols
04989 ? strSymbols[0]
04990 : string.charAt(0);
04991
04992 var trailing = strSymbols
04993 ? castSlice(strSymbols, 1).join('')
04994 : string.slice(1);
04995
04996 return chr[methodName]() + trailing;
04997 };
04998 }
04999
05007 function createCompounder(callback) {
05008 return function(string) {
05009 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
05010 };
05011 }
05012
05021 function createCtor(Ctor) {
05022 return function() {
05023
05024
05025
05026 var args = arguments;
05027 switch (args.length) {
05028 case 0: return new Ctor;
05029 case 1: return new Ctor(args[0]);
05030 case 2: return new Ctor(args[0], args[1]);
05031 case 3: return new Ctor(args[0], args[1], args[2]);
05032 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
05033 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
05034 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
05035 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
05036 }
05037 var thisBinding = baseCreate(Ctor.prototype),
05038 result = Ctor.apply(thisBinding, args);
05039
05040
05041
05042 return isObject(result) ? result : thisBinding;
05043 };
05044 }
05045
05055 function createCurry(func, bitmask, arity) {
05056 var Ctor = createCtor(func);
05057
05058 function wrapper() {
05059 var length = arguments.length,
05060 args = Array(length),
05061 index = length,
05062 placeholder = getHolder(wrapper);
05063
05064 while (index--) {
05065 args[index] = arguments[index];
05066 }
05067 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
05068 ? []
05069 : replaceHolders(args, placeholder);
05070
05071 length -= holders.length;
05072 if (length < arity) {
05073 return createRecurry(
05074 func, bitmask, createHybrid, wrapper.placeholder, undefined,
05075 args, holders, undefined, undefined, arity - length);
05076 }
05077 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
05078 return apply(fn, this, args);
05079 }
05080 return wrapper;
05081 }
05082
05090 function createFind(findIndexFunc) {
05091 return function(collection, predicate, fromIndex) {
05092 var iterable = Object(collection);
05093 if (!isArrayLike(collection)) {
05094 var iteratee = getIteratee(predicate, 3);
05095 collection = keys(collection);
05096 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
05097 }
05098 var index = findIndexFunc(collection, predicate, fromIndex);
05099 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
05100 };
05101 }
05102
05110 function createFlow(fromRight) {
05111 return flatRest(function(funcs) {
05112 var length = funcs.length,
05113 index = length,
05114 prereq = LodashWrapper.prototype.thru;
05115
05116 if (fromRight) {
05117 funcs.reverse();
05118 }
05119 while (index--) {
05120 var func = funcs[index];
05121 if (typeof func != 'function') {
05122 throw new TypeError(FUNC_ERROR_TEXT);
05123 }
05124 if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
05125 var wrapper = new LodashWrapper([], true);
05126 }
05127 }
05128 index = wrapper ? index : length;
05129 while (++index < length) {
05130 func = funcs[index];
05131
05132 var funcName = getFuncName(func),
05133 data = funcName == 'wrapper' ? getData(func) : undefined;
05134
05135 if (data && isLaziable(data[0]) &&
05136 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
05137 !data[4].length && data[9] == 1
05138 ) {
05139 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
05140 } else {
05141 wrapper = (func.length == 1 && isLaziable(func))
05142 ? wrapper[funcName]()
05143 : wrapper.thru(func);
05144 }
05145 }
05146 return function() {
05147 var args = arguments,
05148 value = args[0];
05149
05150 if (wrapper && args.length == 1 && isArray(value)) {
05151 return wrapper.plant(value).value();
05152 }
05153 var index = 0,
05154 result = length ? funcs[index].apply(this, args) : value;
05155
05156 while (++index < length) {
05157 result = funcs[index].call(this, result);
05158 }
05159 return result;
05160 };
05161 });
05162 }
05163
05183 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
05184 var isAry = bitmask & WRAP_ARY_FLAG,
05185 isBind = bitmask & WRAP_BIND_FLAG,
05186 isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
05187 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
05188 isFlip = bitmask & WRAP_FLIP_FLAG,
05189 Ctor = isBindKey ? undefined : createCtor(func);
05190
05191 function wrapper() {
05192 var length = arguments.length,
05193 args = Array(length),
05194 index = length;
05195
05196 while (index--) {
05197 args[index] = arguments[index];
05198 }
05199 if (isCurried) {
05200 var placeholder = getHolder(wrapper),
05201 holdersCount = countHolders(args, placeholder);
05202 }
05203 if (partials) {
05204 args = composeArgs(args, partials, holders, isCurried);
05205 }
05206 if (partialsRight) {
05207 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
05208 }
05209 length -= holdersCount;
05210 if (isCurried && length < arity) {
05211 var newHolders = replaceHolders(args, placeholder);
05212 return createRecurry(
05213 func, bitmask, createHybrid, wrapper.placeholder, thisArg,
05214 args, newHolders, argPos, ary, arity - length
05215 );
05216 }
05217 var thisBinding = isBind ? thisArg : this,
05218 fn = isBindKey ? thisBinding[func] : func;
05219
05220 length = args.length;
05221 if (argPos) {
05222 args = reorder(args, argPos);
05223 } else if (isFlip && length > 1) {
05224 args.reverse();
05225 }
05226 if (isAry && ary < length) {
05227 args.length = ary;
05228 }
05229 if (this && this !== root && this instanceof wrapper) {
05230 fn = Ctor || createCtor(fn);
05231 }
05232 return fn.apply(thisBinding, args);
05233 }
05234 return wrapper;
05235 }
05236
05245 function createInverter(setter, toIteratee) {
05246 return function(object, iteratee) {
05247 return baseInverter(object, setter, toIteratee(iteratee), {});
05248 };
05249 }
05250
05259 function createMathOperation(operator, defaultValue) {
05260 return function(value, other) {
05261 var result;
05262 if (value === undefined && other === undefined) {
05263 return defaultValue;
05264 }
05265 if (value !== undefined) {
05266 result = value;
05267 }
05268 if (other !== undefined) {
05269 if (result === undefined) {
05270 return other;
05271 }
05272 if (typeof value == 'string' || typeof other == 'string') {
05273 value = baseToString(value);
05274 other = baseToString(other);
05275 } else {
05276 value = baseToNumber(value);
05277 other = baseToNumber(other);
05278 }
05279 result = operator(value, other);
05280 }
05281 return result;
05282 };
05283 }
05284
05292 function createOver(arrayFunc) {
05293 return flatRest(function(iteratees) {
05294 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
05295 return baseRest(function(args) {
05296 var thisArg = this;
05297 return arrayFunc(iteratees, function(iteratee) {
05298 return apply(iteratee, thisArg, args);
05299 });
05300 });
05301 });
05302 }
05303
05313 function createPadding(length, chars) {
05314 chars = chars === undefined ? ' ' : baseToString(chars);
05315
05316 var charsLength = chars.length;
05317 if (charsLength < 2) {
05318 return charsLength ? baseRepeat(chars, length) : chars;
05319 }
05320 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
05321 return hasUnicode(chars)
05322 ? castSlice(stringToArray(result), 0, length).join('')
05323 : result.slice(0, length);
05324 }
05325
05338 function createPartial(func, bitmask, thisArg, partials) {
05339 var isBind = bitmask & WRAP_BIND_FLAG,
05340 Ctor = createCtor(func);
05341
05342 function wrapper() {
05343 var argsIndex = -1,
05344 argsLength = arguments.length,
05345 leftIndex = -1,
05346 leftLength = partials.length,
05347 args = Array(leftLength + argsLength),
05348 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
05349
05350 while (++leftIndex < leftLength) {
05351 args[leftIndex] = partials[leftIndex];
05352 }
05353 while (argsLength--) {
05354 args[leftIndex++] = arguments[++argsIndex];
05355 }
05356 return apply(fn, isBind ? thisArg : this, args);
05357 }
05358 return wrapper;
05359 }
05360
05368 function createRange(fromRight) {
05369 return function(start, end, step) {
05370 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
05371 end = step = undefined;
05372 }
05373
05374 start = toFinite(start);
05375 if (end === undefined) {
05376 end = start;
05377 start = 0;
05378 } else {
05379 end = toFinite(end);
05380 }
05381 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
05382 return baseRange(start, end, step, fromRight);
05383 };
05384 }
05385
05393 function createRelationalOperation(operator) {
05394 return function(value, other) {
05395 if (!(typeof value == 'string' && typeof other == 'string')) {
05396 value = toNumber(value);
05397 other = toNumber(other);
05398 }
05399 return operator(value, other);
05400 };
05401 }
05402
05420 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
05421 var isCurry = bitmask & WRAP_CURRY_FLAG,
05422 newHolders = isCurry ? holders : undefined,
05423 newHoldersRight = isCurry ? undefined : holders,
05424 newPartials = isCurry ? partials : undefined,
05425 newPartialsRight = isCurry ? undefined : partials;
05426
05427 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
05428 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
05429
05430 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
05431 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
05432 }
05433 var newData = [
05434 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
05435 newHoldersRight, argPos, ary, arity
05436 ];
05437
05438 var result = wrapFunc.apply(undefined, newData);
05439 if (isLaziable(func)) {
05440 setData(result, newData);
05441 }
05442 result.placeholder = placeholder;
05443 return setWrapToString(result, func, bitmask);
05444 }
05445
05453 function createRound(methodName) {
05454 var func = Math[methodName];
05455 return function(number, precision) {
05456 number = toNumber(number);
05457 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
05458 if (precision) {
05459
05460
05461 var pair = (toString(number) + 'e').split('e'),
05462 value = func(pair[0] + 'e' + (+pair[1] + precision));
05463
05464 pair = (toString(value) + 'e').split('e');
05465 return +(pair[0] + 'e' + (+pair[1] - precision));
05466 }
05467 return func(number);
05468 };
05469 }
05470
05478 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
05479 return new Set(values);
05480 };
05481
05489 function createToPairs(keysFunc) {
05490 return function(object) {
05491 var tag = getTag(object);
05492 if (tag == mapTag) {
05493 return mapToArray(object);
05494 }
05495 if (tag == setTag) {
05496 return setToPairs(object);
05497 }
05498 return baseToPairs(object, keysFunc(object));
05499 };
05500 }
05501
05527 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
05528 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
05529 if (!isBindKey && typeof func != 'function') {
05530 throw new TypeError(FUNC_ERROR_TEXT);
05531 }
05532 var length = partials ? partials.length : 0;
05533 if (!length) {
05534 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
05535 partials = holders = undefined;
05536 }
05537 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
05538 arity = arity === undefined ? arity : toInteger(arity);
05539 length -= holders ? holders.length : 0;
05540
05541 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
05542 var partialsRight = partials,
05543 holdersRight = holders;
05544
05545 partials = holders = undefined;
05546 }
05547 var data = isBindKey ? undefined : getData(func);
05548
05549 var newData = [
05550 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
05551 argPos, ary, arity
05552 ];
05553
05554 if (data) {
05555 mergeData(newData, data);
05556 }
05557 func = newData[0];
05558 bitmask = newData[1];
05559 thisArg = newData[2];
05560 partials = newData[3];
05561 holders = newData[4];
05562 arity = newData[9] = newData[9] === undefined
05563 ? (isBindKey ? 0 : func.length)
05564 : nativeMax(newData[9] - length, 0);
05565
05566 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
05567 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
05568 }
05569 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
05570 var result = createBind(func, bitmask, thisArg);
05571 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
05572 result = createCurry(func, bitmask, arity);
05573 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
05574 result = createPartial(func, bitmask, thisArg, partials);
05575 } else {
05576 result = createHybrid.apply(undefined, newData);
05577 }
05578 var setter = data ? baseSetData : setData;
05579 return setWrapToString(setter(result, newData), func, bitmask);
05580 }
05581
05594 function customDefaultsAssignIn(objValue, srcValue, key, object) {
05595 if (objValue === undefined ||
05596 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
05597 return srcValue;
05598 }
05599 return objValue;
05600 }
05601
05616 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
05617 if (isObject(objValue) && isObject(srcValue)) {
05618
05619 stack.set(srcValue, objValue);
05620 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
05621 stack['delete'](srcValue);
05622 }
05623 return objValue;
05624 }
05625
05635 function customOmitClone(value) {
05636 return isPlainObject(value) ? undefined : value;
05637 }
05638
05652 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
05653 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
05654 arrLength = array.length,
05655 othLength = other.length;
05656
05657 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
05658 return false;
05659 }
05660
05661 var stacked = stack.get(array);
05662 if (stacked && stack.get(other)) {
05663 return stacked == other;
05664 }
05665 var index = -1,
05666 result = true,
05667 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
05668
05669 stack.set(array, other);
05670 stack.set(other, array);
05671
05672
05673 while (++index < arrLength) {
05674 var arrValue = array[index],
05675 othValue = other[index];
05676
05677 if (customizer) {
05678 var compared = isPartial
05679 ? customizer(othValue, arrValue, index, other, array, stack)
05680 : customizer(arrValue, othValue, index, array, other, stack);
05681 }
05682 if (compared !== undefined) {
05683 if (compared) {
05684 continue;
05685 }
05686 result = false;
05687 break;
05688 }
05689
05690 if (seen) {
05691 if (!arraySome(other, function(othValue, othIndex) {
05692 if (!cacheHas(seen, othIndex) &&
05693 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
05694 return seen.push(othIndex);
05695 }
05696 })) {
05697 result = false;
05698 break;
05699 }
05700 } else if (!(
05701 arrValue === othValue ||
05702 equalFunc(arrValue, othValue, bitmask, customizer, stack)
05703 )) {
05704 result = false;
05705 break;
05706 }
05707 }
05708 stack['delete'](array);
05709 stack['delete'](other);
05710 return result;
05711 }
05712
05730 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
05731 switch (tag) {
05732 case dataViewTag:
05733 if ((object.byteLength != other.byteLength) ||
05734 (object.byteOffset != other.byteOffset)) {
05735 return false;
05736 }
05737 object = object.buffer;
05738 other = other.buffer;
05739
05740 case arrayBufferTag:
05741 if ((object.byteLength != other.byteLength) ||
05742 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
05743 return false;
05744 }
05745 return true;
05746
05747 case boolTag:
05748 case dateTag:
05749 case numberTag:
05750
05751
05752 return eq(+object, +other);
05753
05754 case errorTag:
05755 return object.name == other.name && object.message == other.message;
05756
05757 case regexpTag:
05758 case stringTag:
05759
05760
05761
05762 return object == (other + '');
05763
05764 case mapTag:
05765 var convert = mapToArray;
05766
05767 case setTag:
05768 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
05769 convert || (convert = setToArray);
05770
05771 if (object.size != other.size && !isPartial) {
05772 return false;
05773 }
05774
05775 var stacked = stack.get(object);
05776 if (stacked) {
05777 return stacked == other;
05778 }
05779 bitmask |= COMPARE_UNORDERED_FLAG;
05780
05781
05782 stack.set(object, other);
05783 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
05784 stack['delete'](object);
05785 return result;
05786
05787 case symbolTag:
05788 if (symbolValueOf) {
05789 return symbolValueOf.call(object) == symbolValueOf.call(other);
05790 }
05791 }
05792 return false;
05793 }
05794
05808 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
05809 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
05810 objProps = getAllKeys(object),
05811 objLength = objProps.length,
05812 othProps = getAllKeys(other),
05813 othLength = othProps.length;
05814
05815 if (objLength != othLength && !isPartial) {
05816 return false;
05817 }
05818 var index = objLength;
05819 while (index--) {
05820 var key = objProps[index];
05821 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
05822 return false;
05823 }
05824 }
05825
05826 var stacked = stack.get(object);
05827 if (stacked && stack.get(other)) {
05828 return stacked == other;
05829 }
05830 var result = true;
05831 stack.set(object, other);
05832 stack.set(other, object);
05833
05834 var skipCtor = isPartial;
05835 while (++index < objLength) {
05836 key = objProps[index];
05837 var objValue = object[key],
05838 othValue = other[key];
05839
05840 if (customizer) {
05841 var compared = isPartial
05842 ? customizer(othValue, objValue, key, other, object, stack)
05843 : customizer(objValue, othValue, key, object, other, stack);
05844 }
05845
05846 if (!(compared === undefined
05847 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
05848 : compared
05849 )) {
05850 result = false;
05851 break;
05852 }
05853 skipCtor || (skipCtor = key == 'constructor');
05854 }
05855 if (result && !skipCtor) {
05856 var objCtor = object.constructor,
05857 othCtor = other.constructor;
05858
05859
05860 if (objCtor != othCtor &&
05861 ('constructor' in object && 'constructor' in other) &&
05862 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
05863 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
05864 result = false;
05865 }
05866 }
05867 stack['delete'](object);
05868 stack['delete'](other);
05869 return result;
05870 }
05871
05879 function flatRest(func) {
05880 return setToString(overRest(func, undefined, flatten), func + '');
05881 }
05882
05890 function getAllKeys(object) {
05891 return baseGetAllKeys(object, keys, getSymbols);
05892 }
05893
05902 function getAllKeysIn(object) {
05903 return baseGetAllKeys(object, keysIn, getSymbolsIn);
05904 }
05905
05913 var getData = !metaMap ? noop : function(func) {
05914 return metaMap.get(func);
05915 };
05916
05924 function getFuncName(func) {
05925 var result = (func.name + ''),
05926 array = realNames[result],
05927 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
05928
05929 while (length--) {
05930 var data = array[length],
05931 otherFunc = data.func;
05932 if (otherFunc == null || otherFunc == func) {
05933 return data.name;
05934 }
05935 }
05936 return result;
05937 }
05938
05946 function getHolder(func) {
05947 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
05948 return object.placeholder;
05949 }
05950
05962 function getIteratee() {
05963 var result = lodash.iteratee || iteratee;
05964 result = result === iteratee ? baseIteratee : result;
05965 return arguments.length ? result(arguments[0], arguments[1]) : result;
05966 }
05967
05976 function getMapData(map, key) {
05977 var data = map.__data__;
05978 return isKeyable(key)
05979 ? data[typeof key == 'string' ? 'string' : 'hash']
05980 : data.map;
05981 }
05982
05990 function getMatchData(object) {
05991 var result = keys(object),
05992 length = result.length;
05993
05994 while (length--) {
05995 var key = result[length],
05996 value = object[key];
05997
05998 result[length] = [key, value, isStrictComparable(value)];
05999 }
06000 return result;
06001 }
06002
06011 function getNative(object, key) {
06012 var value = getValue(object, key);
06013 return baseIsNative(value) ? value : undefined;
06014 }
06015
06023 function getRawTag(value) {
06024 var isOwn = hasOwnProperty.call(value, symToStringTag),
06025 tag = value[symToStringTag];
06026
06027 try {
06028 value[symToStringTag] = undefined;
06029 var unmasked = true;
06030 } catch (e) {}
06031
06032 var result = nativeObjectToString.call(value);
06033 if (unmasked) {
06034 if (isOwn) {
06035 value[symToStringTag] = tag;
06036 } else {
06037 delete value[symToStringTag];
06038 }
06039 }
06040 return result;
06041 }
06042
06050 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
06051 if (object == null) {
06052 return [];
06053 }
06054 object = Object(object);
06055 return arrayFilter(nativeGetSymbols(object), function(symbol) {
06056 return propertyIsEnumerable.call(object, symbol);
06057 });
06058 };
06059
06067 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
06068 var result = [];
06069 while (object) {
06070 arrayPush(result, getSymbols(object));
06071 object = getPrototype(object);
06072 }
06073 return result;
06074 };
06075
06083 var getTag = baseGetTag;
06084
06085
06086 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
06087 (Map && getTag(new Map) != mapTag) ||
06088 (Promise && getTag(Promise.resolve()) != promiseTag) ||
06089 (Set && getTag(new Set) != setTag) ||
06090 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
06091 getTag = function(value) {
06092 var result = baseGetTag(value),
06093 Ctor = result == objectTag ? value.constructor : undefined,
06094 ctorString = Ctor ? toSource(Ctor) : '';
06095
06096 if (ctorString) {
06097 switch (ctorString) {
06098 case dataViewCtorString: return dataViewTag;
06099 case mapCtorString: return mapTag;
06100 case promiseCtorString: return promiseTag;
06101 case setCtorString: return setTag;
06102 case weakMapCtorString: return weakMapTag;
06103 }
06104 }
06105 return result;
06106 };
06107 }
06108
06119 function getView(start, end, transforms) {
06120 var index = -1,
06121 length = transforms.length;
06122
06123 while (++index < length) {
06124 var data = transforms[index],
06125 size = data.size;
06126
06127 switch (data.type) {
06128 case 'drop': start += size; break;
06129 case 'dropRight': end -= size; break;
06130 case 'take': end = nativeMin(end, start + size); break;
06131 case 'takeRight': start = nativeMax(start, end - size); break;
06132 }
06133 }
06134 return { 'start': start, 'end': end };
06135 }
06136
06144 function getWrapDetails(source) {
06145 var match = source.match(reWrapDetails);
06146 return match ? match[1].split(reSplitDetails) : [];
06147 }
06148
06158 function hasPath(object, path, hasFunc) {
06159 path = castPath(path, object);
06160
06161 var index = -1,
06162 length = path.length,
06163 result = false;
06164
06165 while (++index < length) {
06166 var key = toKey(path[index]);
06167 if (!(result = object != null && hasFunc(object, key))) {
06168 break;
06169 }
06170 object = object[key];
06171 }
06172 if (result || ++index != length) {
06173 return result;
06174 }
06175 length = object == null ? 0 : object.length;
06176 return !!length && isLength(length) && isIndex(key, length) &&
06177 (isArray(object) || isArguments(object));
06178 }
06179
06187 function initCloneArray(array) {
06188 var length = array.length,
06189 result = array.constructor(length);
06190
06191
06192 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
06193 result.index = array.index;
06194 result.input = array.input;
06195 }
06196 return result;
06197 }
06198
06206 function initCloneObject(object) {
06207 return (typeof object.constructor == 'function' && !isPrototype(object))
06208 ? baseCreate(getPrototype(object))
06209 : {};
06210 }
06211
06225 function initCloneByTag(object, tag, cloneFunc, isDeep) {
06226 var Ctor = object.constructor;
06227 switch (tag) {
06228 case arrayBufferTag:
06229 return cloneArrayBuffer(object);
06230
06231 case boolTag:
06232 case dateTag:
06233 return new Ctor(+object);
06234
06235 case dataViewTag:
06236 return cloneDataView(object, isDeep);
06237
06238 case float32Tag: case float64Tag:
06239 case int8Tag: case int16Tag: case int32Tag:
06240 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
06241 return cloneTypedArray(object, isDeep);
06242
06243 case mapTag:
06244 return cloneMap(object, isDeep, cloneFunc);
06245
06246 case numberTag:
06247 case stringTag:
06248 return new Ctor(object);
06249
06250 case regexpTag:
06251 return cloneRegExp(object);
06252
06253 case setTag:
06254 return cloneSet(object, isDeep, cloneFunc);
06255
06256 case symbolTag:
06257 return cloneSymbol(object);
06258 }
06259 }
06260
06269 function insertWrapDetails(source, details) {
06270 var length = details.length;
06271 if (!length) {
06272 return source;
06273 }
06274 var lastIndex = length - 1;
06275 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
06276 details = details.join(length > 2 ? ', ' : ' ');
06277 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
06278 }
06279
06287 function isFlattenable(value) {
06288 return isArray(value) || isArguments(value) ||
06289 !!(spreadableSymbol && value && value[spreadableSymbol]);
06290 }
06291
06300 function isIndex(value, length) {
06301 length = length == null ? MAX_SAFE_INTEGER : length;
06302 return !!length &&
06303 (typeof value == 'number' || reIsUint.test(value)) &&
06304 (value > -1 && value % 1 == 0 && value < length);
06305 }
06306
06317 function isIterateeCall(value, index, object) {
06318 if (!isObject(object)) {
06319 return false;
06320 }
06321 var type = typeof index;
06322 if (type == 'number'
06323 ? (isArrayLike(object) && isIndex(index, object.length))
06324 : (type == 'string' && index in object)
06325 ) {
06326 return eq(object[index], value);
06327 }
06328 return false;
06329 }
06330
06339 function isKey(value, object) {
06340 if (isArray(value)) {
06341 return false;
06342 }
06343 var type = typeof value;
06344 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
06345 value == null || isSymbol(value)) {
06346 return true;
06347 }
06348 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
06349 (object != null && value in Object(object));
06350 }
06351
06359 function isKeyable(value) {
06360 var type = typeof value;
06361 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
06362 ? (value !== '__proto__')
06363 : (value === null);
06364 }
06365
06374 function isLaziable(func) {
06375 var funcName = getFuncName(func),
06376 other = lodash[funcName];
06377
06378 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
06379 return false;
06380 }
06381 if (func === other) {
06382 return true;
06383 }
06384 var data = getData(other);
06385 return !!data && func === data[0];
06386 }
06387
06395 function isMasked(func) {
06396 return !!maskSrcKey && (maskSrcKey in func);
06397 }
06398
06406 var isMaskable = coreJsData ? isFunction : stubFalse;
06407
06415 function isPrototype(value) {
06416 var Ctor = value && value.constructor,
06417 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
06418
06419 return value === proto;
06420 }
06421
06430 function isStrictComparable(value) {
06431 return value === value && !isObject(value);
06432 }
06433
06443 function matchesStrictComparable(key, srcValue) {
06444 return function(object) {
06445 if (object == null) {
06446 return false;
06447 }
06448 return object[key] === srcValue &&
06449 (srcValue !== undefined || (key in Object(object)));
06450 };
06451 }
06452
06461 function memoizeCapped(func) {
06462 var result = memoize(func, function(key) {
06463 if (cache.size === MAX_MEMOIZE_SIZE) {
06464 cache.clear();
06465 }
06466 return key;
06467 });
06468
06469 var cache = result.cache;
06470 return result;
06471 }
06472
06489 function mergeData(data, source) {
06490 var bitmask = data[1],
06491 srcBitmask = source[1],
06492 newBitmask = bitmask | srcBitmask,
06493 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
06494
06495 var isCombo =
06496 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
06497 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
06498 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
06499
06500
06501 if (!(isCommon || isCombo)) {
06502 return data;
06503 }
06504
06505 if (srcBitmask & WRAP_BIND_FLAG) {
06506 data[2] = source[2];
06507
06508 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
06509 }
06510
06511 var value = source[3];
06512 if (value) {
06513 var partials = data[3];
06514 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
06515 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
06516 }
06517
06518 value = source[5];
06519 if (value) {
06520 partials = data[5];
06521 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
06522 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
06523 }
06524
06525 value = source[7];
06526 if (value) {
06527 data[7] = value;
06528 }
06529
06530 if (srcBitmask & WRAP_ARY_FLAG) {
06531 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
06532 }
06533
06534 if (data[9] == null) {
06535 data[9] = source[9];
06536 }
06537
06538 data[0] = source[0];
06539 data[1] = newBitmask;
06540
06541 return data;
06542 }
06543
06553 function nativeKeysIn(object) {
06554 var result = [];
06555 if (object != null) {
06556 for (var key in Object(object)) {
06557 result.push(key);
06558 }
06559 }
06560 return result;
06561 }
06562
06570 function objectToString(value) {
06571 return nativeObjectToString.call(value);
06572 }
06573
06583 function overRest(func, start, transform) {
06584 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
06585 return function() {
06586 var args = arguments,
06587 index = -1,
06588 length = nativeMax(args.length - start, 0),
06589 array = Array(length);
06590
06591 while (++index < length) {
06592 array[index] = args[start + index];
06593 }
06594 index = -1;
06595 var otherArgs = Array(start + 1);
06596 while (++index < start) {
06597 otherArgs[index] = args[index];
06598 }
06599 otherArgs[start] = transform(array);
06600 return apply(func, this, otherArgs);
06601 };
06602 }
06603
06612 function parent(object, path) {
06613 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
06614 }
06615
06626 function reorder(array, indexes) {
06627 var arrLength = array.length,
06628 length = nativeMin(indexes.length, arrLength),
06629 oldArray = copyArray(array);
06630
06631 while (length--) {
06632 var index = indexes[length];
06633 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
06634 }
06635 return array;
06636 }
06637
06652 var setData = shortOut(baseSetData);
06653
06662 var setTimeout = ctxSetTimeout || function(func, wait) {
06663 return root.setTimeout(func, wait);
06664 };
06665
06674 var setToString = shortOut(baseSetToString);
06675
06686 function setWrapToString(wrapper, reference, bitmask) {
06687 var source = (reference + '');
06688 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
06689 }
06690
06700 function shortOut(func) {
06701 var count = 0,
06702 lastCalled = 0;
06703
06704 return function() {
06705 var stamp = nativeNow(),
06706 remaining = HOT_SPAN - (stamp - lastCalled);
06707
06708 lastCalled = stamp;
06709 if (remaining > 0) {
06710 if (++count >= HOT_COUNT) {
06711 return arguments[0];
06712 }
06713 } else {
06714 count = 0;
06715 }
06716 return func.apply(undefined, arguments);
06717 };
06718 }
06719
06728 function shuffleSelf(array, size) {
06729 var index = -1,
06730 length = array.length,
06731 lastIndex = length - 1;
06732
06733 size = size === undefined ? length : size;
06734 while (++index < size) {
06735 var rand = baseRandom(index, lastIndex),
06736 value = array[rand];
06737
06738 array[rand] = array[index];
06739 array[index] = value;
06740 }
06741 array.length = size;
06742 return array;
06743 }
06744
06752 var stringToPath = memoizeCapped(function(string) {
06753 var result = [];
06754 if (reLeadingDot.test(string)) {
06755 result.push('');
06756 }
06757 string.replace(rePropName, function(match, number, quote, string) {
06758 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
06759 });
06760 return result;
06761 });
06762
06770 function toKey(value) {
06771 if (typeof value == 'string' || isSymbol(value)) {
06772 return value;
06773 }
06774 var result = (value + '');
06775 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
06776 }
06777
06785 function toSource(func) {
06786 if (func != null) {
06787 try {
06788 return funcToString.call(func);
06789 } catch (e) {}
06790 try {
06791 return (func + '');
06792 } catch (e) {}
06793 }
06794 return '';
06795 }
06796
06805 function updateWrapDetails(details, bitmask) {
06806 arrayEach(wrapFlags, function(pair) {
06807 var value = '_.' + pair[0];
06808 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
06809 details.push(value);
06810 }
06811 });
06812 return details.sort();
06813 }
06814
06822 function wrapperClone(wrapper) {
06823 if (wrapper instanceof LazyWrapper) {
06824 return wrapper.clone();
06825 }
06826 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
06827 result.__actions__ = copyArray(wrapper.__actions__);
06828 result.__index__ = wrapper.__index__;
06829 result.__values__ = wrapper.__values__;
06830 return result;
06831 }
06832
06833
06834
06856 function chunk(array, size, guard) {
06857 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
06858 size = 1;
06859 } else {
06860 size = nativeMax(toInteger(size), 0);
06861 }
06862 var length = array == null ? 0 : array.length;
06863 if (!length || size < 1) {
06864 return [];
06865 }
06866 var index = 0,
06867 resIndex = 0,
06868 result = Array(nativeCeil(length / size));
06869
06870 while (index < length) {
06871 result[resIndex++] = baseSlice(array, index, (index += size));
06872 }
06873 return result;
06874 }
06875
06891 function compact(array) {
06892 var index = -1,
06893 length = array == null ? 0 : array.length,
06894 resIndex = 0,
06895 result = [];
06896
06897 while (++index < length) {
06898 var value = array[index];
06899 if (value) {
06900 result[resIndex++] = value;
06901 }
06902 }
06903 return result;
06904 }
06905
06928 function concat() {
06929 var length = arguments.length;
06930 if (!length) {
06931 return [];
06932 }
06933 var args = Array(length - 1),
06934 array = arguments[0],
06935 index = length;
06936
06937 while (index--) {
06938 args[index - 1] = arguments[index];
06939 }
06940 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
06941 }
06942
06964 var difference = baseRest(function(array, values) {
06965 return isArrayLikeObject(array)
06966 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
06967 : [];
06968 });
06969
06996 var differenceBy = baseRest(function(array, values) {
06997 var iteratee = last(values);
06998 if (isArrayLikeObject(iteratee)) {
06999 iteratee = undefined;
07000 }
07001 return isArrayLikeObject(array)
07002 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
07003 : [];
07004 });
07005
07029 var differenceWith = baseRest(function(array, values) {
07030 var comparator = last(values);
07031 if (isArrayLikeObject(comparator)) {
07032 comparator = undefined;
07033 }
07034 return isArrayLikeObject(array)
07035 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
07036 : [];
07037 });
07038
07064 function drop(array, n, guard) {
07065 var length = array == null ? 0 : array.length;
07066 if (!length) {
07067 return [];
07068 }
07069 n = (guard || n === undefined) ? 1 : toInteger(n);
07070 return baseSlice(array, n < 0 ? 0 : n, length);
07071 }
07072
07098 function dropRight(array, n, guard) {
07099 var length = array == null ? 0 : array.length;
07100 if (!length) {
07101 return [];
07102 }
07103 n = (guard || n === undefined) ? 1 : toInteger(n);
07104 n = length - n;
07105 return baseSlice(array, 0, n < 0 ? 0 : n);
07106 }
07107
07143 function dropRightWhile(array, predicate) {
07144 return (array && array.length)
07145 ? baseWhile(array, getIteratee(predicate, 3), true, true)
07146 : [];
07147 }
07148
07184 function dropWhile(array, predicate) {
07185 return (array && array.length)
07186 ? baseWhile(array, getIteratee(predicate, 3), true)
07187 : [];
07188 }
07189
07219 function fill(array, value, start, end) {
07220 var length = array == null ? 0 : array.length;
07221 if (!length) {
07222 return [];
07223 }
07224 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
07225 start = 0;
07226 end = length;
07227 }
07228 return baseFill(array, value, start, end);
07229 }
07230
07266 function findIndex(array, predicate, fromIndex) {
07267 var length = array == null ? 0 : array.length;
07268 if (!length) {
07269 return -1;
07270 }
07271 var index = fromIndex == null ? 0 : toInteger(fromIndex);
07272 if (index < 0) {
07273 index = nativeMax(length + index, 0);
07274 }
07275 return baseFindIndex(array, getIteratee(predicate, 3), index);
07276 }
07277
07313 function findLastIndex(array, predicate, fromIndex) {
07314 var length = array == null ? 0 : array.length;
07315 if (!length) {
07316 return -1;
07317 }
07318 var index = length - 1;
07319 if (fromIndex !== undefined) {
07320 index = toInteger(fromIndex);
07321 index = fromIndex < 0
07322 ? nativeMax(length + index, 0)
07323 : nativeMin(index, length - 1);
07324 }
07325 return baseFindIndex(array, getIteratee(predicate, 3), index, true);
07326 }
07327
07342 function flatten(array) {
07343 var length = array == null ? 0 : array.length;
07344 return length ? baseFlatten(array, 1) : [];
07345 }
07346
07361 function flattenDeep(array) {
07362 var length = array == null ? 0 : array.length;
07363 return length ? baseFlatten(array, INFINITY) : [];
07364 }
07365
07386 function flattenDepth(array, depth) {
07387 var length = array == null ? 0 : array.length;
07388 if (!length) {
07389 return [];
07390 }
07391 depth = depth === undefined ? 1 : toInteger(depth);
07392 return baseFlatten(array, depth);
07393 }
07394
07410 function fromPairs(pairs) {
07411 var index = -1,
07412 length = pairs == null ? 0 : pairs.length,
07413 result = {};
07414
07415 while (++index < length) {
07416 var pair = pairs[index];
07417 result[pair[0]] = pair[1];
07418 }
07419 return result;
07420 }
07421
07440 function head(array) {
07441 return (array && array.length) ? array[0] : undefined;
07442 }
07443
07467 function indexOf(array, value, fromIndex) {
07468 var length = array == null ? 0 : array.length;
07469 if (!length) {
07470 return -1;
07471 }
07472 var index = fromIndex == null ? 0 : toInteger(fromIndex);
07473 if (index < 0) {
07474 index = nativeMax(length + index, 0);
07475 }
07476 return baseIndexOf(array, value, index);
07477 }
07478
07493 function initial(array) {
07494 var length = array == null ? 0 : array.length;
07495 return length ? baseSlice(array, 0, -1) : [];
07496 }
07497
07515 var intersection = baseRest(function(arrays) {
07516 var mapped = arrayMap(arrays, castArrayLikeObject);
07517 return (mapped.length && mapped[0] === arrays[0])
07518 ? baseIntersection(mapped)
07519 : [];
07520 });
07521
07545 var intersectionBy = baseRest(function(arrays) {
07546 var iteratee = last(arrays),
07547 mapped = arrayMap(arrays, castArrayLikeObject);
07548
07549 if (iteratee === last(mapped)) {
07550 iteratee = undefined;
07551 } else {
07552 mapped.pop();
07553 }
07554 return (mapped.length && mapped[0] === arrays[0])
07555 ? baseIntersection(mapped, getIteratee(iteratee, 2))
07556 : [];
07557 });
07558
07580 var intersectionWith = baseRest(function(arrays) {
07581 var comparator = last(arrays),
07582 mapped = arrayMap(arrays, castArrayLikeObject);
07583
07584 comparator = typeof comparator == 'function' ? comparator : undefined;
07585 if (comparator) {
07586 mapped.pop();
07587 }
07588 return (mapped.length && mapped[0] === arrays[0])
07589 ? baseIntersection(mapped, undefined, comparator)
07590 : [];
07591 });
07592
07608 function join(array, separator) {
07609 return array == null ? '' : nativeJoin.call(array, separator);
07610 }
07611
07626 function last(array) {
07627 var length = array == null ? 0 : array.length;
07628 return length ? array[length - 1] : undefined;
07629 }
07630
07652 function lastIndexOf(array, value, fromIndex) {
07653 var length = array == null ? 0 : array.length;
07654 if (!length) {
07655 return -1;
07656 }
07657 var index = length;
07658 if (fromIndex !== undefined) {
07659 index = toInteger(fromIndex);
07660 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
07661 }
07662 return value === value
07663 ? strictLastIndexOf(array, value, index)
07664 : baseFindIndex(array, baseIsNaN, index, true);
07665 }
07666
07688 function nth(array, n) {
07689 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
07690 }
07691
07715 var pull = baseRest(pullAll);
07716
07737 function pullAll(array, values) {
07738 return (array && array.length && values && values.length)
07739 ? basePullAll(array, values)
07740 : array;
07741 }
07742
07766 function pullAllBy(array, values, iteratee) {
07767 return (array && array.length && values && values.length)
07768 ? basePullAll(array, values, getIteratee(iteratee, 2))
07769 : array;
07770 }
07771
07795 function pullAllWith(array, values, comparator) {
07796 return (array && array.length && values && values.length)
07797 ? basePullAll(array, values, undefined, comparator)
07798 : array;
07799 }
07800
07825 var pullAt = flatRest(function(array, indexes) {
07826 var length = array == null ? 0 : array.length,
07827 result = baseAt(array, indexes);
07828
07829 basePullAt(array, arrayMap(indexes, function(index) {
07830 return isIndex(index, length) ? +index : index;
07831 }).sort(compareAscending));
07832
07833 return result;
07834 });
07835
07864 function remove(array, predicate) {
07865 var result = [];
07866 if (!(array && array.length)) {
07867 return result;
07868 }
07869 var index = -1,
07870 indexes = [],
07871 length = array.length;
07872
07873 predicate = getIteratee(predicate, 3);
07874 while (++index < length) {
07875 var value = array[index];
07876 if (predicate(value, index, array)) {
07877 result.push(value);
07878 indexes.push(index);
07879 }
07880 }
07881 basePullAt(array, indexes);
07882 return result;
07883 }
07884
07908 function reverse(array) {
07909 return array == null ? array : nativeReverse.call(array);
07910 }
07911
07928 function slice(array, start, end) {
07929 var length = array == null ? 0 : array.length;
07930 if (!length) {
07931 return [];
07932 }
07933 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
07934 start = 0;
07935 end = length;
07936 }
07937 else {
07938 start = start == null ? 0 : toInteger(start);
07939 end = end === undefined ? length : toInteger(end);
07940 }
07941 return baseSlice(array, start, end);
07942 }
07943
07961 function sortedIndex(array, value) {
07962 return baseSortedIndex(array, value);
07963 }
07964
07990 function sortedIndexBy(array, value, iteratee) {
07991 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
07992 }
07993
08010 function sortedIndexOf(array, value) {
08011 var length = array == null ? 0 : array.length;
08012 if (length) {
08013 var index = baseSortedIndex(array, value);
08014 if (index < length && eq(array[index], value)) {
08015 return index;
08016 }
08017 }
08018 return -1;
08019 }
08020
08039 function sortedLastIndex(array, value) {
08040 return baseSortedIndex(array, value, true);
08041 }
08042
08068 function sortedLastIndexBy(array, value, iteratee) {
08069 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
08070 }
08071
08088 function sortedLastIndexOf(array, value) {
08089 var length = array == null ? 0 : array.length;
08090 if (length) {
08091 var index = baseSortedIndex(array, value, true) - 1;
08092 if (eq(array[index], value)) {
08093 return index;
08094 }
08095 }
08096 return -1;
08097 }
08098
08114 function sortedUniq(array) {
08115 return (array && array.length)
08116 ? baseSortedUniq(array)
08117 : [];
08118 }
08119
08136 function sortedUniqBy(array, iteratee) {
08137 return (array && array.length)
08138 ? baseSortedUniq(array, getIteratee(iteratee, 2))
08139 : [];
08140 }
08141
08156 function tail(array) {
08157 var length = array == null ? 0 : array.length;
08158 return length ? baseSlice(array, 1, length) : [];
08159 }
08160
08186 function take(array, n, guard) {
08187 if (!(array && array.length)) {
08188 return [];
08189 }
08190 n = (guard || n === undefined) ? 1 : toInteger(n);
08191 return baseSlice(array, 0, n < 0 ? 0 : n);
08192 }
08193
08219 function takeRight(array, n, guard) {
08220 var length = array == null ? 0 : array.length;
08221 if (!length) {
08222 return [];
08223 }
08224 n = (guard || n === undefined) ? 1 : toInteger(n);
08225 n = length - n;
08226 return baseSlice(array, n < 0 ? 0 : n, length);
08227 }
08228
08264 function takeRightWhile(array, predicate) {
08265 return (array && array.length)
08266 ? baseWhile(array, getIteratee(predicate, 3), false, true)
08267 : [];
08268 }
08269
08305 function takeWhile(array, predicate) {
08306 return (array && array.length)
08307 ? baseWhile(array, getIteratee(predicate, 3))
08308 : [];
08309 }
08310
08327 var union = baseRest(function(arrays) {
08328 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
08329 });
08330
08354 var unionBy = baseRest(function(arrays) {
08355 var iteratee = last(arrays);
08356 if (isArrayLikeObject(iteratee)) {
08357 iteratee = undefined;
08358 }
08359 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
08360 });
08361
08383 var unionWith = baseRest(function(arrays) {
08384 var comparator = last(arrays);
08385 comparator = typeof comparator == 'function' ? comparator : undefined;
08386 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
08387 });
08388
08407 function uniq(array) {
08408 return (array && array.length) ? baseUniq(array) : [];
08409 }
08410
08434 function uniqBy(array, iteratee) {
08435 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
08436 }
08437
08458 function uniqWith(array, comparator) {
08459 comparator = typeof comparator == 'function' ? comparator : undefined;
08460 return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
08461 }
08462
08482 function unzip(array) {
08483 if (!(array && array.length)) {
08484 return [];
08485 }
08486 var length = 0;
08487 array = arrayFilter(array, function(group) {
08488 if (isArrayLikeObject(group)) {
08489 length = nativeMax(group.length, length);
08490 return true;
08491 }
08492 });
08493 return baseTimes(length, function(index) {
08494 return arrayMap(array, baseProperty(index));
08495 });
08496 }
08497
08519 function unzipWith(array, iteratee) {
08520 if (!(array && array.length)) {
08521 return [];
08522 }
08523 var result = unzip(array);
08524 if (iteratee == null) {
08525 return result;
08526 }
08527 return arrayMap(result, function(group) {
08528 return apply(iteratee, undefined, group);
08529 });
08530 }
08531
08552 var without = baseRest(function(array, values) {
08553 return isArrayLikeObject(array)
08554 ? baseDifference(array, values)
08555 : [];
08556 });
08557
08576 var xor = baseRest(function(arrays) {
08577 return baseXor(arrayFilter(arrays, isArrayLikeObject));
08578 });
08579
08603 var xorBy = baseRest(function(arrays) {
08604 var iteratee = last(arrays);
08605 if (isArrayLikeObject(iteratee)) {
08606 iteratee = undefined;
08607 }
08608 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
08609 });
08610
08632 var xorWith = baseRest(function(arrays) {
08633 var comparator = last(arrays);
08634 comparator = typeof comparator == 'function' ? comparator : undefined;
08635 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
08636 });
08637
08654 var zip = baseRest(unzip);
08655
08672 function zipObject(props, values) {
08673 return baseZipObject(props || [], values || [], assignValue);
08674 }
08675
08691 function zipObjectDeep(props, values) {
08692 return baseZipObject(props || [], values || [], baseSet);
08693 }
08694
08715 var zipWith = baseRest(function(arrays) {
08716 var length = arrays.length,
08717 iteratee = length > 1 ? arrays[length - 1] : undefined;
08718
08719 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
08720 return unzipWith(arrays, iteratee);
08721 });
08722
08723
08724
08754 function chain(value) {
08755 var result = lodash(value);
08756 result.__chain__ = true;
08757 return result;
08758 }
08759
08783 function tap(value, interceptor) {
08784 interceptor(value);
08785 return value;
08786 }
08787
08811 function thru(value, interceptor) {
08812 return interceptor(value);
08813 }
08814
08831 var wrapperAt = flatRest(function(paths) {
08832 var length = paths.length,
08833 start = length ? paths[0] : 0,
08834 value = this.__wrapped__,
08835 interceptor = function(object) { return baseAt(object, paths); };
08836
08837 if (length > 1 || this.__actions__.length ||
08838 !(value instanceof LazyWrapper) || !isIndex(start)) {
08839 return this.thru(interceptor);
08840 }
08841 value = value.slice(start, +start + (length ? 1 : 0));
08842 value.__actions__.push({
08843 'func': thru,
08844 'args': [interceptor],
08845 'thisArg': undefined
08846 });
08847 return new LodashWrapper(value, this.__chain__).thru(function(array) {
08848 if (length && !array.length) {
08849 array.push(undefined);
08850 }
08851 return array;
08852 });
08853 });
08854
08882 function wrapperChain() {
08883 return chain(this);
08884 }
08885
08912 function wrapperCommit() {
08913 return new LodashWrapper(this.value(), this.__chain__);
08914 }
08915
08938 function wrapperNext() {
08939 if (this.__values__ === undefined) {
08940 this.__values__ = toArray(this.value());
08941 }
08942 var done = this.__index__ >= this.__values__.length,
08943 value = done ? undefined : this.__values__[this.__index__++];
08944
08945 return { 'done': done, 'value': value };
08946 }
08947
08966 function wrapperToIterator() {
08967 return this;
08968 }
08969
08994 function wrapperPlant(value) {
08995 var result,
08996 parent = this;
08997
08998 while (parent instanceof baseLodash) {
08999 var clone = wrapperClone(parent);
09000 clone.__index__ = 0;
09001 clone.__values__ = undefined;
09002 if (result) {
09003 previous.__wrapped__ = clone;
09004 } else {
09005 result = clone;
09006 }
09007 var previous = clone;
09008 parent = parent.__wrapped__;
09009 }
09010 previous.__wrapped__ = value;
09011 return result;
09012 }
09013
09034 function wrapperReverse() {
09035 var value = this.__wrapped__;
09036 if (value instanceof LazyWrapper) {
09037 var wrapped = value;
09038 if (this.__actions__.length) {
09039 wrapped = new LazyWrapper(this);
09040 }
09041 wrapped = wrapped.reverse();
09042 wrapped.__actions__.push({
09043 'func': thru,
09044 'args': [reverse],
09045 'thisArg': undefined
09046 });
09047 return new LodashWrapper(wrapped, this.__chain__);
09048 }
09049 return this.thru(reverse);
09050 }
09051
09066 function wrapperValue() {
09067 return baseWrapperValue(this.__wrapped__, this.__actions__);
09068 }
09069
09070
09071
09094 var countBy = createAggregator(function(result, value, key) {
09095 if (hasOwnProperty.call(result, key)) {
09096 ++result[key];
09097 } else {
09098 baseAssignValue(result, key, 1);
09099 }
09100 });
09101
09143 function every(collection, predicate, guard) {
09144 var func = isArray(collection) ? arrayEvery : baseEvery;
09145 if (guard && isIterateeCall(collection, predicate, guard)) {
09146 predicate = undefined;
09147 }
09148 return func(collection, getIteratee(predicate, 3));
09149 }
09150
09188 function filter(collection, predicate) {
09189 var func = isArray(collection) ? arrayFilter : baseFilter;
09190 return func(collection, getIteratee(predicate, 3));
09191 }
09192
09229 var find = createFind(findIndex);
09230
09250 var findLast = createFind(findLastIndex);
09251
09273 function flatMap(collection, iteratee) {
09274 return baseFlatten(map(collection, iteratee), 1);
09275 }
09276
09297 function flatMapDeep(collection, iteratee) {
09298 return baseFlatten(map(collection, iteratee), INFINITY);
09299 }
09300
09322 function flatMapDepth(collection, iteratee, depth) {
09323 depth = depth === undefined ? 1 : toInteger(depth);
09324 return baseFlatten(map(collection, iteratee), depth);
09325 }
09326
09357 function forEach(collection, iteratee) {
09358 var func = isArray(collection) ? arrayEach : baseEach;
09359 return func(collection, getIteratee(iteratee, 3));
09360 }
09361
09382 function forEachRight(collection, iteratee) {
09383 var func = isArray(collection) ? arrayEachRight : baseEachRight;
09384 return func(collection, getIteratee(iteratee, 3));
09385 }
09386
09410 var groupBy = createAggregator(function(result, value, key) {
09411 if (hasOwnProperty.call(result, key)) {
09412 result[key].push(value);
09413 } else {
09414 baseAssignValue(result, key, [value]);
09415 }
09416 });
09417
09448 function includes(collection, value, fromIndex, guard) {
09449 collection = isArrayLike(collection) ? collection : values(collection);
09450 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
09451
09452 var length = collection.length;
09453 if (fromIndex < 0) {
09454 fromIndex = nativeMax(length + fromIndex, 0);
09455 }
09456 return isString(collection)
09457 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
09458 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
09459 }
09460
09484 var invokeMap = baseRest(function(collection, path, args) {
09485 var index = -1,
09486 isFunc = typeof path == 'function',
09487 result = isArrayLike(collection) ? Array(collection.length) : [];
09488
09489 baseEach(collection, function(value) {
09490 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
09491 });
09492 return result;
09493 });
09494
09523 var keyBy = createAggregator(function(result, value, key) {
09524 baseAssignValue(result, key, value);
09525 });
09526
09569 function map(collection, iteratee) {
09570 var func = isArray(collection) ? arrayMap : baseMap;
09571 return func(collection, getIteratee(iteratee, 3));
09572 }
09573
09603 function orderBy(collection, iteratees, orders, guard) {
09604 if (collection == null) {
09605 return [];
09606 }
09607 if (!isArray(iteratees)) {
09608 iteratees = iteratees == null ? [] : [iteratees];
09609 }
09610 orders = guard ? undefined : orders;
09611 if (!isArray(orders)) {
09612 orders = orders == null ? [] : [orders];
09613 }
09614 return baseOrderBy(collection, iteratees, orders);
09615 }
09616
09653 var partition = createAggregator(function(result, value, key) {
09654 result[key ? 0 : 1].push(value);
09655 }, function() { return [[], []]; });
09656
09694 function reduce(collection, iteratee, accumulator) {
09695 var func = isArray(collection) ? arrayReduce : baseReduce,
09696 initAccum = arguments.length < 3;
09697
09698 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
09699 }
09700
09723 function reduceRight(collection, iteratee, accumulator) {
09724 var func = isArray(collection) ? arrayReduceRight : baseReduce,
09725 initAccum = arguments.length < 3;
09726
09727 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
09728 }
09729
09764 function reject(collection, predicate) {
09765 var func = isArray(collection) ? arrayFilter : baseFilter;
09766 return func(collection, negate(getIteratee(predicate, 3)));
09767 }
09768
09783 function sample(collection) {
09784 var func = isArray(collection) ? arraySample : baseSample;
09785 return func(collection);
09786 }
09787
09808 function sampleSize(collection, n, guard) {
09809 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
09810 n = 1;
09811 } else {
09812 n = toInteger(n);
09813 }
09814 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
09815 return func(collection, n);
09816 }
09817
09833 function shuffle(collection) {
09834 var func = isArray(collection) ? arrayShuffle : baseShuffle;
09835 return func(collection);
09836 }
09837
09859 function size(collection) {
09860 if (collection == null) {
09861 return 0;
09862 }
09863 if (isArrayLike(collection)) {
09864 return isString(collection) ? stringSize(collection) : collection.length;
09865 }
09866 var tag = getTag(collection);
09867 if (tag == mapTag || tag == setTag) {
09868 return collection.size;
09869 }
09870 return baseKeys(collection).length;
09871 }
09872
09909 function some(collection, predicate, guard) {
09910 var func = isArray(collection) ? arraySome : baseSome;
09911 if (guard && isIterateeCall(collection, predicate, guard)) {
09912 predicate = undefined;
09913 }
09914 return func(collection, getIteratee(predicate, 3));
09915 }
09916
09946 var sortBy = baseRest(function(collection, iteratees) {
09947 if (collection == null) {
09948 return [];
09949 }
09950 var length = iteratees.length;
09951 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
09952 iteratees = [];
09953 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
09954 iteratees = [iteratees[0]];
09955 }
09956 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
09957 });
09958
09959
09960
09977 var now = ctxNow || function() {
09978 return root.Date.now();
09979 };
09980
09981
09982
10007 function after(n, func) {
10008 if (typeof func != 'function') {
10009 throw new TypeError(FUNC_ERROR_TEXT);
10010 }
10011 n = toInteger(n);
10012 return function() {
10013 if (--n < 1) {
10014 return func.apply(this, arguments);
10015 }
10016 };
10017 }
10018
10036 function ary(func, n, guard) {
10037 n = guard ? undefined : n;
10038 n = (func && n == null) ? func.length : n;
10039 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
10040 }
10041
10059 function before(n, func) {
10060 var result;
10061 if (typeof func != 'function') {
10062 throw new TypeError(FUNC_ERROR_TEXT);
10063 }
10064 n = toInteger(n);
10065 return function() {
10066 if (--n > 0) {
10067 result = func.apply(this, arguments);
10068 }
10069 if (n <= 1) {
10070 func = undefined;
10071 }
10072 return result;
10073 };
10074 }
10075
10111 var bind = baseRest(function(func, thisArg, partials) {
10112 var bitmask = WRAP_BIND_FLAG;
10113 if (partials.length) {
10114 var holders = replaceHolders(partials, getHolder(bind));
10115 bitmask |= WRAP_PARTIAL_FLAG;
10116 }
10117 return createWrap(func, bitmask, thisArg, partials, holders);
10118 });
10119
10165 var bindKey = baseRest(function(object, key, partials) {
10166 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
10167 if (partials.length) {
10168 var holders = replaceHolders(partials, getHolder(bindKey));
10169 bitmask |= WRAP_PARTIAL_FLAG;
10170 }
10171 return createWrap(key, bitmask, object, partials, holders);
10172 });
10173
10215 function curry(func, arity, guard) {
10216 arity = guard ? undefined : arity;
10217 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
10218 result.placeholder = curry.placeholder;
10219 return result;
10220 }
10221
10260 function curryRight(func, arity, guard) {
10261 arity = guard ? undefined : arity;
10262 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
10263 result.placeholder = curryRight.placeholder;
10264 return result;
10265 }
10266
10321 function debounce(func, wait, options) {
10322 var lastArgs,
10323 lastThis,
10324 maxWait,
10325 result,
10326 timerId,
10327 lastCallTime,
10328 lastInvokeTime = 0,
10329 leading = false,
10330 maxing = false,
10331 trailing = true;
10332
10333 if (typeof func != 'function') {
10334 throw new TypeError(FUNC_ERROR_TEXT);
10335 }
10336 wait = toNumber(wait) || 0;
10337 if (isObject(options)) {
10338 leading = !!options.leading;
10339 maxing = 'maxWait' in options;
10340 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
10341 trailing = 'trailing' in options ? !!options.trailing : trailing;
10342 }
10343
10344 function invokeFunc(time) {
10345 var args = lastArgs,
10346 thisArg = lastThis;
10347
10348 lastArgs = lastThis = undefined;
10349 lastInvokeTime = time;
10350 result = func.apply(thisArg, args);
10351 return result;
10352 }
10353
10354 function leadingEdge(time) {
10355
10356 lastInvokeTime = time;
10357
10358 timerId = setTimeout(timerExpired, wait);
10359
10360 return leading ? invokeFunc(time) : result;
10361 }
10362
10363 function remainingWait(time) {
10364 var timeSinceLastCall = time - lastCallTime,
10365 timeSinceLastInvoke = time - lastInvokeTime,
10366 result = wait - timeSinceLastCall;
10367
10368 return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
10369 }
10370
10371 function shouldInvoke(time) {
10372 var timeSinceLastCall = time - lastCallTime,
10373 timeSinceLastInvoke = time - lastInvokeTime;
10374
10375
10376
10377
10378 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
10379 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
10380 }
10381
10382 function timerExpired() {
10383 var time = now();
10384 if (shouldInvoke(time)) {
10385 return trailingEdge(time);
10386 }
10387
10388 timerId = setTimeout(timerExpired, remainingWait(time));
10389 }
10390
10391 function trailingEdge(time) {
10392 timerId = undefined;
10393
10394
10395
10396 if (trailing && lastArgs) {
10397 return invokeFunc(time);
10398 }
10399 lastArgs = lastThis = undefined;
10400 return result;
10401 }
10402
10403 function cancel() {
10404 if (timerId !== undefined) {
10405 clearTimeout(timerId);
10406 }
10407 lastInvokeTime = 0;
10408 lastArgs = lastCallTime = lastThis = timerId = undefined;
10409 }
10410
10411 function flush() {
10412 return timerId === undefined ? result : trailingEdge(now());
10413 }
10414
10415 function debounced() {
10416 var time = now(),
10417 isInvoking = shouldInvoke(time);
10418
10419 lastArgs = arguments;
10420 lastThis = this;
10421 lastCallTime = time;
10422
10423 if (isInvoking) {
10424 if (timerId === undefined) {
10425 return leadingEdge(lastCallTime);
10426 }
10427 if (maxing) {
10428
10429 timerId = setTimeout(timerExpired, wait);
10430 return invokeFunc(lastCallTime);
10431 }
10432 }
10433 if (timerId === undefined) {
10434 timerId = setTimeout(timerExpired, wait);
10435 }
10436 return result;
10437 }
10438 debounced.cancel = cancel;
10439 debounced.flush = flush;
10440 return debounced;
10441 }
10442
10461 var defer = baseRest(function(func, args) {
10462 return baseDelay(func, 1, args);
10463 });
10464
10484 var delay = baseRest(function(func, wait, args) {
10485 return baseDelay(func, toNumber(wait) || 0, args);
10486 });
10487
10506 function flip(func) {
10507 return createWrap(func, WRAP_FLIP_FLAG);
10508 }
10509
10554 function memoize(func, resolver) {
10555 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
10556 throw new TypeError(FUNC_ERROR_TEXT);
10557 }
10558 var memoized = function() {
10559 var args = arguments,
10560 key = resolver ? resolver.apply(this, args) : args[0],
10561 cache = memoized.cache;
10562
10563 if (cache.has(key)) {
10564 return cache.get(key);
10565 }
10566 var result = func.apply(this, args);
10567 memoized.cache = cache.set(key, result) || cache;
10568 return result;
10569 };
10570 memoized.cache = new (memoize.Cache || MapCache);
10571 return memoized;
10572 }
10573
10574
10575 memoize.Cache = MapCache;
10576
10597 function negate(predicate) {
10598 if (typeof predicate != 'function') {
10599 throw new TypeError(FUNC_ERROR_TEXT);
10600 }
10601 return function() {
10602 var args = arguments;
10603 switch (args.length) {
10604 case 0: return !predicate.call(this);
10605 case 1: return !predicate.call(this, args[0]);
10606 case 2: return !predicate.call(this, args[0], args[1]);
10607 case 3: return !predicate.call(this, args[0], args[1], args[2]);
10608 }
10609 return !predicate.apply(this, args);
10610 };
10611 }
10612
10631 function once(func) {
10632 return before(2, func);
10633 }
10634
10666 var overArgs = castRest(function(func, transforms) {
10667 transforms = (transforms.length == 1 && isArray(transforms[0]))
10668 ? arrayMap(transforms[0], baseUnary(getIteratee()))
10669 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
10670
10671 var funcsLength = transforms.length;
10672 return baseRest(function(args) {
10673 var index = -1,
10674 length = nativeMin(args.length, funcsLength);
10675
10676 while (++index < length) {
10677 args[index] = transforms[index].call(this, args[index]);
10678 }
10679 return apply(func, this, args);
10680 });
10681 });
10682
10716 var partial = baseRest(function(func, partials) {
10717 var holders = replaceHolders(partials, getHolder(partial));
10718 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
10719 });
10720
10753 var partialRight = baseRest(function(func, partials) {
10754 var holders = replaceHolders(partials, getHolder(partialRight));
10755 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
10756 });
10757
10780 var rearg = flatRest(function(func, indexes) {
10781 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
10782 });
10783
10809 function rest(func, start) {
10810 if (typeof func != 'function') {
10811 throw new TypeError(FUNC_ERROR_TEXT);
10812 }
10813 start = start === undefined ? start : toInteger(start);
10814 return baseRest(func, start);
10815 }
10816
10851 function spread(func, start) {
10852 if (typeof func != 'function') {
10853 throw new TypeError(FUNC_ERROR_TEXT);
10854 }
10855 start = start == null ? 0 : nativeMax(toInteger(start), 0);
10856 return baseRest(function(args) {
10857 var array = args[start],
10858 otherArgs = castSlice(args, 0, start);
10859
10860 if (array) {
10861 arrayPush(otherArgs, array);
10862 }
10863 return apply(func, this, otherArgs);
10864 });
10865 }
10866
10911 function throttle(func, wait, options) {
10912 var leading = true,
10913 trailing = true;
10914
10915 if (typeof func != 'function') {
10916 throw new TypeError(FUNC_ERROR_TEXT);
10917 }
10918 if (isObject(options)) {
10919 leading = 'leading' in options ? !!options.leading : leading;
10920 trailing = 'trailing' in options ? !!options.trailing : trailing;
10921 }
10922 return debounce(func, wait, {
10923 'leading': leading,
10924 'maxWait': wait,
10925 'trailing': trailing
10926 });
10927 }
10928
10944 function unary(func) {
10945 return ary(func, 1);
10946 }
10947
10970 function wrap(value, wrapper) {
10971 return partial(castFunction(wrapper), value);
10972 }
10973
10974
10975
11009 function castArray() {
11010 if (!arguments.length) {
11011 return [];
11012 }
11013 var value = arguments[0];
11014 return isArray(value) ? value : [value];
11015 }
11016
11043 function clone(value) {
11044 return baseClone(value, CLONE_SYMBOLS_FLAG);
11045 }
11046
11078 function cloneWith(value, customizer) {
11079 customizer = typeof customizer == 'function' ? customizer : undefined;
11080 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
11081 }
11082
11101 function cloneDeep(value) {
11102 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
11103 }
11104
11133 function cloneDeepWith(value, customizer) {
11134 customizer = typeof customizer == 'function' ? customizer : undefined;
11135 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
11136 }
11137
11162 function conformsTo(object, source) {
11163 return source == null || baseConformsTo(object, source, keys(source));
11164 }
11165
11198 function eq(value, other) {
11199 return value === other || (value !== value && other !== other);
11200 }
11201
11225 var gt = createRelationalOperation(baseGt);
11226
11250 var gte = createRelationalOperation(function(value, other) {
11251 return value >= other;
11252 });
11253
11272 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
11273 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
11274 !propertyIsEnumerable.call(value, 'callee');
11275 };
11276
11300 var isArray = Array.isArray;
11301
11319 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
11320
11346 function isArrayLike(value) {
11347 return value != null && isLength(value.length) && !isFunction(value);
11348 }
11349
11375 function isArrayLikeObject(value) {
11376 return isObjectLike(value) && isArrayLike(value);
11377 }
11378
11396 function isBoolean(value) {
11397 return value === true || value === false ||
11398 (isObjectLike(value) && baseGetTag(value) == boolTag);
11399 }
11400
11418 var isBuffer = nativeIsBuffer || stubFalse;
11419
11437 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
11438
11456 function isElement(value) {
11457 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
11458 }
11459
11493 function isEmpty(value) {
11494 if (value == null) {
11495 return true;
11496 }
11497 if (isArrayLike(value) &&
11498 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
11499 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
11500 return !value.length;
11501 }
11502 var tag = getTag(value);
11503 if (tag == mapTag || tag == setTag) {
11504 return !value.size;
11505 }
11506 if (isPrototype(value)) {
11507 return !baseKeys(value).length;
11508 }
11509 for (var key in value) {
11510 if (hasOwnProperty.call(value, key)) {
11511 return false;
11512 }
11513 }
11514 return true;
11515 }
11516
11545 function isEqual(value, other) {
11546 return baseIsEqual(value, other);
11547 }
11548
11581 function isEqualWith(value, other, customizer) {
11582 customizer = typeof customizer == 'function' ? customizer : undefined;
11583 var result = customizer ? customizer(value, other) : undefined;
11584 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
11585 }
11586
11605 function isError(value) {
11606 if (!isObjectLike(value)) {
11607 return false;
11608 }
11609 var tag = baseGetTag(value);
11610 return tag == errorTag || tag == domExcTag ||
11611 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
11612 }
11613
11640 function isFinite(value) {
11641 return typeof value == 'number' && nativeIsFinite(value);
11642 }
11643
11661 function isFunction(value) {
11662 if (!isObject(value)) {
11663 return false;
11664 }
11665
11666
11667 var tag = baseGetTag(value);
11668 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
11669 }
11670
11697 function isInteger(value) {
11698 return typeof value == 'number' && value == toInteger(value);
11699 }
11700
11727 function isLength(value) {
11728 return typeof value == 'number' &&
11729 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
11730 }
11731
11757 function isObject(value) {
11758 var type = typeof value;
11759 return value != null && (type == 'object' || type == 'function');
11760 }
11761
11786 function isObjectLike(value) {
11787 return value != null && typeof value == 'object';
11788 }
11789
11807 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
11808
11837 function isMatch(object, source) {
11838 return object === source || baseIsMatch(object, source, getMatchData(source));
11839 }
11840
11873 function isMatchWith(object, source, customizer) {
11874 customizer = typeof customizer == 'function' ? customizer : undefined;
11875 return baseIsMatch(object, source, getMatchData(source), customizer);
11876 }
11877
11906 function isNaN(value) {
11907
11908
11909
11910 return isNumber(value) && value != +value;
11911 }
11912
11939 function isNative(value) {
11940 if (isMaskable(value)) {
11941 throw new Error(CORE_ERROR_TEXT);
11942 }
11943 return baseIsNative(value);
11944 }
11945
11963 function isNull(value) {
11964 return value === null;
11965 }
11966
11987 function isNil(value) {
11988 return value == null;
11989 }
11990
12017 function isNumber(value) {
12018 return typeof value == 'number' ||
12019 (isObjectLike(value) && baseGetTag(value) == numberTag);
12020 }
12021
12050 function isPlainObject(value) {
12051 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
12052 return false;
12053 }
12054 var proto = getPrototype(value);
12055 if (proto === null) {
12056 return true;
12057 }
12058 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
12059 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
12060 funcToString.call(Ctor) == objectCtorString;
12061 }
12062
12080 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
12081
12109 function isSafeInteger(value) {
12110 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
12111 }
12112
12130 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
12131
12149 function isString(value) {
12150 return typeof value == 'string' ||
12151 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
12152 }
12153
12171 function isSymbol(value) {
12172 return typeof value == 'symbol' ||
12173 (isObjectLike(value) && baseGetTag(value) == symbolTag);
12174 }
12175
12193 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
12194
12212 function isUndefined(value) {
12213 return value === undefined;
12214 }
12215
12233 function isWeakMap(value) {
12234 return isObjectLike(value) && getTag(value) == weakMapTag;
12235 }
12236
12254 function isWeakSet(value) {
12255 return isObjectLike(value) && baseGetTag(value) == weakSetTag;
12256 }
12257
12281 var lt = createRelationalOperation(baseLt);
12282
12306 var lte = createRelationalOperation(function(value, other) {
12307 return value <= other;
12308 });
12309
12333 function toArray(value) {
12334 if (!value) {
12335 return [];
12336 }
12337 if (isArrayLike(value)) {
12338 return isString(value) ? stringToArray(value) : copyArray(value);
12339 }
12340 if (symIterator && value[symIterator]) {
12341 return iteratorToArray(value[symIterator]());
12342 }
12343 var tag = getTag(value),
12344 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
12345
12346 return func(value);
12347 }
12348
12372 function toFinite(value) {
12373 if (!value) {
12374 return value === 0 ? value : 0;
12375 }
12376 value = toNumber(value);
12377 if (value === INFINITY || value === -INFINITY) {
12378 var sign = (value < 0 ? -1 : 1);
12379 return sign * MAX_INTEGER;
12380 }
12381 return value === value ? value : 0;
12382 }
12383
12410 function toInteger(value) {
12411 var result = toFinite(value),
12412 remainder = result % 1;
12413
12414 return result === result ? (remainder ? result - remainder : result) : 0;
12415 }
12416
12444 function toLength(value) {
12445 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
12446 }
12447
12471 function toNumber(value) {
12472 if (typeof value == 'number') {
12473 return value;
12474 }
12475 if (isSymbol(value)) {
12476 return NAN;
12477 }
12478 if (isObject(value)) {
12479 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
12480 value = isObject(other) ? (other + '') : other;
12481 }
12482 if (typeof value != 'string') {
12483 return value === 0 ? value : +value;
12484 }
12485 value = value.replace(reTrim, '');
12486 var isBinary = reIsBinary.test(value);
12487 return (isBinary || reIsOctal.test(value))
12488 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
12489 : (reIsBadHex.test(value) ? NAN : +value);
12490 }
12491
12516 function toPlainObject(value) {
12517 return copyObject(value, keysIn(value));
12518 }
12519
12544 function toSafeInteger(value) {
12545 return value
12546 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
12547 : (value === 0 ? value : 0);
12548 }
12549
12571 function toString(value) {
12572 return value == null ? '' : baseToString(value);
12573 }
12574
12575
12576
12609 var assign = createAssigner(function(object, source) {
12610 if (isPrototype(source) || isArrayLike(source)) {
12611 copyObject(source, keys(source), object);
12612 return;
12613 }
12614 for (var key in source) {
12615 if (hasOwnProperty.call(source, key)) {
12616 assignValue(object, key, source[key]);
12617 }
12618 }
12619 });
12620
12652 var assignIn = createAssigner(function(object, source) {
12653 copyObject(source, keysIn(source), object);
12654 });
12655
12685 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
12686 copyObject(source, keysIn(source), object, customizer);
12687 });
12688
12717 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
12718 copyObject(source, keys(source), object, customizer);
12719 });
12720
12738 var at = flatRest(baseAt);
12739
12774 function create(prototype, properties) {
12775 var result = baseCreate(prototype);
12776 return properties == null ? result : baseAssign(result, properties);
12777 }
12778
12800 var defaults = baseRest(function(args) {
12801 args.push(undefined, customDefaultsAssignIn);
12802 return apply(assignInWith, undefined, args);
12803 });
12804
12824 var defaultsDeep = baseRest(function(args) {
12825 args.push(undefined, customDefaultsMerge);
12826 return apply(mergeWith, undefined, args);
12827 });
12828
12864 function findKey(object, predicate) {
12865 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
12866 }
12867
12903 function findLastKey(object, predicate) {
12904 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
12905 }
12906
12935 function forIn(object, iteratee) {
12936 return object == null
12937 ? object
12938 : baseFor(object, getIteratee(iteratee, 3), keysIn);
12939 }
12940
12967 function forInRight(object, iteratee) {
12968 return object == null
12969 ? object
12970 : baseForRight(object, getIteratee(iteratee, 3), keysIn);
12971 }
12972
13001 function forOwn(object, iteratee) {
13002 return object && baseForOwn(object, getIteratee(iteratee, 3));
13003 }
13004
13031 function forOwnRight(object, iteratee) {
13032 return object && baseForOwnRight(object, getIteratee(iteratee, 3));
13033 }
13034
13058 function functions(object) {
13059 return object == null ? [] : baseFunctions(object, keys(object));
13060 }
13061
13085 function functionsIn(object) {
13086 return object == null ? [] : baseFunctions(object, keysIn(object));
13087 }
13088
13114 function get(object, path, defaultValue) {
13115 var result = object == null ? undefined : baseGet(object, path);
13116 return result === undefined ? defaultValue : result;
13117 }
13118
13146 function has(object, path) {
13147 return object != null && hasPath(object, path, baseHas);
13148 }
13149
13176 function hasIn(object, path) {
13177 return object != null && hasPath(object, path, baseHasIn);
13178 }
13179
13198 var invert = createInverter(function(result, value, key) {
13199 result[value] = key;
13200 }, constant(identity));
13201
13228 var invertBy = createInverter(function(result, value, key) {
13229 if (hasOwnProperty.call(result, value)) {
13230 result[value].push(key);
13231 } else {
13232 result[value] = [key];
13233 }
13234 }, getIteratee);
13235
13254 var invoke = baseRest(baseInvoke);
13255
13284 function keys(object) {
13285 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
13286 }
13287
13311 function keysIn(object) {
13312 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
13313 }
13314
13336 function mapKeys(object, iteratee) {
13337 var result = {};
13338 iteratee = getIteratee(iteratee, 3);
13339
13340 baseForOwn(object, function(value, key, object) {
13341 baseAssignValue(result, iteratee(value, key, object), value);
13342 });
13343 return result;
13344 }
13345
13374 function mapValues(object, iteratee) {
13375 var result = {};
13376 iteratee = getIteratee(iteratee, 3);
13377
13378 baseForOwn(object, function(value, key, object) {
13379 baseAssignValue(result, key, iteratee(value, key, object));
13380 });
13381 return result;
13382 }
13383
13415 var merge = createAssigner(function(object, source, srcIndex) {
13416 baseMerge(object, source, srcIndex);
13417 });
13418
13450 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
13451 baseMerge(object, source, srcIndex, customizer);
13452 });
13453
13474 var omit = flatRest(function(object, paths) {
13475 var result = {};
13476 if (object == null) {
13477 return result;
13478 }
13479 var isDeep = false;
13480 paths = arrayMap(paths, function(path) {
13481 path = castPath(path, object);
13482 isDeep || (isDeep = path.length > 1);
13483 return path;
13484 });
13485 copyObject(object, getAllKeysIn(object), result);
13486 if (isDeep) {
13487 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
13488 }
13489 var length = paths.length;
13490 while (length--) {
13491 baseUnset(result, paths[length]);
13492 }
13493 return result;
13494 });
13495
13516 function omitBy(object, predicate) {
13517 return pickBy(object, negate(getIteratee(predicate)));
13518 }
13519
13537 var pick = flatRest(function(object, paths) {
13538 return object == null ? {} : basePick(object, paths);
13539 });
13540
13559 function pickBy(object, predicate) {
13560 if (object == null) {
13561 return {};
13562 }
13563 var props = arrayMap(getAllKeysIn(object), function(prop) {
13564 return [prop];
13565 });
13566 predicate = getIteratee(predicate);
13567 return basePickBy(object, props, function(value, path) {
13568 return predicate(value, path[0]);
13569 });
13570 }
13571
13601 function result(object, path, defaultValue) {
13602 path = castPath(path, object);
13603
13604 var index = -1,
13605 length = path.length;
13606
13607
13608 if (!length) {
13609 length = 1;
13610 object = undefined;
13611 }
13612 while (++index < length) {
13613 var value = object == null ? undefined : object[toKey(path[index])];
13614 if (value === undefined) {
13615 index = length;
13616 value = defaultValue;
13617 }
13618 object = isFunction(value) ? value.call(object) : value;
13619 }
13620 return object;
13621 }
13622
13651 function set(object, path, value) {
13652 return object == null ? object : baseSet(object, path, value);
13653 }
13654
13679 function setWith(object, path, value, customizer) {
13680 customizer = typeof customizer == 'function' ? customizer : undefined;
13681 return object == null ? object : baseSet(object, path, value, customizer);
13682 }
13683
13708 var toPairs = createToPairs(keys);
13709
13734 var toPairsIn = createToPairs(keysIn);
13735
13766 function transform(object, iteratee, accumulator) {
13767 var isArr = isArray(object),
13768 isArrLike = isArr || isBuffer(object) || isTypedArray(object);
13769
13770 iteratee = getIteratee(iteratee, 4);
13771 if (accumulator == null) {
13772 var Ctor = object && object.constructor;
13773 if (isArrLike) {
13774 accumulator = isArr ? new Ctor : [];
13775 }
13776 else if (isObject(object)) {
13777 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
13778 }
13779 else {
13780 accumulator = {};
13781 }
13782 }
13783 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
13784 return iteratee(accumulator, value, index, object);
13785 });
13786 return accumulator;
13787 }
13788
13816 function unset(object, path) {
13817 return object == null ? true : baseUnset(object, path);
13818 }
13819
13847 function update(object, path, updater) {
13848 return object == null ? object : baseUpdate(object, path, castFunction(updater));
13849 }
13850
13875 function updateWith(object, path, updater, customizer) {
13876 customizer = typeof customizer == 'function' ? customizer : undefined;
13877 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
13878 }
13879
13906 function values(object) {
13907 return object == null ? [] : baseValues(object, keys(object));
13908 }
13909
13934 function valuesIn(object) {
13935 return object == null ? [] : baseValues(object, keysIn(object));
13936 }
13937
13938
13939
13959 function clamp(number, lower, upper) {
13960 if (upper === undefined) {
13961 upper = lower;
13962 lower = undefined;
13963 }
13964 if (upper !== undefined) {
13965 upper = toNumber(upper);
13966 upper = upper === upper ? upper : 0;
13967 }
13968 if (lower !== undefined) {
13969 lower = toNumber(lower);
13970 lower = lower === lower ? lower : 0;
13971 }
13972 return baseClamp(toNumber(number), lower, upper);
13973 }
13974
14013 function inRange(number, start, end) {
14014 start = toFinite(start);
14015 if (end === undefined) {
14016 end = start;
14017 start = 0;
14018 } else {
14019 end = toFinite(end);
14020 }
14021 number = toNumber(number);
14022 return baseInRange(number, start, end);
14023 }
14024
14056 function random(lower, upper, floating) {
14057 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
14058 upper = floating = undefined;
14059 }
14060 if (floating === undefined) {
14061 if (typeof upper == 'boolean') {
14062 floating = upper;
14063 upper = undefined;
14064 }
14065 else if (typeof lower == 'boolean') {
14066 floating = lower;
14067 lower = undefined;
14068 }
14069 }
14070 if (lower === undefined && upper === undefined) {
14071 lower = 0;
14072 upper = 1;
14073 }
14074 else {
14075 lower = toFinite(lower);
14076 if (upper === undefined) {
14077 upper = lower;
14078 lower = 0;
14079 } else {
14080 upper = toFinite(upper);
14081 }
14082 }
14083 if (lower > upper) {
14084 var temp = lower;
14085 lower = upper;
14086 upper = temp;
14087 }
14088 if (floating || lower % 1 || upper % 1) {
14089 var rand = nativeRandom();
14090 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
14091 }
14092 return baseRandom(lower, upper);
14093 }
14094
14095
14096
14117 var camelCase = createCompounder(function(result, word, index) {
14118 word = word.toLowerCase();
14119 return result + (index ? capitalize(word) : word);
14120 });
14121
14137 function capitalize(string) {
14138 return upperFirst(toString(string).toLowerCase());
14139 }
14140
14159 function deburr(string) {
14160 string = toString(string);
14161 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
14162 }
14163
14187 function endsWith(string, target, position) {
14188 string = toString(string);
14189 target = baseToString(target);
14190
14191 var length = string.length;
14192 position = position === undefined
14193 ? length
14194 : baseClamp(toInteger(position), 0, length);
14195
14196 var end = position;
14197 position -= target.length;
14198 return position >= 0 && string.slice(position, end) == target;
14199 }
14200
14229 function escape(string) {
14230 string = toString(string);
14231 return (string && reHasUnescapedHtml.test(string))
14232 ? string.replace(reUnescapedHtml, escapeHtmlChar)
14233 : string;
14234 }
14235
14251 function escapeRegExp(string) {
14252 string = toString(string);
14253 return (string && reHasRegExpChar.test(string))
14254 ? string.replace(reRegExpChar, '\\$&')
14255 : string;
14256 }
14257
14279 var kebabCase = createCompounder(function(result, word, index) {
14280 return result + (index ? '-' : '') + word.toLowerCase();
14281 });
14282
14303 var lowerCase = createCompounder(function(result, word, index) {
14304 return result + (index ? ' ' : '') + word.toLowerCase();
14305 });
14306
14324 var lowerFirst = createCaseFirst('toLowerCase');
14325
14349 function pad(string, length, chars) {
14350 string = toString(string);
14351 length = toInteger(length);
14352
14353 var strLength = length ? stringSize(string) : 0;
14354 if (!length || strLength >= length) {
14355 return string;
14356 }
14357 var mid = (length - strLength) / 2;
14358 return (
14359 createPadding(nativeFloor(mid), chars) +
14360 string +
14361 createPadding(nativeCeil(mid), chars)
14362 );
14363 }
14364
14388 function padEnd(string, length, chars) {
14389 string = toString(string);
14390 length = toInteger(length);
14391
14392 var strLength = length ? stringSize(string) : 0;
14393 return (length && strLength < length)
14394 ? (string + createPadding(length - strLength, chars))
14395 : string;
14396 }
14397
14421 function padStart(string, length, chars) {
14422 string = toString(string);
14423 length = toInteger(length);
14424
14425 var strLength = length ? stringSize(string) : 0;
14426 return (length && strLength < length)
14427 ? (createPadding(length - strLength, chars) + string)
14428 : string;
14429 }
14430
14455 function parseInt(string, radix, guard) {
14456 if (guard || radix == null) {
14457 radix = 0;
14458 } else if (radix) {
14459 radix = +radix;
14460 }
14461 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
14462 }
14463
14486 function repeat(string, n, guard) {
14487 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
14488 n = 1;
14489 } else {
14490 n = toInteger(n);
14491 }
14492 return baseRepeat(toString(string), n);
14493 }
14494
14514 function replace() {
14515 var args = arguments,
14516 string = toString(args[0]);
14517
14518 return args.length < 3 ? string : string.replace(args[1], args[2]);
14519 }
14520
14542 var snakeCase = createCompounder(function(result, word, index) {
14543 return result + (index ? '_' : '') + word.toLowerCase();
14544 });
14545
14565 function split(string, separator, limit) {
14566 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
14567 separator = limit = undefined;
14568 }
14569 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
14570 if (!limit) {
14571 return [];
14572 }
14573 string = toString(string);
14574 if (string && (
14575 typeof separator == 'string' ||
14576 (separator != null && !isRegExp(separator))
14577 )) {
14578 separator = baseToString(separator);
14579 if (!separator && hasUnicode(string)) {
14580 return castSlice(stringToArray(string), 0, limit);
14581 }
14582 }
14583 return string.split(separator, limit);
14584 }
14585
14607 var startCase = createCompounder(function(result, word, index) {
14608 return result + (index ? ' ' : '') + upperFirst(word);
14609 });
14610
14634 function startsWith(string, target, position) {
14635 string = toString(string);
14636 position = position == null
14637 ? 0
14638 : baseClamp(toInteger(position), 0, string.length);
14639
14640 target = baseToString(target);
14641 return string.slice(position, position + target.length) == target;
14642 }
14643
14748 function template(string, options, guard) {
14749
14750
14751
14752 var settings = lodash.templateSettings;
14753
14754 if (guard && isIterateeCall(string, options, guard)) {
14755 options = undefined;
14756 }
14757 string = toString(string);
14758 options = assignInWith({}, options, settings, customDefaultsAssignIn);
14759
14760 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
14761 importsKeys = keys(imports),
14762 importsValues = baseValues(imports, importsKeys);
14763
14764 var isEscaping,
14765 isEvaluating,
14766 index = 0,
14767 interpolate = options.interpolate || reNoMatch,
14768 source = "__p += '";
14769
14770
14771 var reDelimiters = RegExp(
14772 (options.escape || reNoMatch).source + '|' +
14773 interpolate.source + '|' +
14774 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
14775 (options.evaluate || reNoMatch).source + '|$'
14776 , 'g');
14777
14778
14779 var sourceURL = '//# sourceURL=' +
14780 ('sourceURL' in options
14781 ? options.sourceURL
14782 : ('lodash.templateSources[' + (++templateCounter) + ']')
14783 ) + '\n';
14784
14785 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
14786 interpolateValue || (interpolateValue = esTemplateValue);
14787
14788
14789 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
14790
14791
14792 if (escapeValue) {
14793 isEscaping = true;
14794 source += "' +\n__e(" + escapeValue + ") +\n'";
14795 }
14796 if (evaluateValue) {
14797 isEvaluating = true;
14798 source += "';\n" + evaluateValue + ";\n__p += '";
14799 }
14800 if (interpolateValue) {
14801 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
14802 }
14803 index = offset + match.length;
14804
14805
14806
14807 return match;
14808 });
14809
14810 source += "';\n";
14811
14812
14813
14814 var variable = options.variable;
14815 if (!variable) {
14816 source = 'with (obj) {\n' + source + '\n}\n';
14817 }
14818
14819 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
14820 .replace(reEmptyStringMiddle, '$1')
14821 .replace(reEmptyStringTrailing, '$1;');
14822
14823
14824 source = 'function(' + (variable || 'obj') + ') {\n' +
14825 (variable
14826 ? ''
14827 : 'obj || (obj = {});\n'
14828 ) +
14829 "var __t, __p = ''" +
14830 (isEscaping
14831 ? ', __e = _.escape'
14832 : ''
14833 ) +
14834 (isEvaluating
14835 ? ', __j = Array.prototype.join;\n' +
14836 "function print() { __p += __j.call(arguments, '') }\n"
14837 : ';\n'
14838 ) +
14839 source +
14840 'return __p\n}';
14841
14842 var result = attempt(function() {
14843 return Function(importsKeys, sourceURL + 'return ' + source)
14844 .apply(undefined, importsValues);
14845 });
14846
14847
14848
14849 result.source = source;
14850 if (isError(result)) {
14851 throw result;
14852 }
14853 return result;
14854 }
14855
14877 function toLower(value) {
14878 return toString(value).toLowerCase();
14879 }
14880
14902 function toUpper(value) {
14903 return toString(value).toUpperCase();
14904 }
14905
14928 function trim(string, chars, guard) {
14929 string = toString(string);
14930 if (string && (guard || chars === undefined)) {
14931 return string.replace(reTrim, '');
14932 }
14933 if (!string || !(chars = baseToString(chars))) {
14934 return string;
14935 }
14936 var strSymbols = stringToArray(string),
14937 chrSymbols = stringToArray(chars),
14938 start = charsStartIndex(strSymbols, chrSymbols),
14939 end = charsEndIndex(strSymbols, chrSymbols) + 1;
14940
14941 return castSlice(strSymbols, start, end).join('');
14942 }
14943
14963 function trimEnd(string, chars, guard) {
14964 string = toString(string);
14965 if (string && (guard || chars === undefined)) {
14966 return string.replace(reTrimEnd, '');
14967 }
14968 if (!string || !(chars = baseToString(chars))) {
14969 return string;
14970 }
14971 var strSymbols = stringToArray(string),
14972 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
14973
14974 return castSlice(strSymbols, 0, end).join('');
14975 }
14976
14996 function trimStart(string, chars, guard) {
14997 string = toString(string);
14998 if (string && (guard || chars === undefined)) {
14999 return string.replace(reTrimStart, '');
15000 }
15001 if (!string || !(chars = baseToString(chars))) {
15002 return string;
15003 }
15004 var strSymbols = stringToArray(string),
15005 start = charsStartIndex(strSymbols, stringToArray(chars));
15006
15007 return castSlice(strSymbols, start).join('');
15008 }
15009
15047 function truncate(string, options) {
15048 var length = DEFAULT_TRUNC_LENGTH,
15049 omission = DEFAULT_TRUNC_OMISSION;
15050
15051 if (isObject(options)) {
15052 var separator = 'separator' in options ? options.separator : separator;
15053 length = 'length' in options ? toInteger(options.length) : length;
15054 omission = 'omission' in options ? baseToString(options.omission) : omission;
15055 }
15056 string = toString(string);
15057
15058 var strLength = string.length;
15059 if (hasUnicode(string)) {
15060 var strSymbols = stringToArray(string);
15061 strLength = strSymbols.length;
15062 }
15063 if (length >= strLength) {
15064 return string;
15065 }
15066 var end = length - stringSize(omission);
15067 if (end < 1) {
15068 return omission;
15069 }
15070 var result = strSymbols
15071 ? castSlice(strSymbols, 0, end).join('')
15072 : string.slice(0, end);
15073
15074 if (separator === undefined) {
15075 return result + omission;
15076 }
15077 if (strSymbols) {
15078 end += (result.length - end);
15079 }
15080 if (isRegExp(separator)) {
15081 if (string.slice(end).search(separator)) {
15082 var match,
15083 substring = result;
15084
15085 if (!separator.global) {
15086 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
15087 }
15088 separator.lastIndex = 0;
15089 while ((match = separator.exec(substring))) {
15090 var newEnd = match.index;
15091 }
15092 result = result.slice(0, newEnd === undefined ? end : newEnd);
15093 }
15094 } else if (string.indexOf(baseToString(separator), end) != end) {
15095 var index = result.lastIndexOf(separator);
15096 if (index > -1) {
15097 result = result.slice(0, index);
15098 }
15099 }
15100 return result + omission;
15101 }
15102
15122 function unescape(string) {
15123 string = toString(string);
15124 return (string && reHasEscapedHtml.test(string))
15125 ? string.replace(reEscapedHtml, unescapeHtmlChar)
15126 : string;
15127 }
15128
15149 var upperCase = createCompounder(function(result, word, index) {
15150 return result + (index ? ' ' : '') + word.toUpperCase();
15151 });
15152
15170 var upperFirst = createCaseFirst('toUpperCase');
15171
15191 function words(string, pattern, guard) {
15192 string = toString(string);
15193 pattern = guard ? undefined : pattern;
15194
15195 if (pattern === undefined) {
15196 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
15197 }
15198 return string.match(pattern) || [];
15199 }
15200
15201
15202
15225 var attempt = baseRest(function(func, args) {
15226 try {
15227 return apply(func, undefined, args);
15228 } catch (e) {
15229 return isError(e) ? e : new Error(e);
15230 }
15231 });
15232
15259 var bindAll = flatRest(function(object, methodNames) {
15260 arrayEach(methodNames, function(key) {
15261 key = toKey(key);
15262 baseAssignValue(object, key, bind(object[key], object));
15263 });
15264 return object;
15265 });
15266
15296 function cond(pairs) {
15297 var length = pairs == null ? 0 : pairs.length,
15298 toIteratee = getIteratee();
15299
15300 pairs = !length ? [] : arrayMap(pairs, function(pair) {
15301 if (typeof pair[1] != 'function') {
15302 throw new TypeError(FUNC_ERROR_TEXT);
15303 }
15304 return [toIteratee(pair[0]), pair[1]];
15305 });
15306
15307 return baseRest(function(args) {
15308 var index = -1;
15309 while (++index < length) {
15310 var pair = pairs[index];
15311 if (apply(pair[0], this, args)) {
15312 return apply(pair[1], this, args);
15313 }
15314 }
15315 });
15316 }
15317
15342 function conforms(source) {
15343 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
15344 }
15345
15365 function constant(value) {
15366 return function() {
15367 return value;
15368 };
15369 }
15370
15391 function defaultTo(value, defaultValue) {
15392 return (value == null || value !== value) ? defaultValue : value;
15393 }
15394
15417 var flow = createFlow();
15418
15440 var flowRight = createFlow(true);
15441
15458 function identity(value) {
15459 return value;
15460 }
15461
15504 function iteratee(func) {
15505 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
15506 }
15507
15536 function matches(source) {
15537 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
15538 }
15539
15566 function matchesProperty(path, srcValue) {
15567 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
15568 }
15569
15594 var method = baseRest(function(path, args) {
15595 return function(object) {
15596 return baseInvoke(object, path, args);
15597 };
15598 });
15599
15623 var methodOf = baseRest(function(object, args) {
15624 return function(path) {
15625 return baseInvoke(object, path, args);
15626 };
15627 });
15628
15665 function mixin(object, source, options) {
15666 var props = keys(source),
15667 methodNames = baseFunctions(source, props);
15668
15669 if (options == null &&
15670 !(isObject(source) && (methodNames.length || !props.length))) {
15671 options = source;
15672 source = object;
15673 object = this;
15674 methodNames = baseFunctions(source, keys(source));
15675 }
15676 var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
15677 isFunc = isFunction(object);
15678
15679 arrayEach(methodNames, function(methodName) {
15680 var func = source[methodName];
15681 object[methodName] = func;
15682 if (isFunc) {
15683 object.prototype[methodName] = function() {
15684 var chainAll = this.__chain__;
15685 if (chain || chainAll) {
15686 var result = object(this.__wrapped__),
15687 actions = result.__actions__ = copyArray(this.__actions__);
15688
15689 actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
15690 result.__chain__ = chainAll;
15691 return result;
15692 }
15693 return func.apply(object, arrayPush([this.value()], arguments));
15694 };
15695 }
15696 });
15697
15698 return object;
15699 }
15700
15714 function noConflict() {
15715 if (root._ === this) {
15716 root._ = oldDash;
15717 }
15718 return this;
15719 }
15720
15733 function noop() {
15734
15735 }
15736
15757 function nthArg(n) {
15758 n = toInteger(n);
15759 return baseRest(function(args) {
15760 return baseNth(args, n);
15761 });
15762 }
15763
15782 var over = createOver(arrayMap);
15783
15808 var overEvery = createOver(arrayEvery);
15809
15834 var overSome = createOver(arraySome);
15835
15858 function property(path) {
15859 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
15860 }
15861
15883 function propertyOf(object) {
15884 return function(path) {
15885 return object == null ? undefined : baseGet(object, path);
15886 };
15887 }
15888
15930 var range = createRange();
15931
15968 var rangeRight = createRange(true);
15969
15988 function stubArray() {
15989 return [];
15990 }
15991
16005 function stubFalse() {
16006 return false;
16007 }
16008
16027 function stubObject() {
16028 return {};
16029 }
16030
16044 function stubString() {
16045 return '';
16046 }
16047
16061 function stubTrue() {
16062 return true;
16063 }
16064
16084 function times(n, iteratee) {
16085 n = toInteger(n);
16086 if (n < 1 || n > MAX_SAFE_INTEGER) {
16087 return [];
16088 }
16089 var index = MAX_ARRAY_LENGTH,
16090 length = nativeMin(n, MAX_ARRAY_LENGTH);
16091
16092 iteratee = getIteratee(iteratee);
16093 n -= MAX_ARRAY_LENGTH;
16094
16095 var result = baseTimes(length, iteratee);
16096 while (++index < n) {
16097 iteratee(index);
16098 }
16099 return result;
16100 }
16101
16119 function toPath(value) {
16120 if (isArray(value)) {
16121 return arrayMap(value, toKey);
16122 }
16123 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
16124 }
16125
16143 function uniqueId(prefix) {
16144 var id = ++idCounter;
16145 return toString(prefix) + id;
16146 }
16147
16148
16149
16165 var add = createMathOperation(function(augend, addend) {
16166 return augend + addend;
16167 }, 0);
16168
16190 var ceil = createRound('ceil');
16191
16207 var divide = createMathOperation(function(dividend, divisor) {
16208 return dividend / divisor;
16209 }, 1);
16210
16232 var floor = createRound('floor');
16233
16252 function max(array) {
16253 return (array && array.length)
16254 ? baseExtremum(array, identity, baseGt)
16255 : undefined;
16256 }
16257
16281 function maxBy(array, iteratee) {
16282 return (array && array.length)
16283 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
16284 : undefined;
16285 }
16286
16301 function mean(array) {
16302 return baseMean(array, identity);
16303 }
16304
16328 function meanBy(array, iteratee) {
16329 return baseMean(array, getIteratee(iteratee, 2));
16330 }
16331
16350 function min(array) {
16351 return (array && array.length)
16352 ? baseExtremum(array, identity, baseLt)
16353 : undefined;
16354 }
16355
16379 function minBy(array, iteratee) {
16380 return (array && array.length)
16381 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
16382 : undefined;
16383 }
16384
16400 var multiply = createMathOperation(function(multiplier, multiplicand) {
16401 return multiplier * multiplicand;
16402 }, 1);
16403
16425 var round = createRound('round');
16426
16442 var subtract = createMathOperation(function(minuend, subtrahend) {
16443 return minuend - subtrahend;
16444 }, 0);
16445
16460 function sum(array) {
16461 return (array && array.length)
16462 ? baseSum(array, identity)
16463 : 0;
16464 }
16465
16489 function sumBy(array, iteratee) {
16490 return (array && array.length)
16491 ? baseSum(array, getIteratee(iteratee, 2))
16492 : 0;
16493 }
16494
16495
16496
16497
16498 lodash.after = after;
16499 lodash.ary = ary;
16500 lodash.assign = assign;
16501 lodash.assignIn = assignIn;
16502 lodash.assignInWith = assignInWith;
16503 lodash.assignWith = assignWith;
16504 lodash.at = at;
16505 lodash.before = before;
16506 lodash.bind = bind;
16507 lodash.bindAll = bindAll;
16508 lodash.bindKey = bindKey;
16509 lodash.castArray = castArray;
16510 lodash.chain = chain;
16511 lodash.chunk = chunk;
16512 lodash.compact = compact;
16513 lodash.concat = concat;
16514 lodash.cond = cond;
16515 lodash.conforms = conforms;
16516 lodash.constant = constant;
16517 lodash.countBy = countBy;
16518 lodash.create = create;
16519 lodash.curry = curry;
16520 lodash.curryRight = curryRight;
16521 lodash.debounce = debounce;
16522 lodash.defaults = defaults;
16523 lodash.defaultsDeep = defaultsDeep;
16524 lodash.defer = defer;
16525 lodash.delay = delay;
16526 lodash.difference = difference;
16527 lodash.differenceBy = differenceBy;
16528 lodash.differenceWith = differenceWith;
16529 lodash.drop = drop;
16530 lodash.dropRight = dropRight;
16531 lodash.dropRightWhile = dropRightWhile;
16532 lodash.dropWhile = dropWhile;
16533 lodash.fill = fill;
16534 lodash.filter = filter;
16535 lodash.flatMap = flatMap;
16536 lodash.flatMapDeep = flatMapDeep;
16537 lodash.flatMapDepth = flatMapDepth;
16538 lodash.flatten = flatten;
16539 lodash.flattenDeep = flattenDeep;
16540 lodash.flattenDepth = flattenDepth;
16541 lodash.flip = flip;
16542 lodash.flow = flow;
16543 lodash.flowRight = flowRight;
16544 lodash.fromPairs = fromPairs;
16545 lodash.functions = functions;
16546 lodash.functionsIn = functionsIn;
16547 lodash.groupBy = groupBy;
16548 lodash.initial = initial;
16549 lodash.intersection = intersection;
16550 lodash.intersectionBy = intersectionBy;
16551 lodash.intersectionWith = intersectionWith;
16552 lodash.invert = invert;
16553 lodash.invertBy = invertBy;
16554 lodash.invokeMap = invokeMap;
16555 lodash.iteratee = iteratee;
16556 lodash.keyBy = keyBy;
16557 lodash.keys = keys;
16558 lodash.keysIn = keysIn;
16559 lodash.map = map;
16560 lodash.mapKeys = mapKeys;
16561 lodash.mapValues = mapValues;
16562 lodash.matches = matches;
16563 lodash.matchesProperty = matchesProperty;
16564 lodash.memoize = memoize;
16565 lodash.merge = merge;
16566 lodash.mergeWith = mergeWith;
16567 lodash.method = method;
16568 lodash.methodOf = methodOf;
16569 lodash.mixin = mixin;
16570 lodash.negate = negate;
16571 lodash.nthArg = nthArg;
16572 lodash.omit = omit;
16573 lodash.omitBy = omitBy;
16574 lodash.once = once;
16575 lodash.orderBy = orderBy;
16576 lodash.over = over;
16577 lodash.overArgs = overArgs;
16578 lodash.overEvery = overEvery;
16579 lodash.overSome = overSome;
16580 lodash.partial = partial;
16581 lodash.partialRight = partialRight;
16582 lodash.partition = partition;
16583 lodash.pick = pick;
16584 lodash.pickBy = pickBy;
16585 lodash.property = property;
16586 lodash.propertyOf = propertyOf;
16587 lodash.pull = pull;
16588 lodash.pullAll = pullAll;
16589 lodash.pullAllBy = pullAllBy;
16590 lodash.pullAllWith = pullAllWith;
16591 lodash.pullAt = pullAt;
16592 lodash.range = range;
16593 lodash.rangeRight = rangeRight;
16594 lodash.rearg = rearg;
16595 lodash.reject = reject;
16596 lodash.remove = remove;
16597 lodash.rest = rest;
16598 lodash.reverse = reverse;
16599 lodash.sampleSize = sampleSize;
16600 lodash.set = set;
16601 lodash.setWith = setWith;
16602 lodash.shuffle = shuffle;
16603 lodash.slice = slice;
16604 lodash.sortBy = sortBy;
16605 lodash.sortedUniq = sortedUniq;
16606 lodash.sortedUniqBy = sortedUniqBy;
16607 lodash.split = split;
16608 lodash.spread = spread;
16609 lodash.tail = tail;
16610 lodash.take = take;
16611 lodash.takeRight = takeRight;
16612 lodash.takeRightWhile = takeRightWhile;
16613 lodash.takeWhile = takeWhile;
16614 lodash.tap = tap;
16615 lodash.throttle = throttle;
16616 lodash.thru = thru;
16617 lodash.toArray = toArray;
16618 lodash.toPairs = toPairs;
16619 lodash.toPairsIn = toPairsIn;
16620 lodash.toPath = toPath;
16621 lodash.toPlainObject = toPlainObject;
16622 lodash.transform = transform;
16623 lodash.unary = unary;
16624 lodash.union = union;
16625 lodash.unionBy = unionBy;
16626 lodash.unionWith = unionWith;
16627 lodash.uniq = uniq;
16628 lodash.uniqBy = uniqBy;
16629 lodash.uniqWith = uniqWith;
16630 lodash.unset = unset;
16631 lodash.unzip = unzip;
16632 lodash.unzipWith = unzipWith;
16633 lodash.update = update;
16634 lodash.updateWith = updateWith;
16635 lodash.values = values;
16636 lodash.valuesIn = valuesIn;
16637 lodash.without = without;
16638 lodash.words = words;
16639 lodash.wrap = wrap;
16640 lodash.xor = xor;
16641 lodash.xorBy = xorBy;
16642 lodash.xorWith = xorWith;
16643 lodash.zip = zip;
16644 lodash.zipObject = zipObject;
16645 lodash.zipObjectDeep = zipObjectDeep;
16646 lodash.zipWith = zipWith;
16647
16648
16649 lodash.entries = toPairs;
16650 lodash.entriesIn = toPairsIn;
16651 lodash.extend = assignIn;
16652 lodash.extendWith = assignInWith;
16653
16654
16655 mixin(lodash, lodash);
16656
16657
16658
16659
16660 lodash.add = add;
16661 lodash.attempt = attempt;
16662 lodash.camelCase = camelCase;
16663 lodash.capitalize = capitalize;
16664 lodash.ceil = ceil;
16665 lodash.clamp = clamp;
16666 lodash.clone = clone;
16667 lodash.cloneDeep = cloneDeep;
16668 lodash.cloneDeepWith = cloneDeepWith;
16669 lodash.cloneWith = cloneWith;
16670 lodash.conformsTo = conformsTo;
16671 lodash.deburr = deburr;
16672 lodash.defaultTo = defaultTo;
16673 lodash.divide = divide;
16674 lodash.endsWith = endsWith;
16675 lodash.eq = eq;
16676 lodash.escape = escape;
16677 lodash.escapeRegExp = escapeRegExp;
16678 lodash.every = every;
16679 lodash.find = find;
16680 lodash.findIndex = findIndex;
16681 lodash.findKey = findKey;
16682 lodash.findLast = findLast;
16683 lodash.findLastIndex = findLastIndex;
16684 lodash.findLastKey = findLastKey;
16685 lodash.floor = floor;
16686 lodash.forEach = forEach;
16687 lodash.forEachRight = forEachRight;
16688 lodash.forIn = forIn;
16689 lodash.forInRight = forInRight;
16690 lodash.forOwn = forOwn;
16691 lodash.forOwnRight = forOwnRight;
16692 lodash.get = get;
16693 lodash.gt = gt;
16694 lodash.gte = gte;
16695 lodash.has = has;
16696 lodash.hasIn = hasIn;
16697 lodash.head = head;
16698 lodash.identity = identity;
16699 lodash.includes = includes;
16700 lodash.indexOf = indexOf;
16701 lodash.inRange = inRange;
16702 lodash.invoke = invoke;
16703 lodash.isArguments = isArguments;
16704 lodash.isArray = isArray;
16705 lodash.isArrayBuffer = isArrayBuffer;
16706 lodash.isArrayLike = isArrayLike;
16707 lodash.isArrayLikeObject = isArrayLikeObject;
16708 lodash.isBoolean = isBoolean;
16709 lodash.isBuffer = isBuffer;
16710 lodash.isDate = isDate;
16711 lodash.isElement = isElement;
16712 lodash.isEmpty = isEmpty;
16713 lodash.isEqual = isEqual;
16714 lodash.isEqualWith = isEqualWith;
16715 lodash.isError = isError;
16716 lodash.isFinite = isFinite;
16717 lodash.isFunction = isFunction;
16718 lodash.isInteger = isInteger;
16719 lodash.isLength = isLength;
16720 lodash.isMap = isMap;
16721 lodash.isMatch = isMatch;
16722 lodash.isMatchWith = isMatchWith;
16723 lodash.isNaN = isNaN;
16724 lodash.isNative = isNative;
16725 lodash.isNil = isNil;
16726 lodash.isNull = isNull;
16727 lodash.isNumber = isNumber;
16728 lodash.isObject = isObject;
16729 lodash.isObjectLike = isObjectLike;
16730 lodash.isPlainObject = isPlainObject;
16731 lodash.isRegExp = isRegExp;
16732 lodash.isSafeInteger = isSafeInteger;
16733 lodash.isSet = isSet;
16734 lodash.isString = isString;
16735 lodash.isSymbol = isSymbol;
16736 lodash.isTypedArray = isTypedArray;
16737 lodash.isUndefined = isUndefined;
16738 lodash.isWeakMap = isWeakMap;
16739 lodash.isWeakSet = isWeakSet;
16740 lodash.join = join;
16741 lodash.kebabCase = kebabCase;
16742 lodash.last = last;
16743 lodash.lastIndexOf = lastIndexOf;
16744 lodash.lowerCase = lowerCase;
16745 lodash.lowerFirst = lowerFirst;
16746 lodash.lt = lt;
16747 lodash.lte = lte;
16748 lodash.max = max;
16749 lodash.maxBy = maxBy;
16750 lodash.mean = mean;
16751 lodash.meanBy = meanBy;
16752 lodash.min = min;
16753 lodash.minBy = minBy;
16754 lodash.stubArray = stubArray;
16755 lodash.stubFalse = stubFalse;
16756 lodash.stubObject = stubObject;
16757 lodash.stubString = stubString;
16758 lodash.stubTrue = stubTrue;
16759 lodash.multiply = multiply;
16760 lodash.nth = nth;
16761 lodash.noConflict = noConflict;
16762 lodash.noop = noop;
16763 lodash.now = now;
16764 lodash.pad = pad;
16765 lodash.padEnd = padEnd;
16766 lodash.padStart = padStart;
16767 lodash.parseInt = parseInt;
16768 lodash.random = random;
16769 lodash.reduce = reduce;
16770 lodash.reduceRight = reduceRight;
16771 lodash.repeat = repeat;
16772 lodash.replace = replace;
16773 lodash.result = result;
16774 lodash.round = round;
16775 lodash.runInContext = runInContext;
16776 lodash.sample = sample;
16777 lodash.size = size;
16778 lodash.snakeCase = snakeCase;
16779 lodash.some = some;
16780 lodash.sortedIndex = sortedIndex;
16781 lodash.sortedIndexBy = sortedIndexBy;
16782 lodash.sortedIndexOf = sortedIndexOf;
16783 lodash.sortedLastIndex = sortedLastIndex;
16784 lodash.sortedLastIndexBy = sortedLastIndexBy;
16785 lodash.sortedLastIndexOf = sortedLastIndexOf;
16786 lodash.startCase = startCase;
16787 lodash.startsWith = startsWith;
16788 lodash.subtract = subtract;
16789 lodash.sum = sum;
16790 lodash.sumBy = sumBy;
16791 lodash.template = template;
16792 lodash.times = times;
16793 lodash.toFinite = toFinite;
16794 lodash.toInteger = toInteger;
16795 lodash.toLength = toLength;
16796 lodash.toLower = toLower;
16797 lodash.toNumber = toNumber;
16798 lodash.toSafeInteger = toSafeInteger;
16799 lodash.toString = toString;
16800 lodash.toUpper = toUpper;
16801 lodash.trim = trim;
16802 lodash.trimEnd = trimEnd;
16803 lodash.trimStart = trimStart;
16804 lodash.truncate = truncate;
16805 lodash.unescape = unescape;
16806 lodash.uniqueId = uniqueId;
16807 lodash.upperCase = upperCase;
16808 lodash.upperFirst = upperFirst;
16809
16810
16811 lodash.each = forEach;
16812 lodash.eachRight = forEachRight;
16813 lodash.first = head;
16814
16815 mixin(lodash, (function() {
16816 var source = {};
16817 baseForOwn(lodash, function(func, methodName) {
16818 if (!hasOwnProperty.call(lodash.prototype, methodName)) {
16819 source[methodName] = func;
16820 }
16821 });
16822 return source;
16823 }()), { 'chain': false });
16824
16825
16826
16834 lodash.VERSION = VERSION;
16835
16836
16837 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
16838 lodash[methodName].placeholder = lodash;
16839 });
16840
16841
16842 arrayEach(['drop', 'take'], function(methodName, index) {
16843 LazyWrapper.prototype[methodName] = function(n) {
16844 n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
16845
16846 var result = (this.__filtered__ && !index)
16847 ? new LazyWrapper(this)
16848 : this.clone();
16849
16850 if (result.__filtered__) {
16851 result.__takeCount__ = nativeMin(n, result.__takeCount__);
16852 } else {
16853 result.__views__.push({
16854 'size': nativeMin(n, MAX_ARRAY_LENGTH),
16855 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
16856 });
16857 }
16858 return result;
16859 };
16860
16861 LazyWrapper.prototype[methodName + 'Right'] = function(n) {
16862 return this.reverse()[methodName](n).reverse();
16863 };
16864 });
16865
16866
16867 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
16868 var type = index + 1,
16869 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
16870
16871 LazyWrapper.prototype[methodName] = function(iteratee) {
16872 var result = this.clone();
16873 result.__iteratees__.push({
16874 'iteratee': getIteratee(iteratee, 3),
16875 'type': type
16876 });
16877 result.__filtered__ = result.__filtered__ || isFilter;
16878 return result;
16879 };
16880 });
16881
16882
16883 arrayEach(['head', 'last'], function(methodName, index) {
16884 var takeName = 'take' + (index ? 'Right' : '');
16885
16886 LazyWrapper.prototype[methodName] = function() {
16887 return this[takeName](1).value()[0];
16888 };
16889 });
16890
16891
16892 arrayEach(['initial', 'tail'], function(methodName, index) {
16893 var dropName = 'drop' + (index ? '' : 'Right');
16894
16895 LazyWrapper.prototype[methodName] = function() {
16896 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
16897 };
16898 });
16899
16900 LazyWrapper.prototype.compact = function() {
16901 return this.filter(identity);
16902 };
16903
16904 LazyWrapper.prototype.find = function(predicate) {
16905 return this.filter(predicate).head();
16906 };
16907
16908 LazyWrapper.prototype.findLast = function(predicate) {
16909 return this.reverse().find(predicate);
16910 };
16911
16912 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
16913 if (typeof path == 'function') {
16914 return new LazyWrapper(this);
16915 }
16916 return this.map(function(value) {
16917 return baseInvoke(value, path, args);
16918 });
16919 });
16920
16921 LazyWrapper.prototype.reject = function(predicate) {
16922 return this.filter(negate(getIteratee(predicate)));
16923 };
16924
16925 LazyWrapper.prototype.slice = function(start, end) {
16926 start = toInteger(start);
16927
16928 var result = this;
16929 if (result.__filtered__ && (start > 0 || end < 0)) {
16930 return new LazyWrapper(result);
16931 }
16932 if (start < 0) {
16933 result = result.takeRight(-start);
16934 } else if (start) {
16935 result = result.drop(start);
16936 }
16937 if (end !== undefined) {
16938 end = toInteger(end);
16939 result = end < 0 ? result.dropRight(-end) : result.take(end - start);
16940 }
16941 return result;
16942 };
16943
16944 LazyWrapper.prototype.takeRightWhile = function(predicate) {
16945 return this.reverse().takeWhile(predicate).reverse();
16946 };
16947
16948 LazyWrapper.prototype.toArray = function() {
16949 return this.take(MAX_ARRAY_LENGTH);
16950 };
16951
16952
16953 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
16954 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
16955 isTaker = /^(?:head|last)$/.test(methodName),
16956 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
16957 retUnwrapped = isTaker || /^find/.test(methodName);
16958
16959 if (!lodashFunc) {
16960 return;
16961 }
16962 lodash.prototype[methodName] = function() {
16963 var value = this.__wrapped__,
16964 args = isTaker ? [1] : arguments,
16965 isLazy = value instanceof LazyWrapper,
16966 iteratee = args[0],
16967 useLazy = isLazy || isArray(value);
16968
16969 var interceptor = function(value) {
16970 var result = lodashFunc.apply(lodash, arrayPush([value], args));
16971 return (isTaker && chainAll) ? result[0] : result;
16972 };
16973
16974 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
16975
16976 isLazy = useLazy = false;
16977 }
16978 var chainAll = this.__chain__,
16979 isHybrid = !!this.__actions__.length,
16980 isUnwrapped = retUnwrapped && !chainAll,
16981 onlyLazy = isLazy && !isHybrid;
16982
16983 if (!retUnwrapped && useLazy) {
16984 value = onlyLazy ? value : new LazyWrapper(this);
16985 var result = func.apply(value, args);
16986 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
16987 return new LodashWrapper(result, chainAll);
16988 }
16989 if (isUnwrapped && onlyLazy) {
16990 return func.apply(this, args);
16991 }
16992 result = this.thru(interceptor);
16993 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
16994 };
16995 });
16996
16997
16998 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
16999 var func = arrayProto[methodName],
17000 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
17001 retUnwrapped = /^(?:pop|shift)$/.test(methodName);
17002
17003 lodash.prototype[methodName] = function() {
17004 var args = arguments;
17005 if (retUnwrapped && !this.__chain__) {
17006 var value = this.value();
17007 return func.apply(isArray(value) ? value : [], args);
17008 }
17009 return this[chainName](function(value) {
17010 return func.apply(isArray(value) ? value : [], args);
17011 });
17012 };
17013 });
17014
17015
17016 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
17017 var lodashFunc = lodash[methodName];
17018 if (lodashFunc) {
17019 var key = (lodashFunc.name + ''),
17020 names = realNames[key] || (realNames[key] = []);
17021
17022 names.push({ 'name': methodName, 'func': lodashFunc });
17023 }
17024 });
17025
17026 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
17027 'name': 'wrapper',
17028 'func': undefined
17029 }];
17030
17031
17032 LazyWrapper.prototype.clone = lazyClone;
17033 LazyWrapper.prototype.reverse = lazyReverse;
17034 LazyWrapper.prototype.value = lazyValue;
17035
17036
17037 lodash.prototype.at = wrapperAt;
17038 lodash.prototype.chain = wrapperChain;
17039 lodash.prototype.commit = wrapperCommit;
17040 lodash.prototype.next = wrapperNext;
17041 lodash.prototype.plant = wrapperPlant;
17042 lodash.prototype.reverse = wrapperReverse;
17043 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
17044
17045
17046 lodash.prototype.first = lodash.prototype.head;
17047
17048 if (symIterator) {
17049 lodash.prototype[symIterator] = wrapperToIterator;
17050 }
17051 return lodash;
17052 });
17053
17054
17055
17056
17057 var _ = runInContext();
17058
17059
17060 if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
17061
17062
17063
17064
17065 root._ = _;
17066
17067
17068
17069 define(function() {
17070 return _;
17071 });
17072 }
17073
17074 else if (freeModule) {
17075
17076 (freeModule.exports = _)._ = _;
17077
17078 freeExports._ = _;
17079 }
17080 else {
17081
17082 root._ = _;
17083 }
17084 }.call(this));