├── .gitignore ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── lib ├── lodash-rails.rb └── lodash │ ├── rails.rb │ └── rails │ ├── engine.rb │ └── version.rb ├── lodash-rails.gemspec └── vendor └── assets └── javascripts ├── lodash.core.js ├── lodash.core.min.js ├── lodash.js └── lodash.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | .pkg/ 2 | .vscode/ 3 | *.gem 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2012-2021 Richard Hubers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # lodash-rails 2 | 3 | [lodash](http://lodash.com/) for the Rails asset pipeline. 4 | 5 | ## Installation 6 | 7 | Add this line to the assets group in your Gemfile: 8 | 9 | ```ruby 10 | gem 'lodash-rails' 11 | ``` 12 | 13 | Add the necessary library to `app/assets/javascripts/application.js`: 14 | 15 | ```js 16 | //= require lodash 17 | ``` 18 | 19 | ## What's included? 20 | 21 | lodash 4.17.21: 22 | 23 | - lodash.core.js 24 | - lodash.core.min.js 25 | - lodash.js 26 | - lodash.min.js 27 | 28 | Copyright Richard Hubers, released under the MIT License. 29 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | -------------------------------------------------------------------------------- /lib/lodash-rails.rb: -------------------------------------------------------------------------------- 1 | require 'lodash/rails' 2 | -------------------------------------------------------------------------------- /lib/lodash/rails.rb: -------------------------------------------------------------------------------- 1 | require 'lodash/rails/engine' 2 | require 'lodash/rails/version' 3 | -------------------------------------------------------------------------------- /lib/lodash/rails/engine.rb: -------------------------------------------------------------------------------- 1 | module LoDash 2 | module Rails 3 | class Engine < ::Rails::Engine 4 | end 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/lodash/rails/version.rb: -------------------------------------------------------------------------------- 1 | module LoDash 2 | module Rails 3 | VERSION = "4.17.21" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lodash-rails.gemspec: -------------------------------------------------------------------------------- 1 | require File.expand_path('../lib/lodash/rails/version', __FILE__) 2 | 3 | Gem::Specification.new do |s| 4 | s.name = 'lodash-rails' 5 | s.version = LoDash::Rails::VERSION 6 | s.description = 'lodash for the Rails asset pipeline' 7 | s.summary = 'This gem makes lodash available for the Rails asset pipeline' 8 | s.authors = ['Richard Hubers'] 9 | s.email = ['richard.hubers@gmail.com'] 10 | s.date = Time.now.strftime('%Y-%m-%d') 11 | s.require_paths = ['lib'] 12 | s.add_dependency('railties', '>= 3.1') 13 | s.files = Dir["{lib,vendor}/**/*"] + ["README.md"] 14 | s.homepage = 'http://github.com/rh/lodash-rails' 15 | s.license = 'MIT' 16 | end 17 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/lodash.core.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Lodash (Custom Build) 4 | * Build: `lodash core -o ./dist/lodash.core.js` 5 | * Copyright OpenJS Foundation and other contributors 6 | * Released under MIT license 7 | * Based on Underscore.js 1.8.3 8 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 9 | */ 10 | ;(function() { 11 | 12 | /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 13 | var undefined; 14 | 15 | /** Used as the semantic version number. */ 16 | var VERSION = '4.17.21'; 17 | 18 | /** Error message constants. */ 19 | var FUNC_ERROR_TEXT = 'Expected a function'; 20 | 21 | /** Used to compose bitmasks for value comparisons. */ 22 | var COMPARE_PARTIAL_FLAG = 1, 23 | COMPARE_UNORDERED_FLAG = 2; 24 | 25 | /** Used to compose bitmasks for function metadata. */ 26 | var WRAP_BIND_FLAG = 1, 27 | WRAP_PARTIAL_FLAG = 32; 28 | 29 | /** Used as references for various `Number` constants. */ 30 | var INFINITY = 1 / 0, 31 | MAX_SAFE_INTEGER = 9007199254740991; 32 | 33 | /** `Object#toString` result references. */ 34 | var argsTag = '[object Arguments]', 35 | arrayTag = '[object Array]', 36 | asyncTag = '[object AsyncFunction]', 37 | boolTag = '[object Boolean]', 38 | dateTag = '[object Date]', 39 | errorTag = '[object Error]', 40 | funcTag = '[object Function]', 41 | genTag = '[object GeneratorFunction]', 42 | numberTag = '[object Number]', 43 | objectTag = '[object Object]', 44 | proxyTag = '[object Proxy]', 45 | regexpTag = '[object RegExp]', 46 | stringTag = '[object String]'; 47 | 48 | /** Used to match HTML entities and HTML characters. */ 49 | var reUnescapedHtml = /[&<>"']/g, 50 | reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 51 | 52 | /** Used to detect unsigned integer values. */ 53 | var reIsUint = /^(?:0|[1-9]\d*)$/; 54 | 55 | /** Used to map characters to HTML entities. */ 56 | var htmlEscapes = { 57 | '&': '&', 58 | '<': '<', 59 | '>': '>', 60 | '"': '"', 61 | "'": ''' 62 | }; 63 | 64 | /** Detect free variable `global` from Node.js. */ 65 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 66 | 67 | /** Detect free variable `self`. */ 68 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 69 | 70 | /** Used as a reference to the global object. */ 71 | var root = freeGlobal || freeSelf || Function('return this')(); 72 | 73 | /** Detect free variable `exports`. */ 74 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; 75 | 76 | /** Detect free variable `module`. */ 77 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; 78 | 79 | /*--------------------------------------------------------------------------*/ 80 | 81 | /** 82 | * Appends the elements of `values` to `array`. 83 | * 84 | * @private 85 | * @param {Array} array The array to modify. 86 | * @param {Array} values The values to append. 87 | * @returns {Array} Returns `array`. 88 | */ 89 | function arrayPush(array, values) { 90 | array.push.apply(array, values); 91 | return array; 92 | } 93 | 94 | /** 95 | * The base implementation of `_.findIndex` and `_.findLastIndex` without 96 | * support for iteratee shorthands. 97 | * 98 | * @private 99 | * @param {Array} array The array to inspect. 100 | * @param {Function} predicate The function invoked per iteration. 101 | * @param {number} fromIndex The index to search from. 102 | * @param {boolean} [fromRight] Specify iterating from right to left. 103 | * @returns {number} Returns the index of the matched value, else `-1`. 104 | */ 105 | function baseFindIndex(array, predicate, fromIndex, fromRight) { 106 | var length = array.length, 107 | index = fromIndex + (fromRight ? 1 : -1); 108 | 109 | while ((fromRight ? index-- : ++index < length)) { 110 | if (predicate(array[index], index, array)) { 111 | return index; 112 | } 113 | } 114 | return -1; 115 | } 116 | 117 | /** 118 | * The base implementation of `_.property` without support for deep paths. 119 | * 120 | * @private 121 | * @param {string} key The key of the property to get. 122 | * @returns {Function} Returns the new accessor function. 123 | */ 124 | function baseProperty(key) { 125 | return function(object) { 126 | return object == null ? undefined : object[key]; 127 | }; 128 | } 129 | 130 | /** 131 | * The base implementation of `_.propertyOf` without support for deep paths. 132 | * 133 | * @private 134 | * @param {Object} object The object to query. 135 | * @returns {Function} Returns the new accessor function. 136 | */ 137 | function basePropertyOf(object) { 138 | return function(key) { 139 | return object == null ? undefined : object[key]; 140 | }; 141 | } 142 | 143 | /** 144 | * The base implementation of `_.reduce` and `_.reduceRight`, without support 145 | * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 146 | * 147 | * @private 148 | * @param {Array|Object} collection The collection to iterate over. 149 | * @param {Function} iteratee The function invoked per iteration. 150 | * @param {*} accumulator The initial value. 151 | * @param {boolean} initAccum Specify using the first or last element of 152 | * `collection` as the initial value. 153 | * @param {Function} eachFunc The function to iterate over `collection`. 154 | * @returns {*} Returns the accumulated value. 155 | */ 156 | function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 157 | eachFunc(collection, function(value, index, collection) { 158 | accumulator = initAccum 159 | ? (initAccum = false, value) 160 | : iteratee(accumulator, value, index, collection); 161 | }); 162 | return accumulator; 163 | } 164 | 165 | /** 166 | * The base implementation of `_.values` and `_.valuesIn` which creates an 167 | * array of `object` property values corresponding to the property names 168 | * of `props`. 169 | * 170 | * @private 171 | * @param {Object} object The object to query. 172 | * @param {Array} props The property names to get values for. 173 | * @returns {Object} Returns the array of property values. 174 | */ 175 | function baseValues(object, props) { 176 | return baseMap(props, function(key) { 177 | return object[key]; 178 | }); 179 | } 180 | 181 | /** 182 | * Used by `_.escape` to convert characters to HTML entities. 183 | * 184 | * @private 185 | * @param {string} chr The matched character to escape. 186 | * @returns {string} Returns the escaped character. 187 | */ 188 | var escapeHtmlChar = basePropertyOf(htmlEscapes); 189 | 190 | /** 191 | * Creates a unary function that invokes `func` with its argument transformed. 192 | * 193 | * @private 194 | * @param {Function} func The function to wrap. 195 | * @param {Function} transform The argument transform. 196 | * @returns {Function} Returns the new function. 197 | */ 198 | function overArg(func, transform) { 199 | return function(arg) { 200 | return func(transform(arg)); 201 | }; 202 | } 203 | 204 | /*--------------------------------------------------------------------------*/ 205 | 206 | /** Used for built-in method references. */ 207 | var arrayProto = Array.prototype, 208 | objectProto = Object.prototype; 209 | 210 | /** Used to check objects for own properties. */ 211 | var hasOwnProperty = objectProto.hasOwnProperty; 212 | 213 | /** Used to generate unique IDs. */ 214 | var idCounter = 0; 215 | 216 | /** 217 | * Used to resolve the 218 | * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 219 | * of values. 220 | */ 221 | var nativeObjectToString = objectProto.toString; 222 | 223 | /** Used to restore the original `_` reference in `_.noConflict`. */ 224 | var oldDash = root._; 225 | 226 | /** Built-in value references. */ 227 | var objectCreate = Object.create, 228 | propertyIsEnumerable = objectProto.propertyIsEnumerable; 229 | 230 | /* Built-in method references for those with the same name as other `lodash` methods. */ 231 | var nativeIsFinite = root.isFinite, 232 | nativeKeys = overArg(Object.keys, Object), 233 | nativeMax = Math.max; 234 | 235 | /*------------------------------------------------------------------------*/ 236 | 237 | /** 238 | * Creates a `lodash` object which wraps `value` to enable implicit method 239 | * chain sequences. Methods that operate on and return arrays, collections, 240 | * and functions can be chained together. Methods that retrieve a single value 241 | * or may return a primitive value will automatically end the chain sequence 242 | * and return the unwrapped value. Otherwise, the value must be unwrapped 243 | * with `_#value`. 244 | * 245 | * Explicit chain sequences, which must be unwrapped with `_#value`, may be 246 | * enabled using `_.chain`. 247 | * 248 | * The execution of chained methods is lazy, that is, it's deferred until 249 | * `_#value` is implicitly or explicitly called. 250 | * 251 | * Lazy evaluation allows several methods to support shortcut fusion. 252 | * Shortcut fusion is an optimization to merge iteratee calls; this avoids 253 | * the creation of intermediate arrays and can greatly reduce the number of 254 | * iteratee executions. Sections of a chain sequence qualify for shortcut 255 | * fusion if the section is applied to an array and iteratees accept only 256 | * one argument. The heuristic for whether a section qualifies for shortcut 257 | * fusion is subject to change. 258 | * 259 | * Chaining is supported in custom builds as long as the `_#value` method is 260 | * directly or indirectly included in the build. 261 | * 262 | * In addition to lodash methods, wrappers have `Array` and `String` methods. 263 | * 264 | * The wrapper `Array` methods are: 265 | * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 266 | * 267 | * The wrapper `String` methods are: 268 | * `replace` and `split` 269 | * 270 | * The wrapper methods that support shortcut fusion are: 271 | * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 272 | * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 273 | * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 274 | * 275 | * The chainable wrapper methods are: 276 | * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 277 | * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 278 | * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 279 | * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 280 | * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 281 | * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 282 | * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 283 | * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 284 | * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 285 | * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 286 | * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 287 | * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 288 | * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 289 | * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 290 | * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 291 | * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 292 | * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 293 | * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 294 | * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 295 | * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 296 | * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 297 | * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 298 | * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 299 | * `zipObject`, `zipObjectDeep`, and `zipWith` 300 | * 301 | * The wrapper methods that are **not** chainable by default are: 302 | * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 303 | * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 304 | * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 305 | * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 306 | * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 307 | * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 308 | * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 309 | * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 310 | * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 311 | * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 312 | * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 313 | * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 314 | * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 315 | * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 316 | * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 317 | * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 318 | * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 319 | * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 320 | * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 321 | * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 322 | * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 323 | * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 324 | * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 325 | * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 326 | * `upperFirst`, `value`, and `words` 327 | * 328 | * @name _ 329 | * @constructor 330 | * @category Seq 331 | * @param {*} value The value to wrap in a `lodash` instance. 332 | * @returns {Object} Returns the new `lodash` wrapper instance. 333 | * @example 334 | * 335 | * function square(n) { 336 | * return n * n; 337 | * } 338 | * 339 | * var wrapped = _([1, 2, 3]); 340 | * 341 | * // Returns an unwrapped value. 342 | * wrapped.reduce(_.add); 343 | * // => 6 344 | * 345 | * // Returns a wrapped value. 346 | * var squares = wrapped.map(square); 347 | * 348 | * _.isArray(squares); 349 | * // => false 350 | * 351 | * _.isArray(squares.value()); 352 | * // => true 353 | */ 354 | function lodash(value) { 355 | return value instanceof LodashWrapper 356 | ? value 357 | : new LodashWrapper(value); 358 | } 359 | 360 | /** 361 | * The base implementation of `_.create` without support for assigning 362 | * properties to the created object. 363 | * 364 | * @private 365 | * @param {Object} proto The object to inherit from. 366 | * @returns {Object} Returns the new object. 367 | */ 368 | var baseCreate = (function() { 369 | function object() {} 370 | return function(proto) { 371 | if (!isObject(proto)) { 372 | return {}; 373 | } 374 | if (objectCreate) { 375 | return objectCreate(proto); 376 | } 377 | object.prototype = proto; 378 | var result = new object; 379 | object.prototype = undefined; 380 | return result; 381 | }; 382 | }()); 383 | 384 | /** 385 | * The base constructor for creating `lodash` wrapper objects. 386 | * 387 | * @private 388 | * @param {*} value The value to wrap. 389 | * @param {boolean} [chainAll] Enable explicit method chain sequences. 390 | */ 391 | function LodashWrapper(value, chainAll) { 392 | this.__wrapped__ = value; 393 | this.__actions__ = []; 394 | this.__chain__ = !!chainAll; 395 | } 396 | 397 | LodashWrapper.prototype = baseCreate(lodash.prototype); 398 | LodashWrapper.prototype.constructor = LodashWrapper; 399 | 400 | /*------------------------------------------------------------------------*/ 401 | 402 | /** 403 | * Assigns `value` to `key` of `object` if the existing value is not equivalent 404 | * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 405 | * for equality comparisons. 406 | * 407 | * @private 408 | * @param {Object} object The object to modify. 409 | * @param {string} key The key of the property to assign. 410 | * @param {*} value The value to assign. 411 | */ 412 | function assignValue(object, key, value) { 413 | var objValue = object[key]; 414 | if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 415 | (value === undefined && !(key in object))) { 416 | baseAssignValue(object, key, value); 417 | } 418 | } 419 | 420 | /** 421 | * The base implementation of `assignValue` and `assignMergeValue` without 422 | * value checks. 423 | * 424 | * @private 425 | * @param {Object} object The object to modify. 426 | * @param {string} key The key of the property to assign. 427 | * @param {*} value The value to assign. 428 | */ 429 | function baseAssignValue(object, key, value) { 430 | object[key] = value; 431 | } 432 | 433 | /** 434 | * The base implementation of `_.delay` and `_.defer` which accepts `args` 435 | * to provide to `func`. 436 | * 437 | * @private 438 | * @param {Function} func The function to delay. 439 | * @param {number} wait The number of milliseconds to delay invocation. 440 | * @param {Array} args The arguments to provide to `func`. 441 | * @returns {number|Object} Returns the timer id or timeout object. 442 | */ 443 | function baseDelay(func, wait, args) { 444 | if (typeof func != 'function') { 445 | throw new TypeError(FUNC_ERROR_TEXT); 446 | } 447 | return setTimeout(function() { func.apply(undefined, args); }, wait); 448 | } 449 | 450 | /** 451 | * The base implementation of `_.forEach` without support for iteratee shorthands. 452 | * 453 | * @private 454 | * @param {Array|Object} collection The collection to iterate over. 455 | * @param {Function} iteratee The function invoked per iteration. 456 | * @returns {Array|Object} Returns `collection`. 457 | */ 458 | var baseEach = createBaseEach(baseForOwn); 459 | 460 | /** 461 | * The base implementation of `_.every` without support for iteratee shorthands. 462 | * 463 | * @private 464 | * @param {Array|Object} collection The collection to iterate over. 465 | * @param {Function} predicate The function invoked per iteration. 466 | * @returns {boolean} Returns `true` if all elements pass the predicate check, 467 | * else `false` 468 | */ 469 | function baseEvery(collection, predicate) { 470 | var result = true; 471 | baseEach(collection, function(value, index, collection) { 472 | result = !!predicate(value, index, collection); 473 | return result; 474 | }); 475 | return result; 476 | } 477 | 478 | /** 479 | * The base implementation of methods like `_.max` and `_.min` which accepts a 480 | * `comparator` to determine the extremum value. 481 | * 482 | * @private 483 | * @param {Array} array The array to iterate over. 484 | * @param {Function} iteratee The iteratee invoked per iteration. 485 | * @param {Function} comparator The comparator used to compare values. 486 | * @returns {*} Returns the extremum value. 487 | */ 488 | function baseExtremum(array, iteratee, comparator) { 489 | var index = -1, 490 | length = array.length; 491 | 492 | while (++index < length) { 493 | var value = array[index], 494 | current = iteratee(value); 495 | 496 | if (current != null && (computed === undefined 497 | ? (current === current && !false) 498 | : comparator(current, computed) 499 | )) { 500 | var computed = current, 501 | result = value; 502 | } 503 | } 504 | return result; 505 | } 506 | 507 | /** 508 | * The base implementation of `_.filter` without support for iteratee shorthands. 509 | * 510 | * @private 511 | * @param {Array|Object} collection The collection to iterate over. 512 | * @param {Function} predicate The function invoked per iteration. 513 | * @returns {Array} Returns the new filtered array. 514 | */ 515 | function baseFilter(collection, predicate) { 516 | var result = []; 517 | baseEach(collection, function(value, index, collection) { 518 | if (predicate(value, index, collection)) { 519 | result.push(value); 520 | } 521 | }); 522 | return result; 523 | } 524 | 525 | /** 526 | * The base implementation of `_.flatten` with support for restricting flattening. 527 | * 528 | * @private 529 | * @param {Array} array The array to flatten. 530 | * @param {number} depth The maximum recursion depth. 531 | * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 532 | * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 533 | * @param {Array} [result=[]] The initial result value. 534 | * @returns {Array} Returns the new flattened array. 535 | */ 536 | function baseFlatten(array, depth, predicate, isStrict, result) { 537 | var index = -1, 538 | length = array.length; 539 | 540 | predicate || (predicate = isFlattenable); 541 | result || (result = []); 542 | 543 | while (++index < length) { 544 | var value = array[index]; 545 | if (depth > 0 && predicate(value)) { 546 | if (depth > 1) { 547 | // Recursively flatten arrays (susceptible to call stack limits). 548 | baseFlatten(value, depth - 1, predicate, isStrict, result); 549 | } else { 550 | arrayPush(result, value); 551 | } 552 | } else if (!isStrict) { 553 | result[result.length] = value; 554 | } 555 | } 556 | return result; 557 | } 558 | 559 | /** 560 | * The base implementation of `baseForOwn` which iterates over `object` 561 | * properties returned by `keysFunc` and invokes `iteratee` for each property. 562 | * Iteratee functions may exit iteration early by explicitly returning `false`. 563 | * 564 | * @private 565 | * @param {Object} object The object to iterate over. 566 | * @param {Function} iteratee The function invoked per iteration. 567 | * @param {Function} keysFunc The function to get the keys of `object`. 568 | * @returns {Object} Returns `object`. 569 | */ 570 | var baseFor = createBaseFor(); 571 | 572 | /** 573 | * The base implementation of `_.forOwn` without support for iteratee shorthands. 574 | * 575 | * @private 576 | * @param {Object} object The object to iterate over. 577 | * @param {Function} iteratee The function invoked per iteration. 578 | * @returns {Object} Returns `object`. 579 | */ 580 | function baseForOwn(object, iteratee) { 581 | return object && baseFor(object, iteratee, keys); 582 | } 583 | 584 | /** 585 | * The base implementation of `_.functions` which creates an array of 586 | * `object` function property names filtered from `props`. 587 | * 588 | * @private 589 | * @param {Object} object The object to inspect. 590 | * @param {Array} props The property names to filter. 591 | * @returns {Array} Returns the function names. 592 | */ 593 | function baseFunctions(object, props) { 594 | return baseFilter(props, function(key) { 595 | return isFunction(object[key]); 596 | }); 597 | } 598 | 599 | /** 600 | * The base implementation of `getTag` without fallbacks for buggy environments. 601 | * 602 | * @private 603 | * @param {*} value The value to query. 604 | * @returns {string} Returns the `toStringTag`. 605 | */ 606 | function baseGetTag(value) { 607 | return objectToString(value); 608 | } 609 | 610 | /** 611 | * The base implementation of `_.gt` which doesn't coerce arguments. 612 | * 613 | * @private 614 | * @param {*} value The value to compare. 615 | * @param {*} other The other value to compare. 616 | * @returns {boolean} Returns `true` if `value` is greater than `other`, 617 | * else `false`. 618 | */ 619 | function baseGt(value, other) { 620 | return value > other; 621 | } 622 | 623 | /** 624 | * The base implementation of `_.isArguments`. 625 | * 626 | * @private 627 | * @param {*} value The value to check. 628 | * @returns {boolean} Returns `true` if `value` is an `arguments` object, 629 | */ 630 | var baseIsArguments = noop; 631 | 632 | /** 633 | * The base implementation of `_.isDate` without Node.js optimizations. 634 | * 635 | * @private 636 | * @param {*} value The value to check. 637 | * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 638 | */ 639 | function baseIsDate(value) { 640 | return isObjectLike(value) && baseGetTag(value) == dateTag; 641 | } 642 | 643 | /** 644 | * The base implementation of `_.isEqual` which supports partial comparisons 645 | * and tracks traversed objects. 646 | * 647 | * @private 648 | * @param {*} value The value to compare. 649 | * @param {*} other The other value to compare. 650 | * @param {boolean} bitmask The bitmask flags. 651 | * 1 - Unordered comparison 652 | * 2 - Partial comparison 653 | * @param {Function} [customizer] The function to customize comparisons. 654 | * @param {Object} [stack] Tracks traversed `value` and `other` objects. 655 | * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 656 | */ 657 | function baseIsEqual(value, other, bitmask, customizer, stack) { 658 | if (value === other) { 659 | return true; 660 | } 661 | if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 662 | return value !== value && other !== other; 663 | } 664 | return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 665 | } 666 | 667 | /** 668 | * A specialized version of `baseIsEqual` for arrays and objects which performs 669 | * deep comparisons and tracks traversed objects enabling objects with circular 670 | * references to be compared. 671 | * 672 | * @private 673 | * @param {Object} object The object to compare. 674 | * @param {Object} other The other object to compare. 675 | * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 676 | * @param {Function} customizer The function to customize comparisons. 677 | * @param {Function} equalFunc The function to determine equivalents of values. 678 | * @param {Object} [stack] Tracks traversed `object` and `other` objects. 679 | * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 680 | */ 681 | function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 682 | var objIsArr = isArray(object), 683 | othIsArr = isArray(other), 684 | objTag = objIsArr ? arrayTag : baseGetTag(object), 685 | othTag = othIsArr ? arrayTag : baseGetTag(other); 686 | 687 | objTag = objTag == argsTag ? objectTag : objTag; 688 | othTag = othTag == argsTag ? objectTag : othTag; 689 | 690 | var objIsObj = objTag == objectTag, 691 | othIsObj = othTag == objectTag, 692 | isSameTag = objTag == othTag; 693 | 694 | stack || (stack = []); 695 | var objStack = find(stack, function(entry) { 696 | return entry[0] == object; 697 | }); 698 | var othStack = find(stack, function(entry) { 699 | return entry[0] == other; 700 | }); 701 | if (objStack && othStack) { 702 | return objStack[1] == other; 703 | } 704 | stack.push([object, other]); 705 | stack.push([other, object]); 706 | if (isSameTag && !objIsObj) { 707 | var result = (objIsArr) 708 | ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 709 | : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 710 | stack.pop(); 711 | return result; 712 | } 713 | if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 714 | var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 715 | othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 716 | 717 | if (objIsWrapped || othIsWrapped) { 718 | var objUnwrapped = objIsWrapped ? object.value() : object, 719 | othUnwrapped = othIsWrapped ? other.value() : other; 720 | 721 | var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 722 | stack.pop(); 723 | return result; 724 | } 725 | } 726 | if (!isSameTag) { 727 | return false; 728 | } 729 | var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); 730 | stack.pop(); 731 | return result; 732 | } 733 | 734 | /** 735 | * The base implementation of `_.isRegExp` without Node.js optimizations. 736 | * 737 | * @private 738 | * @param {*} value The value to check. 739 | * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 740 | */ 741 | function baseIsRegExp(value) { 742 | return isObjectLike(value) && baseGetTag(value) == regexpTag; 743 | } 744 | 745 | /** 746 | * The base implementation of `_.iteratee`. 747 | * 748 | * @private 749 | * @param {*} [value=_.identity] The value to convert to an iteratee. 750 | * @returns {Function} Returns the iteratee. 751 | */ 752 | function baseIteratee(func) { 753 | if (typeof func == 'function') { 754 | return func; 755 | } 756 | if (func == null) { 757 | return identity; 758 | } 759 | return (typeof func == 'object' ? baseMatches : baseProperty)(func); 760 | } 761 | 762 | /** 763 | * The base implementation of `_.lt` which doesn't coerce arguments. 764 | * 765 | * @private 766 | * @param {*} value The value to compare. 767 | * @param {*} other The other value to compare. 768 | * @returns {boolean} Returns `true` if `value` is less than `other`, 769 | * else `false`. 770 | */ 771 | function baseLt(value, other) { 772 | return value < other; 773 | } 774 | 775 | /** 776 | * The base implementation of `_.map` without support for iteratee shorthands. 777 | * 778 | * @private 779 | * @param {Array|Object} collection The collection to iterate over. 780 | * @param {Function} iteratee The function invoked per iteration. 781 | * @returns {Array} Returns the new mapped array. 782 | */ 783 | function baseMap(collection, iteratee) { 784 | var index = -1, 785 | result = isArrayLike(collection) ? Array(collection.length) : []; 786 | 787 | baseEach(collection, function(value, key, collection) { 788 | result[++index] = iteratee(value, key, collection); 789 | }); 790 | return result; 791 | } 792 | 793 | /** 794 | * The base implementation of `_.matches` which doesn't clone `source`. 795 | * 796 | * @private 797 | * @param {Object} source The object of property values to match. 798 | * @returns {Function} Returns the new spec function. 799 | */ 800 | function baseMatches(source) { 801 | var props = nativeKeys(source); 802 | return function(object) { 803 | var length = props.length; 804 | if (object == null) { 805 | return !length; 806 | } 807 | object = Object(object); 808 | while (length--) { 809 | var key = props[length]; 810 | if (!(key in object && 811 | baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) 812 | )) { 813 | return false; 814 | } 815 | } 816 | return true; 817 | }; 818 | } 819 | 820 | /** 821 | * The base implementation of `_.pick` without support for individual 822 | * property identifiers. 823 | * 824 | * @private 825 | * @param {Object} object The source object. 826 | * @param {string[]} paths The property paths to pick. 827 | * @returns {Object} Returns the new object. 828 | */ 829 | function basePick(object, props) { 830 | object = Object(object); 831 | return reduce(props, function(result, key) { 832 | if (key in object) { 833 | result[key] = object[key]; 834 | } 835 | return result; 836 | }, {}); 837 | } 838 | 839 | /** 840 | * The base implementation of `_.rest` which doesn't validate or coerce arguments. 841 | * 842 | * @private 843 | * @param {Function} func The function to apply a rest parameter to. 844 | * @param {number} [start=func.length-1] The start position of the rest parameter. 845 | * @returns {Function} Returns the new function. 846 | */ 847 | function baseRest(func, start) { 848 | return setToString(overRest(func, start, identity), func + ''); 849 | } 850 | 851 | /** 852 | * The base implementation of `_.slice` without an iteratee call guard. 853 | * 854 | * @private 855 | * @param {Array} array The array to slice. 856 | * @param {number} [start=0] The start position. 857 | * @param {number} [end=array.length] The end position. 858 | * @returns {Array} Returns the slice of `array`. 859 | */ 860 | function baseSlice(array, start, end) { 861 | var index = -1, 862 | length = array.length; 863 | 864 | if (start < 0) { 865 | start = -start > length ? 0 : (length + start); 866 | } 867 | end = end > length ? length : end; 868 | if (end < 0) { 869 | end += length; 870 | } 871 | length = start > end ? 0 : ((end - start) >>> 0); 872 | start >>>= 0; 873 | 874 | var result = Array(length); 875 | while (++index < length) { 876 | result[index] = array[index + start]; 877 | } 878 | return result; 879 | } 880 | 881 | /** 882 | * Copies the values of `source` to `array`. 883 | * 884 | * @private 885 | * @param {Array} source The array to copy values from. 886 | * @param {Array} [array=[]] The array to copy values to. 887 | * @returns {Array} Returns `array`. 888 | */ 889 | function copyArray(source) { 890 | return baseSlice(source, 0, source.length); 891 | } 892 | 893 | /** 894 | * The base implementation of `_.some` without support for iteratee shorthands. 895 | * 896 | * @private 897 | * @param {Array|Object} collection The collection to iterate over. 898 | * @param {Function} predicate The function invoked per iteration. 899 | * @returns {boolean} Returns `true` if any element passes the predicate check, 900 | * else `false`. 901 | */ 902 | function baseSome(collection, predicate) { 903 | var result; 904 | 905 | baseEach(collection, function(value, index, collection) { 906 | result = predicate(value, index, collection); 907 | return !result; 908 | }); 909 | return !!result; 910 | } 911 | 912 | /** 913 | * The base implementation of `wrapperValue` which returns the result of 914 | * performing a sequence of actions on the unwrapped `value`, where each 915 | * successive action is supplied the return value of the previous. 916 | * 917 | * @private 918 | * @param {*} value The unwrapped value. 919 | * @param {Array} actions Actions to perform to resolve the unwrapped value. 920 | * @returns {*} Returns the resolved value. 921 | */ 922 | function baseWrapperValue(value, actions) { 923 | var result = value; 924 | return reduce(actions, function(result, action) { 925 | return action.func.apply(action.thisArg, arrayPush([result], action.args)); 926 | }, result); 927 | } 928 | 929 | /** 930 | * Compares values to sort them in ascending order. 931 | * 932 | * @private 933 | * @param {*} value The value to compare. 934 | * @param {*} other The other value to compare. 935 | * @returns {number} Returns the sort order indicator for `value`. 936 | */ 937 | function compareAscending(value, other) { 938 | if (value !== other) { 939 | var valIsDefined = value !== undefined, 940 | valIsNull = value === null, 941 | valIsReflexive = value === value, 942 | valIsSymbol = false; 943 | 944 | var othIsDefined = other !== undefined, 945 | othIsNull = other === null, 946 | othIsReflexive = other === other, 947 | othIsSymbol = false; 948 | 949 | if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 950 | (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 951 | (valIsNull && othIsDefined && othIsReflexive) || 952 | (!valIsDefined && othIsReflexive) || 953 | !valIsReflexive) { 954 | return 1; 955 | } 956 | if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 957 | (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 958 | (othIsNull && valIsDefined && valIsReflexive) || 959 | (!othIsDefined && valIsReflexive) || 960 | !othIsReflexive) { 961 | return -1; 962 | } 963 | } 964 | return 0; 965 | } 966 | 967 | /** 968 | * Copies properties of `source` to `object`. 969 | * 970 | * @private 971 | * @param {Object} source The object to copy properties from. 972 | * @param {Array} props The property identifiers to copy. 973 | * @param {Object} [object={}] The object to copy properties to. 974 | * @param {Function} [customizer] The function to customize copied values. 975 | * @returns {Object} Returns `object`. 976 | */ 977 | function copyObject(source, props, object, customizer) { 978 | var isNew = !object; 979 | object || (object = {}); 980 | 981 | var index = -1, 982 | length = props.length; 983 | 984 | while (++index < length) { 985 | var key = props[index]; 986 | 987 | var newValue = customizer 988 | ? customizer(object[key], source[key], key, object, source) 989 | : undefined; 990 | 991 | if (newValue === undefined) { 992 | newValue = source[key]; 993 | } 994 | if (isNew) { 995 | baseAssignValue(object, key, newValue); 996 | } else { 997 | assignValue(object, key, newValue); 998 | } 999 | } 1000 | return object; 1001 | } 1002 | 1003 | /** 1004 | * Creates a function like `_.assign`. 1005 | * 1006 | * @private 1007 | * @param {Function} assigner The function to assign values. 1008 | * @returns {Function} Returns the new assigner function. 1009 | */ 1010 | function createAssigner(assigner) { 1011 | return baseRest(function(object, sources) { 1012 | var index = -1, 1013 | length = sources.length, 1014 | customizer = length > 1 ? sources[length - 1] : undefined; 1015 | 1016 | customizer = (assigner.length > 3 && typeof customizer == 'function') 1017 | ? (length--, customizer) 1018 | : undefined; 1019 | 1020 | object = Object(object); 1021 | while (++index < length) { 1022 | var source = sources[index]; 1023 | if (source) { 1024 | assigner(object, source, index, customizer); 1025 | } 1026 | } 1027 | return object; 1028 | }); 1029 | } 1030 | 1031 | /** 1032 | * Creates a `baseEach` or `baseEachRight` function. 1033 | * 1034 | * @private 1035 | * @param {Function} eachFunc The function to iterate over a collection. 1036 | * @param {boolean} [fromRight] Specify iterating from right to left. 1037 | * @returns {Function} Returns the new base function. 1038 | */ 1039 | function createBaseEach(eachFunc, fromRight) { 1040 | return function(collection, iteratee) { 1041 | if (collection == null) { 1042 | return collection; 1043 | } 1044 | if (!isArrayLike(collection)) { 1045 | return eachFunc(collection, iteratee); 1046 | } 1047 | var length = collection.length, 1048 | index = fromRight ? length : -1, 1049 | iterable = Object(collection); 1050 | 1051 | while ((fromRight ? index-- : ++index < length)) { 1052 | if (iteratee(iterable[index], index, iterable) === false) { 1053 | break; 1054 | } 1055 | } 1056 | return collection; 1057 | }; 1058 | } 1059 | 1060 | /** 1061 | * Creates a base function for methods like `_.forIn` and `_.forOwn`. 1062 | * 1063 | * @private 1064 | * @param {boolean} [fromRight] Specify iterating from right to left. 1065 | * @returns {Function} Returns the new base function. 1066 | */ 1067 | function createBaseFor(fromRight) { 1068 | return function(object, iteratee, keysFunc) { 1069 | var index = -1, 1070 | iterable = Object(object), 1071 | props = keysFunc(object), 1072 | length = props.length; 1073 | 1074 | while (length--) { 1075 | var key = props[fromRight ? length : ++index]; 1076 | if (iteratee(iterable[key], key, iterable) === false) { 1077 | break; 1078 | } 1079 | } 1080 | return object; 1081 | }; 1082 | } 1083 | 1084 | /** 1085 | * Creates a function that produces an instance of `Ctor` regardless of 1086 | * whether it was invoked as part of a `new` expression or by `call` or `apply`. 1087 | * 1088 | * @private 1089 | * @param {Function} Ctor The constructor to wrap. 1090 | * @returns {Function} Returns the new wrapped function. 1091 | */ 1092 | function createCtor(Ctor) { 1093 | return function() { 1094 | // Use a `switch` statement to work with class constructors. See 1095 | // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 1096 | // for more details. 1097 | var args = arguments; 1098 | var thisBinding = baseCreate(Ctor.prototype), 1099 | result = Ctor.apply(thisBinding, args); 1100 | 1101 | // Mimic the constructor's `return` behavior. 1102 | // See https://es5.github.io/#x13.2.2 for more details. 1103 | return isObject(result) ? result : thisBinding; 1104 | }; 1105 | } 1106 | 1107 | /** 1108 | * Creates a `_.find` or `_.findLast` function. 1109 | * 1110 | * @private 1111 | * @param {Function} findIndexFunc The function to find the collection index. 1112 | * @returns {Function} Returns the new find function. 1113 | */ 1114 | function createFind(findIndexFunc) { 1115 | return function(collection, predicate, fromIndex) { 1116 | var iterable = Object(collection); 1117 | if (!isArrayLike(collection)) { 1118 | var iteratee = baseIteratee(predicate, 3); 1119 | collection = keys(collection); 1120 | predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 1121 | } 1122 | var index = findIndexFunc(collection, predicate, fromIndex); 1123 | return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 1124 | }; 1125 | } 1126 | 1127 | /** 1128 | * Creates a function that wraps `func` to invoke it with the `this` binding 1129 | * of `thisArg` and `partials` prepended to the arguments it receives. 1130 | * 1131 | * @private 1132 | * @param {Function} func The function to wrap. 1133 | * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 1134 | * @param {*} thisArg The `this` binding of `func`. 1135 | * @param {Array} partials The arguments to prepend to those provided to 1136 | * the new function. 1137 | * @returns {Function} Returns the new wrapped function. 1138 | */ 1139 | function createPartial(func, bitmask, thisArg, partials) { 1140 | if (typeof func != 'function') { 1141 | throw new TypeError(FUNC_ERROR_TEXT); 1142 | } 1143 | var isBind = bitmask & WRAP_BIND_FLAG, 1144 | Ctor = createCtor(func); 1145 | 1146 | function wrapper() { 1147 | var argsIndex = -1, 1148 | argsLength = arguments.length, 1149 | leftIndex = -1, 1150 | leftLength = partials.length, 1151 | args = Array(leftLength + argsLength), 1152 | fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 1153 | 1154 | while (++leftIndex < leftLength) { 1155 | args[leftIndex] = partials[leftIndex]; 1156 | } 1157 | while (argsLength--) { 1158 | args[leftIndex++] = arguments[++argsIndex]; 1159 | } 1160 | return fn.apply(isBind ? thisArg : this, args); 1161 | } 1162 | return wrapper; 1163 | } 1164 | 1165 | /** 1166 | * A specialized version of `baseIsEqualDeep` for arrays with support for 1167 | * partial deep comparisons. 1168 | * 1169 | * @private 1170 | * @param {Array} array The array to compare. 1171 | * @param {Array} other The other array to compare. 1172 | * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1173 | * @param {Function} customizer The function to customize comparisons. 1174 | * @param {Function} equalFunc The function to determine equivalents of values. 1175 | * @param {Object} stack Tracks traversed `array` and `other` objects. 1176 | * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 1177 | */ 1178 | function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 1179 | var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 1180 | arrLength = array.length, 1181 | othLength = other.length; 1182 | 1183 | if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 1184 | return false; 1185 | } 1186 | // Check that cyclic values are equal. 1187 | var arrStacked = stack.get(array); 1188 | var othStacked = stack.get(other); 1189 | if (arrStacked && othStacked) { 1190 | return arrStacked == other && othStacked == array; 1191 | } 1192 | var index = -1, 1193 | result = true, 1194 | seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; 1195 | 1196 | // Ignore non-index properties. 1197 | while (++index < arrLength) { 1198 | var arrValue = array[index], 1199 | othValue = other[index]; 1200 | 1201 | var compared; 1202 | if (compared !== undefined) { 1203 | if (compared) { 1204 | continue; 1205 | } 1206 | result = false; 1207 | break; 1208 | } 1209 | // Recursively compare arrays (susceptible to call stack limits). 1210 | if (seen) { 1211 | if (!baseSome(other, function(othValue, othIndex) { 1212 | if (!indexOf(seen, othIndex) && 1213 | (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 1214 | return seen.push(othIndex); 1215 | } 1216 | })) { 1217 | result = false; 1218 | break; 1219 | } 1220 | } else if (!( 1221 | arrValue === othValue || 1222 | equalFunc(arrValue, othValue, bitmask, customizer, stack) 1223 | )) { 1224 | result = false; 1225 | break; 1226 | } 1227 | } 1228 | return result; 1229 | } 1230 | 1231 | /** 1232 | * A specialized version of `baseIsEqualDeep` for comparing objects of 1233 | * the same `toStringTag`. 1234 | * 1235 | * **Note:** This function only supports comparing values with tags of 1236 | * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 1237 | * 1238 | * @private 1239 | * @param {Object} object The object to compare. 1240 | * @param {Object} other The other object to compare. 1241 | * @param {string} tag The `toStringTag` of the objects to compare. 1242 | * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1243 | * @param {Function} customizer The function to customize comparisons. 1244 | * @param {Function} equalFunc The function to determine equivalents of values. 1245 | * @param {Object} stack Tracks traversed `object` and `other` objects. 1246 | * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 1247 | */ 1248 | function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 1249 | switch (tag) { 1250 | 1251 | case boolTag: 1252 | case dateTag: 1253 | case numberTag: 1254 | // Coerce booleans to `1` or `0` and dates to milliseconds. 1255 | // Invalid dates are coerced to `NaN`. 1256 | return eq(+object, +other); 1257 | 1258 | case errorTag: 1259 | return object.name == other.name && object.message == other.message; 1260 | 1261 | case regexpTag: 1262 | case stringTag: 1263 | // Coerce regexes to strings and treat strings, primitives and objects, 1264 | // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 1265 | // for more details. 1266 | return object == (other + ''); 1267 | 1268 | } 1269 | return false; 1270 | } 1271 | 1272 | /** 1273 | * A specialized version of `baseIsEqualDeep` for objects with support for 1274 | * partial deep comparisons. 1275 | * 1276 | * @private 1277 | * @param {Object} object The object to compare. 1278 | * @param {Object} other The other object to compare. 1279 | * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 1280 | * @param {Function} customizer The function to customize comparisons. 1281 | * @param {Function} equalFunc The function to determine equivalents of values. 1282 | * @param {Object} stack Tracks traversed `object` and `other` objects. 1283 | * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 1284 | */ 1285 | function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 1286 | var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 1287 | objProps = keys(object), 1288 | objLength = objProps.length, 1289 | othProps = keys(other), 1290 | othLength = othProps.length; 1291 | 1292 | if (objLength != othLength && !isPartial) { 1293 | return false; 1294 | } 1295 | var index = objLength; 1296 | while (index--) { 1297 | var key = objProps[index]; 1298 | if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 1299 | return false; 1300 | } 1301 | } 1302 | // Check that cyclic values are equal. 1303 | var objStacked = stack.get(object); 1304 | var othStacked = stack.get(other); 1305 | if (objStacked && othStacked) { 1306 | return objStacked == other && othStacked == object; 1307 | } 1308 | var result = true; 1309 | 1310 | var skipCtor = isPartial; 1311 | while (++index < objLength) { 1312 | key = objProps[index]; 1313 | var objValue = object[key], 1314 | othValue = other[key]; 1315 | 1316 | var compared; 1317 | // Recursively compare objects (susceptible to call stack limits). 1318 | if (!(compared === undefined 1319 | ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 1320 | : compared 1321 | )) { 1322 | result = false; 1323 | break; 1324 | } 1325 | skipCtor || (skipCtor = key == 'constructor'); 1326 | } 1327 | if (result && !skipCtor) { 1328 | var objCtor = object.constructor, 1329 | othCtor = other.constructor; 1330 | 1331 | // Non `Object` object instances with different constructors are not equal. 1332 | if (objCtor != othCtor && 1333 | ('constructor' in object && 'constructor' in other) && 1334 | !(typeof objCtor == 'function' && objCtor instanceof objCtor && 1335 | typeof othCtor == 'function' && othCtor instanceof othCtor)) { 1336 | result = false; 1337 | } 1338 | } 1339 | return result; 1340 | } 1341 | 1342 | /** 1343 | * A specialized version of `baseRest` which flattens the rest array. 1344 | * 1345 | * @private 1346 | * @param {Function} func The function to apply a rest parameter to. 1347 | * @returns {Function} Returns the new function. 1348 | */ 1349 | function flatRest(func) { 1350 | return setToString(overRest(func, undefined, flatten), func + ''); 1351 | } 1352 | 1353 | /** 1354 | * Checks if `value` is a flattenable `arguments` object or array. 1355 | * 1356 | * @private 1357 | * @param {*} value The value to check. 1358 | * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 1359 | */ 1360 | function isFlattenable(value) { 1361 | return isArray(value) || isArguments(value); 1362 | } 1363 | 1364 | /** 1365 | * Checks if `value` is a valid array-like index. 1366 | * 1367 | * @private 1368 | * @param {*} value The value to check. 1369 | * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 1370 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 1371 | */ 1372 | function isIndex(value, length) { 1373 | var type = typeof value; 1374 | length = length == null ? MAX_SAFE_INTEGER : length; 1375 | 1376 | return !!length && 1377 | (type == 'number' || 1378 | (type != 'symbol' && reIsUint.test(value))) && 1379 | (value > -1 && value % 1 == 0 && value < length); 1380 | } 1381 | 1382 | /** 1383 | * Checks if the given arguments are from an iteratee call. 1384 | * 1385 | * @private 1386 | * @param {*} value The potential iteratee value argument. 1387 | * @param {*} index The potential iteratee index or key argument. 1388 | * @param {*} object The potential iteratee object argument. 1389 | * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 1390 | * else `false`. 1391 | */ 1392 | function isIterateeCall(value, index, object) { 1393 | if (!isObject(object)) { 1394 | return false; 1395 | } 1396 | var type = typeof index; 1397 | if (type == 'number' 1398 | ? (isArrayLike(object) && isIndex(index, object.length)) 1399 | : (type == 'string' && index in object) 1400 | ) { 1401 | return eq(object[index], value); 1402 | } 1403 | return false; 1404 | } 1405 | 1406 | /** 1407 | * This function is like 1408 | * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 1409 | * except that it includes inherited enumerable properties. 1410 | * 1411 | * @private 1412 | * @param {Object} object The object to query. 1413 | * @returns {Array} Returns the array of property names. 1414 | */ 1415 | function nativeKeysIn(object) { 1416 | var result = []; 1417 | if (object != null) { 1418 | for (var key in Object(object)) { 1419 | result.push(key); 1420 | } 1421 | } 1422 | return result; 1423 | } 1424 | 1425 | /** 1426 | * Converts `value` to a string using `Object.prototype.toString`. 1427 | * 1428 | * @private 1429 | * @param {*} value The value to convert. 1430 | * @returns {string} Returns the converted string. 1431 | */ 1432 | function objectToString(value) { 1433 | return nativeObjectToString.call(value); 1434 | } 1435 | 1436 | /** 1437 | * A specialized version of `baseRest` which transforms the rest array. 1438 | * 1439 | * @private 1440 | * @param {Function} func The function to apply a rest parameter to. 1441 | * @param {number} [start=func.length-1] The start position of the rest parameter. 1442 | * @param {Function} transform The rest array transform. 1443 | * @returns {Function} Returns the new function. 1444 | */ 1445 | function overRest(func, start, transform) { 1446 | start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 1447 | return function() { 1448 | var args = arguments, 1449 | index = -1, 1450 | length = nativeMax(args.length - start, 0), 1451 | array = Array(length); 1452 | 1453 | while (++index < length) { 1454 | array[index] = args[start + index]; 1455 | } 1456 | index = -1; 1457 | var otherArgs = Array(start + 1); 1458 | while (++index < start) { 1459 | otherArgs[index] = args[index]; 1460 | } 1461 | otherArgs[start] = transform(array); 1462 | return func.apply(this, otherArgs); 1463 | }; 1464 | } 1465 | 1466 | /** 1467 | * Sets the `toString` method of `func` to return `string`. 1468 | * 1469 | * @private 1470 | * @param {Function} func The function to modify. 1471 | * @param {Function} string The `toString` result. 1472 | * @returns {Function} Returns `func`. 1473 | */ 1474 | var setToString = identity; 1475 | 1476 | /*------------------------------------------------------------------------*/ 1477 | 1478 | /** 1479 | * Creates an array with all falsey values removed. The values `false`, `null`, 1480 | * `0`, `""`, `undefined`, and `NaN` are falsey. 1481 | * 1482 | * @static 1483 | * @memberOf _ 1484 | * @since 0.1.0 1485 | * @category Array 1486 | * @param {Array} array The array to compact. 1487 | * @returns {Array} Returns the new array of filtered values. 1488 | * @example 1489 | * 1490 | * _.compact([0, 1, false, 2, '', 3]); 1491 | * // => [1, 2, 3] 1492 | */ 1493 | function compact(array) { 1494 | return baseFilter(array, Boolean); 1495 | } 1496 | 1497 | /** 1498 | * Creates a new array concatenating `array` with any additional arrays 1499 | * and/or values. 1500 | * 1501 | * @static 1502 | * @memberOf _ 1503 | * @since 4.0.0 1504 | * @category Array 1505 | * @param {Array} array The array to concatenate. 1506 | * @param {...*} [values] The values to concatenate. 1507 | * @returns {Array} Returns the new concatenated array. 1508 | * @example 1509 | * 1510 | * var array = [1]; 1511 | * var other = _.concat(array, 2, [3], [[4]]); 1512 | * 1513 | * console.log(other); 1514 | * // => [1, 2, 3, [4]] 1515 | * 1516 | * console.log(array); 1517 | * // => [1] 1518 | */ 1519 | function concat() { 1520 | var length = arguments.length; 1521 | if (!length) { 1522 | return []; 1523 | } 1524 | var args = Array(length - 1), 1525 | array = arguments[0], 1526 | index = length; 1527 | 1528 | while (index--) { 1529 | args[index - 1] = arguments[index]; 1530 | } 1531 | return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 1532 | } 1533 | 1534 | /** 1535 | * This method is like `_.find` except that it returns the index of the first 1536 | * element `predicate` returns truthy for instead of the element itself. 1537 | * 1538 | * @static 1539 | * @memberOf _ 1540 | * @since 1.1.0 1541 | * @category Array 1542 | * @param {Array} array The array to inspect. 1543 | * @param {Function} [predicate=_.identity] The function invoked per iteration. 1544 | * @param {number} [fromIndex=0] The index to search from. 1545 | * @returns {number} Returns the index of the found element, else `-1`. 1546 | * @example 1547 | * 1548 | * var users = [ 1549 | * { 'user': 'barney', 'active': false }, 1550 | * { 'user': 'fred', 'active': false }, 1551 | * { 'user': 'pebbles', 'active': true } 1552 | * ]; 1553 | * 1554 | * _.findIndex(users, function(o) { return o.user == 'barney'; }); 1555 | * // => 0 1556 | * 1557 | * // The `_.matches` iteratee shorthand. 1558 | * _.findIndex(users, { 'user': 'fred', 'active': false }); 1559 | * // => 1 1560 | * 1561 | * // The `_.matchesProperty` iteratee shorthand. 1562 | * _.findIndex(users, ['active', false]); 1563 | * // => 0 1564 | * 1565 | * // The `_.property` iteratee shorthand. 1566 | * _.findIndex(users, 'active'); 1567 | * // => 2 1568 | */ 1569 | function findIndex(array, predicate, fromIndex) { 1570 | var length = array == null ? 0 : array.length; 1571 | if (!length) { 1572 | return -1; 1573 | } 1574 | var index = fromIndex == null ? 0 : toInteger(fromIndex); 1575 | if (index < 0) { 1576 | index = nativeMax(length + index, 0); 1577 | } 1578 | return baseFindIndex(array, baseIteratee(predicate, 3), index); 1579 | } 1580 | 1581 | /** 1582 | * Flattens `array` a single level deep. 1583 | * 1584 | * @static 1585 | * @memberOf _ 1586 | * @since 0.1.0 1587 | * @category Array 1588 | * @param {Array} array The array to flatten. 1589 | * @returns {Array} Returns the new flattened array. 1590 | * @example 1591 | * 1592 | * _.flatten([1, [2, [3, [4]], 5]]); 1593 | * // => [1, 2, [3, [4]], 5] 1594 | */ 1595 | function flatten(array) { 1596 | var length = array == null ? 0 : array.length; 1597 | return length ? baseFlatten(array, 1) : []; 1598 | } 1599 | 1600 | /** 1601 | * Recursively flattens `array`. 1602 | * 1603 | * @static 1604 | * @memberOf _ 1605 | * @since 3.0.0 1606 | * @category Array 1607 | * @param {Array} array The array to flatten. 1608 | * @returns {Array} Returns the new flattened array. 1609 | * @example 1610 | * 1611 | * _.flattenDeep([1, [2, [3, [4]], 5]]); 1612 | * // => [1, 2, 3, 4, 5] 1613 | */ 1614 | function flattenDeep(array) { 1615 | var length = array == null ? 0 : array.length; 1616 | return length ? baseFlatten(array, INFINITY) : []; 1617 | } 1618 | 1619 | /** 1620 | * Gets the first element of `array`. 1621 | * 1622 | * @static 1623 | * @memberOf _ 1624 | * @since 0.1.0 1625 | * @alias first 1626 | * @category Array 1627 | * @param {Array} array The array to query. 1628 | * @returns {*} Returns the first element of `array`. 1629 | * @example 1630 | * 1631 | * _.head([1, 2, 3]); 1632 | * // => 1 1633 | * 1634 | * _.head([]); 1635 | * // => undefined 1636 | */ 1637 | function head(array) { 1638 | return (array && array.length) ? array[0] : undefined; 1639 | } 1640 | 1641 | /** 1642 | * Gets the index at which the first occurrence of `value` is found in `array` 1643 | * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 1644 | * for equality comparisons. If `fromIndex` is negative, it's used as the 1645 | * offset from the end of `array`. 1646 | * 1647 | * @static 1648 | * @memberOf _ 1649 | * @since 0.1.0 1650 | * @category Array 1651 | * @param {Array} array The array to inspect. 1652 | * @param {*} value The value to search for. 1653 | * @param {number} [fromIndex=0] The index to search from. 1654 | * @returns {number} Returns the index of the matched value, else `-1`. 1655 | * @example 1656 | * 1657 | * _.indexOf([1, 2, 1, 2], 2); 1658 | * // => 1 1659 | * 1660 | * // Search from the `fromIndex`. 1661 | * _.indexOf([1, 2, 1, 2], 2, 2); 1662 | * // => 3 1663 | */ 1664 | function indexOf(array, value, fromIndex) { 1665 | var length = array == null ? 0 : array.length; 1666 | if (typeof fromIndex == 'number') { 1667 | fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; 1668 | } else { 1669 | fromIndex = 0; 1670 | } 1671 | var index = (fromIndex || 0) - 1, 1672 | isReflexive = value === value; 1673 | 1674 | while (++index < length) { 1675 | var other = array[index]; 1676 | if ((isReflexive ? other === value : other !== other)) { 1677 | return index; 1678 | } 1679 | } 1680 | return -1; 1681 | } 1682 | 1683 | /** 1684 | * Gets the last element of `array`. 1685 | * 1686 | * @static 1687 | * @memberOf _ 1688 | * @since 0.1.0 1689 | * @category Array 1690 | * @param {Array} array The array to query. 1691 | * @returns {*} Returns the last element of `array`. 1692 | * @example 1693 | * 1694 | * _.last([1, 2, 3]); 1695 | * // => 3 1696 | */ 1697 | function last(array) { 1698 | var length = array == null ? 0 : array.length; 1699 | return length ? array[length - 1] : undefined; 1700 | } 1701 | 1702 | /** 1703 | * Creates a slice of `array` from `start` up to, but not including, `end`. 1704 | * 1705 | * **Note:** This method is used instead of 1706 | * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 1707 | * returned. 1708 | * 1709 | * @static 1710 | * @memberOf _ 1711 | * @since 3.0.0 1712 | * @category Array 1713 | * @param {Array} array The array to slice. 1714 | * @param {number} [start=0] The start position. 1715 | * @param {number} [end=array.length] The end position. 1716 | * @returns {Array} Returns the slice of `array`. 1717 | */ 1718 | function slice(array, start, end) { 1719 | var length = array == null ? 0 : array.length; 1720 | start = start == null ? 0 : +start; 1721 | end = end === undefined ? length : +end; 1722 | return length ? baseSlice(array, start, end) : []; 1723 | } 1724 | 1725 | /*------------------------------------------------------------------------*/ 1726 | 1727 | /** 1728 | * Creates a `lodash` wrapper instance that wraps `value` with explicit method 1729 | * chain sequences enabled. The result of such sequences must be unwrapped 1730 | * with `_#value`. 1731 | * 1732 | * @static 1733 | * @memberOf _ 1734 | * @since 1.3.0 1735 | * @category Seq 1736 | * @param {*} value The value to wrap. 1737 | * @returns {Object} Returns the new `lodash` wrapper instance. 1738 | * @example 1739 | * 1740 | * var users = [ 1741 | * { 'user': 'barney', 'age': 36 }, 1742 | * { 'user': 'fred', 'age': 40 }, 1743 | * { 'user': 'pebbles', 'age': 1 } 1744 | * ]; 1745 | * 1746 | * var youngest = _ 1747 | * .chain(users) 1748 | * .sortBy('age') 1749 | * .map(function(o) { 1750 | * return o.user + ' is ' + o.age; 1751 | * }) 1752 | * .head() 1753 | * .value(); 1754 | * // => 'pebbles is 1' 1755 | */ 1756 | function chain(value) { 1757 | var result = lodash(value); 1758 | result.__chain__ = true; 1759 | return result; 1760 | } 1761 | 1762 | /** 1763 | * This method invokes `interceptor` and returns `value`. The interceptor 1764 | * is invoked with one argument; (value). The purpose of this method is to 1765 | * "tap into" a method chain sequence in order to modify intermediate results. 1766 | * 1767 | * @static 1768 | * @memberOf _ 1769 | * @since 0.1.0 1770 | * @category Seq 1771 | * @param {*} value The value to provide to `interceptor`. 1772 | * @param {Function} interceptor The function to invoke. 1773 | * @returns {*} Returns `value`. 1774 | * @example 1775 | * 1776 | * _([1, 2, 3]) 1777 | * .tap(function(array) { 1778 | * // Mutate input array. 1779 | * array.pop(); 1780 | * }) 1781 | * .reverse() 1782 | * .value(); 1783 | * // => [2, 1] 1784 | */ 1785 | function tap(value, interceptor) { 1786 | interceptor(value); 1787 | return value; 1788 | } 1789 | 1790 | /** 1791 | * This method is like `_.tap` except that it returns the result of `interceptor`. 1792 | * The purpose of this method is to "pass thru" values replacing intermediate 1793 | * results in a method chain sequence. 1794 | * 1795 | * @static 1796 | * @memberOf _ 1797 | * @since 3.0.0 1798 | * @category Seq 1799 | * @param {*} value The value to provide to `interceptor`. 1800 | * @param {Function} interceptor The function to invoke. 1801 | * @returns {*} Returns the result of `interceptor`. 1802 | * @example 1803 | * 1804 | * _(' abc ') 1805 | * .chain() 1806 | * .trim() 1807 | * .thru(function(value) { 1808 | * return [value]; 1809 | * }) 1810 | * .value(); 1811 | * // => ['abc'] 1812 | */ 1813 | function thru(value, interceptor) { 1814 | return interceptor(value); 1815 | } 1816 | 1817 | /** 1818 | * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 1819 | * 1820 | * @name chain 1821 | * @memberOf _ 1822 | * @since 0.1.0 1823 | * @category Seq 1824 | * @returns {Object} Returns the new `lodash` wrapper instance. 1825 | * @example 1826 | * 1827 | * var users = [ 1828 | * { 'user': 'barney', 'age': 36 }, 1829 | * { 'user': 'fred', 'age': 40 } 1830 | * ]; 1831 | * 1832 | * // A sequence without explicit chaining. 1833 | * _(users).head(); 1834 | * // => { 'user': 'barney', 'age': 36 } 1835 | * 1836 | * // A sequence with explicit chaining. 1837 | * _(users) 1838 | * .chain() 1839 | * .head() 1840 | * .pick('user') 1841 | * .value(); 1842 | * // => { 'user': 'barney' } 1843 | */ 1844 | function wrapperChain() { 1845 | return chain(this); 1846 | } 1847 | 1848 | /** 1849 | * Executes the chain sequence to resolve the unwrapped value. 1850 | * 1851 | * @name value 1852 | * @memberOf _ 1853 | * @since 0.1.0 1854 | * @alias toJSON, valueOf 1855 | * @category Seq 1856 | * @returns {*} Returns the resolved unwrapped value. 1857 | * @example 1858 | * 1859 | * _([1, 2, 3]).value(); 1860 | * // => [1, 2, 3] 1861 | */ 1862 | function wrapperValue() { 1863 | return baseWrapperValue(this.__wrapped__, this.__actions__); 1864 | } 1865 | 1866 | /*------------------------------------------------------------------------*/ 1867 | 1868 | /** 1869 | * Checks if `predicate` returns truthy for **all** elements of `collection`. 1870 | * Iteration is stopped once `predicate` returns falsey. The predicate is 1871 | * invoked with three arguments: (value, index|key, collection). 1872 | * 1873 | * **Note:** This method returns `true` for 1874 | * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 1875 | * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 1876 | * elements of empty collections. 1877 | * 1878 | * @static 1879 | * @memberOf _ 1880 | * @since 0.1.0 1881 | * @category Collection 1882 | * @param {Array|Object} collection The collection to iterate over. 1883 | * @param {Function} [predicate=_.identity] The function invoked per iteration. 1884 | * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 1885 | * @returns {boolean} Returns `true` if all elements pass the predicate check, 1886 | * else `false`. 1887 | * @example 1888 | * 1889 | * _.every([true, 1, null, 'yes'], Boolean); 1890 | * // => false 1891 | * 1892 | * var users = [ 1893 | * { 'user': 'barney', 'age': 36, 'active': false }, 1894 | * { 'user': 'fred', 'age': 40, 'active': false } 1895 | * ]; 1896 | * 1897 | * // The `_.matches` iteratee shorthand. 1898 | * _.every(users, { 'user': 'barney', 'active': false }); 1899 | * // => false 1900 | * 1901 | * // The `_.matchesProperty` iteratee shorthand. 1902 | * _.every(users, ['active', false]); 1903 | * // => true 1904 | * 1905 | * // The `_.property` iteratee shorthand. 1906 | * _.every(users, 'active'); 1907 | * // => false 1908 | */ 1909 | function every(collection, predicate, guard) { 1910 | predicate = guard ? undefined : predicate; 1911 | return baseEvery(collection, baseIteratee(predicate)); 1912 | } 1913 | 1914 | /** 1915 | * Iterates over elements of `collection`, returning an array of all elements 1916 | * `predicate` returns truthy for. The predicate is invoked with three 1917 | * arguments: (value, index|key, collection). 1918 | * 1919 | * **Note:** Unlike `_.remove`, this method returns a new array. 1920 | * 1921 | * @static 1922 | * @memberOf _ 1923 | * @since 0.1.0 1924 | * @category Collection 1925 | * @param {Array|Object} collection The collection to iterate over. 1926 | * @param {Function} [predicate=_.identity] The function invoked per iteration. 1927 | * @returns {Array} Returns the new filtered array. 1928 | * @see _.reject 1929 | * @example 1930 | * 1931 | * var users = [ 1932 | * { 'user': 'barney', 'age': 36, 'active': true }, 1933 | * { 'user': 'fred', 'age': 40, 'active': false } 1934 | * ]; 1935 | * 1936 | * _.filter(users, function(o) { return !o.active; }); 1937 | * // => objects for ['fred'] 1938 | * 1939 | * // The `_.matches` iteratee shorthand. 1940 | * _.filter(users, { 'age': 36, 'active': true }); 1941 | * // => objects for ['barney'] 1942 | * 1943 | * // The `_.matchesProperty` iteratee shorthand. 1944 | * _.filter(users, ['active', false]); 1945 | * // => objects for ['fred'] 1946 | * 1947 | * // The `_.property` iteratee shorthand. 1948 | * _.filter(users, 'active'); 1949 | * // => objects for ['barney'] 1950 | * 1951 | * // Combining several predicates using `_.overEvery` or `_.overSome`. 1952 | * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 1953 | * // => objects for ['fred', 'barney'] 1954 | */ 1955 | function filter(collection, predicate) { 1956 | return baseFilter(collection, baseIteratee(predicate)); 1957 | } 1958 | 1959 | /** 1960 | * Iterates over elements of `collection`, returning the first element 1961 | * `predicate` returns truthy for. The predicate is invoked with three 1962 | * arguments: (value, index|key, collection). 1963 | * 1964 | * @static 1965 | * @memberOf _ 1966 | * @since 0.1.0 1967 | * @category Collection 1968 | * @param {Array|Object} collection The collection to inspect. 1969 | * @param {Function} [predicate=_.identity] The function invoked per iteration. 1970 | * @param {number} [fromIndex=0] The index to search from. 1971 | * @returns {*} Returns the matched element, else `undefined`. 1972 | * @example 1973 | * 1974 | * var users = [ 1975 | * { 'user': 'barney', 'age': 36, 'active': true }, 1976 | * { 'user': 'fred', 'age': 40, 'active': false }, 1977 | * { 'user': 'pebbles', 'age': 1, 'active': true } 1978 | * ]; 1979 | * 1980 | * _.find(users, function(o) { return o.age < 40; }); 1981 | * // => object for 'barney' 1982 | * 1983 | * // The `_.matches` iteratee shorthand. 1984 | * _.find(users, { 'age': 1, 'active': true }); 1985 | * // => object for 'pebbles' 1986 | * 1987 | * // The `_.matchesProperty` iteratee shorthand. 1988 | * _.find(users, ['active', false]); 1989 | * // => object for 'fred' 1990 | * 1991 | * // The `_.property` iteratee shorthand. 1992 | * _.find(users, 'active'); 1993 | * // => object for 'barney' 1994 | */ 1995 | var find = createFind(findIndex); 1996 | 1997 | /** 1998 | * Iterates over elements of `collection` and invokes `iteratee` for each element. 1999 | * The iteratee is invoked with three arguments: (value, index|key, collection). 2000 | * Iteratee functions may exit iteration early by explicitly returning `false`. 2001 | * 2002 | * **Note:** As with other "Collections" methods, objects with a "length" 2003 | * property are iterated like arrays. To avoid this behavior use `_.forIn` 2004 | * or `_.forOwn` for object iteration. 2005 | * 2006 | * @static 2007 | * @memberOf _ 2008 | * @since 0.1.0 2009 | * @alias each 2010 | * @category Collection 2011 | * @param {Array|Object} collection The collection to iterate over. 2012 | * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2013 | * @returns {Array|Object} Returns `collection`. 2014 | * @see _.forEachRight 2015 | * @example 2016 | * 2017 | * _.forEach([1, 2], function(value) { 2018 | * console.log(value); 2019 | * }); 2020 | * // => Logs `1` then `2`. 2021 | * 2022 | * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 2023 | * console.log(key); 2024 | * }); 2025 | * // => Logs 'a' then 'b' (iteration order is not guaranteed). 2026 | */ 2027 | function forEach(collection, iteratee) { 2028 | return baseEach(collection, baseIteratee(iteratee)); 2029 | } 2030 | 2031 | /** 2032 | * Creates an array of values by running each element in `collection` thru 2033 | * `iteratee`. The iteratee is invoked with three arguments: 2034 | * (value, index|key, collection). 2035 | * 2036 | * Many lodash methods are guarded to work as iteratees for methods like 2037 | * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 2038 | * 2039 | * The guarded methods are: 2040 | * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 2041 | * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 2042 | * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 2043 | * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 2044 | * 2045 | * @static 2046 | * @memberOf _ 2047 | * @since 0.1.0 2048 | * @category Collection 2049 | * @param {Array|Object} collection The collection to iterate over. 2050 | * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2051 | * @returns {Array} Returns the new mapped array. 2052 | * @example 2053 | * 2054 | * function square(n) { 2055 | * return n * n; 2056 | * } 2057 | * 2058 | * _.map([4, 8], square); 2059 | * // => [16, 64] 2060 | * 2061 | * _.map({ 'a': 4, 'b': 8 }, square); 2062 | * // => [16, 64] (iteration order is not guaranteed) 2063 | * 2064 | * var users = [ 2065 | * { 'user': 'barney' }, 2066 | * { 'user': 'fred' } 2067 | * ]; 2068 | * 2069 | * // The `_.property` iteratee shorthand. 2070 | * _.map(users, 'user'); 2071 | * // => ['barney', 'fred'] 2072 | */ 2073 | function map(collection, iteratee) { 2074 | return baseMap(collection, baseIteratee(iteratee)); 2075 | } 2076 | 2077 | /** 2078 | * Reduces `collection` to a value which is the accumulated result of running 2079 | * each element in `collection` thru `iteratee`, where each successive 2080 | * invocation is supplied the return value of the previous. If `accumulator` 2081 | * is not given, the first element of `collection` is used as the initial 2082 | * value. The iteratee is invoked with four arguments: 2083 | * (accumulator, value, index|key, collection). 2084 | * 2085 | * Many lodash methods are guarded to work as iteratees for methods like 2086 | * `_.reduce`, `_.reduceRight`, and `_.transform`. 2087 | * 2088 | * The guarded methods are: 2089 | * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 2090 | * and `sortBy` 2091 | * 2092 | * @static 2093 | * @memberOf _ 2094 | * @since 0.1.0 2095 | * @category Collection 2096 | * @param {Array|Object} collection The collection to iterate over. 2097 | * @param {Function} [iteratee=_.identity] The function invoked per iteration. 2098 | * @param {*} [accumulator] The initial value. 2099 | * @returns {*} Returns the accumulated value. 2100 | * @see _.reduceRight 2101 | * @example 2102 | * 2103 | * _.reduce([1, 2], function(sum, n) { 2104 | * return sum + n; 2105 | * }, 0); 2106 | * // => 3 2107 | * 2108 | * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 2109 | * (result[value] || (result[value] = [])).push(key); 2110 | * return result; 2111 | * }, {}); 2112 | * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 2113 | */ 2114 | function reduce(collection, iteratee, accumulator) { 2115 | return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); 2116 | } 2117 | 2118 | /** 2119 | * Gets the size of `collection` by returning its length for array-like 2120 | * values or the number of own enumerable string keyed properties for objects. 2121 | * 2122 | * @static 2123 | * @memberOf _ 2124 | * @since 0.1.0 2125 | * @category Collection 2126 | * @param {Array|Object|string} collection The collection to inspect. 2127 | * @returns {number} Returns the collection size. 2128 | * @example 2129 | * 2130 | * _.size([1, 2, 3]); 2131 | * // => 3 2132 | * 2133 | * _.size({ 'a': 1, 'b': 2 }); 2134 | * // => 2 2135 | * 2136 | * _.size('pebbles'); 2137 | * // => 7 2138 | */ 2139 | function size(collection) { 2140 | if (collection == null) { 2141 | return 0; 2142 | } 2143 | collection = isArrayLike(collection) ? collection : nativeKeys(collection); 2144 | return collection.length; 2145 | } 2146 | 2147 | /** 2148 | * Checks if `predicate` returns truthy for **any** element of `collection`. 2149 | * Iteration is stopped once `predicate` returns truthy. The predicate is 2150 | * invoked with three arguments: (value, index|key, collection). 2151 | * 2152 | * @static 2153 | * @memberOf _ 2154 | * @since 0.1.0 2155 | * @category Collection 2156 | * @param {Array|Object} collection The collection to iterate over. 2157 | * @param {Function} [predicate=_.identity] The function invoked per iteration. 2158 | * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 2159 | * @returns {boolean} Returns `true` if any element passes the predicate check, 2160 | * else `false`. 2161 | * @example 2162 | * 2163 | * _.some([null, 0, 'yes', false], Boolean); 2164 | * // => true 2165 | * 2166 | * var users = [ 2167 | * { 'user': 'barney', 'active': true }, 2168 | * { 'user': 'fred', 'active': false } 2169 | * ]; 2170 | * 2171 | * // The `_.matches` iteratee shorthand. 2172 | * _.some(users, { 'user': 'barney', 'active': false }); 2173 | * // => false 2174 | * 2175 | * // The `_.matchesProperty` iteratee shorthand. 2176 | * _.some(users, ['active', false]); 2177 | * // => true 2178 | * 2179 | * // The `_.property` iteratee shorthand. 2180 | * _.some(users, 'active'); 2181 | * // => true 2182 | */ 2183 | function some(collection, predicate, guard) { 2184 | predicate = guard ? undefined : predicate; 2185 | return baseSome(collection, baseIteratee(predicate)); 2186 | } 2187 | 2188 | /** 2189 | * Creates an array of elements, sorted in ascending order by the results of 2190 | * running each element in a collection thru each iteratee. This method 2191 | * performs a stable sort, that is, it preserves the original sort order of 2192 | * equal elements. The iteratees are invoked with one argument: (value). 2193 | * 2194 | * @static 2195 | * @memberOf _ 2196 | * @since 0.1.0 2197 | * @category Collection 2198 | * @param {Array|Object} collection The collection to iterate over. 2199 | * @param {...(Function|Function[])} [iteratees=[_.identity]] 2200 | * The iteratees to sort by. 2201 | * @returns {Array} Returns the new sorted array. 2202 | * @example 2203 | * 2204 | * var users = [ 2205 | * { 'user': 'fred', 'age': 48 }, 2206 | * { 'user': 'barney', 'age': 36 }, 2207 | * { 'user': 'fred', 'age': 30 }, 2208 | * { 'user': 'barney', 'age': 34 } 2209 | * ]; 2210 | * 2211 | * _.sortBy(users, [function(o) { return o.user; }]); 2212 | * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 2213 | * 2214 | * _.sortBy(users, ['user', 'age']); 2215 | * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 2216 | */ 2217 | function sortBy(collection, iteratee) { 2218 | var index = 0; 2219 | iteratee = baseIteratee(iteratee); 2220 | 2221 | return baseMap(baseMap(collection, function(value, key, collection) { 2222 | return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; 2223 | }).sort(function(object, other) { 2224 | return compareAscending(object.criteria, other.criteria) || (object.index - other.index); 2225 | }), baseProperty('value')); 2226 | } 2227 | 2228 | /*------------------------------------------------------------------------*/ 2229 | 2230 | /** 2231 | * Creates a function that invokes `func`, with the `this` binding and arguments 2232 | * of the created function, while it's called less than `n` times. Subsequent 2233 | * calls to the created function return the result of the last `func` invocation. 2234 | * 2235 | * @static 2236 | * @memberOf _ 2237 | * @since 3.0.0 2238 | * @category Function 2239 | * @param {number} n The number of calls at which `func` is no longer invoked. 2240 | * @param {Function} func The function to restrict. 2241 | * @returns {Function} Returns the new restricted function. 2242 | * @example 2243 | * 2244 | * jQuery(element).on('click', _.before(5, addContactToList)); 2245 | * // => Allows adding up to 4 contacts to the list. 2246 | */ 2247 | function before(n, func) { 2248 | var result; 2249 | if (typeof func != 'function') { 2250 | throw new TypeError(FUNC_ERROR_TEXT); 2251 | } 2252 | n = toInteger(n); 2253 | return function() { 2254 | if (--n > 0) { 2255 | result = func.apply(this, arguments); 2256 | } 2257 | if (n <= 1) { 2258 | func = undefined; 2259 | } 2260 | return result; 2261 | }; 2262 | } 2263 | 2264 | /** 2265 | * Creates a function that invokes `func` with the `this` binding of `thisArg` 2266 | * and `partials` prepended to the arguments it receives. 2267 | * 2268 | * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 2269 | * may be used as a placeholder for partially applied arguments. 2270 | * 2271 | * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 2272 | * property of bound functions. 2273 | * 2274 | * @static 2275 | * @memberOf _ 2276 | * @since 0.1.0 2277 | * @category Function 2278 | * @param {Function} func The function to bind. 2279 | * @param {*} thisArg The `this` binding of `func`. 2280 | * @param {...*} [partials] The arguments to be partially applied. 2281 | * @returns {Function} Returns the new bound function. 2282 | * @example 2283 | * 2284 | * function greet(greeting, punctuation) { 2285 | * return greeting + ' ' + this.user + punctuation; 2286 | * } 2287 | * 2288 | * var object = { 'user': 'fred' }; 2289 | * 2290 | * var bound = _.bind(greet, object, 'hi'); 2291 | * bound('!'); 2292 | * // => 'hi fred!' 2293 | * 2294 | * // Bound with placeholders. 2295 | * var bound = _.bind(greet, object, _, '!'); 2296 | * bound('hi'); 2297 | * // => 'hi fred!' 2298 | */ 2299 | var bind = baseRest(function(func, thisArg, partials) { 2300 | return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); 2301 | }); 2302 | 2303 | /** 2304 | * Defers invoking the `func` until the current call stack has cleared. Any 2305 | * additional arguments are provided to `func` when it's invoked. 2306 | * 2307 | * @static 2308 | * @memberOf _ 2309 | * @since 0.1.0 2310 | * @category Function 2311 | * @param {Function} func The function to defer. 2312 | * @param {...*} [args] The arguments to invoke `func` with. 2313 | * @returns {number} Returns the timer id. 2314 | * @example 2315 | * 2316 | * _.defer(function(text) { 2317 | * console.log(text); 2318 | * }, 'deferred'); 2319 | * // => Logs 'deferred' after one millisecond. 2320 | */ 2321 | var defer = baseRest(function(func, args) { 2322 | return baseDelay(func, 1, args); 2323 | }); 2324 | 2325 | /** 2326 | * Invokes `func` after `wait` milliseconds. Any additional arguments are 2327 | * provided to `func` when it's invoked. 2328 | * 2329 | * @static 2330 | * @memberOf _ 2331 | * @since 0.1.0 2332 | * @category Function 2333 | * @param {Function} func The function to delay. 2334 | * @param {number} wait The number of milliseconds to delay invocation. 2335 | * @param {...*} [args] The arguments to invoke `func` with. 2336 | * @returns {number} Returns the timer id. 2337 | * @example 2338 | * 2339 | * _.delay(function(text) { 2340 | * console.log(text); 2341 | * }, 1000, 'later'); 2342 | * // => Logs 'later' after one second. 2343 | */ 2344 | var delay = baseRest(function(func, wait, args) { 2345 | return baseDelay(func, toNumber(wait) || 0, args); 2346 | }); 2347 | 2348 | /** 2349 | * Creates a function that negates the result of the predicate `func`. The 2350 | * `func` predicate is invoked with the `this` binding and arguments of the 2351 | * created function. 2352 | * 2353 | * @static 2354 | * @memberOf _ 2355 | * @since 3.0.0 2356 | * @category Function 2357 | * @param {Function} predicate The predicate to negate. 2358 | * @returns {Function} Returns the new negated function. 2359 | * @example 2360 | * 2361 | * function isEven(n) { 2362 | * return n % 2 == 0; 2363 | * } 2364 | * 2365 | * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 2366 | * // => [1, 3, 5] 2367 | */ 2368 | function negate(predicate) { 2369 | if (typeof predicate != 'function') { 2370 | throw new TypeError(FUNC_ERROR_TEXT); 2371 | } 2372 | return function() { 2373 | var args = arguments; 2374 | return !predicate.apply(this, args); 2375 | }; 2376 | } 2377 | 2378 | /** 2379 | * Creates a function that is restricted to invoking `func` once. Repeat calls 2380 | * to the function return the value of the first invocation. The `func` is 2381 | * invoked with the `this` binding and arguments of the created function. 2382 | * 2383 | * @static 2384 | * @memberOf _ 2385 | * @since 0.1.0 2386 | * @category Function 2387 | * @param {Function} func The function to restrict. 2388 | * @returns {Function} Returns the new restricted function. 2389 | * @example 2390 | * 2391 | * var initialize = _.once(createApplication); 2392 | * initialize(); 2393 | * initialize(); 2394 | * // => `createApplication` is invoked once 2395 | */ 2396 | function once(func) { 2397 | return before(2, func); 2398 | } 2399 | 2400 | /*------------------------------------------------------------------------*/ 2401 | 2402 | /** 2403 | * Creates a shallow clone of `value`. 2404 | * 2405 | * **Note:** This method is loosely based on the 2406 | * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 2407 | * and supports cloning arrays, array buffers, booleans, date objects, maps, 2408 | * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 2409 | * arrays. The own enumerable properties of `arguments` objects are cloned 2410 | * as plain objects. An empty object is returned for uncloneable values such 2411 | * as error objects, functions, DOM nodes, and WeakMaps. 2412 | * 2413 | * @static 2414 | * @memberOf _ 2415 | * @since 0.1.0 2416 | * @category Lang 2417 | * @param {*} value The value to clone. 2418 | * @returns {*} Returns the cloned value. 2419 | * @see _.cloneDeep 2420 | * @example 2421 | * 2422 | * var objects = [{ 'a': 1 }, { 'b': 2 }]; 2423 | * 2424 | * var shallow = _.clone(objects); 2425 | * console.log(shallow[0] === objects[0]); 2426 | * // => true 2427 | */ 2428 | function clone(value) { 2429 | if (!isObject(value)) { 2430 | return value; 2431 | } 2432 | return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); 2433 | } 2434 | 2435 | /** 2436 | * Performs a 2437 | * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 2438 | * comparison between two values to determine if they are equivalent. 2439 | * 2440 | * @static 2441 | * @memberOf _ 2442 | * @since 4.0.0 2443 | * @category Lang 2444 | * @param {*} value The value to compare. 2445 | * @param {*} other The other value to compare. 2446 | * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2447 | * @example 2448 | * 2449 | * var object = { 'a': 1 }; 2450 | * var other = { 'a': 1 }; 2451 | * 2452 | * _.eq(object, object); 2453 | * // => true 2454 | * 2455 | * _.eq(object, other); 2456 | * // => false 2457 | * 2458 | * _.eq('a', 'a'); 2459 | * // => true 2460 | * 2461 | * _.eq('a', Object('a')); 2462 | * // => false 2463 | * 2464 | * _.eq(NaN, NaN); 2465 | * // => true 2466 | */ 2467 | function eq(value, other) { 2468 | return value === other || (value !== value && other !== other); 2469 | } 2470 | 2471 | /** 2472 | * Checks if `value` is likely an `arguments` object. 2473 | * 2474 | * @static 2475 | * @memberOf _ 2476 | * @since 0.1.0 2477 | * @category Lang 2478 | * @param {*} value The value to check. 2479 | * @returns {boolean} Returns `true` if `value` is an `arguments` object, 2480 | * else `false`. 2481 | * @example 2482 | * 2483 | * _.isArguments(function() { return arguments; }()); 2484 | * // => true 2485 | * 2486 | * _.isArguments([1, 2, 3]); 2487 | * // => false 2488 | */ 2489 | var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 2490 | return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 2491 | !propertyIsEnumerable.call(value, 'callee'); 2492 | }; 2493 | 2494 | /** 2495 | * Checks if `value` is classified as an `Array` object. 2496 | * 2497 | * @static 2498 | * @memberOf _ 2499 | * @since 0.1.0 2500 | * @category Lang 2501 | * @param {*} value The value to check. 2502 | * @returns {boolean} Returns `true` if `value` is an array, else `false`. 2503 | * @example 2504 | * 2505 | * _.isArray([1, 2, 3]); 2506 | * // => true 2507 | * 2508 | * _.isArray(document.body.children); 2509 | * // => false 2510 | * 2511 | * _.isArray('abc'); 2512 | * // => false 2513 | * 2514 | * _.isArray(_.noop); 2515 | * // => false 2516 | */ 2517 | var isArray = Array.isArray; 2518 | 2519 | /** 2520 | * Checks if `value` is array-like. A value is considered array-like if it's 2521 | * not a function and has a `value.length` that's an integer greater than or 2522 | * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 2523 | * 2524 | * @static 2525 | * @memberOf _ 2526 | * @since 4.0.0 2527 | * @category Lang 2528 | * @param {*} value The value to check. 2529 | * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 2530 | * @example 2531 | * 2532 | * _.isArrayLike([1, 2, 3]); 2533 | * // => true 2534 | * 2535 | * _.isArrayLike(document.body.children); 2536 | * // => true 2537 | * 2538 | * _.isArrayLike('abc'); 2539 | * // => true 2540 | * 2541 | * _.isArrayLike(_.noop); 2542 | * // => false 2543 | */ 2544 | function isArrayLike(value) { 2545 | return value != null && isLength(value.length) && !isFunction(value); 2546 | } 2547 | 2548 | /** 2549 | * Checks if `value` is classified as a boolean primitive or object. 2550 | * 2551 | * @static 2552 | * @memberOf _ 2553 | * @since 0.1.0 2554 | * @category Lang 2555 | * @param {*} value The value to check. 2556 | * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 2557 | * @example 2558 | * 2559 | * _.isBoolean(false); 2560 | * // => true 2561 | * 2562 | * _.isBoolean(null); 2563 | * // => false 2564 | */ 2565 | function isBoolean(value) { 2566 | return value === true || value === false || 2567 | (isObjectLike(value) && baseGetTag(value) == boolTag); 2568 | } 2569 | 2570 | /** 2571 | * Checks if `value` is classified as a `Date` object. 2572 | * 2573 | * @static 2574 | * @memberOf _ 2575 | * @since 0.1.0 2576 | * @category Lang 2577 | * @param {*} value The value to check. 2578 | * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 2579 | * @example 2580 | * 2581 | * _.isDate(new Date); 2582 | * // => true 2583 | * 2584 | * _.isDate('Mon April 23 2012'); 2585 | * // => false 2586 | */ 2587 | var isDate = baseIsDate; 2588 | 2589 | /** 2590 | * Checks if `value` is an empty object, collection, map, or set. 2591 | * 2592 | * Objects are considered empty if they have no own enumerable string keyed 2593 | * properties. 2594 | * 2595 | * Array-like values such as `arguments` objects, arrays, buffers, strings, or 2596 | * jQuery-like collections are considered empty if they have a `length` of `0`. 2597 | * Similarly, maps and sets are considered empty if they have a `size` of `0`. 2598 | * 2599 | * @static 2600 | * @memberOf _ 2601 | * @since 0.1.0 2602 | * @category Lang 2603 | * @param {*} value The value to check. 2604 | * @returns {boolean} Returns `true` if `value` is empty, else `false`. 2605 | * @example 2606 | * 2607 | * _.isEmpty(null); 2608 | * // => true 2609 | * 2610 | * _.isEmpty(true); 2611 | * // => true 2612 | * 2613 | * _.isEmpty(1); 2614 | * // => true 2615 | * 2616 | * _.isEmpty([1, 2, 3]); 2617 | * // => false 2618 | * 2619 | * _.isEmpty({ 'a': 1 }); 2620 | * // => false 2621 | */ 2622 | function isEmpty(value) { 2623 | if (isArrayLike(value) && 2624 | (isArray(value) || isString(value) || 2625 | isFunction(value.splice) || isArguments(value))) { 2626 | return !value.length; 2627 | } 2628 | return !nativeKeys(value).length; 2629 | } 2630 | 2631 | /** 2632 | * Performs a deep comparison between two values to determine if they are 2633 | * equivalent. 2634 | * 2635 | * **Note:** This method supports comparing arrays, array buffers, booleans, 2636 | * date objects, error objects, maps, numbers, `Object` objects, regexes, 2637 | * sets, strings, symbols, and typed arrays. `Object` objects are compared 2638 | * by their own, not inherited, enumerable properties. Functions and DOM 2639 | * nodes are compared by strict equality, i.e. `===`. 2640 | * 2641 | * @static 2642 | * @memberOf _ 2643 | * @since 0.1.0 2644 | * @category Lang 2645 | * @param {*} value The value to compare. 2646 | * @param {*} other The other value to compare. 2647 | * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2648 | * @example 2649 | * 2650 | * var object = { 'a': 1 }; 2651 | * var other = { 'a': 1 }; 2652 | * 2653 | * _.isEqual(object, other); 2654 | * // => true 2655 | * 2656 | * object === other; 2657 | * // => false 2658 | */ 2659 | function isEqual(value, other) { 2660 | return baseIsEqual(value, other); 2661 | } 2662 | 2663 | /** 2664 | * Checks if `value` is a finite primitive number. 2665 | * 2666 | * **Note:** This method is based on 2667 | * [`Number.isFinite`](https://mdn.io/Number/isFinite). 2668 | * 2669 | * @static 2670 | * @memberOf _ 2671 | * @since 0.1.0 2672 | * @category Lang 2673 | * @param {*} value The value to check. 2674 | * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 2675 | * @example 2676 | * 2677 | * _.isFinite(3); 2678 | * // => true 2679 | * 2680 | * _.isFinite(Number.MIN_VALUE); 2681 | * // => true 2682 | * 2683 | * _.isFinite(Infinity); 2684 | * // => false 2685 | * 2686 | * _.isFinite('3'); 2687 | * // => false 2688 | */ 2689 | function isFinite(value) { 2690 | return typeof value == 'number' && nativeIsFinite(value); 2691 | } 2692 | 2693 | /** 2694 | * Checks if `value` is classified as a `Function` object. 2695 | * 2696 | * @static 2697 | * @memberOf _ 2698 | * @since 0.1.0 2699 | * @category Lang 2700 | * @param {*} value The value to check. 2701 | * @returns {boolean} Returns `true` if `value` is a function, else `false`. 2702 | * @example 2703 | * 2704 | * _.isFunction(_); 2705 | * // => true 2706 | * 2707 | * _.isFunction(/abc/); 2708 | * // => false 2709 | */ 2710 | function isFunction(value) { 2711 | if (!isObject(value)) { 2712 | return false; 2713 | } 2714 | // The use of `Object#toString` avoids issues with the `typeof` operator 2715 | // in Safari 9 which returns 'object' for typed arrays and other constructors. 2716 | var tag = baseGetTag(value); 2717 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 2718 | } 2719 | 2720 | /** 2721 | * Checks if `value` is a valid array-like length. 2722 | * 2723 | * **Note:** This method is loosely based on 2724 | * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 2725 | * 2726 | * @static 2727 | * @memberOf _ 2728 | * @since 4.0.0 2729 | * @category Lang 2730 | * @param {*} value The value to check. 2731 | * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 2732 | * @example 2733 | * 2734 | * _.isLength(3); 2735 | * // => true 2736 | * 2737 | * _.isLength(Number.MIN_VALUE); 2738 | * // => false 2739 | * 2740 | * _.isLength(Infinity); 2741 | * // => false 2742 | * 2743 | * _.isLength('3'); 2744 | * // => false 2745 | */ 2746 | function isLength(value) { 2747 | return typeof value == 'number' && 2748 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 2749 | } 2750 | 2751 | /** 2752 | * Checks if `value` is the 2753 | * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 2754 | * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 2755 | * 2756 | * @static 2757 | * @memberOf _ 2758 | * @since 0.1.0 2759 | * @category Lang 2760 | * @param {*} value The value to check. 2761 | * @returns {boolean} Returns `true` if `value` is an object, else `false`. 2762 | * @example 2763 | * 2764 | * _.isObject({}); 2765 | * // => true 2766 | * 2767 | * _.isObject([1, 2, 3]); 2768 | * // => true 2769 | * 2770 | * _.isObject(_.noop); 2771 | * // => true 2772 | * 2773 | * _.isObject(null); 2774 | * // => false 2775 | */ 2776 | function isObject(value) { 2777 | var type = typeof value; 2778 | return value != null && (type == 'object' || type == 'function'); 2779 | } 2780 | 2781 | /** 2782 | * Checks if `value` is object-like. A value is object-like if it's not `null` 2783 | * and has a `typeof` result of "object". 2784 | * 2785 | * @static 2786 | * @memberOf _ 2787 | * @since 4.0.0 2788 | * @category Lang 2789 | * @param {*} value The value to check. 2790 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2791 | * @example 2792 | * 2793 | * _.isObjectLike({}); 2794 | * // => true 2795 | * 2796 | * _.isObjectLike([1, 2, 3]); 2797 | * // => true 2798 | * 2799 | * _.isObjectLike(_.noop); 2800 | * // => false 2801 | * 2802 | * _.isObjectLike(null); 2803 | * // => false 2804 | */ 2805 | function isObjectLike(value) { 2806 | return value != null && typeof value == 'object'; 2807 | } 2808 | 2809 | /** 2810 | * Checks if `value` is `NaN`. 2811 | * 2812 | * **Note:** This method is based on 2813 | * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 2814 | * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 2815 | * `undefined` and other non-number values. 2816 | * 2817 | * @static 2818 | * @memberOf _ 2819 | * @since 0.1.0 2820 | * @category Lang 2821 | * @param {*} value The value to check. 2822 | * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 2823 | * @example 2824 | * 2825 | * _.isNaN(NaN); 2826 | * // => true 2827 | * 2828 | * _.isNaN(new Number(NaN)); 2829 | * // => true 2830 | * 2831 | * isNaN(undefined); 2832 | * // => true 2833 | * 2834 | * _.isNaN(undefined); 2835 | * // => false 2836 | */ 2837 | function isNaN(value) { 2838 | // An `NaN` primitive is the only value that is not equal to itself. 2839 | // Perform the `toStringTag` check first to avoid errors with some 2840 | // ActiveX objects in IE. 2841 | return isNumber(value) && value != +value; 2842 | } 2843 | 2844 | /** 2845 | * Checks if `value` is `null`. 2846 | * 2847 | * @static 2848 | * @memberOf _ 2849 | * @since 0.1.0 2850 | * @category Lang 2851 | * @param {*} value The value to check. 2852 | * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 2853 | * @example 2854 | * 2855 | * _.isNull(null); 2856 | * // => true 2857 | * 2858 | * _.isNull(void 0); 2859 | * // => false 2860 | */ 2861 | function isNull(value) { 2862 | return value === null; 2863 | } 2864 | 2865 | /** 2866 | * Checks if `value` is classified as a `Number` primitive or object. 2867 | * 2868 | * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 2869 | * classified as numbers, use the `_.isFinite` method. 2870 | * 2871 | * @static 2872 | * @memberOf _ 2873 | * @since 0.1.0 2874 | * @category Lang 2875 | * @param {*} value The value to check. 2876 | * @returns {boolean} Returns `true` if `value` is a number, else `false`. 2877 | * @example 2878 | * 2879 | * _.isNumber(3); 2880 | * // => true 2881 | * 2882 | * _.isNumber(Number.MIN_VALUE); 2883 | * // => true 2884 | * 2885 | * _.isNumber(Infinity); 2886 | * // => true 2887 | * 2888 | * _.isNumber('3'); 2889 | * // => false 2890 | */ 2891 | function isNumber(value) { 2892 | return typeof value == 'number' || 2893 | (isObjectLike(value) && baseGetTag(value) == numberTag); 2894 | } 2895 | 2896 | /** 2897 | * Checks if `value` is classified as a `RegExp` object. 2898 | * 2899 | * @static 2900 | * @memberOf _ 2901 | * @since 0.1.0 2902 | * @category Lang 2903 | * @param {*} value The value to check. 2904 | * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 2905 | * @example 2906 | * 2907 | * _.isRegExp(/abc/); 2908 | * // => true 2909 | * 2910 | * _.isRegExp('/abc/'); 2911 | * // => false 2912 | */ 2913 | var isRegExp = baseIsRegExp; 2914 | 2915 | /** 2916 | * Checks if `value` is classified as a `String` primitive or object. 2917 | * 2918 | * @static 2919 | * @since 0.1.0 2920 | * @memberOf _ 2921 | * @category Lang 2922 | * @param {*} value The value to check. 2923 | * @returns {boolean} Returns `true` if `value` is a string, else `false`. 2924 | * @example 2925 | * 2926 | * _.isString('abc'); 2927 | * // => true 2928 | * 2929 | * _.isString(1); 2930 | * // => false 2931 | */ 2932 | function isString(value) { 2933 | return typeof value == 'string' || 2934 | (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 2935 | } 2936 | 2937 | /** 2938 | * Checks if `value` is `undefined`. 2939 | * 2940 | * @static 2941 | * @since 0.1.0 2942 | * @memberOf _ 2943 | * @category Lang 2944 | * @param {*} value The value to check. 2945 | * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 2946 | * @example 2947 | * 2948 | * _.isUndefined(void 0); 2949 | * // => true 2950 | * 2951 | * _.isUndefined(null); 2952 | * // => false 2953 | */ 2954 | function isUndefined(value) { 2955 | return value === undefined; 2956 | } 2957 | 2958 | /** 2959 | * Converts `value` to an array. 2960 | * 2961 | * @static 2962 | * @since 0.1.0 2963 | * @memberOf _ 2964 | * @category Lang 2965 | * @param {*} value The value to convert. 2966 | * @returns {Array} Returns the converted array. 2967 | * @example 2968 | * 2969 | * _.toArray({ 'a': 1, 'b': 2 }); 2970 | * // => [1, 2] 2971 | * 2972 | * _.toArray('abc'); 2973 | * // => ['a', 'b', 'c'] 2974 | * 2975 | * _.toArray(1); 2976 | * // => [] 2977 | * 2978 | * _.toArray(null); 2979 | * // => [] 2980 | */ 2981 | function toArray(value) { 2982 | if (!isArrayLike(value)) { 2983 | return values(value); 2984 | } 2985 | return value.length ? copyArray(value) : []; 2986 | } 2987 | 2988 | /** 2989 | * Converts `value` to an integer. 2990 | * 2991 | * **Note:** This method is loosely based on 2992 | * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 2993 | * 2994 | * @static 2995 | * @memberOf _ 2996 | * @since 4.0.0 2997 | * @category Lang 2998 | * @param {*} value The value to convert. 2999 | * @returns {number} Returns the converted integer. 3000 | * @example 3001 | * 3002 | * _.toInteger(3.2); 3003 | * // => 3 3004 | * 3005 | * _.toInteger(Number.MIN_VALUE); 3006 | * // => 0 3007 | * 3008 | * _.toInteger(Infinity); 3009 | * // => 1.7976931348623157e+308 3010 | * 3011 | * _.toInteger('3.2'); 3012 | * // => 3 3013 | */ 3014 | var toInteger = Number; 3015 | 3016 | /** 3017 | * Converts `value` to a number. 3018 | * 3019 | * @static 3020 | * @memberOf _ 3021 | * @since 4.0.0 3022 | * @category Lang 3023 | * @param {*} value The value to process. 3024 | * @returns {number} Returns the number. 3025 | * @example 3026 | * 3027 | * _.toNumber(3.2); 3028 | * // => 3.2 3029 | * 3030 | * _.toNumber(Number.MIN_VALUE); 3031 | * // => 5e-324 3032 | * 3033 | * _.toNumber(Infinity); 3034 | * // => Infinity 3035 | * 3036 | * _.toNumber('3.2'); 3037 | * // => 3.2 3038 | */ 3039 | var toNumber = Number; 3040 | 3041 | /** 3042 | * Converts `value` to a string. An empty string is returned for `null` 3043 | * and `undefined` values. The sign of `-0` is preserved. 3044 | * 3045 | * @static 3046 | * @memberOf _ 3047 | * @since 4.0.0 3048 | * @category Lang 3049 | * @param {*} value The value to convert. 3050 | * @returns {string} Returns the converted string. 3051 | * @example 3052 | * 3053 | * _.toString(null); 3054 | * // => '' 3055 | * 3056 | * _.toString(-0); 3057 | * // => '-0' 3058 | * 3059 | * _.toString([1, 2, 3]); 3060 | * // => '1,2,3' 3061 | */ 3062 | function toString(value) { 3063 | if (typeof value == 'string') { 3064 | return value; 3065 | } 3066 | return value == null ? '' : (value + ''); 3067 | } 3068 | 3069 | /*------------------------------------------------------------------------*/ 3070 | 3071 | /** 3072 | * Assigns own enumerable string keyed properties of source objects to the 3073 | * destination object. Source objects are applied from left to right. 3074 | * Subsequent sources overwrite property assignments of previous sources. 3075 | * 3076 | * **Note:** This method mutates `object` and is loosely based on 3077 | * [`Object.assign`](https://mdn.io/Object/assign). 3078 | * 3079 | * @static 3080 | * @memberOf _ 3081 | * @since 0.10.0 3082 | * @category Object 3083 | * @param {Object} object The destination object. 3084 | * @param {...Object} [sources] The source objects. 3085 | * @returns {Object} Returns `object`. 3086 | * @see _.assignIn 3087 | * @example 3088 | * 3089 | * function Foo() { 3090 | * this.a = 1; 3091 | * } 3092 | * 3093 | * function Bar() { 3094 | * this.c = 3; 3095 | * } 3096 | * 3097 | * Foo.prototype.b = 2; 3098 | * Bar.prototype.d = 4; 3099 | * 3100 | * _.assign({ 'a': 0 }, new Foo, new Bar); 3101 | * // => { 'a': 1, 'c': 3 } 3102 | */ 3103 | var assign = createAssigner(function(object, source) { 3104 | copyObject(source, nativeKeys(source), object); 3105 | }); 3106 | 3107 | /** 3108 | * This method is like `_.assign` except that it iterates over own and 3109 | * inherited source properties. 3110 | * 3111 | * **Note:** This method mutates `object`. 3112 | * 3113 | * @static 3114 | * @memberOf _ 3115 | * @since 4.0.0 3116 | * @alias extend 3117 | * @category Object 3118 | * @param {Object} object The destination object. 3119 | * @param {...Object} [sources] The source objects. 3120 | * @returns {Object} Returns `object`. 3121 | * @see _.assign 3122 | * @example 3123 | * 3124 | * function Foo() { 3125 | * this.a = 1; 3126 | * } 3127 | * 3128 | * function Bar() { 3129 | * this.c = 3; 3130 | * } 3131 | * 3132 | * Foo.prototype.b = 2; 3133 | * Bar.prototype.d = 4; 3134 | * 3135 | * _.assignIn({ 'a': 0 }, new Foo, new Bar); 3136 | * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 3137 | */ 3138 | var assignIn = createAssigner(function(object, source) { 3139 | copyObject(source, nativeKeysIn(source), object); 3140 | }); 3141 | 3142 | /** 3143 | * Creates an object that inherits from the `prototype` object. If a 3144 | * `properties` object is given, its own enumerable string keyed properties 3145 | * are assigned to the created object. 3146 | * 3147 | * @static 3148 | * @memberOf _ 3149 | * @since 2.3.0 3150 | * @category Object 3151 | * @param {Object} prototype The object to inherit from. 3152 | * @param {Object} [properties] The properties to assign to the object. 3153 | * @returns {Object} Returns the new object. 3154 | * @example 3155 | * 3156 | * function Shape() { 3157 | * this.x = 0; 3158 | * this.y = 0; 3159 | * } 3160 | * 3161 | * function Circle() { 3162 | * Shape.call(this); 3163 | * } 3164 | * 3165 | * Circle.prototype = _.create(Shape.prototype, { 3166 | * 'constructor': Circle 3167 | * }); 3168 | * 3169 | * var circle = new Circle; 3170 | * circle instanceof Circle; 3171 | * // => true 3172 | * 3173 | * circle instanceof Shape; 3174 | * // => true 3175 | */ 3176 | function create(prototype, properties) { 3177 | var result = baseCreate(prototype); 3178 | return properties == null ? result : assign(result, properties); 3179 | } 3180 | 3181 | /** 3182 | * Assigns own and inherited enumerable string keyed properties of source 3183 | * objects to the destination object for all destination properties that 3184 | * resolve to `undefined`. Source objects are applied from left to right. 3185 | * Once a property is set, additional values of the same property are ignored. 3186 | * 3187 | * **Note:** This method mutates `object`. 3188 | * 3189 | * @static 3190 | * @since 0.1.0 3191 | * @memberOf _ 3192 | * @category Object 3193 | * @param {Object} object The destination object. 3194 | * @param {...Object} [sources] The source objects. 3195 | * @returns {Object} Returns `object`. 3196 | * @see _.defaultsDeep 3197 | * @example 3198 | * 3199 | * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 3200 | * // => { 'a': 1, 'b': 2 } 3201 | */ 3202 | var defaults = baseRest(function(object, sources) { 3203 | object = Object(object); 3204 | 3205 | var index = -1; 3206 | var length = sources.length; 3207 | var guard = length > 2 ? sources[2] : undefined; 3208 | 3209 | if (guard && isIterateeCall(sources[0], sources[1], guard)) { 3210 | length = 1; 3211 | } 3212 | 3213 | while (++index < length) { 3214 | var source = sources[index]; 3215 | var props = keysIn(source); 3216 | var propsIndex = -1; 3217 | var propsLength = props.length; 3218 | 3219 | while (++propsIndex < propsLength) { 3220 | var key = props[propsIndex]; 3221 | var value = object[key]; 3222 | 3223 | if (value === undefined || 3224 | (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 3225 | object[key] = source[key]; 3226 | } 3227 | } 3228 | } 3229 | 3230 | return object; 3231 | }); 3232 | 3233 | /** 3234 | * Checks if `path` is a direct property of `object`. 3235 | * 3236 | * @static 3237 | * @since 0.1.0 3238 | * @memberOf _ 3239 | * @category Object 3240 | * @param {Object} object The object to query. 3241 | * @param {Array|string} path The path to check. 3242 | * @returns {boolean} Returns `true` if `path` exists, else `false`. 3243 | * @example 3244 | * 3245 | * var object = { 'a': { 'b': 2 } }; 3246 | * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 3247 | * 3248 | * _.has(object, 'a'); 3249 | * // => true 3250 | * 3251 | * _.has(object, 'a.b'); 3252 | * // => true 3253 | * 3254 | * _.has(object, ['a', 'b']); 3255 | * // => true 3256 | * 3257 | * _.has(other, 'a'); 3258 | * // => false 3259 | */ 3260 | function has(object, path) { 3261 | return object != null && hasOwnProperty.call(object, path); 3262 | } 3263 | 3264 | /** 3265 | * Creates an array of the own enumerable property names of `object`. 3266 | * 3267 | * **Note:** Non-object values are coerced to objects. See the 3268 | * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 3269 | * for more details. 3270 | * 3271 | * @static 3272 | * @since 0.1.0 3273 | * @memberOf _ 3274 | * @category Object 3275 | * @param {Object} object The object to query. 3276 | * @returns {Array} Returns the array of property names. 3277 | * @example 3278 | * 3279 | * function Foo() { 3280 | * this.a = 1; 3281 | * this.b = 2; 3282 | * } 3283 | * 3284 | * Foo.prototype.c = 3; 3285 | * 3286 | * _.keys(new Foo); 3287 | * // => ['a', 'b'] (iteration order is not guaranteed) 3288 | * 3289 | * _.keys('hi'); 3290 | * // => ['0', '1'] 3291 | */ 3292 | var keys = nativeKeys; 3293 | 3294 | /** 3295 | * Creates an array of the own and inherited enumerable property names of `object`. 3296 | * 3297 | * **Note:** Non-object values are coerced to objects. 3298 | * 3299 | * @static 3300 | * @memberOf _ 3301 | * @since 3.0.0 3302 | * @category Object 3303 | * @param {Object} object The object to query. 3304 | * @returns {Array} Returns the array of property names. 3305 | * @example 3306 | * 3307 | * function Foo() { 3308 | * this.a = 1; 3309 | * this.b = 2; 3310 | * } 3311 | * 3312 | * Foo.prototype.c = 3; 3313 | * 3314 | * _.keysIn(new Foo); 3315 | * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 3316 | */ 3317 | var keysIn = nativeKeysIn; 3318 | 3319 | /** 3320 | * Creates an object composed of the picked `object` properties. 3321 | * 3322 | * @static 3323 | * @since 0.1.0 3324 | * @memberOf _ 3325 | * @category Object 3326 | * @param {Object} object The source object. 3327 | * @param {...(string|string[])} [paths] The property paths to pick. 3328 | * @returns {Object} Returns the new object. 3329 | * @example 3330 | * 3331 | * var object = { 'a': 1, 'b': '2', 'c': 3 }; 3332 | * 3333 | * _.pick(object, ['a', 'c']); 3334 | * // => { 'a': 1, 'c': 3 } 3335 | */ 3336 | var pick = flatRest(function(object, paths) { 3337 | return object == null ? {} : basePick(object, paths); 3338 | }); 3339 | 3340 | /** 3341 | * This method is like `_.get` except that if the resolved value is a 3342 | * function it's invoked with the `this` binding of its parent object and 3343 | * its result is returned. 3344 | * 3345 | * @static 3346 | * @since 0.1.0 3347 | * @memberOf _ 3348 | * @category Object 3349 | * @param {Object} object The object to query. 3350 | * @param {Array|string} path The path of the property to resolve. 3351 | * @param {*} [defaultValue] The value returned for `undefined` resolved values. 3352 | * @returns {*} Returns the resolved value. 3353 | * @example 3354 | * 3355 | * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 3356 | * 3357 | * _.result(object, 'a[0].b.c1'); 3358 | * // => 3 3359 | * 3360 | * _.result(object, 'a[0].b.c2'); 3361 | * // => 4 3362 | * 3363 | * _.result(object, 'a[0].b.c3', 'default'); 3364 | * // => 'default' 3365 | * 3366 | * _.result(object, 'a[0].b.c3', _.constant('default')); 3367 | * // => 'default' 3368 | */ 3369 | function result(object, path, defaultValue) { 3370 | var value = object == null ? undefined : object[path]; 3371 | if (value === undefined) { 3372 | value = defaultValue; 3373 | } 3374 | return isFunction(value) ? value.call(object) : value; 3375 | } 3376 | 3377 | /** 3378 | * Creates an array of the own enumerable string keyed property values of `object`. 3379 | * 3380 | * **Note:** Non-object values are coerced to objects. 3381 | * 3382 | * @static 3383 | * @since 0.1.0 3384 | * @memberOf _ 3385 | * @category Object 3386 | * @param {Object} object The object to query. 3387 | * @returns {Array} Returns the array of property values. 3388 | * @example 3389 | * 3390 | * function Foo() { 3391 | * this.a = 1; 3392 | * this.b = 2; 3393 | * } 3394 | * 3395 | * Foo.prototype.c = 3; 3396 | * 3397 | * _.values(new Foo); 3398 | * // => [1, 2] (iteration order is not guaranteed) 3399 | * 3400 | * _.values('hi'); 3401 | * // => ['h', 'i'] 3402 | */ 3403 | function values(object) { 3404 | return object == null ? [] : baseValues(object, keys(object)); 3405 | } 3406 | 3407 | /*------------------------------------------------------------------------*/ 3408 | 3409 | /** 3410 | * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 3411 | * corresponding HTML entities. 3412 | * 3413 | * **Note:** No other characters are escaped. To escape additional 3414 | * characters use a third-party library like [_he_](https://mths.be/he). 3415 | * 3416 | * Though the ">" character is escaped for symmetry, characters like 3417 | * ">" and "/" don't need escaping in HTML and have no special meaning 3418 | * unless they're part of a tag or unquoted attribute value. See 3419 | * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 3420 | * (under "semi-related fun fact") for more details. 3421 | * 3422 | * When working with HTML you should always 3423 | * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 3424 | * XSS vectors. 3425 | * 3426 | * @static 3427 | * @since 0.1.0 3428 | * @memberOf _ 3429 | * @category String 3430 | * @param {string} [string=''] The string to escape. 3431 | * @returns {string} Returns the escaped string. 3432 | * @example 3433 | * 3434 | * _.escape('fred, barney, & pebbles'); 3435 | * // => 'fred, barney, & pebbles' 3436 | */ 3437 | function escape(string) { 3438 | string = toString(string); 3439 | return (string && reHasUnescapedHtml.test(string)) 3440 | ? string.replace(reUnescapedHtml, escapeHtmlChar) 3441 | : string; 3442 | } 3443 | 3444 | /*------------------------------------------------------------------------*/ 3445 | 3446 | /** 3447 | * This method returns the first argument it receives. 3448 | * 3449 | * @static 3450 | * @since 0.1.0 3451 | * @memberOf _ 3452 | * @category Util 3453 | * @param {*} value Any value. 3454 | * @returns {*} Returns `value`. 3455 | * @example 3456 | * 3457 | * var object = { 'a': 1 }; 3458 | * 3459 | * console.log(_.identity(object) === object); 3460 | * // => true 3461 | */ 3462 | function identity(value) { 3463 | return value; 3464 | } 3465 | 3466 | /** 3467 | * Creates a function that invokes `func` with the arguments of the created 3468 | * function. If `func` is a property name, the created function returns the 3469 | * property value for a given element. If `func` is an array or object, the 3470 | * created function returns `true` for elements that contain the equivalent 3471 | * source properties, otherwise it returns `false`. 3472 | * 3473 | * @static 3474 | * @since 4.0.0 3475 | * @memberOf _ 3476 | * @category Util 3477 | * @param {*} [func=_.identity] The value to convert to a callback. 3478 | * @returns {Function} Returns the callback. 3479 | * @example 3480 | * 3481 | * var users = [ 3482 | * { 'user': 'barney', 'age': 36, 'active': true }, 3483 | * { 'user': 'fred', 'age': 40, 'active': false } 3484 | * ]; 3485 | * 3486 | * // The `_.matches` iteratee shorthand. 3487 | * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 3488 | * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 3489 | * 3490 | * // The `_.matchesProperty` iteratee shorthand. 3491 | * _.filter(users, _.iteratee(['user', 'fred'])); 3492 | * // => [{ 'user': 'fred', 'age': 40 }] 3493 | * 3494 | * // The `_.property` iteratee shorthand. 3495 | * _.map(users, _.iteratee('user')); 3496 | * // => ['barney', 'fred'] 3497 | * 3498 | * // Create custom iteratee shorthands. 3499 | * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 3500 | * return !_.isRegExp(func) ? iteratee(func) : function(string) { 3501 | * return func.test(string); 3502 | * }; 3503 | * }); 3504 | * 3505 | * _.filter(['abc', 'def'], /ef/); 3506 | * // => ['def'] 3507 | */ 3508 | var iteratee = baseIteratee; 3509 | 3510 | /** 3511 | * Creates a function that performs a partial deep comparison between a given 3512 | * object and `source`, returning `true` if the given object has equivalent 3513 | * property values, else `false`. 3514 | * 3515 | * **Note:** The created function is equivalent to `_.isMatch` with `source` 3516 | * partially applied. 3517 | * 3518 | * Partial comparisons will match empty array and empty object `source` 3519 | * values against any array or object value, respectively. See `_.isEqual` 3520 | * for a list of supported value comparisons. 3521 | * 3522 | * **Note:** Multiple values can be checked by combining several matchers 3523 | * using `_.overSome` 3524 | * 3525 | * @static 3526 | * @memberOf _ 3527 | * @since 3.0.0 3528 | * @category Util 3529 | * @param {Object} source The object of property values to match. 3530 | * @returns {Function} Returns the new spec function. 3531 | * @example 3532 | * 3533 | * var objects = [ 3534 | * { 'a': 1, 'b': 2, 'c': 3 }, 3535 | * { 'a': 4, 'b': 5, 'c': 6 } 3536 | * ]; 3537 | * 3538 | * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 3539 | * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 3540 | * 3541 | * // Checking for several possible values 3542 | * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 3543 | * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 3544 | */ 3545 | function matches(source) { 3546 | return baseMatches(assign({}, source)); 3547 | } 3548 | 3549 | /** 3550 | * Adds all own enumerable string keyed function properties of a source 3551 | * object to the destination object. If `object` is a function, then methods 3552 | * are added to its prototype as well. 3553 | * 3554 | * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 3555 | * avoid conflicts caused by modifying the original. 3556 | * 3557 | * @static 3558 | * @since 0.1.0 3559 | * @memberOf _ 3560 | * @category Util 3561 | * @param {Function|Object} [object=lodash] The destination object. 3562 | * @param {Object} source The object of functions to add. 3563 | * @param {Object} [options={}] The options object. 3564 | * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 3565 | * @returns {Function|Object} Returns `object`. 3566 | * @example 3567 | * 3568 | * function vowels(string) { 3569 | * return _.filter(string, function(v) { 3570 | * return /[aeiou]/i.test(v); 3571 | * }); 3572 | * } 3573 | * 3574 | * _.mixin({ 'vowels': vowels }); 3575 | * _.vowels('fred'); 3576 | * // => ['e'] 3577 | * 3578 | * _('fred').vowels().value(); 3579 | * // => ['e'] 3580 | * 3581 | * _.mixin({ 'vowels': vowels }, { 'chain': false }); 3582 | * _('fred').vowels(); 3583 | * // => ['e'] 3584 | */ 3585 | function mixin(object, source, options) { 3586 | var props = keys(source), 3587 | methodNames = baseFunctions(source, props); 3588 | 3589 | if (options == null && 3590 | !(isObject(source) && (methodNames.length || !props.length))) { 3591 | options = source; 3592 | source = object; 3593 | object = this; 3594 | methodNames = baseFunctions(source, keys(source)); 3595 | } 3596 | var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 3597 | isFunc = isFunction(object); 3598 | 3599 | baseEach(methodNames, function(methodName) { 3600 | var func = source[methodName]; 3601 | object[methodName] = func; 3602 | if (isFunc) { 3603 | object.prototype[methodName] = function() { 3604 | var chainAll = this.__chain__; 3605 | if (chain || chainAll) { 3606 | var result = object(this.__wrapped__), 3607 | actions = result.__actions__ = copyArray(this.__actions__); 3608 | 3609 | actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 3610 | result.__chain__ = chainAll; 3611 | return result; 3612 | } 3613 | return func.apply(object, arrayPush([this.value()], arguments)); 3614 | }; 3615 | } 3616 | }); 3617 | 3618 | return object; 3619 | } 3620 | 3621 | /** 3622 | * Reverts the `_` variable to its previous value and returns a reference to 3623 | * the `lodash` function. 3624 | * 3625 | * @static 3626 | * @since 0.1.0 3627 | * @memberOf _ 3628 | * @category Util 3629 | * @returns {Function} Returns the `lodash` function. 3630 | * @example 3631 | * 3632 | * var lodash = _.noConflict(); 3633 | */ 3634 | function noConflict() { 3635 | if (root._ === this) { 3636 | root._ = oldDash; 3637 | } 3638 | return this; 3639 | } 3640 | 3641 | /** 3642 | * This method returns `undefined`. 3643 | * 3644 | * @static 3645 | * @memberOf _ 3646 | * @since 2.3.0 3647 | * @category Util 3648 | * @example 3649 | * 3650 | * _.times(2, _.noop); 3651 | * // => [undefined, undefined] 3652 | */ 3653 | function noop() { 3654 | // No operation performed. 3655 | } 3656 | 3657 | /** 3658 | * Generates a unique ID. If `prefix` is given, the ID is appended to it. 3659 | * 3660 | * @static 3661 | * @since 0.1.0 3662 | * @memberOf _ 3663 | * @category Util 3664 | * @param {string} [prefix=''] The value to prefix the ID with. 3665 | * @returns {string} Returns the unique ID. 3666 | * @example 3667 | * 3668 | * _.uniqueId('contact_'); 3669 | * // => 'contact_104' 3670 | * 3671 | * _.uniqueId(); 3672 | * // => '105' 3673 | */ 3674 | function uniqueId(prefix) { 3675 | var id = ++idCounter; 3676 | return toString(prefix) + id; 3677 | } 3678 | 3679 | /*------------------------------------------------------------------------*/ 3680 | 3681 | /** 3682 | * Computes the maximum value of `array`. If `array` is empty or falsey, 3683 | * `undefined` is returned. 3684 | * 3685 | * @static 3686 | * @since 0.1.0 3687 | * @memberOf _ 3688 | * @category Math 3689 | * @param {Array} array The array to iterate over. 3690 | * @returns {*} Returns the maximum value. 3691 | * @example 3692 | * 3693 | * _.max([4, 2, 8, 6]); 3694 | * // => 8 3695 | * 3696 | * _.max([]); 3697 | * // => undefined 3698 | */ 3699 | function max(array) { 3700 | return (array && array.length) 3701 | ? baseExtremum(array, identity, baseGt) 3702 | : undefined; 3703 | } 3704 | 3705 | /** 3706 | * Computes the minimum value of `array`. If `array` is empty or falsey, 3707 | * `undefined` is returned. 3708 | * 3709 | * @static 3710 | * @since 0.1.0 3711 | * @memberOf _ 3712 | * @category Math 3713 | * @param {Array} array The array to iterate over. 3714 | * @returns {*} Returns the minimum value. 3715 | * @example 3716 | * 3717 | * _.min([4, 2, 8, 6]); 3718 | * // => 2 3719 | * 3720 | * _.min([]); 3721 | * // => undefined 3722 | */ 3723 | function min(array) { 3724 | return (array && array.length) 3725 | ? baseExtremum(array, identity, baseLt) 3726 | : undefined; 3727 | } 3728 | 3729 | /*------------------------------------------------------------------------*/ 3730 | 3731 | // Add methods that return wrapped values in chain sequences. 3732 | lodash.assignIn = assignIn; 3733 | lodash.before = before; 3734 | lodash.bind = bind; 3735 | lodash.chain = chain; 3736 | lodash.compact = compact; 3737 | lodash.concat = concat; 3738 | lodash.create = create; 3739 | lodash.defaults = defaults; 3740 | lodash.defer = defer; 3741 | lodash.delay = delay; 3742 | lodash.filter = filter; 3743 | lodash.flatten = flatten; 3744 | lodash.flattenDeep = flattenDeep; 3745 | lodash.iteratee = iteratee; 3746 | lodash.keys = keys; 3747 | lodash.map = map; 3748 | lodash.matches = matches; 3749 | lodash.mixin = mixin; 3750 | lodash.negate = negate; 3751 | lodash.once = once; 3752 | lodash.pick = pick; 3753 | lodash.slice = slice; 3754 | lodash.sortBy = sortBy; 3755 | lodash.tap = tap; 3756 | lodash.thru = thru; 3757 | lodash.toArray = toArray; 3758 | lodash.values = values; 3759 | 3760 | // Add aliases. 3761 | lodash.extend = assignIn; 3762 | 3763 | // Add methods to `lodash.prototype`. 3764 | mixin(lodash, lodash); 3765 | 3766 | /*------------------------------------------------------------------------*/ 3767 | 3768 | // Add methods that return unwrapped values in chain sequences. 3769 | lodash.clone = clone; 3770 | lodash.escape = escape; 3771 | lodash.every = every; 3772 | lodash.find = find; 3773 | lodash.forEach = forEach; 3774 | lodash.has = has; 3775 | lodash.head = head; 3776 | lodash.identity = identity; 3777 | lodash.indexOf = indexOf; 3778 | lodash.isArguments = isArguments; 3779 | lodash.isArray = isArray; 3780 | lodash.isBoolean = isBoolean; 3781 | lodash.isDate = isDate; 3782 | lodash.isEmpty = isEmpty; 3783 | lodash.isEqual = isEqual; 3784 | lodash.isFinite = isFinite; 3785 | lodash.isFunction = isFunction; 3786 | lodash.isNaN = isNaN; 3787 | lodash.isNull = isNull; 3788 | lodash.isNumber = isNumber; 3789 | lodash.isObject = isObject; 3790 | lodash.isRegExp = isRegExp; 3791 | lodash.isString = isString; 3792 | lodash.isUndefined = isUndefined; 3793 | lodash.last = last; 3794 | lodash.max = max; 3795 | lodash.min = min; 3796 | lodash.noConflict = noConflict; 3797 | lodash.noop = noop; 3798 | lodash.reduce = reduce; 3799 | lodash.result = result; 3800 | lodash.size = size; 3801 | lodash.some = some; 3802 | lodash.uniqueId = uniqueId; 3803 | 3804 | // Add aliases. 3805 | lodash.each = forEach; 3806 | lodash.first = head; 3807 | 3808 | mixin(lodash, (function() { 3809 | var source = {}; 3810 | baseForOwn(lodash, function(func, methodName) { 3811 | if (!hasOwnProperty.call(lodash.prototype, methodName)) { 3812 | source[methodName] = func; 3813 | } 3814 | }); 3815 | return source; 3816 | }()), { 'chain': false }); 3817 | 3818 | /*------------------------------------------------------------------------*/ 3819 | 3820 | /** 3821 | * The semantic version number. 3822 | * 3823 | * @static 3824 | * @memberOf _ 3825 | * @type {string} 3826 | */ 3827 | lodash.VERSION = VERSION; 3828 | 3829 | // Add `Array` methods to `lodash.prototype`. 3830 | baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 3831 | var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], 3832 | chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 3833 | retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); 3834 | 3835 | lodash.prototype[methodName] = function() { 3836 | var args = arguments; 3837 | if (retUnwrapped && !this.__chain__) { 3838 | var value = this.value(); 3839 | return func.apply(isArray(value) ? value : [], args); 3840 | } 3841 | return this[chainName](function(value) { 3842 | return func.apply(isArray(value) ? value : [], args); 3843 | }); 3844 | }; 3845 | }); 3846 | 3847 | // Add chain sequence methods to the `lodash` wrapper. 3848 | lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 3849 | 3850 | /*--------------------------------------------------------------------------*/ 3851 | 3852 | // Some AMD build optimizers, like r.js, check for condition patterns like: 3853 | if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { 3854 | // Expose Lodash on the global object to prevent errors when Lodash is 3855 | // loaded by a script tag in the presence of an AMD loader. 3856 | // See http://requirejs.org/docs/errors.html#mismatch for more details. 3857 | // Use `_.noConflict` to remove Lodash from the global object. 3858 | root._ = lodash; 3859 | 3860 | // Define as an anonymous module so, through path mapping, it can be 3861 | // referenced as the "underscore" module. 3862 | define(function() { 3863 | return lodash; 3864 | }); 3865 | } 3866 | // Check for `exports` after `define` in case a build optimizer adds it. 3867 | else if (freeModule) { 3868 | // Export for Node.js. 3869 | (freeModule.exports = lodash)._ = lodash; 3870 | // Export for CommonJS support. 3871 | freeExports._ = lodash; 3872 | } 3873 | else { 3874 | // Export to the global object. 3875 | root._ = lodash; 3876 | } 3877 | }.call(this)); 3878 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/lodash.core.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE 4 | * Build: `lodash core -o ./dist/lodash.core.js` 5 | */ 6 | ;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); 7 | return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ 9 | return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, 10 | r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;var c=o.get(n),f=o.get(t);if(c&&f)return c==t&&f==n;for(var c=-1,f=true,a=2&r?[]:Z;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn); 16 | }function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n; 17 | return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n); 18 | return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ 19 | return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; 20 | var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r 4 | * Copyright OpenJS Foundation and other contributors 5 | * Released under MIT license 6 | * Based on Underscore.js 1.8.3 7 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 8 | */ 9 | (function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function L(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function C(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e; 14 | return e}function U(n){return"\\"+Yr[n]}function B(n,t){return null==n?X:n[t]}function T(n){return Nr.test(n)}function $(n){return Pr.test(n)}function D(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function F(n,t){return function(r){return n(t(r))}}function N(n,t){for(var r=-1,e=n.length,u=0,i=[];++r>>1,$n=[["ary",mn],["bind",_n],["bindKey",vn],["curry",yn],["curryRight",dn],["flip",jn],["partial",bn],["partialRight",wn],["rearg",xn]],Dn="[object Arguments]",Mn="[object Array]",Fn="[object AsyncFunction]",Nn="[object Boolean]",Pn="[object Date]",qn="[object DOMException]",Zn="[object Error]",Kn="[object Function]",Vn="[object GeneratorFunction]",Gn="[object Map]",Hn="[object Number]",Jn="[object Null]",Yn="[object Object]",Qn="[object Promise]",Xn="[object Proxy]",nt="[object RegExp]",tt="[object Set]",rt="[object String]",et="[object Symbol]",ut="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",ft="[object ArrayBuffer]",ct="[object DataView]",at="[object Float32Array]",lt="[object Float64Array]",st="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",_t="[object Uint8Array]",vt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",dt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,jt=RegExp(mt.source),At=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+/,Ct=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dt=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",Qt="\\u0300-\\u036f",Xt="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",tr=Qt+Xt+nr,rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",or="\\u2000-\\u206f",fr=" \\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",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",lr=ur+ir+or+fr,sr="['\u2019]",hr="["+Yt+"]",pr="["+lr+"]",_r="["+tr+"]",vr="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+vr+rr+er+cr+"]",br="\\ud83c[\\udffb-\\udfff]",wr="(?:"+_r+"|"+br+")",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+cr+"]",kr="\\u200d",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",zr="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Er=wr+"?",Sr="["+ar+"]?",Wr="(?:"+kr+"(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*",Lr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ur=Sr+Er+Wr,Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+_r+"?",_r,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(_r,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,Cr,Lr,vr,Br].join("|"),"g"),Nr=RegExp("["+kr+Yt+tr+ar+"]"),Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={}; 17 | Kr[at]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=!0,Kr[Dn]=Kr[Mn]=Kr[ft]=Kr[Nn]=Kr[ct]=Kr[Pn]=Kr[Zn]=Kr[Kn]=Kr[Gn]=Kr[Hn]=Kr[Yn]=Kr[nt]=Kr[tt]=Kr[rt]=Kr[it]=!1;var Vr={};Vr[Dn]=Vr[Mn]=Vr[ft]=Vr[ct]=Vr[Nn]=Vr[Pn]=Vr[at]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[Gn]=Vr[Hn]=Vr[Yn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[et]=Vr[_t]=Vr[vt]=Vr[gt]=Vr[yt]=!0,Vr[Zn]=Vr[Kn]=Vr[it]=!1;var Gr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a", 18 | "\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae", 19 | "\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g", 20 | "\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O", 21 | "\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w", 22 | "\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof global&&global&&global.Object===Object&&global,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ee&&"object"==typeof module&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){ 23 | try{var n=ue&&ue.require&&ue.require("util").types;return n?n:oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x(Gr),ge=x(Hr),ye=x(Jr),de=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ct)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t, 24 | this.__index__=0,this.__values__=X}function Ct(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Un,this.__views__=[]}function $t(){var n=new Ct(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n}function Yt(){if(this.__filtered__){var n=new Ct(this);n.__dir__=-1, 25 | n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Qt(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=Oi(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h-1}function lr(n,t){var r=this.__data__,e=Wr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function sr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function Fr(n,t,e,u,i,o){var f,c=t&an,a=t&ln,l=t&sn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=zi(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Kn||h==Vn;if(mh(n))return Iu(n,c);if(h==Yn||h==Dn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?Mu(n,Ur(f,n)):Du(n,Cr(f,n))}else{if(!Vr[h])return i?n:{};f=Si(n,h,c)}}o||(o=new wr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach(function(r){f.add(Fr(r,t,e,r,n,o))}):jh(n)&&n.forEach(function(r,u){ 33 | f.set(u,Fr(r,t,e,u,n,o))});var v=l?a?di:yi:a?qc:Pc,g=s?X:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),Sr(f,u,Fr(r,t,e,u,n,o))}),f}function Nr(n){var t=Pc(n);return function(r){return Pr(r,n,t)}}function Pr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Gr(n,t,r){if("function"!=typeof n)throw new pl(en);return Ws(function(){n.apply(X,r)},t)}function Hr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length; 34 | if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=!1):t.length>=tn&&(i=S,a=!1,t=new yr(t));n:for(;++uu?0:u+r), 35 | e=e===X||e>u?u:kc(e),e<0&&(e+=u),e=r>e?0:Oc(e);r0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,function(t){return uc(n[t])})}function _e(n,t){t=ku(t,n);for(var r=0,e=t.length;null!=n&&rt}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function Ae(n,t,r){return n>=Hl(t,r)&&n=120&&p.length>=120)?new yr(a&&p):X}p=n[0]; 37 | var _=-1,v=l[0];n:for(;++_-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){ 44 | var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function ru(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}function eu(n,t){var r="";if(!n||t<1||t>Wn)return r;do t%2&&(r+=n),t=Nl(t/2),t&&(n+=n);while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Ir(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Mr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;t=ku(t,n); 45 | for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++uu?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o=tn){var s=t?null:ks(n);if(s)return P(s);c=!1,u=S,l=new yr}else l=t?[]:a;n:for(;++e=e?n:au(n,t,r)}function Iu(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r); 50 | return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function zu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Eu(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}function Su(n){return _s?ll(_s.call(n)):{}}function Wu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=bc(n),o=t!==X,f=null===t,c=t===t,a=bc(t); 51 | if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e-1?u[i?t[o]:o]:X}}function Yu(n){return gi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],!0)}for(e=o?e:r;++e1&&d.reverse(),s&&cf))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&pn?new yr:X;for(i.set(n,t),i.set(t,n);++s1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Ut,"{\n/* [wrapped with "+t+"] */\n")}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n; 70 | return t=null==t?Wn:t,!!t&&("number"==r||"symbol"!=r&&Vt.test(n))&&n>-1&&n%1==0&&n0){if(++t>=On)return arguments[0]}else t=0; 74 | return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}}function uf(){return this}function of(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function ff(){var n=this.__wrapped__;if(n instanceof Ct){var t=n;return this.__actions__.length&&(t=new Ct(this)),t=t.reverse(),t.__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo); 84 | }function cf(){return wu(this.__wrapped__,this.__actions__)}function af(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function lf(n,t){return(bh(n)?i:te)(n,mi(t,3))}function sf(n,t){return ee(yf(n,t),1)}function hf(n,t){return ee(yf(n,t),Sn)}function pf(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function gf(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)), 85 | dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function df(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),r=e?X:r,bh(r)||(r=null==r?[]:[r]),He(n,t,r))}function bf(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)}function wf(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)}function mf(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))}function xf(n){return(bh(n)?Ir:iu)(n)}function jf(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t), 86 | (bh(n)?Rr:ou)(n,t)}function Af(n){return(bh(n)?zr:cu)(n)}function kf(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Gn||t==tt?n.size:Me(n).length}function Of(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function If(n,t){if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,mn,X,X,X,X,t)}function zf(n,t){var r;if("function"!=typeof t)throw new pl(en); 87 | return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Ef(n,t,r){t=r?X:t;var e=ai(n,yn,X,X,X,X,X,t);return e.placeholder=Ef.placeholder,e}function Sf(n,t,r){t=r?X:t;var e=ai(n,dn,X,X,X,X,X,t);return e.placeholder=Sf.placeholder,e}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Ws(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Hl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=_; 88 | }function f(){var n=fh();return o(n)?c(n):(g=Ws(f,i(n)),X)}function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function a(){g!==X&&As(g),d=0,h=y=p=g=X}function l(){return g===X?v:c(fh())}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new pl(en);return t=Ic(t)||0,fc(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Gl(Ic(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m), 89 | s.cancel=a,s.flush=l,s}function Lf(n){return ai(n,jn)}function Cf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||sr),r}function Uf(n){if("function"!=typeof n)throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2: 90 | return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Bf(n){return zf(2,n)}function Tf(n,t){if("function"!=typeof n)throw new pl(en);return t=t===X?t:kc(t),uu(n,t)}function $f(t,r){if("function"!=typeof t)throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu(function(e){var u=e[r],i=Ou(e,0,r);return u&&a(i,u),n(t,this,i)})}function Df(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u), 91 | Wf(n,t,{leading:e,maxWait:t,trailing:u})}function Mf(n){return Rf(n,1)}function Ff(n,t){return ph(Au(t),n)}function Nf(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]}function Pf(n){return Fr(n,sn)}function qf(n,t){return t="function"==typeof t?t:X,Fr(n,sn,t)}function Zf(n){return Fr(n,an|sn)}function Kf(n,t){return t="function"==typeof t?t:X,Fr(n,an|sn,t)}function Vf(n,t){return null==t||Pr(n,t,Pc(t))}function Gf(n,t){return n===t||n!==n&&t!==t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n); 92 | }function Jf(n){return cc(n)&&Hf(n)}function Yf(n){return n===!0||n===!1||cc(n)&&we(n)==Nn}function Qf(n){return cc(n)&&1===n.nodeType&&!gc(n)}function Xf(n){if(null==n)return!0;if(Hf(n)&&(bh(n)||"string"==typeof n||"function"==typeof n.splice||mh(n)||Oh(n)||dh(n)))return!n.length;var t=zs(n);if(t==Gn||t==tt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return!1;return!0}function nc(n,t){return Se(n,t)}function tc(n,t,r){r="function"==typeof r?r:X;var e=r?r(n,t):X;return e===X?Se(n,t,X,r):!!e; 93 | }function rc(n){if(!cc(n))return!1;var t=we(n);return t==Zn||t==qn||"string"==typeof n.message&&"string"==typeof n.name&&!gc(n)}function ec(n){return"number"==typeof n&&Zl(n)}function uc(n){if(!fc(n))return!1;var t=we(n);return t==Kn||t==Vn||t==Fn||t==Xn}function ic(n){return"number"==typeof n&&n==kc(n)}function oc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Wn}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&"object"==typeof n}function ac(n,t){ 94 | return n===t||Ce(n,t,ji(t))}function lc(n,t,r){return r="function"==typeof r?r:X,Ce(n,t,ji(t),r)}function sc(n){return vc(n)&&n!=+n}function hc(n){if(Es(n))throw new fl(rn);return Ue(n)}function pc(n){return null===n}function _c(n){return null==n}function vc(n){return"number"==typeof n||cc(n)&&we(n)==Hn}function gc(n){if(!cc(n)||we(n)!=Yn)return!1;var t=El(n);if(null===t)return!0;var r=bl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&dl.call(r)==jl}function yc(n){ 95 | return ic(n)&&n>=-Wn&&n<=Wn}function dc(n){return"string"==typeof n||!bh(n)&&cc(n)&&we(n)==rt}function bc(n){return"symbol"==typeof n||cc(n)&&we(n)==et}function wc(n){return n===X}function mc(n){return cc(n)&&zs(n)==it}function xc(n){return cc(n)&&we(n)==ot}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return D(n[Ul]());var t=zs(n);return(t==Gn?M:t==tt?P:ra)(n)}function Ac(n){if(!n)return 0===n?n:0;if(n=Ic(n),n===Sn||n===-Sn){return(n<0?-1:1)*Ln}return n===n?n:0}function kc(n){ 96 | var t=Ac(n),r=t%1;return t===t?r?t-r:t:0}function Oc(n){return n?Mr(kc(n),0,Un):0}function Ic(n){if("number"==typeof n)return n;if(bc(n))return Cn;if(fc(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=fc(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=R(n);var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Cn:+n}function Rc(n){return $u(n,qc(n))}function zc(n){return n?Mr(kc(n),-Wn,Wn):0===n?n:0}function Ec(n){return null==n?"":vu(n)}function Sc(n,t){var r=gs(n);return null==t?r:Cr(r,t); 97 | }function Wc(n,t){return v(n,mi(t,3),ue)}function Lc(n,t){return v(n,mi(t,3),oe)}function Cc(n,t){return null==n?n:bs(n,mi(t,3),qc)}function Uc(n,t){return null==n?n:ws(n,mi(t,3),qc)}function Bc(n,t){return n&&ue(n,mi(t,3))}function Tc(n,t){return n&&oe(n,mi(t,3))}function $c(n){return null==n?[]:fe(n,Pc(n))}function Dc(n){return null==n?[]:fe(n,qc(n))}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Fc(n,t){return null!=n&&Ri(n,t,xe)}function Nc(n,t){return null!=n&&Ri(n,t,je); 98 | }function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,!0):Fe(n)}function Zc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,t(n,e,u),n)}),r}function Kc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Br(r,e,t(n,e,u))}),r}function Vc(n,t){return Gc(n,Uf(mi(t)))}function Gc(n,t){if(null==n)return{};var r=c(di(n),function(n){return[n]});return t=mi(t),Ye(n,r,function(n,r){return t(n,r[0])})}function Hc(n,t,r){t=ku(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++et){ 101 | var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return n=Ec(n),n&&n.replace(Gt,ve).replace(Dr,"")}function aa(n,t,r){n=Ec(n),t=vu(t);var e=n.length;r=r===X?e:Mr(kc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function la(n){return n=Ec(n),n&&At.test(n)?n.replace(xt,ge):n}function sa(n){return n=Ec(n),n&&Wt.test(n)?n.replace(St,"\\$&"):n}function ha(n,t,r){n=Ec(n),t=kc(t); 102 | var e=t?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)}function pa(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e>>0)?(n=Ec(n),n&&("string"==typeof t||null!=t&&!Ah(t))&&(t=vu(t),!t&&T(n))?Ou(G(n),0,r):n.split(t,r)):[]}function ba(n,t,r){return n=Ec(n),r=null==r?0:Mr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t}function wa(n,t,r){var e=Z.templateSettings;r&&Ui(n,t,r)&&(t=X),n=Ec(n),t=Sh({},t,e,li);var u,i,o=Sh({},t.imports,e.imports,li),f=Pc(o),c=E(o,f),a=0,l=t.interpolate||Ht,s="__p += '",h=sl((t.escape||Ht).source+"|"+l.source+"|"+(l===It?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+(bl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zr+"]")+"\n"; 104 | n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Jt,U),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=bl.call(t,"variable")&&t.variable;if(_){if(Dt.test(_))throw new fl(un)}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(dt,""):s).replace(bt,"$1").replace(wt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}"; 105 | var v=Xh(function(){return cl(f,p+"return "+s).apply(X,c)});if(v.source=s,rc(v))throw v;return v}function ma(n){return Ec(n).toLowerCase()}function xa(n){return Ec(n).toUpperCase()}function ja(n,t,r){if(n=Ec(n),n&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Ou(e,W(e,u),L(e,u)+1).join("")}function Aa(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,0,L(e,G(t))+1).join("")}function ka(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.replace(Lt,""); 106 | if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,W(e,G(t))).join("")}function Oa(n,t){var r=An,e=kn;if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}n=Ec(n);var i=n.length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Ou(o,0,f).join(""):n.slice(0,f);if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Nt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index; 107 | c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function Ia(n){return n=Ec(n),n&&jt.test(n)?n.replace(mt,ye):n}function Ra(n,t,r){return n=Ec(n),t=r?X:t,t===X?$(n)?Q(n):_(n):n.match(t)||[]}function za(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]}):[],uu(function(e){for(var u=-1;++uWn)return[];var r=Un,e=Hl(n,Un);t=mi(t),n-=Un;for(var u=O(e,t);++r1?n[t-1]:X;return r="function"==typeof r?(n.pop(), 119 | r):X,Ho(n,r)}),Qs=gi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ct&&Ci(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),Xs=Fu(function(n,t,r){bl.call(n,r)?++n[r]:Br(n,r,1)}),nh=Ju(ho),th=Ju(po),rh=Fu(function(n,t,r){bl.call(n,r)?n[r].push(t):Br(n,r,[t])}),eh=uu(function(t,r,e){var u=-1,i="function"==typeof r,o=Hf(t)?il(t.length):[]; 120 | return ys(t,function(t){o[++u]=i?n(r,t,e):Ie(t,r,e)}),o}),uh=Fu(function(n,t,r){Br(n,r,t)}),ih=Fu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),oh=uu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])}),fh=Dl||function(){return re.Date.now()},ch=uu(function(n,t,r){var e=_n;if(r.length){var u=N(r,wi(ch));e|=bn}return ai(n,e,t,r,u)}),ah=uu(function(n,t,r){var e=_n|vn;if(r.length){var u=N(r,wi(ah));e|=bn; 121 | }return ai(t,e,n,r,u)}),lh=uu(function(n,t){return Gr(n,1,t)}),sh=uu(function(n,t,r){return Gr(n,Ic(t)||0,r)});Cf.Cache=sr;var hh=js(function(t,r){r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()));var e=r.length;return uu(function(u){for(var i=-1,o=Hl(u.length,e);++i=t}),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):ze,mh=ql||qa,xh=ae?z(ae):Ee,jh=le?z(le):Le,Ah=se?z(se):Be,kh=he?z(he):Te,Oh=pe?z(pe):$e,Ih=ii(Ne),Rh=ii(function(n,t){return n<=t}),zh=Nu(function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Sr(n,r,t[r])}),Eh=Nu(function(n,t){$u(t,qc(t),n)}),Sh=Nu(function(n,t,r,e){$u(t,qc(t),n,e)}),Wh=Nu(function(n,t,r,e){$u(t,Pc(t),n,e); 123 | }),Lh=gi(Tr),Ch=uu(function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r1),t}),$u(n,di(n),r),e&&(r=Fr(r,an|ln|sn,hi));for(var u=t.length;u--;)yu(r,t[u]);return r}),Nh=gi(function(n,t){return null==n?{}:Je(n,t)}),Ph=ci(Pc),qh=ci(qc),Zh=Vu(function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)}),Kh=Vu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vh=Vu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gh=Ku("toLowerCase"),Hh=Vu(function(n,t,r){ 125 | return n+(r?"_":"")+t.toLowerCase()}),Jh=Vu(function(n,t,r){return n+(r?" ":"")+Qh(t)}),Yh=Vu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qh=Ku("toUpperCase"),Xh=uu(function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}}),np=gi(function(n,t){return r(t,function(t){t=no(t),Br(n,t,ch(n[t],n))}),n}),tp=Yu(),rp=Yu(!0),ep=uu(function(n,t){return function(r){return Ie(r,n,t)}}),up=uu(function(n,t){return function(r){return Ie(n,r,t)}}),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(!0),lp=ni(function(n,t){ 126 | return n+t},0),sp=fi("ceil"),hp=ni(function(n,t){return n/t},1),pp=fi("floor"),_p=ni(function(n,t){return n*t},1),vp=fi("round"),gp=ni(function(n,t){return n-t},0);return Z.after=If,Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=Nf,Z.chain=Qo,Z.chunk=uo,Z.compact=io,Z.concat=oo,Z.cond=za,Z.conforms=Ea,Z.constant=Sa,Z.countBy=Xs,Z.create=Sc,Z.curry=Ef,Z.curryRight=Sf,Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh, 127 | Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=fo,Z.dropRight=co,Z.dropRightWhile=ao,Z.dropWhile=lo,Z.fill=so,Z.filter=lf,Z.flatMap=sf,Z.flatMapDeep=hf,Z.flatMapDepth=pf,Z.flatten=_o,Z.flattenDeep=vo,Z.flattenDepth=go,Z.flip=Lf,Z.flow=tp,Z.flowRight=rp,Z.fromPairs=yo,Z.functions=$c,Z.functionsIn=Dc,Z.groupBy=rh,Z.initial=mo,Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc, 128 | Z.map=yf,Z.mapKeys=Zc,Z.mapValues=Kc,Z.matches=Ua,Z.matchesProperty=Ba,Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=Ma,Z.omit=Fh,Z.omitBy=Vc,Z.once=Bf,Z.orderBy=df,Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=Na,Z.pull=Fs,Z.pullAll=Oo,Z.pullAllBy=Io,Z.pullAllWith=Ro,Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=mf,Z.remove=zo,Z.rest=Tf, 129 | Z.reverse=Eo,Z.sampleSize=jf,Z.set=Jc,Z.setWith=Yc,Z.shuffle=Af,Z.slice=So,Z.sortBy=oh,Z.sortedUniq=$o,Z.sortedUniqBy=Do,Z.split=da,Z.spread=$f,Z.tail=Mo,Z.take=Fo,Z.takeRight=No,Z.takeRightWhile=Po,Z.takeWhile=qo,Z.tap=Xo,Z.throttle=Df,Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=Ha,Z.toPlainObject=Rc,Z.transform=Qc,Z.unary=Mf,Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=Zo,Z.uniqBy=Ko,Z.uniqWith=Vo,Z.unset=Xc,Z.unzip=Go,Z.unzipWith=Ho,Z.update=na,Z.updateWith=ta,Z.values=ra,Z.valuesIn=ea, 130 | Z.without=Ks,Z.words=Ra,Z.wrap=Ff,Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=Jo,Z.zipObjectDeep=Yo,Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=ua,Z.clone=Pf,Z.cloneDeep=Zf,Z.cloneDeepWith=Kf,Z.cloneWith=qf,Z.conformsTo=Vf,Z.deburr=ca,Z.defaultTo=Wa,Z.divide=hp,Z.endsWith=aa,Z.eq=Gf,Z.escape=la,Z.escapeRegExp=sa,Z.every=af,Z.find=nh,Z.findIndex=ho,Z.findKey=Wc,Z.findLast=th,Z.findLastIndex=po, 131 | Z.findLastKey=Lc,Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=Cc,Z.forInRight=Uc,Z.forOwn=Bc,Z.forOwnRight=Tc,Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=Fc,Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=gf,Z.indexOf=wo,Z.inRange=ia,Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=Yf,Z.isBuffer=mh,Z.isDate=xh,Z.isElement=Qf,Z.isEmpty=Xf,Z.isEqual=nc,Z.isEqualWith=tc,Z.isError=rc,Z.isFinite=ec,Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh, 132 | Z.isMatch=ac,Z.isMatchWith=lc,Z.isNaN=sc,Z.isNative=hc,Z.isNil=_c,Z.isNull=pc,Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=yc,Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Oh,Z.isUndefined=wc,Z.isWeakMap=mc,Z.isWeakSet=xc,Z.join=xo,Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=Ao,Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Ih,Z.lte=Rh,Z.max=Ya,Z.maxBy=Qa,Z.mean=Xa,Z.meanBy=nl,Z.min=tl,Z.minBy=rl,Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=Za,Z.stubString=Ka, 133 | Z.stubTrue=Va,Z.multiply=_p,Z.nth=ko,Z.noConflict=$a,Z.noop=Da,Z.now=fh,Z.pad=ha,Z.padEnd=pa,Z.padStart=_a,Z.parseInt=va,Z.random=oa,Z.reduce=bf,Z.reduceRight=wf,Z.repeat=ga,Z.replace=ya,Z.result=Hc,Z.round=vp,Z.runInContext=p,Z.sample=xf,Z.size=kf,Z.snakeCase=Hh,Z.some=Of,Z.sortedIndex=Wo,Z.sortedIndexBy=Lo,Z.sortedIndexOf=Co,Z.sortedLastIndex=Uo,Z.sortedLastIndexBy=Bo,Z.sortedLastIndexOf=To,Z.startCase=Jh,Z.startsWith=ba,Z.subtract=gp,Z.sum=el,Z.sumBy=ul,Z.template=wa,Z.times=Ga,Z.toFinite=Ac,Z.toInteger=kc, 134 | Z.toLength=Oc,Z.toLower=ma,Z.toNumber=Ic,Z.toSafeInteger=zc,Z.toString=Ec,Z.toUpper=xa,Z.trim=ja,Z.trimEnd=Aa,Z.trimStart=ka,Z.truncate=Oa,Z.unescape=Ia,Z.uniqueId=Ja,Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,function(t,r){bl.call(Z.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),Z.VERSION=nn,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Z[n].placeholder=Z}),r(["drop","take"],function(n,t){Ct.prototype[n]=function(r){ 135 | r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ct(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Un),type:n+(e.__dir__<0?"Right":"")}),e},Ct.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==Rn||r==En;Ct.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){ 136 | var r="take"+(t?"Right":"");Ct.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[r](1)}}),Ct.prototype.compact=function(){return this.filter(La)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=uu(function(n,t){return"function"==typeof n?new Ct(this):this.map(function(r){ 137 | return Ie(r,n,t)})}),Ct.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ct.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ct(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=kc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(Un)},ue(Ct.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t); 138 | u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ct,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ct(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){ 139 | var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r](function(r){return t.apply(bh(r)?r:[],n)})}}),ue(Ct.prototype,function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}}),fs[Qu(X,vn).name]=[{name:"wrapper",func:X}],Ct.prototype.clone=$t,Ct.prototype.reverse=Yt,Ct.prototype.value=Qt,Z.prototype.at=Qs, 140 | Z.prototype.chain=tf,Z.prototype.commit=rf,Z.prototype.next=ef,Z.prototype.plant=of,Z.prototype.reverse=ff,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=cf,Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=uf),Z},be=de();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=be,define(function(){return be})):ue?((ue.exports=be)._=be,ee._=be):re._=be}).call(this); 141 | --------------------------------------------------------------------------------