UNPKG

653 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory(require("vue"));
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["index"] = factory(require("vue"));
8 else
9 root["index"] = factory(root["Vue"]);
10})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = "fae3");
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ "00fd":
100/***/ (function(module, exports, __webpack_require__) {
101
102var Symbol = __webpack_require__("9e69");
103
104/** Used for built-in method references. */
105var objectProto = Object.prototype;
106
107/** Used to check objects for own properties. */
108var hasOwnProperty = objectProto.hasOwnProperty;
109
110/**
111 * Used to resolve the
112 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
113 * of values.
114 */
115var nativeObjectToString = objectProto.toString;
116
117/** Built-in value references. */
118var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
119
120/**
121 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
122 *
123 * @private
124 * @param {*} value The value to query.
125 * @returns {string} Returns the raw `toStringTag`.
126 */
127function getRawTag(value) {
128 var isOwn = hasOwnProperty.call(value, symToStringTag),
129 tag = value[symToStringTag];
130
131 try {
132 value[symToStringTag] = undefined;
133 var unmasked = true;
134 } catch (e) {}
135
136 var result = nativeObjectToString.call(value);
137 if (unmasked) {
138 if (isOwn) {
139 value[symToStringTag] = tag;
140 } else {
141 delete value[symToStringTag];
142 }
143 }
144 return result;
145}
146
147module.exports = getRawTag;
148
149
150/***/ }),
151
152/***/ "08ce":
153/***/ (function(module, __webpack_exports__, __webpack_require__) {
154
155"use strict";
156__webpack_require__.r(__webpack_exports__);
157
158// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-input.vue?vue&type=template&id=ef34fb18&scoped=true&
159var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('input',_vm._g({staticClass:"input form-control",attrs:{"id":_vm.id,"type":_vm.type,"name":_vm.name,"disabled":_vm.disabled},domProps:{"value":_vm.value},on:{"input":function($event){return _vm.$emit('update', $event.target.value)}}},_vm.$listeners))}
160var staticRenderFns = []
161
162
163// CONCATENATED MODULE: ./src/components/_base-input.vue?vue&type=template&id=ef34fb18&scoped=true&
164
165// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-input.vue?vue&type=script&lang=js&
166/* harmony default export */ var _base_inputvue_type_script_lang_js_ = ({
167 name: 'BaseInput',
168 model: {
169 event: 'update'
170 },
171 props: {
172 id: {
173 type: String,
174 default: null
175 },
176 name: {
177 type: String,
178 default: null
179 },
180 type: {
181 type: String,
182 default: 'text'
183 },
184 value: {
185 type: [String, Number, Boolean],
186 default: null
187 },
188 disabled: {
189 type: Boolean,
190 default: false
191 }
192 }
193});
194// CONCATENATED MODULE: ./src/components/_base-input.vue?vue&type=script&lang=js&
195 /* harmony default export */ var components_base_inputvue_type_script_lang_js_ = (_base_inputvue_type_script_lang_js_);
196// EXTERNAL MODULE: ./src/components/_base-input.vue?vue&type=style&index=0&id=ef34fb18&lang=scss&scoped=true&
197var _base_inputvue_type_style_index_0_id_ef34fb18_lang_scss_scoped_true_ = __webpack_require__("d22d");
198
199// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
200var componentNormalizer = __webpack_require__("2877");
201
202// CONCATENATED MODULE: ./src/components/_base-input.vue
203
204
205
206
207
208
209/* normalize component */
210
211var component = Object(componentNormalizer["a" /* default */])(
212 components_base_inputvue_type_script_lang_js_,
213 render,
214 staticRenderFns,
215 false,
216 null,
217 "ef34fb18",
218 null
219
220)
221
222/* harmony default export */ var _base_input = __webpack_exports__["default"] = (component.exports);
223
224/***/ }),
225
226/***/ "1102":
227/***/ (function(module, exports, __webpack_require__) {
228
229// extracted by mini-css-extract-plugin
230
231/***/ }),
232
233/***/ "126d":
234/***/ (function(module, exports, __webpack_require__) {
235
236var asciiToArray = __webpack_require__("6da8"),
237 hasUnicode = __webpack_require__("aaec"),
238 unicodeToArray = __webpack_require__("d094");
239
240/**
241 * Converts `string` to an array.
242 *
243 * @private
244 * @param {string} string The string to convert.
245 * @returns {Array} Returns the converted array.
246 */
247function stringToArray(string) {
248 return hasUnicode(string)
249 ? unicodeToArray(string)
250 : asciiToArray(string);
251}
252
253module.exports = stringToArray;
254
255
256/***/ }),
257
258/***/ "1310":
259/***/ (function(module, exports) {
260
261/**
262 * Checks if `value` is object-like. A value is object-like if it's not `null`
263 * and has a `typeof` result of "object".
264 *
265 * @static
266 * @memberOf _
267 * @since 4.0.0
268 * @category Lang
269 * @param {*} value The value to check.
270 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
271 * @example
272 *
273 * _.isObjectLike({});
274 * // => true
275 *
276 * _.isObjectLike([1, 2, 3]);
277 * // => true
278 *
279 * _.isObjectLike(_.noop);
280 * // => false
281 *
282 * _.isObjectLike(null);
283 * // => false
284 */
285function isObjectLike(value) {
286 return value != null && typeof value == 'object';
287}
288
289module.exports = isObjectLike;
290
291
292/***/ }),
293
294/***/ "1347":
295/***/ (function(module, __webpack_exports__, __webpack_require__) {
296
297"use strict";
298/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tab_vue_vue_type_style_index_0_id_9d7e964a_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("79c6");
299/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tab_vue_vue_type_style_index_0_id_9d7e964a_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tab_vue_vue_type_style_index_0_id_9d7e964a_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
300/* unused harmony reexport * */
301 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tab_vue_vue_type_style_index_0_id_9d7e964a_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
302
303/***/ }),
304
305/***/ "188a":
306/***/ (function(module, __webpack_exports__, __webpack_require__) {
307
308"use strict";
309/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_button_vue_vue_type_style_index_0_id_5609df9c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("46a6");
310/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_button_vue_vue_type_style_index_0_id_5609df9c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_button_vue_vue_type_style_index_0_id_5609df9c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
311/* unused harmony reexport * */
312 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_button_vue_vue_type_style_index_0_id_5609df9c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
313
314/***/ }),
315
316/***/ "2877":
317/***/ (function(module, __webpack_exports__, __webpack_require__) {
318
319"use strict";
320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
321/* globals __VUE_SSR_CONTEXT__ */
322
323// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
324// This module is a runtime utility for cleaner component module output and will
325// be included in the final webpack user bundle.
326
327function normalizeComponent (
328 scriptExports,
329 render,
330 staticRenderFns,
331 functionalTemplate,
332 injectStyles,
333 scopeId,
334 moduleIdentifier, /* server only */
335 shadowMode /* vue-cli only */
336) {
337 // Vue.extend constructor export interop
338 var options = typeof scriptExports === 'function'
339 ? scriptExports.options
340 : scriptExports
341
342 // render functions
343 if (render) {
344 options.render = render
345 options.staticRenderFns = staticRenderFns
346 options._compiled = true
347 }
348
349 // functional template
350 if (functionalTemplate) {
351 options.functional = true
352 }
353
354 // scopedId
355 if (scopeId) {
356 options._scopeId = 'data-v-' + scopeId
357 }
358
359 var hook
360 if (moduleIdentifier) { // server build
361 hook = function (context) {
362 // 2.3 injection
363 context =
364 context || // cached call
365 (this.$vnode && this.$vnode.ssrContext) || // stateful
366 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
367 // 2.2 with runInNewContext: true
368 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
369 context = __VUE_SSR_CONTEXT__
370 }
371 // inject component styles
372 if (injectStyles) {
373 injectStyles.call(this, context)
374 }
375 // register component module identifier for async chunk inferrence
376 if (context && context._registeredComponents) {
377 context._registeredComponents.add(moduleIdentifier)
378 }
379 }
380 // used by ssr in case component is cached and beforeCreate
381 // never gets called
382 options._ssrRegister = hook
383 } else if (injectStyles) {
384 hook = shadowMode
385 ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
386 : injectStyles
387 }
388
389 if (hook) {
390 if (options.functional) {
391 // for template-only hot-reload because in that case the render fn doesn't
392 // go through the normalizer
393 options._injectStyles = hook
394 // register for functioal component in vue file
395 var originalRender = options.render
396 options.render = function renderWithStyleInjection (h, context) {
397 hook.call(context)
398 return originalRender(h, context)
399 }
400 } else {
401 // inject component registration as beforeCreate hook
402 var existing = options.beforeCreate
403 options.beforeCreate = existing
404 ? [].concat(existing, hook)
405 : [hook]
406 }
407 }
408
409 return {
410 exports: scriptExports,
411 options: options
412 }
413}
414
415
416/***/ }),
417
418/***/ "29f3":
419/***/ (function(module, exports) {
420
421/** Used for built-in method references. */
422var objectProto = Object.prototype;
423
424/**
425 * Used to resolve the
426 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
427 * of values.
428 */
429var nativeObjectToString = objectProto.toString;
430
431/**
432 * Converts `value` to a string using `Object.prototype.toString`.
433 *
434 * @private
435 * @param {*} value The value to convert.
436 * @returns {string} Returns the converted string.
437 */
438function objectToString(value) {
439 return nativeObjectToString.call(value);
440}
441
442module.exports = objectToString;
443
444
445/***/ }),
446
447/***/ "2b10":
448/***/ (function(module, exports) {
449
450/**
451 * The base implementation of `_.slice` without an iteratee call guard.
452 *
453 * @private
454 * @param {Array} array The array to slice.
455 * @param {number} [start=0] The start position.
456 * @param {number} [end=array.length] The end position.
457 * @returns {Array} Returns the slice of `array`.
458 */
459function baseSlice(array, start, end) {
460 var index = -1,
461 length = array.length;
462
463 if (start < 0) {
464 start = -start > length ? 0 : (length + start);
465 }
466 end = end > length ? length : end;
467 if (end < 0) {
468 end += length;
469 }
470 length = start > end ? 0 : ((end - start) >>> 0);
471 start >>>= 0;
472
473 var result = Array(length);
474 while (++index < length) {
475 result[index] = array[index + start];
476 }
477 return result;
478}
479
480module.exports = baseSlice;
481
482
483/***/ }),
484
485/***/ "2b3e":
486/***/ (function(module, exports, __webpack_require__) {
487
488var freeGlobal = __webpack_require__("585a9");
489
490/** Detect free variable `self`. */
491var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
492
493/** Used as a reference to the global object. */
494var root = freeGlobal || freeSelf || Function('return this')();
495
496module.exports = root;
497
498
499/***/ }),
500
501/***/ "2cfe":
502/***/ (function(module, exports, __webpack_require__) {
503
504// extracted by mini-css-extract-plugin
505
506/***/ }),
507
508/***/ "2ef0":
509/***/ (function(module, exports, __webpack_require__) {
510
511/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
512 * @license
513 * Lodash <https://lodash.com/>
514 * Copyright JS Foundation and other contributors <https://js.foundation/>
515 * Released under MIT license <https://lodash.com/license>
516 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
517 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
518 */
519;(function() {
520
521 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
522 var undefined;
523
524 /** Used as the semantic version number. */
525 var VERSION = '4.17.11';
526
527 /** Used as the size to enable large array optimizations. */
528 var LARGE_ARRAY_SIZE = 200;
529
530 /** Error message constants. */
531 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
532 FUNC_ERROR_TEXT = 'Expected a function';
533
534 /** Used to stand-in for `undefined` hash values. */
535 var HASH_UNDEFINED = '__lodash_hash_undefined__';
536
537 /** Used as the maximum memoize cache size. */
538 var MAX_MEMOIZE_SIZE = 500;
539
540 /** Used as the internal argument placeholder. */
541 var PLACEHOLDER = '__lodash_placeholder__';
542
543 /** Used to compose bitmasks for cloning. */
544 var CLONE_DEEP_FLAG = 1,
545 CLONE_FLAT_FLAG = 2,
546 CLONE_SYMBOLS_FLAG = 4;
547
548 /** Used to compose bitmasks for value comparisons. */
549 var COMPARE_PARTIAL_FLAG = 1,
550 COMPARE_UNORDERED_FLAG = 2;
551
552 /** Used to compose bitmasks for function metadata. */
553 var WRAP_BIND_FLAG = 1,
554 WRAP_BIND_KEY_FLAG = 2,
555 WRAP_CURRY_BOUND_FLAG = 4,
556 WRAP_CURRY_FLAG = 8,
557 WRAP_CURRY_RIGHT_FLAG = 16,
558 WRAP_PARTIAL_FLAG = 32,
559 WRAP_PARTIAL_RIGHT_FLAG = 64,
560 WRAP_ARY_FLAG = 128,
561 WRAP_REARG_FLAG = 256,
562 WRAP_FLIP_FLAG = 512;
563
564 /** Used as default options for `_.truncate`. */
565 var DEFAULT_TRUNC_LENGTH = 30,
566 DEFAULT_TRUNC_OMISSION = '...';
567
568 /** Used to detect hot functions by number of calls within a span of milliseconds. */
569 var HOT_COUNT = 800,
570 HOT_SPAN = 16;
571
572 /** Used to indicate the type of lazy iteratees. */
573 var LAZY_FILTER_FLAG = 1,
574 LAZY_MAP_FLAG = 2,
575 LAZY_WHILE_FLAG = 3;
576
577 /** Used as references for various `Number` constants. */
578 var INFINITY = 1 / 0,
579 MAX_SAFE_INTEGER = 9007199254740991,
580 MAX_INTEGER = 1.7976931348623157e+308,
581 NAN = 0 / 0;
582
583 /** Used as references for the maximum length and index of an array. */
584 var MAX_ARRAY_LENGTH = 4294967295,
585 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
586 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
587
588 /** Used to associate wrap methods with their bit flags. */
589 var wrapFlags = [
590 ['ary', WRAP_ARY_FLAG],
591 ['bind', WRAP_BIND_FLAG],
592 ['bindKey', WRAP_BIND_KEY_FLAG],
593 ['curry', WRAP_CURRY_FLAG],
594 ['curryRight', WRAP_CURRY_RIGHT_FLAG],
595 ['flip', WRAP_FLIP_FLAG],
596 ['partial', WRAP_PARTIAL_FLAG],
597 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
598 ['rearg', WRAP_REARG_FLAG]
599 ];
600
601 /** `Object#toString` result references. */
602 var argsTag = '[object Arguments]',
603 arrayTag = '[object Array]',
604 asyncTag = '[object AsyncFunction]',
605 boolTag = '[object Boolean]',
606 dateTag = '[object Date]',
607 domExcTag = '[object DOMException]',
608 errorTag = '[object Error]',
609 funcTag = '[object Function]',
610 genTag = '[object GeneratorFunction]',
611 mapTag = '[object Map]',
612 numberTag = '[object Number]',
613 nullTag = '[object Null]',
614 objectTag = '[object Object]',
615 promiseTag = '[object Promise]',
616 proxyTag = '[object Proxy]',
617 regexpTag = '[object RegExp]',
618 setTag = '[object Set]',
619 stringTag = '[object String]',
620 symbolTag = '[object Symbol]',
621 undefinedTag = '[object Undefined]',
622 weakMapTag = '[object WeakMap]',
623 weakSetTag = '[object WeakSet]';
624
625 var arrayBufferTag = '[object ArrayBuffer]',
626 dataViewTag = '[object DataView]',
627 float32Tag = '[object Float32Array]',
628 float64Tag = '[object Float64Array]',
629 int8Tag = '[object Int8Array]',
630 int16Tag = '[object Int16Array]',
631 int32Tag = '[object Int32Array]',
632 uint8Tag = '[object Uint8Array]',
633 uint8ClampedTag = '[object Uint8ClampedArray]',
634 uint16Tag = '[object Uint16Array]',
635 uint32Tag = '[object Uint32Array]';
636
637 /** Used to match empty string literals in compiled template source. */
638 var reEmptyStringLeading = /\b__p \+= '';/g,
639 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
640 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
641
642 /** Used to match HTML entities and HTML characters. */
643 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
644 reUnescapedHtml = /[&<>"']/g,
645 reHasEscapedHtml = RegExp(reEscapedHtml.source),
646 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
647
648 /** Used to match template delimiters. */
649 var reEscape = /<%-([\s\S]+?)%>/g,
650 reEvaluate = /<%([\s\S]+?)%>/g,
651 reInterpolate = /<%=([\s\S]+?)%>/g;
652
653 /** Used to match property names within property paths. */
654 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
655 reIsPlainProp = /^\w*$/,
656 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
657
658 /**
659 * Used to match `RegExp`
660 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
661 */
662 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
663 reHasRegExpChar = RegExp(reRegExpChar.source);
664
665 /** Used to match leading and trailing whitespace. */
666 var reTrim = /^\s+|\s+$/g,
667 reTrimStart = /^\s+/,
668 reTrimEnd = /\s+$/;
669
670 /** Used to match wrap detail comments. */
671 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
672 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
673 reSplitDetails = /,? & /;
674
675 /** Used to match words composed of alphanumeric characters. */
676 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
677
678 /** Used to match backslashes in property paths. */
679 var reEscapeChar = /\\(\\)?/g;
680
681 /**
682 * Used to match
683 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
684 */
685 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
686
687 /** Used to match `RegExp` flags from their coerced string values. */
688 var reFlags = /\w*$/;
689
690 /** Used to detect bad signed hexadecimal string values. */
691 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
692
693 /** Used to detect binary string values. */
694 var reIsBinary = /^0b[01]+$/i;
695
696 /** Used to detect host constructors (Safari). */
697 var reIsHostCtor = /^\[object .+?Constructor\]$/;
698
699 /** Used to detect octal string values. */
700 var reIsOctal = /^0o[0-7]+$/i;
701
702 /** Used to detect unsigned integer values. */
703 var reIsUint = /^(?:0|[1-9]\d*)$/;
704
705 /** Used to match Latin Unicode letters (excluding mathematical operators). */
706 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
707
708 /** Used to ensure capturing order of template delimiters. */
709 var reNoMatch = /($^)/;
710
711 /** Used to match unescaped characters in compiled string literals. */
712 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
713
714 /** Used to compose unicode character classes. */
715 var rsAstralRange = '\\ud800-\\udfff',
716 rsComboMarksRange = '\\u0300-\\u036f',
717 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
718 rsComboSymbolsRange = '\\u20d0-\\u20ff',
719 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
720 rsDingbatRange = '\\u2700-\\u27bf',
721 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
722 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
723 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
724 rsPunctuationRange = '\\u2000-\\u206f',
725 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
726 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
727 rsVarRange = '\\ufe0e\\ufe0f',
728 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
729
730 /** Used to compose unicode capture groups. */
731 var rsApos = "['\u2019]",
732 rsAstral = '[' + rsAstralRange + ']',
733 rsBreak = '[' + rsBreakRange + ']',
734 rsCombo = '[' + rsComboRange + ']',
735 rsDigits = '\\d+',
736 rsDingbat = '[' + rsDingbatRange + ']',
737 rsLower = '[' + rsLowerRange + ']',
738 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
739 rsFitz = '\\ud83c[\\udffb-\\udfff]',
740 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
741 rsNonAstral = '[^' + rsAstralRange + ']',
742 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
743 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
744 rsUpper = '[' + rsUpperRange + ']',
745 rsZWJ = '\\u200d';
746
747 /** Used to compose unicode regexes. */
748 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
749 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
750 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
751 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
752 reOptMod = rsModifier + '?',
753 rsOptVar = '[' + rsVarRange + ']?',
754 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
755 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
756 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
757 rsSeq = rsOptVar + reOptMod + rsOptJoin,
758 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
759 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
760
761 /** Used to match apostrophes. */
762 var reApos = RegExp(rsApos, 'g');
763
764 /**
765 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
766 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
767 */
768 var reComboMark = RegExp(rsCombo, 'g');
769
770 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
771 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
772
773 /** Used to match complex or compound words. */
774 var reUnicodeWord = RegExp([
775 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
776 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
777 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
778 rsUpper + '+' + rsOptContrUpper,
779 rsOrdUpper,
780 rsOrdLower,
781 rsDigits,
782 rsEmoji
783 ].join('|'), 'g');
784
785 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
786 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
787
788 /** Used to detect strings that need a more robust regexp to match words. */
789 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
790
791 /** Used to assign default `context` object properties. */
792 var contextProps = [
793 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
794 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
795 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
796 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
797 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
798 ];
799
800 /** Used to make template sourceURLs easier to identify. */
801 var templateCounter = -1;
802
803 /** Used to identify `toStringTag` values of typed arrays. */
804 var typedArrayTags = {};
805 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
806 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
807 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
808 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
809 typedArrayTags[uint32Tag] = true;
810 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
811 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
812 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
813 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
814 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
815 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
816 typedArrayTags[setTag] = typedArrayTags[stringTag] =
817 typedArrayTags[weakMapTag] = false;
818
819 /** Used to identify `toStringTag` values supported by `_.clone`. */
820 var cloneableTags = {};
821 cloneableTags[argsTag] = cloneableTags[arrayTag] =
822 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
823 cloneableTags[boolTag] = cloneableTags[dateTag] =
824 cloneableTags[float32Tag] = cloneableTags[float64Tag] =
825 cloneableTags[int8Tag] = cloneableTags[int16Tag] =
826 cloneableTags[int32Tag] = cloneableTags[mapTag] =
827 cloneableTags[numberTag] = cloneableTags[objectTag] =
828 cloneableTags[regexpTag] = cloneableTags[setTag] =
829 cloneableTags[stringTag] = cloneableTags[symbolTag] =
830 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
831 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
832 cloneableTags[errorTag] = cloneableTags[funcTag] =
833 cloneableTags[weakMapTag] = false;
834
835 /** Used to map Latin Unicode letters to basic Latin letters. */
836 var deburredLetters = {
837 // Latin-1 Supplement block.
838 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
839 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
840 '\xc7': 'C', '\xe7': 'c',
841 '\xd0': 'D', '\xf0': 'd',
842 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
843 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
844 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
845 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
846 '\xd1': 'N', '\xf1': 'n',
847 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
848 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
849 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
850 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
851 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
852 '\xc6': 'Ae', '\xe6': 'ae',
853 '\xde': 'Th', '\xfe': 'th',
854 '\xdf': 'ss',
855 // Latin Extended-A block.
856 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
857 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
858 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
859 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
860 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
861 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
862 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
863 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
864 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
865 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
866 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
867 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
868 '\u0134': 'J', '\u0135': 'j',
869 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
870 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
871 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
872 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
873 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
874 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
875 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
876 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
877 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
878 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
879 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
880 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
881 '\u0163': 't', '\u0165': 't', '\u0167': 't',
882 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
883 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
884 '\u0174': 'W', '\u0175': 'w',
885 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
886 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
887 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
888 '\u0132': 'IJ', '\u0133': 'ij',
889 '\u0152': 'Oe', '\u0153': 'oe',
890 '\u0149': "'n", '\u017f': 's'
891 };
892
893 /** Used to map characters to HTML entities. */
894 var htmlEscapes = {
895 '&': '&amp;',
896 '<': '&lt;',
897 '>': '&gt;',
898 '"': '&quot;',
899 "'": '&#39;'
900 };
901
902 /** Used to map HTML entities to characters. */
903 var htmlUnescapes = {
904 '&amp;': '&',
905 '&lt;': '<',
906 '&gt;': '>',
907 '&quot;': '"',
908 '&#39;': "'"
909 };
910
911 /** Used to escape characters for inclusion in compiled string literals. */
912 var stringEscapes = {
913 '\\': '\\',
914 "'": "'",
915 '\n': 'n',
916 '\r': 'r',
917 '\u2028': 'u2028',
918 '\u2029': 'u2029'
919 };
920
921 /** Built-in method references without a dependency on `root`. */
922 var freeParseFloat = parseFloat,
923 freeParseInt = parseInt;
924
925 /** Detect free variable `global` from Node.js. */
926 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
927
928 /** Detect free variable `self`. */
929 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
930
931 /** Used as a reference to the global object. */
932 var root = freeGlobal || freeSelf || Function('return this')();
933
934 /** Detect free variable `exports`. */
935 var freeExports = true && exports && !exports.nodeType && exports;
936
937 /** Detect free variable `module`. */
938 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
939
940 /** Detect the popular CommonJS extension `module.exports`. */
941 var moduleExports = freeModule && freeModule.exports === freeExports;
942
943 /** Detect free variable `process` from Node.js. */
944 var freeProcess = moduleExports && freeGlobal.process;
945
946 /** Used to access faster Node.js helpers. */
947 var nodeUtil = (function() {
948 try {
949 // Use `util.types` for Node.js 10+.
950 var types = freeModule && freeModule.require && freeModule.require('util').types;
951
952 if (types) {
953 return types;
954 }
955
956 // Legacy `process.binding('util')` for Node.js < 10.
957 return freeProcess && freeProcess.binding && freeProcess.binding('util');
958 } catch (e) {}
959 }());
960
961 /* Node.js helper references. */
962 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
963 nodeIsDate = nodeUtil && nodeUtil.isDate,
964 nodeIsMap = nodeUtil && nodeUtil.isMap,
965 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
966 nodeIsSet = nodeUtil && nodeUtil.isSet,
967 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
968
969 /*--------------------------------------------------------------------------*/
970
971 /**
972 * A faster alternative to `Function#apply`, this function invokes `func`
973 * with the `this` binding of `thisArg` and the arguments of `args`.
974 *
975 * @private
976 * @param {Function} func The function to invoke.
977 * @param {*} thisArg The `this` binding of `func`.
978 * @param {Array} args The arguments to invoke `func` with.
979 * @returns {*} Returns the result of `func`.
980 */
981 function apply(func, thisArg, args) {
982 switch (args.length) {
983 case 0: return func.call(thisArg);
984 case 1: return func.call(thisArg, args[0]);
985 case 2: return func.call(thisArg, args[0], args[1]);
986 case 3: return func.call(thisArg, args[0], args[1], args[2]);
987 }
988 return func.apply(thisArg, args);
989 }
990
991 /**
992 * A specialized version of `baseAggregator` for arrays.
993 *
994 * @private
995 * @param {Array} [array] The array to iterate over.
996 * @param {Function} setter The function to set `accumulator` values.
997 * @param {Function} iteratee The iteratee to transform keys.
998 * @param {Object} accumulator The initial aggregated object.
999 * @returns {Function} Returns `accumulator`.
1000 */
1001 function arrayAggregator(array, setter, iteratee, accumulator) {
1002 var index = -1,
1003 length = array == null ? 0 : array.length;
1004
1005 while (++index < length) {
1006 var value = array[index];
1007 setter(accumulator, value, iteratee(value), array);
1008 }
1009 return accumulator;
1010 }
1011
1012 /**
1013 * A specialized version of `_.forEach` for arrays without support for
1014 * iteratee shorthands.
1015 *
1016 * @private
1017 * @param {Array} [array] The array to iterate over.
1018 * @param {Function} iteratee The function invoked per iteration.
1019 * @returns {Array} Returns `array`.
1020 */
1021 function arrayEach(array, iteratee) {
1022 var index = -1,
1023 length = array == null ? 0 : array.length;
1024
1025 while (++index < length) {
1026 if (iteratee(array[index], index, array) === false) {
1027 break;
1028 }
1029 }
1030 return array;
1031 }
1032
1033 /**
1034 * A specialized version of `_.forEachRight` for arrays without support for
1035 * iteratee shorthands.
1036 *
1037 * @private
1038 * @param {Array} [array] The array to iterate over.
1039 * @param {Function} iteratee The function invoked per iteration.
1040 * @returns {Array} Returns `array`.
1041 */
1042 function arrayEachRight(array, iteratee) {
1043 var length = array == null ? 0 : array.length;
1044
1045 while (length--) {
1046 if (iteratee(array[length], length, array) === false) {
1047 break;
1048 }
1049 }
1050 return array;
1051 }
1052
1053 /**
1054 * A specialized version of `_.every` for arrays without support for
1055 * iteratee shorthands.
1056 *
1057 * @private
1058 * @param {Array} [array] The array to iterate over.
1059 * @param {Function} predicate The function invoked per iteration.
1060 * @returns {boolean} Returns `true` if all elements pass the predicate check,
1061 * else `false`.
1062 */
1063 function arrayEvery(array, predicate) {
1064 var index = -1,
1065 length = array == null ? 0 : array.length;
1066
1067 while (++index < length) {
1068 if (!predicate(array[index], index, array)) {
1069 return false;
1070 }
1071 }
1072 return true;
1073 }
1074
1075 /**
1076 * A specialized version of `_.filter` for arrays without support for
1077 * iteratee shorthands.
1078 *
1079 * @private
1080 * @param {Array} [array] The array to iterate over.
1081 * @param {Function} predicate The function invoked per iteration.
1082 * @returns {Array} Returns the new filtered array.
1083 */
1084 function arrayFilter(array, predicate) {
1085 var index = -1,
1086 length = array == null ? 0 : array.length,
1087 resIndex = 0,
1088 result = [];
1089
1090 while (++index < length) {
1091 var value = array[index];
1092 if (predicate(value, index, array)) {
1093 result[resIndex++] = value;
1094 }
1095 }
1096 return result;
1097 }
1098
1099 /**
1100 * A specialized version of `_.includes` for arrays without support for
1101 * specifying an index to search from.
1102 *
1103 * @private
1104 * @param {Array} [array] The array to inspect.
1105 * @param {*} target The value to search for.
1106 * @returns {boolean} Returns `true` if `target` is found, else `false`.
1107 */
1108 function arrayIncludes(array, value) {
1109 var length = array == null ? 0 : array.length;
1110 return !!length && baseIndexOf(array, value, 0) > -1;
1111 }
1112
1113 /**
1114 * This function is like `arrayIncludes` except that it accepts a comparator.
1115 *
1116 * @private
1117 * @param {Array} [array] The array to inspect.
1118 * @param {*} target The value to search for.
1119 * @param {Function} comparator The comparator invoked per element.
1120 * @returns {boolean} Returns `true` if `target` is found, else `false`.
1121 */
1122 function arrayIncludesWith(array, value, comparator) {
1123 var index = -1,
1124 length = array == null ? 0 : array.length;
1125
1126 while (++index < length) {
1127 if (comparator(value, array[index])) {
1128 return true;
1129 }
1130 }
1131 return false;
1132 }
1133
1134 /**
1135 * A specialized version of `_.map` for arrays without support for iteratee
1136 * shorthands.
1137 *
1138 * @private
1139 * @param {Array} [array] The array to iterate over.
1140 * @param {Function} iteratee The function invoked per iteration.
1141 * @returns {Array} Returns the new mapped array.
1142 */
1143 function arrayMap(array, iteratee) {
1144 var index = -1,
1145 length = array == null ? 0 : array.length,
1146 result = Array(length);
1147
1148 while (++index < length) {
1149 result[index] = iteratee(array[index], index, array);
1150 }
1151 return result;
1152 }
1153
1154 /**
1155 * Appends the elements of `values` to `array`.
1156 *
1157 * @private
1158 * @param {Array} array The array to modify.
1159 * @param {Array} values The values to append.
1160 * @returns {Array} Returns `array`.
1161 */
1162 function arrayPush(array, values) {
1163 var index = -1,
1164 length = values.length,
1165 offset = array.length;
1166
1167 while (++index < length) {
1168 array[offset + index] = values[index];
1169 }
1170 return array;
1171 }
1172
1173 /**
1174 * A specialized version of `_.reduce` for arrays without support for
1175 * iteratee shorthands.
1176 *
1177 * @private
1178 * @param {Array} [array] The array to iterate over.
1179 * @param {Function} iteratee The function invoked per iteration.
1180 * @param {*} [accumulator] The initial value.
1181 * @param {boolean} [initAccum] Specify using the first element of `array` as
1182 * the initial value.
1183 * @returns {*} Returns the accumulated value.
1184 */
1185 function arrayReduce(array, iteratee, accumulator, initAccum) {
1186 var index = -1,
1187 length = array == null ? 0 : array.length;
1188
1189 if (initAccum && length) {
1190 accumulator = array[++index];
1191 }
1192 while (++index < length) {
1193 accumulator = iteratee(accumulator, array[index], index, array);
1194 }
1195 return accumulator;
1196 }
1197
1198 /**
1199 * A specialized version of `_.reduceRight` for arrays without support for
1200 * iteratee shorthands.
1201 *
1202 * @private
1203 * @param {Array} [array] The array to iterate over.
1204 * @param {Function} iteratee The function invoked per iteration.
1205 * @param {*} [accumulator] The initial value.
1206 * @param {boolean} [initAccum] Specify using the last element of `array` as
1207 * the initial value.
1208 * @returns {*} Returns the accumulated value.
1209 */
1210 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
1211 var length = array == null ? 0 : array.length;
1212 if (initAccum && length) {
1213 accumulator = array[--length];
1214 }
1215 while (length--) {
1216 accumulator = iteratee(accumulator, array[length], length, array);
1217 }
1218 return accumulator;
1219 }
1220
1221 /**
1222 * A specialized version of `_.some` for arrays without support for iteratee
1223 * shorthands.
1224 *
1225 * @private
1226 * @param {Array} [array] The array to iterate over.
1227 * @param {Function} predicate The function invoked per iteration.
1228 * @returns {boolean} Returns `true` if any element passes the predicate check,
1229 * else `false`.
1230 */
1231 function arraySome(array, predicate) {
1232 var index = -1,
1233 length = array == null ? 0 : array.length;
1234
1235 while (++index < length) {
1236 if (predicate(array[index], index, array)) {
1237 return true;
1238 }
1239 }
1240 return false;
1241 }
1242
1243 /**
1244 * Gets the size of an ASCII `string`.
1245 *
1246 * @private
1247 * @param {string} string The string inspect.
1248 * @returns {number} Returns the string size.
1249 */
1250 var asciiSize = baseProperty('length');
1251
1252 /**
1253 * Converts an ASCII `string` to an array.
1254 *
1255 * @private
1256 * @param {string} string The string to convert.
1257 * @returns {Array} Returns the converted array.
1258 */
1259 function asciiToArray(string) {
1260 return string.split('');
1261 }
1262
1263 /**
1264 * Splits an ASCII `string` into an array of its words.
1265 *
1266 * @private
1267 * @param {string} The string to inspect.
1268 * @returns {Array} Returns the words of `string`.
1269 */
1270 function asciiWords(string) {
1271 return string.match(reAsciiWord) || [];
1272 }
1273
1274 /**
1275 * The base implementation of methods like `_.findKey` and `_.findLastKey`,
1276 * without support for iteratee shorthands, which iterates over `collection`
1277 * using `eachFunc`.
1278 *
1279 * @private
1280 * @param {Array|Object} collection The collection to inspect.
1281 * @param {Function} predicate The function invoked per iteration.
1282 * @param {Function} eachFunc The function to iterate over `collection`.
1283 * @returns {*} Returns the found element or its key, else `undefined`.
1284 */
1285 function baseFindKey(collection, predicate, eachFunc) {
1286 var result;
1287 eachFunc(collection, function(value, key, collection) {
1288 if (predicate(value, key, collection)) {
1289 result = key;
1290 return false;
1291 }
1292 });
1293 return result;
1294 }
1295
1296 /**
1297 * The base implementation of `_.findIndex` and `_.findLastIndex` without
1298 * support for iteratee shorthands.
1299 *
1300 * @private
1301 * @param {Array} array The array to inspect.
1302 * @param {Function} predicate The function invoked per iteration.
1303 * @param {number} fromIndex The index to search from.
1304 * @param {boolean} [fromRight] Specify iterating from right to left.
1305 * @returns {number} Returns the index of the matched value, else `-1`.
1306 */
1307 function baseFindIndex(array, predicate, fromIndex, fromRight) {
1308 var length = array.length,
1309 index = fromIndex + (fromRight ? 1 : -1);
1310
1311 while ((fromRight ? index-- : ++index < length)) {
1312 if (predicate(array[index], index, array)) {
1313 return index;
1314 }
1315 }
1316 return -1;
1317 }
1318
1319 /**
1320 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1321 *
1322 * @private
1323 * @param {Array} array The array to inspect.
1324 * @param {*} value The value to search for.
1325 * @param {number} fromIndex The index to search from.
1326 * @returns {number} Returns the index of the matched value, else `-1`.
1327 */
1328 function baseIndexOf(array, value, fromIndex) {
1329 return value === value
1330 ? strictIndexOf(array, value, fromIndex)
1331 : baseFindIndex(array, baseIsNaN, fromIndex);
1332 }
1333
1334 /**
1335 * This function is like `baseIndexOf` except that it accepts a comparator.
1336 *
1337 * @private
1338 * @param {Array} array The array to inspect.
1339 * @param {*} value The value to search for.
1340 * @param {number} fromIndex The index to search from.
1341 * @param {Function} comparator The comparator invoked per element.
1342 * @returns {number} Returns the index of the matched value, else `-1`.
1343 */
1344 function baseIndexOfWith(array, value, fromIndex, comparator) {
1345 var index = fromIndex - 1,
1346 length = array.length;
1347
1348 while (++index < length) {
1349 if (comparator(array[index], value)) {
1350 return index;
1351 }
1352 }
1353 return -1;
1354 }
1355
1356 /**
1357 * The base implementation of `_.isNaN` without support for number objects.
1358 *
1359 * @private
1360 * @param {*} value The value to check.
1361 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1362 */
1363 function baseIsNaN(value) {
1364 return value !== value;
1365 }
1366
1367 /**
1368 * The base implementation of `_.mean` and `_.meanBy` without support for
1369 * iteratee shorthands.
1370 *
1371 * @private
1372 * @param {Array} array The array to iterate over.
1373 * @param {Function} iteratee The function invoked per iteration.
1374 * @returns {number} Returns the mean.
1375 */
1376 function baseMean(array, iteratee) {
1377 var length = array == null ? 0 : array.length;
1378 return length ? (baseSum(array, iteratee) / length) : NAN;
1379 }
1380
1381 /**
1382 * The base implementation of `_.property` without support for deep paths.
1383 *
1384 * @private
1385 * @param {string} key The key of the property to get.
1386 * @returns {Function} Returns the new accessor function.
1387 */
1388 function baseProperty(key) {
1389 return function(object) {
1390 return object == null ? undefined : object[key];
1391 };
1392 }
1393
1394 /**
1395 * The base implementation of `_.propertyOf` without support for deep paths.
1396 *
1397 * @private
1398 * @param {Object} object The object to query.
1399 * @returns {Function} Returns the new accessor function.
1400 */
1401 function basePropertyOf(object) {
1402 return function(key) {
1403 return object == null ? undefined : object[key];
1404 };
1405 }
1406
1407 /**
1408 * The base implementation of `_.reduce` and `_.reduceRight`, without support
1409 * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
1410 *
1411 * @private
1412 * @param {Array|Object} collection The collection to iterate over.
1413 * @param {Function} iteratee The function invoked per iteration.
1414 * @param {*} accumulator The initial value.
1415 * @param {boolean} initAccum Specify using the first or last element of
1416 * `collection` as the initial value.
1417 * @param {Function} eachFunc The function to iterate over `collection`.
1418 * @returns {*} Returns the accumulated value.
1419 */
1420 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
1421 eachFunc(collection, function(value, index, collection) {
1422 accumulator = initAccum
1423 ? (initAccum = false, value)
1424 : iteratee(accumulator, value, index, collection);
1425 });
1426 return accumulator;
1427 }
1428
1429 /**
1430 * The base implementation of `_.sortBy` which uses `comparer` to define the
1431 * sort order of `array` and replaces criteria objects with their corresponding
1432 * values.
1433 *
1434 * @private
1435 * @param {Array} array The array to sort.
1436 * @param {Function} comparer The function to define sort order.
1437 * @returns {Array} Returns `array`.
1438 */
1439 function baseSortBy(array, comparer) {
1440 var length = array.length;
1441
1442 array.sort(comparer);
1443 while (length--) {
1444 array[length] = array[length].value;
1445 }
1446 return array;
1447 }
1448
1449 /**
1450 * The base implementation of `_.sum` and `_.sumBy` without support for
1451 * iteratee shorthands.
1452 *
1453 * @private
1454 * @param {Array} array The array to iterate over.
1455 * @param {Function} iteratee The function invoked per iteration.
1456 * @returns {number} Returns the sum.
1457 */
1458 function baseSum(array, iteratee) {
1459 var result,
1460 index = -1,
1461 length = array.length;
1462
1463 while (++index < length) {
1464 var current = iteratee(array[index]);
1465 if (current !== undefined) {
1466 result = result === undefined ? current : (result + current);
1467 }
1468 }
1469 return result;
1470 }
1471
1472 /**
1473 * The base implementation of `_.times` without support for iteratee shorthands
1474 * or max array length checks.
1475 *
1476 * @private
1477 * @param {number} n The number of times to invoke `iteratee`.
1478 * @param {Function} iteratee The function invoked per iteration.
1479 * @returns {Array} Returns the array of results.
1480 */
1481 function baseTimes(n, iteratee) {
1482 var index = -1,
1483 result = Array(n);
1484
1485 while (++index < n) {
1486 result[index] = iteratee(index);
1487 }
1488 return result;
1489 }
1490
1491 /**
1492 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
1493 * of key-value pairs for `object` corresponding to the property names of `props`.
1494 *
1495 * @private
1496 * @param {Object} object The object to query.
1497 * @param {Array} props The property names to get values for.
1498 * @returns {Object} Returns the key-value pairs.
1499 */
1500 function baseToPairs(object, props) {
1501 return arrayMap(props, function(key) {
1502 return [key, object[key]];
1503 });
1504 }
1505
1506 /**
1507 * The base implementation of `_.unary` without support for storing metadata.
1508 *
1509 * @private
1510 * @param {Function} func The function to cap arguments for.
1511 * @returns {Function} Returns the new capped function.
1512 */
1513 function baseUnary(func) {
1514 return function(value) {
1515 return func(value);
1516 };
1517 }
1518
1519 /**
1520 * The base implementation of `_.values` and `_.valuesIn` which creates an
1521 * array of `object` property values corresponding to the property names
1522 * of `props`.
1523 *
1524 * @private
1525 * @param {Object} object The object to query.
1526 * @param {Array} props The property names to get values for.
1527 * @returns {Object} Returns the array of property values.
1528 */
1529 function baseValues(object, props) {
1530 return arrayMap(props, function(key) {
1531 return object[key];
1532 });
1533 }
1534
1535 /**
1536 * Checks if a `cache` value for `key` exists.
1537 *
1538 * @private
1539 * @param {Object} cache The cache to query.
1540 * @param {string} key The key of the entry to check.
1541 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1542 */
1543 function cacheHas(cache, key) {
1544 return cache.has(key);
1545 }
1546
1547 /**
1548 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
1549 * that is not found in the character symbols.
1550 *
1551 * @private
1552 * @param {Array} strSymbols The string symbols to inspect.
1553 * @param {Array} chrSymbols The character symbols to find.
1554 * @returns {number} Returns the index of the first unmatched string symbol.
1555 */
1556 function charsStartIndex(strSymbols, chrSymbols) {
1557 var index = -1,
1558 length = strSymbols.length;
1559
1560 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
1561 return index;
1562 }
1563
1564 /**
1565 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
1566 * that is not found in the character symbols.
1567 *
1568 * @private
1569 * @param {Array} strSymbols The string symbols to inspect.
1570 * @param {Array} chrSymbols The character symbols to find.
1571 * @returns {number} Returns the index of the last unmatched string symbol.
1572 */
1573 function charsEndIndex(strSymbols, chrSymbols) {
1574 var index = strSymbols.length;
1575
1576 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
1577 return index;
1578 }
1579
1580 /**
1581 * Gets the number of `placeholder` occurrences in `array`.
1582 *
1583 * @private
1584 * @param {Array} array The array to inspect.
1585 * @param {*} placeholder The placeholder to search for.
1586 * @returns {number} Returns the placeholder count.
1587 */
1588 function countHolders(array, placeholder) {
1589 var length = array.length,
1590 result = 0;
1591
1592 while (length--) {
1593 if (array[length] === placeholder) {
1594 ++result;
1595 }
1596 }
1597 return result;
1598 }
1599
1600 /**
1601 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
1602 * letters to basic Latin letters.
1603 *
1604 * @private
1605 * @param {string} letter The matched letter to deburr.
1606 * @returns {string} Returns the deburred letter.
1607 */
1608 var deburrLetter = basePropertyOf(deburredLetters);
1609
1610 /**
1611 * Used by `_.escape` to convert characters to HTML entities.
1612 *
1613 * @private
1614 * @param {string} chr The matched character to escape.
1615 * @returns {string} Returns the escaped character.
1616 */
1617 var escapeHtmlChar = basePropertyOf(htmlEscapes);
1618
1619 /**
1620 * Used by `_.template` to escape characters for inclusion in compiled string literals.
1621 *
1622 * @private
1623 * @param {string} chr The matched character to escape.
1624 * @returns {string} Returns the escaped character.
1625 */
1626 function escapeStringChar(chr) {
1627 return '\\' + stringEscapes[chr];
1628 }
1629
1630 /**
1631 * Gets the value at `key` of `object`.
1632 *
1633 * @private
1634 * @param {Object} [object] The object to query.
1635 * @param {string} key The key of the property to get.
1636 * @returns {*} Returns the property value.
1637 */
1638 function getValue(object, key) {
1639 return object == null ? undefined : object[key];
1640 }
1641
1642 /**
1643 * Checks if `string` contains Unicode symbols.
1644 *
1645 * @private
1646 * @param {string} string The string to inspect.
1647 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
1648 */
1649 function hasUnicode(string) {
1650 return reHasUnicode.test(string);
1651 }
1652
1653 /**
1654 * Checks if `string` contains a word composed of Unicode symbols.
1655 *
1656 * @private
1657 * @param {string} string The string to inspect.
1658 * @returns {boolean} Returns `true` if a word is found, else `false`.
1659 */
1660 function hasUnicodeWord(string) {
1661 return reHasUnicodeWord.test(string);
1662 }
1663
1664 /**
1665 * Converts `iterator` to an array.
1666 *
1667 * @private
1668 * @param {Object} iterator The iterator to convert.
1669 * @returns {Array} Returns the converted array.
1670 */
1671 function iteratorToArray(iterator) {
1672 var data,
1673 result = [];
1674
1675 while (!(data = iterator.next()).done) {
1676 result.push(data.value);
1677 }
1678 return result;
1679 }
1680
1681 /**
1682 * Converts `map` to its key-value pairs.
1683 *
1684 * @private
1685 * @param {Object} map The map to convert.
1686 * @returns {Array} Returns the key-value pairs.
1687 */
1688 function mapToArray(map) {
1689 var index = -1,
1690 result = Array(map.size);
1691
1692 map.forEach(function(value, key) {
1693 result[++index] = [key, value];
1694 });
1695 return result;
1696 }
1697
1698 /**
1699 * Creates a unary function that invokes `func` with its argument transformed.
1700 *
1701 * @private
1702 * @param {Function} func The function to wrap.
1703 * @param {Function} transform The argument transform.
1704 * @returns {Function} Returns the new function.
1705 */
1706 function overArg(func, transform) {
1707 return function(arg) {
1708 return func(transform(arg));
1709 };
1710 }
1711
1712 /**
1713 * Replaces all `placeholder` elements in `array` with an internal placeholder
1714 * and returns an array of their indexes.
1715 *
1716 * @private
1717 * @param {Array} array The array to modify.
1718 * @param {*} placeholder The placeholder to replace.
1719 * @returns {Array} Returns the new array of placeholder indexes.
1720 */
1721 function replaceHolders(array, placeholder) {
1722 var index = -1,
1723 length = array.length,
1724 resIndex = 0,
1725 result = [];
1726
1727 while (++index < length) {
1728 var value = array[index];
1729 if (value === placeholder || value === PLACEHOLDER) {
1730 array[index] = PLACEHOLDER;
1731 result[resIndex++] = index;
1732 }
1733 }
1734 return result;
1735 }
1736
1737 /**
1738 * Converts `set` to an array of its values.
1739 *
1740 * @private
1741 * @param {Object} set The set to convert.
1742 * @returns {Array} Returns the values.
1743 */
1744 function setToArray(set) {
1745 var index = -1,
1746 result = Array(set.size);
1747
1748 set.forEach(function(value) {
1749 result[++index] = value;
1750 });
1751 return result;
1752 }
1753
1754 /**
1755 * Converts `set` to its value-value pairs.
1756 *
1757 * @private
1758 * @param {Object} set The set to convert.
1759 * @returns {Array} Returns the value-value pairs.
1760 */
1761 function setToPairs(set) {
1762 var index = -1,
1763 result = Array(set.size);
1764
1765 set.forEach(function(value) {
1766 result[++index] = [value, value];
1767 });
1768 return result;
1769 }
1770
1771 /**
1772 * A specialized version of `_.indexOf` which performs strict equality
1773 * comparisons of values, i.e. `===`.
1774 *
1775 * @private
1776 * @param {Array} array The array to inspect.
1777 * @param {*} value The value to search for.
1778 * @param {number} fromIndex The index to search from.
1779 * @returns {number} Returns the index of the matched value, else `-1`.
1780 */
1781 function strictIndexOf(array, value, fromIndex) {
1782 var index = fromIndex - 1,
1783 length = array.length;
1784
1785 while (++index < length) {
1786 if (array[index] === value) {
1787 return index;
1788 }
1789 }
1790 return -1;
1791 }
1792
1793 /**
1794 * A specialized version of `_.lastIndexOf` which performs strict equality
1795 * comparisons of values, i.e. `===`.
1796 *
1797 * @private
1798 * @param {Array} array The array to inspect.
1799 * @param {*} value The value to search for.
1800 * @param {number} fromIndex The index to search from.
1801 * @returns {number} Returns the index of the matched value, else `-1`.
1802 */
1803 function strictLastIndexOf(array, value, fromIndex) {
1804 var index = fromIndex + 1;
1805 while (index--) {
1806 if (array[index] === value) {
1807 return index;
1808 }
1809 }
1810 return index;
1811 }
1812
1813 /**
1814 * Gets the number of symbols in `string`.
1815 *
1816 * @private
1817 * @param {string} string The string to inspect.
1818 * @returns {number} Returns the string size.
1819 */
1820 function stringSize(string) {
1821 return hasUnicode(string)
1822 ? unicodeSize(string)
1823 : asciiSize(string);
1824 }
1825
1826 /**
1827 * Converts `string` to an array.
1828 *
1829 * @private
1830 * @param {string} string The string to convert.
1831 * @returns {Array} Returns the converted array.
1832 */
1833 function stringToArray(string) {
1834 return hasUnicode(string)
1835 ? unicodeToArray(string)
1836 : asciiToArray(string);
1837 }
1838
1839 /**
1840 * Used by `_.unescape` to convert HTML entities to characters.
1841 *
1842 * @private
1843 * @param {string} chr The matched character to unescape.
1844 * @returns {string} Returns the unescaped character.
1845 */
1846 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
1847
1848 /**
1849 * Gets the size of a Unicode `string`.
1850 *
1851 * @private
1852 * @param {string} string The string inspect.
1853 * @returns {number} Returns the string size.
1854 */
1855 function unicodeSize(string) {
1856 var result = reUnicode.lastIndex = 0;
1857 while (reUnicode.test(string)) {
1858 ++result;
1859 }
1860 return result;
1861 }
1862
1863 /**
1864 * Converts a Unicode `string` to an array.
1865 *
1866 * @private
1867 * @param {string} string The string to convert.
1868 * @returns {Array} Returns the converted array.
1869 */
1870 function unicodeToArray(string) {
1871 return string.match(reUnicode) || [];
1872 }
1873
1874 /**
1875 * Splits a Unicode `string` into an array of its words.
1876 *
1877 * @private
1878 * @param {string} The string to inspect.
1879 * @returns {Array} Returns the words of `string`.
1880 */
1881 function unicodeWords(string) {
1882 return string.match(reUnicodeWord) || [];
1883 }
1884
1885 /*--------------------------------------------------------------------------*/
1886
1887 /**
1888 * Create a new pristine `lodash` function using the `context` object.
1889 *
1890 * @static
1891 * @memberOf _
1892 * @since 1.1.0
1893 * @category Util
1894 * @param {Object} [context=root] The context object.
1895 * @returns {Function} Returns a new `lodash` function.
1896 * @example
1897 *
1898 * _.mixin({ 'foo': _.constant('foo') });
1899 *
1900 * var lodash = _.runInContext();
1901 * lodash.mixin({ 'bar': lodash.constant('bar') });
1902 *
1903 * _.isFunction(_.foo);
1904 * // => true
1905 * _.isFunction(_.bar);
1906 * // => false
1907 *
1908 * lodash.isFunction(lodash.foo);
1909 * // => false
1910 * lodash.isFunction(lodash.bar);
1911 * // => true
1912 *
1913 * // Create a suped-up `defer` in Node.js.
1914 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
1915 */
1916 var runInContext = (function runInContext(context) {
1917 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
1918
1919 /** Built-in constructor references. */
1920 var Array = context.Array,
1921 Date = context.Date,
1922 Error = context.Error,
1923 Function = context.Function,
1924 Math = context.Math,
1925 Object = context.Object,
1926 RegExp = context.RegExp,
1927 String = context.String,
1928 TypeError = context.TypeError;
1929
1930 /** Used for built-in method references. */
1931 var arrayProto = Array.prototype,
1932 funcProto = Function.prototype,
1933 objectProto = Object.prototype;
1934
1935 /** Used to detect overreaching core-js shims. */
1936 var coreJsData = context['__core-js_shared__'];
1937
1938 /** Used to resolve the decompiled source of functions. */
1939 var funcToString = funcProto.toString;
1940
1941 /** Used to check objects for own properties. */
1942 var hasOwnProperty = objectProto.hasOwnProperty;
1943
1944 /** Used to generate unique IDs. */
1945 var idCounter = 0;
1946
1947 /** Used to detect methods masquerading as native. */
1948 var maskSrcKey = (function() {
1949 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1950 return uid ? ('Symbol(src)_1.' + uid) : '';
1951 }());
1952
1953 /**
1954 * Used to resolve the
1955 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1956 * of values.
1957 */
1958 var nativeObjectToString = objectProto.toString;
1959
1960 /** Used to infer the `Object` constructor. */
1961 var objectCtorString = funcToString.call(Object);
1962
1963 /** Used to restore the original `_` reference in `_.noConflict`. */
1964 var oldDash = root._;
1965
1966 /** Used to detect if a method is native. */
1967 var reIsNative = RegExp('^' +
1968 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
1969 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1970 );
1971
1972 /** Built-in value references. */
1973 var Buffer = moduleExports ? context.Buffer : undefined,
1974 Symbol = context.Symbol,
1975 Uint8Array = context.Uint8Array,
1976 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
1977 getPrototype = overArg(Object.getPrototypeOf, Object),
1978 objectCreate = Object.create,
1979 propertyIsEnumerable = objectProto.propertyIsEnumerable,
1980 splice = arrayProto.splice,
1981 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
1982 symIterator = Symbol ? Symbol.iterator : undefined,
1983 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
1984
1985 var defineProperty = (function() {
1986 try {
1987 var func = getNative(Object, 'defineProperty');
1988 func({}, '', {});
1989 return func;
1990 } catch (e) {}
1991 }());
1992
1993 /** Mocked built-ins. */
1994 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
1995 ctxNow = Date && Date.now !== root.Date.now && Date.now,
1996 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
1997
1998 /* Built-in method references for those with the same name as other `lodash` methods. */
1999 var nativeCeil = Math.ceil,
2000 nativeFloor = Math.floor,
2001 nativeGetSymbols = Object.getOwnPropertySymbols,
2002 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
2003 nativeIsFinite = context.isFinite,
2004 nativeJoin = arrayProto.join,
2005 nativeKeys = overArg(Object.keys, Object),
2006 nativeMax = Math.max,
2007 nativeMin = Math.min,
2008 nativeNow = Date.now,
2009 nativeParseInt = context.parseInt,
2010 nativeRandom = Math.random,
2011 nativeReverse = arrayProto.reverse;
2012
2013 /* Built-in method references that are verified to be native. */
2014 var DataView = getNative(context, 'DataView'),
2015 Map = getNative(context, 'Map'),
2016 Promise = getNative(context, 'Promise'),
2017 Set = getNative(context, 'Set'),
2018 WeakMap = getNative(context, 'WeakMap'),
2019 nativeCreate = getNative(Object, 'create');
2020
2021 /** Used to store function metadata. */
2022 var metaMap = WeakMap && new WeakMap;
2023
2024 /** Used to lookup unminified function names. */
2025 var realNames = {};
2026
2027 /** Used to detect maps, sets, and weakmaps. */
2028 var dataViewCtorString = toSource(DataView),
2029 mapCtorString = toSource(Map),
2030 promiseCtorString = toSource(Promise),
2031 setCtorString = toSource(Set),
2032 weakMapCtorString = toSource(WeakMap);
2033
2034 /** Used to convert symbols to primitives and strings. */
2035 var symbolProto = Symbol ? Symbol.prototype : undefined,
2036 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
2037 symbolToString = symbolProto ? symbolProto.toString : undefined;
2038
2039 /*------------------------------------------------------------------------*/
2040
2041 /**
2042 * Creates a `lodash` object which wraps `value` to enable implicit method
2043 * chain sequences. Methods that operate on and return arrays, collections,
2044 * and functions can be chained together. Methods that retrieve a single value
2045 * or may return a primitive value will automatically end the chain sequence
2046 * and return the unwrapped value. Otherwise, the value must be unwrapped
2047 * with `_#value`.
2048 *
2049 * Explicit chain sequences, which must be unwrapped with `_#value`, may be
2050 * enabled using `_.chain`.
2051 *
2052 * The execution of chained methods is lazy, that is, it's deferred until
2053 * `_#value` is implicitly or explicitly called.
2054 *
2055 * Lazy evaluation allows several methods to support shortcut fusion.
2056 * Shortcut fusion is an optimization to merge iteratee calls; this avoids
2057 * the creation of intermediate arrays and can greatly reduce the number of
2058 * iteratee executions. Sections of a chain sequence qualify for shortcut
2059 * fusion if the section is applied to an array and iteratees accept only
2060 * one argument. The heuristic for whether a section qualifies for shortcut
2061 * fusion is subject to change.
2062 *
2063 * Chaining is supported in custom builds as long as the `_#value` method is
2064 * directly or indirectly included in the build.
2065 *
2066 * In addition to lodash methods, wrappers have `Array` and `String` methods.
2067 *
2068 * The wrapper `Array` methods are:
2069 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
2070 *
2071 * The wrapper `String` methods are:
2072 * `replace` and `split`
2073 *
2074 * The wrapper methods that support shortcut fusion are:
2075 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
2076 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
2077 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
2078 *
2079 * The chainable wrapper methods are:
2080 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
2081 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
2082 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
2083 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
2084 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
2085 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
2086 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
2087 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
2088 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
2089 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
2090 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
2091 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
2092 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
2093 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
2094 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
2095 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
2096 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
2097 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
2098 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
2099 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
2100 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
2101 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
2102 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
2103 * `zipObject`, `zipObjectDeep`, and `zipWith`
2104 *
2105 * The wrapper methods that are **not** chainable by default are:
2106 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
2107 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
2108 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
2109 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
2110 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
2111 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
2112 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
2113 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
2114 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
2115 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
2116 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
2117 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
2118 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
2119 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
2120 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
2121 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
2122 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
2123 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
2124 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
2125 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
2126 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
2127 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
2128 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
2129 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
2130 * `upperFirst`, `value`, and `words`
2131 *
2132 * @name _
2133 * @constructor
2134 * @category Seq
2135 * @param {*} value The value to wrap in a `lodash` instance.
2136 * @returns {Object} Returns the new `lodash` wrapper instance.
2137 * @example
2138 *
2139 * function square(n) {
2140 * return n * n;
2141 * }
2142 *
2143 * var wrapped = _([1, 2, 3]);
2144 *
2145 * // Returns an unwrapped value.
2146 * wrapped.reduce(_.add);
2147 * // => 6
2148 *
2149 * // Returns a wrapped value.
2150 * var squares = wrapped.map(square);
2151 *
2152 * _.isArray(squares);
2153 * // => false
2154 *
2155 * _.isArray(squares.value());
2156 * // => true
2157 */
2158 function lodash(value) {
2159 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
2160 if (value instanceof LodashWrapper) {
2161 return value;
2162 }
2163 if (hasOwnProperty.call(value, '__wrapped__')) {
2164 return wrapperClone(value);
2165 }
2166 }
2167 return new LodashWrapper(value);
2168 }
2169
2170 /**
2171 * The base implementation of `_.create` without support for assigning
2172 * properties to the created object.
2173 *
2174 * @private
2175 * @param {Object} proto The object to inherit from.
2176 * @returns {Object} Returns the new object.
2177 */
2178 var baseCreate = (function() {
2179 function object() {}
2180 return function(proto) {
2181 if (!isObject(proto)) {
2182 return {};
2183 }
2184 if (objectCreate) {
2185 return objectCreate(proto);
2186 }
2187 object.prototype = proto;
2188 var result = new object;
2189 object.prototype = undefined;
2190 return result;
2191 };
2192 }());
2193
2194 /**
2195 * The function whose prototype chain sequence wrappers inherit from.
2196 *
2197 * @private
2198 */
2199 function baseLodash() {
2200 // No operation performed.
2201 }
2202
2203 /**
2204 * The base constructor for creating `lodash` wrapper objects.
2205 *
2206 * @private
2207 * @param {*} value The value to wrap.
2208 * @param {boolean} [chainAll] Enable explicit method chain sequences.
2209 */
2210 function LodashWrapper(value, chainAll) {
2211 this.__wrapped__ = value;
2212 this.__actions__ = [];
2213 this.__chain__ = !!chainAll;
2214 this.__index__ = 0;
2215 this.__values__ = undefined;
2216 }
2217
2218 /**
2219 * By default, the template delimiters used by lodash are like those in
2220 * embedded Ruby (ERB) as well as ES2015 template strings. Change the
2221 * following template settings to use alternative delimiters.
2222 *
2223 * @static
2224 * @memberOf _
2225 * @type {Object}
2226 */
2227 lodash.templateSettings = {
2228
2229 /**
2230 * Used to detect `data` property values to be HTML-escaped.
2231 *
2232 * @memberOf _.templateSettings
2233 * @type {RegExp}
2234 */
2235 'escape': reEscape,
2236
2237 /**
2238 * Used to detect code to be evaluated.
2239 *
2240 * @memberOf _.templateSettings
2241 * @type {RegExp}
2242 */
2243 'evaluate': reEvaluate,
2244
2245 /**
2246 * Used to detect `data` property values to inject.
2247 *
2248 * @memberOf _.templateSettings
2249 * @type {RegExp}
2250 */
2251 'interpolate': reInterpolate,
2252
2253 /**
2254 * Used to reference the data object in the template text.
2255 *
2256 * @memberOf _.templateSettings
2257 * @type {string}
2258 */
2259 'variable': '',
2260
2261 /**
2262 * Used to import variables into the compiled template.
2263 *
2264 * @memberOf _.templateSettings
2265 * @type {Object}
2266 */
2267 'imports': {
2268
2269 /**
2270 * A reference to the `lodash` function.
2271 *
2272 * @memberOf _.templateSettings.imports
2273 * @type {Function}
2274 */
2275 '_': lodash
2276 }
2277 };
2278
2279 // Ensure wrappers are instances of `baseLodash`.
2280 lodash.prototype = baseLodash.prototype;
2281 lodash.prototype.constructor = lodash;
2282
2283 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
2284 LodashWrapper.prototype.constructor = LodashWrapper;
2285
2286 /*------------------------------------------------------------------------*/
2287
2288 /**
2289 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
2290 *
2291 * @private
2292 * @constructor
2293 * @param {*} value The value to wrap.
2294 */
2295 function LazyWrapper(value) {
2296 this.__wrapped__ = value;
2297 this.__actions__ = [];
2298 this.__dir__ = 1;
2299 this.__filtered__ = false;
2300 this.__iteratees__ = [];
2301 this.__takeCount__ = MAX_ARRAY_LENGTH;
2302 this.__views__ = [];
2303 }
2304
2305 /**
2306 * Creates a clone of the lazy wrapper object.
2307 *
2308 * @private
2309 * @name clone
2310 * @memberOf LazyWrapper
2311 * @returns {Object} Returns the cloned `LazyWrapper` object.
2312 */
2313 function lazyClone() {
2314 var result = new LazyWrapper(this.__wrapped__);
2315 result.__actions__ = copyArray(this.__actions__);
2316 result.__dir__ = this.__dir__;
2317 result.__filtered__ = this.__filtered__;
2318 result.__iteratees__ = copyArray(this.__iteratees__);
2319 result.__takeCount__ = this.__takeCount__;
2320 result.__views__ = copyArray(this.__views__);
2321 return result;
2322 }
2323
2324 /**
2325 * Reverses the direction of lazy iteration.
2326 *
2327 * @private
2328 * @name reverse
2329 * @memberOf LazyWrapper
2330 * @returns {Object} Returns the new reversed `LazyWrapper` object.
2331 */
2332 function lazyReverse() {
2333 if (this.__filtered__) {
2334 var result = new LazyWrapper(this);
2335 result.__dir__ = -1;
2336 result.__filtered__ = true;
2337 } else {
2338 result = this.clone();
2339 result.__dir__ *= -1;
2340 }
2341 return result;
2342 }
2343
2344 /**
2345 * Extracts the unwrapped value from its lazy wrapper.
2346 *
2347 * @private
2348 * @name value
2349 * @memberOf LazyWrapper
2350 * @returns {*} Returns the unwrapped value.
2351 */
2352 function lazyValue() {
2353 var array = this.__wrapped__.value(),
2354 dir = this.__dir__,
2355 isArr = isArray(array),
2356 isRight = dir < 0,
2357 arrLength = isArr ? array.length : 0,
2358 view = getView(0, arrLength, this.__views__),
2359 start = view.start,
2360 end = view.end,
2361 length = end - start,
2362 index = isRight ? end : (start - 1),
2363 iteratees = this.__iteratees__,
2364 iterLength = iteratees.length,
2365 resIndex = 0,
2366 takeCount = nativeMin(length, this.__takeCount__);
2367
2368 if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
2369 return baseWrapperValue(array, this.__actions__);
2370 }
2371 var result = [];
2372
2373 outer:
2374 while (length-- && resIndex < takeCount) {
2375 index += dir;
2376
2377 var iterIndex = -1,
2378 value = array[index];
2379
2380 while (++iterIndex < iterLength) {
2381 var data = iteratees[iterIndex],
2382 iteratee = data.iteratee,
2383 type = data.type,
2384 computed = iteratee(value);
2385
2386 if (type == LAZY_MAP_FLAG) {
2387 value = computed;
2388 } else if (!computed) {
2389 if (type == LAZY_FILTER_FLAG) {
2390 continue outer;
2391 } else {
2392 break outer;
2393 }
2394 }
2395 }
2396 result[resIndex++] = value;
2397 }
2398 return result;
2399 }
2400
2401 // Ensure `LazyWrapper` is an instance of `baseLodash`.
2402 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
2403 LazyWrapper.prototype.constructor = LazyWrapper;
2404
2405 /*------------------------------------------------------------------------*/
2406
2407 /**
2408 * Creates a hash object.
2409 *
2410 * @private
2411 * @constructor
2412 * @param {Array} [entries] The key-value pairs to cache.
2413 */
2414 function Hash(entries) {
2415 var index = -1,
2416 length = entries == null ? 0 : entries.length;
2417
2418 this.clear();
2419 while (++index < length) {
2420 var entry = entries[index];
2421 this.set(entry[0], entry[1]);
2422 }
2423 }
2424
2425 /**
2426 * Removes all key-value entries from the hash.
2427 *
2428 * @private
2429 * @name clear
2430 * @memberOf Hash
2431 */
2432 function hashClear() {
2433 this.__data__ = nativeCreate ? nativeCreate(null) : {};
2434 this.size = 0;
2435 }
2436
2437 /**
2438 * Removes `key` and its value from the hash.
2439 *
2440 * @private
2441 * @name delete
2442 * @memberOf Hash
2443 * @param {Object} hash The hash to modify.
2444 * @param {string} key The key of the value to remove.
2445 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2446 */
2447 function hashDelete(key) {
2448 var result = this.has(key) && delete this.__data__[key];
2449 this.size -= result ? 1 : 0;
2450 return result;
2451 }
2452
2453 /**
2454 * Gets the hash value for `key`.
2455 *
2456 * @private
2457 * @name get
2458 * @memberOf Hash
2459 * @param {string} key The key of the value to get.
2460 * @returns {*} Returns the entry value.
2461 */
2462 function hashGet(key) {
2463 var data = this.__data__;
2464 if (nativeCreate) {
2465 var result = data[key];
2466 return result === HASH_UNDEFINED ? undefined : result;
2467 }
2468 return hasOwnProperty.call(data, key) ? data[key] : undefined;
2469 }
2470
2471 /**
2472 * Checks if a hash value for `key` exists.
2473 *
2474 * @private
2475 * @name has
2476 * @memberOf Hash
2477 * @param {string} key The key of the entry to check.
2478 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2479 */
2480 function hashHas(key) {
2481 var data = this.__data__;
2482 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
2483 }
2484
2485 /**
2486 * Sets the hash `key` to `value`.
2487 *
2488 * @private
2489 * @name set
2490 * @memberOf Hash
2491 * @param {string} key The key of the value to set.
2492 * @param {*} value The value to set.
2493 * @returns {Object} Returns the hash instance.
2494 */
2495 function hashSet(key, value) {
2496 var data = this.__data__;
2497 this.size += this.has(key) ? 0 : 1;
2498 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
2499 return this;
2500 }
2501
2502 // Add methods to `Hash`.
2503 Hash.prototype.clear = hashClear;
2504 Hash.prototype['delete'] = hashDelete;
2505 Hash.prototype.get = hashGet;
2506 Hash.prototype.has = hashHas;
2507 Hash.prototype.set = hashSet;
2508
2509 /*------------------------------------------------------------------------*/
2510
2511 /**
2512 * Creates an list cache object.
2513 *
2514 * @private
2515 * @constructor
2516 * @param {Array} [entries] The key-value pairs to cache.
2517 */
2518 function ListCache(entries) {
2519 var index = -1,
2520 length = entries == null ? 0 : entries.length;
2521
2522 this.clear();
2523 while (++index < length) {
2524 var entry = entries[index];
2525 this.set(entry[0], entry[1]);
2526 }
2527 }
2528
2529 /**
2530 * Removes all key-value entries from the list cache.
2531 *
2532 * @private
2533 * @name clear
2534 * @memberOf ListCache
2535 */
2536 function listCacheClear() {
2537 this.__data__ = [];
2538 this.size = 0;
2539 }
2540
2541 /**
2542 * Removes `key` and its value from the list cache.
2543 *
2544 * @private
2545 * @name delete
2546 * @memberOf ListCache
2547 * @param {string} key The key of the value to remove.
2548 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2549 */
2550 function listCacheDelete(key) {
2551 var data = this.__data__,
2552 index = assocIndexOf(data, key);
2553
2554 if (index < 0) {
2555 return false;
2556 }
2557 var lastIndex = data.length - 1;
2558 if (index == lastIndex) {
2559 data.pop();
2560 } else {
2561 splice.call(data, index, 1);
2562 }
2563 --this.size;
2564 return true;
2565 }
2566
2567 /**
2568 * Gets the list cache value for `key`.
2569 *
2570 * @private
2571 * @name get
2572 * @memberOf ListCache
2573 * @param {string} key The key of the value to get.
2574 * @returns {*} Returns the entry value.
2575 */
2576 function listCacheGet(key) {
2577 var data = this.__data__,
2578 index = assocIndexOf(data, key);
2579
2580 return index < 0 ? undefined : data[index][1];
2581 }
2582
2583 /**
2584 * Checks if a list cache value for `key` exists.
2585 *
2586 * @private
2587 * @name has
2588 * @memberOf ListCache
2589 * @param {string} key The key of the entry to check.
2590 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2591 */
2592 function listCacheHas(key) {
2593 return assocIndexOf(this.__data__, key) > -1;
2594 }
2595
2596 /**
2597 * Sets the list cache `key` to `value`.
2598 *
2599 * @private
2600 * @name set
2601 * @memberOf ListCache
2602 * @param {string} key The key of the value to set.
2603 * @param {*} value The value to set.
2604 * @returns {Object} Returns the list cache instance.
2605 */
2606 function listCacheSet(key, value) {
2607 var data = this.__data__,
2608 index = assocIndexOf(data, key);
2609
2610 if (index < 0) {
2611 ++this.size;
2612 data.push([key, value]);
2613 } else {
2614 data[index][1] = value;
2615 }
2616 return this;
2617 }
2618
2619 // Add methods to `ListCache`.
2620 ListCache.prototype.clear = listCacheClear;
2621 ListCache.prototype['delete'] = listCacheDelete;
2622 ListCache.prototype.get = listCacheGet;
2623 ListCache.prototype.has = listCacheHas;
2624 ListCache.prototype.set = listCacheSet;
2625
2626 /*------------------------------------------------------------------------*/
2627
2628 /**
2629 * Creates a map cache object to store key-value pairs.
2630 *
2631 * @private
2632 * @constructor
2633 * @param {Array} [entries] The key-value pairs to cache.
2634 */
2635 function MapCache(entries) {
2636 var index = -1,
2637 length = entries == null ? 0 : entries.length;
2638
2639 this.clear();
2640 while (++index < length) {
2641 var entry = entries[index];
2642 this.set(entry[0], entry[1]);
2643 }
2644 }
2645
2646 /**
2647 * Removes all key-value entries from the map.
2648 *
2649 * @private
2650 * @name clear
2651 * @memberOf MapCache
2652 */
2653 function mapCacheClear() {
2654 this.size = 0;
2655 this.__data__ = {
2656 'hash': new Hash,
2657 'map': new (Map || ListCache),
2658 'string': new Hash
2659 };
2660 }
2661
2662 /**
2663 * Removes `key` and its value from the map.
2664 *
2665 * @private
2666 * @name delete
2667 * @memberOf MapCache
2668 * @param {string} key The key of the value to remove.
2669 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2670 */
2671 function mapCacheDelete(key) {
2672 var result = getMapData(this, key)['delete'](key);
2673 this.size -= result ? 1 : 0;
2674 return result;
2675 }
2676
2677 /**
2678 * Gets the map value for `key`.
2679 *
2680 * @private
2681 * @name get
2682 * @memberOf MapCache
2683 * @param {string} key The key of the value to get.
2684 * @returns {*} Returns the entry value.
2685 */
2686 function mapCacheGet(key) {
2687 return getMapData(this, key).get(key);
2688 }
2689
2690 /**
2691 * Checks if a map value for `key` exists.
2692 *
2693 * @private
2694 * @name has
2695 * @memberOf MapCache
2696 * @param {string} key The key of the entry to check.
2697 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2698 */
2699 function mapCacheHas(key) {
2700 return getMapData(this, key).has(key);
2701 }
2702
2703 /**
2704 * Sets the map `key` to `value`.
2705 *
2706 * @private
2707 * @name set
2708 * @memberOf MapCache
2709 * @param {string} key The key of the value to set.
2710 * @param {*} value The value to set.
2711 * @returns {Object} Returns the map cache instance.
2712 */
2713 function mapCacheSet(key, value) {
2714 var data = getMapData(this, key),
2715 size = data.size;
2716
2717 data.set(key, value);
2718 this.size += data.size == size ? 0 : 1;
2719 return this;
2720 }
2721
2722 // Add methods to `MapCache`.
2723 MapCache.prototype.clear = mapCacheClear;
2724 MapCache.prototype['delete'] = mapCacheDelete;
2725 MapCache.prototype.get = mapCacheGet;
2726 MapCache.prototype.has = mapCacheHas;
2727 MapCache.prototype.set = mapCacheSet;
2728
2729 /*------------------------------------------------------------------------*/
2730
2731 /**
2732 *
2733 * Creates an array cache object to store unique values.
2734 *
2735 * @private
2736 * @constructor
2737 * @param {Array} [values] The values to cache.
2738 */
2739 function SetCache(values) {
2740 var index = -1,
2741 length = values == null ? 0 : values.length;
2742
2743 this.__data__ = new MapCache;
2744 while (++index < length) {
2745 this.add(values[index]);
2746 }
2747 }
2748
2749 /**
2750 * Adds `value` to the array cache.
2751 *
2752 * @private
2753 * @name add
2754 * @memberOf SetCache
2755 * @alias push
2756 * @param {*} value The value to cache.
2757 * @returns {Object} Returns the cache instance.
2758 */
2759 function setCacheAdd(value) {
2760 this.__data__.set(value, HASH_UNDEFINED);
2761 return this;
2762 }
2763
2764 /**
2765 * Checks if `value` is in the array cache.
2766 *
2767 * @private
2768 * @name has
2769 * @memberOf SetCache
2770 * @param {*} value The value to search for.
2771 * @returns {number} Returns `true` if `value` is found, else `false`.
2772 */
2773 function setCacheHas(value) {
2774 return this.__data__.has(value);
2775 }
2776
2777 // Add methods to `SetCache`.
2778 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
2779 SetCache.prototype.has = setCacheHas;
2780
2781 /*------------------------------------------------------------------------*/
2782
2783 /**
2784 * Creates a stack cache object to store key-value pairs.
2785 *
2786 * @private
2787 * @constructor
2788 * @param {Array} [entries] The key-value pairs to cache.
2789 */
2790 function Stack(entries) {
2791 var data = this.__data__ = new ListCache(entries);
2792 this.size = data.size;
2793 }
2794
2795 /**
2796 * Removes all key-value entries from the stack.
2797 *
2798 * @private
2799 * @name clear
2800 * @memberOf Stack
2801 */
2802 function stackClear() {
2803 this.__data__ = new ListCache;
2804 this.size = 0;
2805 }
2806
2807 /**
2808 * Removes `key` and its value from the stack.
2809 *
2810 * @private
2811 * @name delete
2812 * @memberOf Stack
2813 * @param {string} key The key of the value to remove.
2814 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2815 */
2816 function stackDelete(key) {
2817 var data = this.__data__,
2818 result = data['delete'](key);
2819
2820 this.size = data.size;
2821 return result;
2822 }
2823
2824 /**
2825 * Gets the stack value for `key`.
2826 *
2827 * @private
2828 * @name get
2829 * @memberOf Stack
2830 * @param {string} key The key of the value to get.
2831 * @returns {*} Returns the entry value.
2832 */
2833 function stackGet(key) {
2834 return this.__data__.get(key);
2835 }
2836
2837 /**
2838 * Checks if a stack value for `key` exists.
2839 *
2840 * @private
2841 * @name has
2842 * @memberOf Stack
2843 * @param {string} key The key of the entry to check.
2844 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2845 */
2846 function stackHas(key) {
2847 return this.__data__.has(key);
2848 }
2849
2850 /**
2851 * Sets the stack `key` to `value`.
2852 *
2853 * @private
2854 * @name set
2855 * @memberOf Stack
2856 * @param {string} key The key of the value to set.
2857 * @param {*} value The value to set.
2858 * @returns {Object} Returns the stack cache instance.
2859 */
2860 function stackSet(key, value) {
2861 var data = this.__data__;
2862 if (data instanceof ListCache) {
2863 var pairs = data.__data__;
2864 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
2865 pairs.push([key, value]);
2866 this.size = ++data.size;
2867 return this;
2868 }
2869 data = this.__data__ = new MapCache(pairs);
2870 }
2871 data.set(key, value);
2872 this.size = data.size;
2873 return this;
2874 }
2875
2876 // Add methods to `Stack`.
2877 Stack.prototype.clear = stackClear;
2878 Stack.prototype['delete'] = stackDelete;
2879 Stack.prototype.get = stackGet;
2880 Stack.prototype.has = stackHas;
2881 Stack.prototype.set = stackSet;
2882
2883 /*------------------------------------------------------------------------*/
2884
2885 /**
2886 * Creates an array of the enumerable property names of the array-like `value`.
2887 *
2888 * @private
2889 * @param {*} value The value to query.
2890 * @param {boolean} inherited Specify returning inherited property names.
2891 * @returns {Array} Returns the array of property names.
2892 */
2893 function arrayLikeKeys(value, inherited) {
2894 var isArr = isArray(value),
2895 isArg = !isArr && isArguments(value),
2896 isBuff = !isArr && !isArg && isBuffer(value),
2897 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
2898 skipIndexes = isArr || isArg || isBuff || isType,
2899 result = skipIndexes ? baseTimes(value.length, String) : [],
2900 length = result.length;
2901
2902 for (var key in value) {
2903 if ((inherited || hasOwnProperty.call(value, key)) &&
2904 !(skipIndexes && (
2905 // Safari 9 has enumerable `arguments.length` in strict mode.
2906 key == 'length' ||
2907 // Node.js 0.10 has enumerable non-index properties on buffers.
2908 (isBuff && (key == 'offset' || key == 'parent')) ||
2909 // PhantomJS 2 has enumerable non-index properties on typed arrays.
2910 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
2911 // Skip index properties.
2912 isIndex(key, length)
2913 ))) {
2914 result.push(key);
2915 }
2916 }
2917 return result;
2918 }
2919
2920 /**
2921 * A specialized version of `_.sample` for arrays.
2922 *
2923 * @private
2924 * @param {Array} array The array to sample.
2925 * @returns {*} Returns the random element.
2926 */
2927 function arraySample(array) {
2928 var length = array.length;
2929 return length ? array[baseRandom(0, length - 1)] : undefined;
2930 }
2931
2932 /**
2933 * A specialized version of `_.sampleSize` for arrays.
2934 *
2935 * @private
2936 * @param {Array} array The array to sample.
2937 * @param {number} n The number of elements to sample.
2938 * @returns {Array} Returns the random elements.
2939 */
2940 function arraySampleSize(array, n) {
2941 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
2942 }
2943
2944 /**
2945 * A specialized version of `_.shuffle` for arrays.
2946 *
2947 * @private
2948 * @param {Array} array The array to shuffle.
2949 * @returns {Array} Returns the new shuffled array.
2950 */
2951 function arrayShuffle(array) {
2952 return shuffleSelf(copyArray(array));
2953 }
2954
2955 /**
2956 * This function is like `assignValue` except that it doesn't assign
2957 * `undefined` values.
2958 *
2959 * @private
2960 * @param {Object} object The object to modify.
2961 * @param {string} key The key of the property to assign.
2962 * @param {*} value The value to assign.
2963 */
2964 function assignMergeValue(object, key, value) {
2965 if ((value !== undefined && !eq(object[key], value)) ||
2966 (value === undefined && !(key in object))) {
2967 baseAssignValue(object, key, value);
2968 }
2969 }
2970
2971 /**
2972 * Assigns `value` to `key` of `object` if the existing value is not equivalent
2973 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2974 * for equality comparisons.
2975 *
2976 * @private
2977 * @param {Object} object The object to modify.
2978 * @param {string} key The key of the property to assign.
2979 * @param {*} value The value to assign.
2980 */
2981 function assignValue(object, key, value) {
2982 var objValue = object[key];
2983 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
2984 (value === undefined && !(key in object))) {
2985 baseAssignValue(object, key, value);
2986 }
2987 }
2988
2989 /**
2990 * Gets the index at which the `key` is found in `array` of key-value pairs.
2991 *
2992 * @private
2993 * @param {Array} array The array to inspect.
2994 * @param {*} key The key to search for.
2995 * @returns {number} Returns the index of the matched value, else `-1`.
2996 */
2997 function assocIndexOf(array, key) {
2998 var length = array.length;
2999 while (length--) {
3000 if (eq(array[length][0], key)) {
3001 return length;
3002 }
3003 }
3004 return -1;
3005 }
3006
3007 /**
3008 * Aggregates elements of `collection` on `accumulator` with keys transformed
3009 * by `iteratee` and values set by `setter`.
3010 *
3011 * @private
3012 * @param {Array|Object} collection The collection to iterate over.
3013 * @param {Function} setter The function to set `accumulator` values.
3014 * @param {Function} iteratee The iteratee to transform keys.
3015 * @param {Object} accumulator The initial aggregated object.
3016 * @returns {Function} Returns `accumulator`.
3017 */
3018 function baseAggregator(collection, setter, iteratee, accumulator) {
3019 baseEach(collection, function(value, key, collection) {
3020 setter(accumulator, value, iteratee(value), collection);
3021 });
3022 return accumulator;
3023 }
3024
3025 /**
3026 * The base implementation of `_.assign` without support for multiple sources
3027 * or `customizer` functions.
3028 *
3029 * @private
3030 * @param {Object} object The destination object.
3031 * @param {Object} source The source object.
3032 * @returns {Object} Returns `object`.
3033 */
3034 function baseAssign(object, source) {
3035 return object && copyObject(source, keys(source), object);
3036 }
3037
3038 /**
3039 * The base implementation of `_.assignIn` without support for multiple sources
3040 * or `customizer` functions.
3041 *
3042 * @private
3043 * @param {Object} object The destination object.
3044 * @param {Object} source The source object.
3045 * @returns {Object} Returns `object`.
3046 */
3047 function baseAssignIn(object, source) {
3048 return object && copyObject(source, keysIn(source), object);
3049 }
3050
3051 /**
3052 * The base implementation of `assignValue` and `assignMergeValue` without
3053 * value checks.
3054 *
3055 * @private
3056 * @param {Object} object The object to modify.
3057 * @param {string} key The key of the property to assign.
3058 * @param {*} value The value to assign.
3059 */
3060 function baseAssignValue(object, key, value) {
3061 if (key == '__proto__' && defineProperty) {
3062 defineProperty(object, key, {
3063 'configurable': true,
3064 'enumerable': true,
3065 'value': value,
3066 'writable': true
3067 });
3068 } else {
3069 object[key] = value;
3070 }
3071 }
3072
3073 /**
3074 * The base implementation of `_.at` without support for individual paths.
3075 *
3076 * @private
3077 * @param {Object} object The object to iterate over.
3078 * @param {string[]} paths The property paths to pick.
3079 * @returns {Array} Returns the picked elements.
3080 */
3081 function baseAt(object, paths) {
3082 var index = -1,
3083 length = paths.length,
3084 result = Array(length),
3085 skip = object == null;
3086
3087 while (++index < length) {
3088 result[index] = skip ? undefined : get(object, paths[index]);
3089 }
3090 return result;
3091 }
3092
3093 /**
3094 * The base implementation of `_.clamp` which doesn't coerce arguments.
3095 *
3096 * @private
3097 * @param {number} number The number to clamp.
3098 * @param {number} [lower] The lower bound.
3099 * @param {number} upper The upper bound.
3100 * @returns {number} Returns the clamped number.
3101 */
3102 function baseClamp(number, lower, upper) {
3103 if (number === number) {
3104 if (upper !== undefined) {
3105 number = number <= upper ? number : upper;
3106 }
3107 if (lower !== undefined) {
3108 number = number >= lower ? number : lower;
3109 }
3110 }
3111 return number;
3112 }
3113
3114 /**
3115 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
3116 * traversed objects.
3117 *
3118 * @private
3119 * @param {*} value The value to clone.
3120 * @param {boolean} bitmask The bitmask flags.
3121 * 1 - Deep clone
3122 * 2 - Flatten inherited properties
3123 * 4 - Clone symbols
3124 * @param {Function} [customizer] The function to customize cloning.
3125 * @param {string} [key] The key of `value`.
3126 * @param {Object} [object] The parent object of `value`.
3127 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
3128 * @returns {*} Returns the cloned value.
3129 */
3130 function baseClone(value, bitmask, customizer, key, object, stack) {
3131 var result,
3132 isDeep = bitmask & CLONE_DEEP_FLAG,
3133 isFlat = bitmask & CLONE_FLAT_FLAG,
3134 isFull = bitmask & CLONE_SYMBOLS_FLAG;
3135
3136 if (customizer) {
3137 result = object ? customizer(value, key, object, stack) : customizer(value);
3138 }
3139 if (result !== undefined) {
3140 return result;
3141 }
3142 if (!isObject(value)) {
3143 return value;
3144 }
3145 var isArr = isArray(value);
3146 if (isArr) {
3147 result = initCloneArray(value);
3148 if (!isDeep) {
3149 return copyArray(value, result);
3150 }
3151 } else {
3152 var tag = getTag(value),
3153 isFunc = tag == funcTag || tag == genTag;
3154
3155 if (isBuffer(value)) {
3156 return cloneBuffer(value, isDeep);
3157 }
3158 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
3159 result = (isFlat || isFunc) ? {} : initCloneObject(value);
3160 if (!isDeep) {
3161 return isFlat
3162 ? copySymbolsIn(value, baseAssignIn(result, value))
3163 : copySymbols(value, baseAssign(result, value));
3164 }
3165 } else {
3166 if (!cloneableTags[tag]) {
3167 return object ? value : {};
3168 }
3169 result = initCloneByTag(value, tag, isDeep);
3170 }
3171 }
3172 // Check for circular references and return its corresponding clone.
3173 stack || (stack = new Stack);
3174 var stacked = stack.get(value);
3175 if (stacked) {
3176 return stacked;
3177 }
3178 stack.set(value, result);
3179
3180 if (isSet(value)) {
3181 value.forEach(function(subValue) {
3182 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
3183 });
3184
3185 return result;
3186 }
3187
3188 if (isMap(value)) {
3189 value.forEach(function(subValue, key) {
3190 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
3191 });
3192
3193 return result;
3194 }
3195
3196 var keysFunc = isFull
3197 ? (isFlat ? getAllKeysIn : getAllKeys)
3198 : (isFlat ? keysIn : keys);
3199
3200 var props = isArr ? undefined : keysFunc(value);
3201 arrayEach(props || value, function(subValue, key) {
3202 if (props) {
3203 key = subValue;
3204 subValue = value[key];
3205 }
3206 // Recursively populate clone (susceptible to call stack limits).
3207 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
3208 });
3209 return result;
3210 }
3211
3212 /**
3213 * The base implementation of `_.conforms` which doesn't clone `source`.
3214 *
3215 * @private
3216 * @param {Object} source The object of property predicates to conform to.
3217 * @returns {Function} Returns the new spec function.
3218 */
3219 function baseConforms(source) {
3220 var props = keys(source);
3221 return function(object) {
3222 return baseConformsTo(object, source, props);
3223 };
3224 }
3225
3226 /**
3227 * The base implementation of `_.conformsTo` which accepts `props` to check.
3228 *
3229 * @private
3230 * @param {Object} object The object to inspect.
3231 * @param {Object} source The object of property predicates to conform to.
3232 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
3233 */
3234 function baseConformsTo(object, source, props) {
3235 var length = props.length;
3236 if (object == null) {
3237 return !length;
3238 }
3239 object = Object(object);
3240 while (length--) {
3241 var key = props[length],
3242 predicate = source[key],
3243 value = object[key];
3244
3245 if ((value === undefined && !(key in object)) || !predicate(value)) {
3246 return false;
3247 }
3248 }
3249 return true;
3250 }
3251
3252 /**
3253 * The base implementation of `_.delay` and `_.defer` which accepts `args`
3254 * to provide to `func`.
3255 *
3256 * @private
3257 * @param {Function} func The function to delay.
3258 * @param {number} wait The number of milliseconds to delay invocation.
3259 * @param {Array} args The arguments to provide to `func`.
3260 * @returns {number|Object} Returns the timer id or timeout object.
3261 */
3262 function baseDelay(func, wait, args) {
3263 if (typeof func != 'function') {
3264 throw new TypeError(FUNC_ERROR_TEXT);
3265 }
3266 return setTimeout(function() { func.apply(undefined, args); }, wait);
3267 }
3268
3269 /**
3270 * The base implementation of methods like `_.difference` without support
3271 * for excluding multiple arrays or iteratee shorthands.
3272 *
3273 * @private
3274 * @param {Array} array The array to inspect.
3275 * @param {Array} values The values to exclude.
3276 * @param {Function} [iteratee] The iteratee invoked per element.
3277 * @param {Function} [comparator] The comparator invoked per element.
3278 * @returns {Array} Returns the new array of filtered values.
3279 */
3280 function baseDifference(array, values, iteratee, comparator) {
3281 var index = -1,
3282 includes = arrayIncludes,
3283 isCommon = true,
3284 length = array.length,
3285 result = [],
3286 valuesLength = values.length;
3287
3288 if (!length) {
3289 return result;
3290 }
3291 if (iteratee) {
3292 values = arrayMap(values, baseUnary(iteratee));
3293 }
3294 if (comparator) {
3295 includes = arrayIncludesWith;
3296 isCommon = false;
3297 }
3298 else if (values.length >= LARGE_ARRAY_SIZE) {
3299 includes = cacheHas;
3300 isCommon = false;
3301 values = new SetCache(values);
3302 }
3303 outer:
3304 while (++index < length) {
3305 var value = array[index],
3306 computed = iteratee == null ? value : iteratee(value);
3307
3308 value = (comparator || value !== 0) ? value : 0;
3309 if (isCommon && computed === computed) {
3310 var valuesIndex = valuesLength;
3311 while (valuesIndex--) {
3312 if (values[valuesIndex] === computed) {
3313 continue outer;
3314 }
3315 }
3316 result.push(value);
3317 }
3318 else if (!includes(values, computed, comparator)) {
3319 result.push(value);
3320 }
3321 }
3322 return result;
3323 }
3324
3325 /**
3326 * The base implementation of `_.forEach` without support for iteratee shorthands.
3327 *
3328 * @private
3329 * @param {Array|Object} collection The collection to iterate over.
3330 * @param {Function} iteratee The function invoked per iteration.
3331 * @returns {Array|Object} Returns `collection`.
3332 */
3333 var baseEach = createBaseEach(baseForOwn);
3334
3335 /**
3336 * The base implementation of `_.forEachRight` without support for iteratee shorthands.
3337 *
3338 * @private
3339 * @param {Array|Object} collection The collection to iterate over.
3340 * @param {Function} iteratee The function invoked per iteration.
3341 * @returns {Array|Object} Returns `collection`.
3342 */
3343 var baseEachRight = createBaseEach(baseForOwnRight, true);
3344
3345 /**
3346 * The base implementation of `_.every` without support for iteratee shorthands.
3347 *
3348 * @private
3349 * @param {Array|Object} collection The collection to iterate over.
3350 * @param {Function} predicate The function invoked per iteration.
3351 * @returns {boolean} Returns `true` if all elements pass the predicate check,
3352 * else `false`
3353 */
3354 function baseEvery(collection, predicate) {
3355 var result = true;
3356 baseEach(collection, function(value, index, collection) {
3357 result = !!predicate(value, index, collection);
3358 return result;
3359 });
3360 return result;
3361 }
3362
3363 /**
3364 * The base implementation of methods like `_.max` and `_.min` which accepts a
3365 * `comparator` to determine the extremum value.
3366 *
3367 * @private
3368 * @param {Array} array The array to iterate over.
3369 * @param {Function} iteratee The iteratee invoked per iteration.
3370 * @param {Function} comparator The comparator used to compare values.
3371 * @returns {*} Returns the extremum value.
3372 */
3373 function baseExtremum(array, iteratee, comparator) {
3374 var index = -1,
3375 length = array.length;
3376
3377 while (++index < length) {
3378 var value = array[index],
3379 current = iteratee(value);
3380
3381 if (current != null && (computed === undefined
3382 ? (current === current && !isSymbol(current))
3383 : comparator(current, computed)
3384 )) {
3385 var computed = current,
3386 result = value;
3387 }
3388 }
3389 return result;
3390 }
3391
3392 /**
3393 * The base implementation of `_.fill` without an iteratee call guard.
3394 *
3395 * @private
3396 * @param {Array} array The array to fill.
3397 * @param {*} value The value to fill `array` with.
3398 * @param {number} [start=0] The start position.
3399 * @param {number} [end=array.length] The end position.
3400 * @returns {Array} Returns `array`.
3401 */
3402 function baseFill(array, value, start, end) {
3403 var length = array.length;
3404
3405 start = toInteger(start);
3406 if (start < 0) {
3407 start = -start > length ? 0 : (length + start);
3408 }
3409 end = (end === undefined || end > length) ? length : toInteger(end);
3410 if (end < 0) {
3411 end += length;
3412 }
3413 end = start > end ? 0 : toLength(end);
3414 while (start < end) {
3415 array[start++] = value;
3416 }
3417 return array;
3418 }
3419
3420 /**
3421 * The base implementation of `_.filter` without support for iteratee shorthands.
3422 *
3423 * @private
3424 * @param {Array|Object} collection The collection to iterate over.
3425 * @param {Function} predicate The function invoked per iteration.
3426 * @returns {Array} Returns the new filtered array.
3427 */
3428 function baseFilter(collection, predicate) {
3429 var result = [];
3430 baseEach(collection, function(value, index, collection) {
3431 if (predicate(value, index, collection)) {
3432 result.push(value);
3433 }
3434 });
3435 return result;
3436 }
3437
3438 /**
3439 * The base implementation of `_.flatten` with support for restricting flattening.
3440 *
3441 * @private
3442 * @param {Array} array The array to flatten.
3443 * @param {number} depth The maximum recursion depth.
3444 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
3445 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
3446 * @param {Array} [result=[]] The initial result value.
3447 * @returns {Array} Returns the new flattened array.
3448 */
3449 function baseFlatten(array, depth, predicate, isStrict, result) {
3450 var index = -1,
3451 length = array.length;
3452
3453 predicate || (predicate = isFlattenable);
3454 result || (result = []);
3455
3456 while (++index < length) {
3457 var value = array[index];
3458 if (depth > 0 && predicate(value)) {
3459 if (depth > 1) {
3460 // Recursively flatten arrays (susceptible to call stack limits).
3461 baseFlatten(value, depth - 1, predicate, isStrict, result);
3462 } else {
3463 arrayPush(result, value);
3464 }
3465 } else if (!isStrict) {
3466 result[result.length] = value;
3467 }
3468 }
3469 return result;
3470 }
3471
3472 /**
3473 * The base implementation of `baseForOwn` which iterates over `object`
3474 * properties returned by `keysFunc` and invokes `iteratee` for each property.
3475 * Iteratee functions may exit iteration early by explicitly returning `false`.
3476 *
3477 * @private
3478 * @param {Object} object The object to iterate over.
3479 * @param {Function} iteratee The function invoked per iteration.
3480 * @param {Function} keysFunc The function to get the keys of `object`.
3481 * @returns {Object} Returns `object`.
3482 */
3483 var baseFor = createBaseFor();
3484
3485 /**
3486 * This function is like `baseFor` except that it iterates over properties
3487 * in the opposite order.
3488 *
3489 * @private
3490 * @param {Object} object The object to iterate over.
3491 * @param {Function} iteratee The function invoked per iteration.
3492 * @param {Function} keysFunc The function to get the keys of `object`.
3493 * @returns {Object} Returns `object`.
3494 */
3495 var baseForRight = createBaseFor(true);
3496
3497 /**
3498 * The base implementation of `_.forOwn` without support for iteratee shorthands.
3499 *
3500 * @private
3501 * @param {Object} object The object to iterate over.
3502 * @param {Function} iteratee The function invoked per iteration.
3503 * @returns {Object} Returns `object`.
3504 */
3505 function baseForOwn(object, iteratee) {
3506 return object && baseFor(object, iteratee, keys);
3507 }
3508
3509 /**
3510 * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
3511 *
3512 * @private
3513 * @param {Object} object The object to iterate over.
3514 * @param {Function} iteratee The function invoked per iteration.
3515 * @returns {Object} Returns `object`.
3516 */
3517 function baseForOwnRight(object, iteratee) {
3518 return object && baseForRight(object, iteratee, keys);
3519 }
3520
3521 /**
3522 * The base implementation of `_.functions` which creates an array of
3523 * `object` function property names filtered from `props`.
3524 *
3525 * @private
3526 * @param {Object} object The object to inspect.
3527 * @param {Array} props The property names to filter.
3528 * @returns {Array} Returns the function names.
3529 */
3530 function baseFunctions(object, props) {
3531 return arrayFilter(props, function(key) {
3532 return isFunction(object[key]);
3533 });
3534 }
3535
3536 /**
3537 * The base implementation of `_.get` without support for default values.
3538 *
3539 * @private
3540 * @param {Object} object The object to query.
3541 * @param {Array|string} path The path of the property to get.
3542 * @returns {*} Returns the resolved value.
3543 */
3544 function baseGet(object, path) {
3545 path = castPath(path, object);
3546
3547 var index = 0,
3548 length = path.length;
3549
3550 while (object != null && index < length) {
3551 object = object[toKey(path[index++])];
3552 }
3553 return (index && index == length) ? object : undefined;
3554 }
3555
3556 /**
3557 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
3558 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
3559 * symbols of `object`.
3560 *
3561 * @private
3562 * @param {Object} object The object to query.
3563 * @param {Function} keysFunc The function to get the keys of `object`.
3564 * @param {Function} symbolsFunc The function to get the symbols of `object`.
3565 * @returns {Array} Returns the array of property names and symbols.
3566 */
3567 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
3568 var result = keysFunc(object);
3569 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
3570 }
3571
3572 /**
3573 * The base implementation of `getTag` without fallbacks for buggy environments.
3574 *
3575 * @private
3576 * @param {*} value The value to query.
3577 * @returns {string} Returns the `toStringTag`.
3578 */
3579 function baseGetTag(value) {
3580 if (value == null) {
3581 return value === undefined ? undefinedTag : nullTag;
3582 }
3583 return (symToStringTag && symToStringTag in Object(value))
3584 ? getRawTag(value)
3585 : objectToString(value);
3586 }
3587
3588 /**
3589 * The base implementation of `_.gt` which doesn't coerce arguments.
3590 *
3591 * @private
3592 * @param {*} value The value to compare.
3593 * @param {*} other The other value to compare.
3594 * @returns {boolean} Returns `true` if `value` is greater than `other`,
3595 * else `false`.
3596 */
3597 function baseGt(value, other) {
3598 return value > other;
3599 }
3600
3601 /**
3602 * The base implementation of `_.has` without support for deep paths.
3603 *
3604 * @private
3605 * @param {Object} [object] The object to query.
3606 * @param {Array|string} key The key to check.
3607 * @returns {boolean} Returns `true` if `key` exists, else `false`.
3608 */
3609 function baseHas(object, key) {
3610 return object != null && hasOwnProperty.call(object, key);
3611 }
3612
3613 /**
3614 * The base implementation of `_.hasIn` without support for deep paths.
3615 *
3616 * @private
3617 * @param {Object} [object] The object to query.
3618 * @param {Array|string} key The key to check.
3619 * @returns {boolean} Returns `true` if `key` exists, else `false`.
3620 */
3621 function baseHasIn(object, key) {
3622 return object != null && key in Object(object);
3623 }
3624
3625 /**
3626 * The base implementation of `_.inRange` which doesn't coerce arguments.
3627 *
3628 * @private
3629 * @param {number} number The number to check.
3630 * @param {number} start The start of the range.
3631 * @param {number} end The end of the range.
3632 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
3633 */
3634 function baseInRange(number, start, end) {
3635 return number >= nativeMin(start, end) && number < nativeMax(start, end);
3636 }
3637
3638 /**
3639 * The base implementation of methods like `_.intersection`, without support
3640 * for iteratee shorthands, that accepts an array of arrays to inspect.
3641 *
3642 * @private
3643 * @param {Array} arrays The arrays to inspect.
3644 * @param {Function} [iteratee] The iteratee invoked per element.
3645 * @param {Function} [comparator] The comparator invoked per element.
3646 * @returns {Array} Returns the new array of shared values.
3647 */
3648 function baseIntersection(arrays, iteratee, comparator) {
3649 var includes = comparator ? arrayIncludesWith : arrayIncludes,
3650 length = arrays[0].length,
3651 othLength = arrays.length,
3652 othIndex = othLength,
3653 caches = Array(othLength),
3654 maxLength = Infinity,
3655 result = [];
3656
3657 while (othIndex--) {
3658 var array = arrays[othIndex];
3659 if (othIndex && iteratee) {
3660 array = arrayMap(array, baseUnary(iteratee));
3661 }
3662 maxLength = nativeMin(array.length, maxLength);
3663 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
3664 ? new SetCache(othIndex && array)
3665 : undefined;
3666 }
3667 array = arrays[0];
3668
3669 var index = -1,
3670 seen = caches[0];
3671
3672 outer:
3673 while (++index < length && result.length < maxLength) {
3674 var value = array[index],
3675 computed = iteratee ? iteratee(value) : value;
3676
3677 value = (comparator || value !== 0) ? value : 0;
3678 if (!(seen
3679 ? cacheHas(seen, computed)
3680 : includes(result, computed, comparator)
3681 )) {
3682 othIndex = othLength;
3683 while (--othIndex) {
3684 var cache = caches[othIndex];
3685 if (!(cache
3686 ? cacheHas(cache, computed)
3687 : includes(arrays[othIndex], computed, comparator))
3688 ) {
3689 continue outer;
3690 }
3691 }
3692 if (seen) {
3693 seen.push(computed);
3694 }
3695 result.push(value);
3696 }
3697 }
3698 return result;
3699 }
3700
3701 /**
3702 * The base implementation of `_.invert` and `_.invertBy` which inverts
3703 * `object` with values transformed by `iteratee` and set by `setter`.
3704 *
3705 * @private
3706 * @param {Object} object The object to iterate over.
3707 * @param {Function} setter The function to set `accumulator` values.
3708 * @param {Function} iteratee The iteratee to transform values.
3709 * @param {Object} accumulator The initial inverted object.
3710 * @returns {Function} Returns `accumulator`.
3711 */
3712 function baseInverter(object, setter, iteratee, accumulator) {
3713 baseForOwn(object, function(value, key, object) {
3714 setter(accumulator, iteratee(value), key, object);
3715 });
3716 return accumulator;
3717 }
3718
3719 /**
3720 * The base implementation of `_.invoke` without support for individual
3721 * method arguments.
3722 *
3723 * @private
3724 * @param {Object} object The object to query.
3725 * @param {Array|string} path The path of the method to invoke.
3726 * @param {Array} args The arguments to invoke the method with.
3727 * @returns {*} Returns the result of the invoked method.
3728 */
3729 function baseInvoke(object, path, args) {
3730 path = castPath(path, object);
3731 object = parent(object, path);
3732 var func = object == null ? object : object[toKey(last(path))];
3733 return func == null ? undefined : apply(func, object, args);
3734 }
3735
3736 /**
3737 * The base implementation of `_.isArguments`.
3738 *
3739 * @private
3740 * @param {*} value The value to check.
3741 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
3742 */
3743 function baseIsArguments(value) {
3744 return isObjectLike(value) && baseGetTag(value) == argsTag;
3745 }
3746
3747 /**
3748 * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
3749 *
3750 * @private
3751 * @param {*} value The value to check.
3752 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
3753 */
3754 function baseIsArrayBuffer(value) {
3755 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
3756 }
3757
3758 /**
3759 * The base implementation of `_.isDate` without Node.js optimizations.
3760 *
3761 * @private
3762 * @param {*} value The value to check.
3763 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
3764 */
3765 function baseIsDate(value) {
3766 return isObjectLike(value) && baseGetTag(value) == dateTag;
3767 }
3768
3769 /**
3770 * The base implementation of `_.isEqual` which supports partial comparisons
3771 * and tracks traversed objects.
3772 *
3773 * @private
3774 * @param {*} value The value to compare.
3775 * @param {*} other The other value to compare.
3776 * @param {boolean} bitmask The bitmask flags.
3777 * 1 - Unordered comparison
3778 * 2 - Partial comparison
3779 * @param {Function} [customizer] The function to customize comparisons.
3780 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
3781 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
3782 */
3783 function baseIsEqual(value, other, bitmask, customizer, stack) {
3784 if (value === other) {
3785 return true;
3786 }
3787 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
3788 return value !== value && other !== other;
3789 }
3790 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
3791 }
3792
3793 /**
3794 * A specialized version of `baseIsEqual` for arrays and objects which performs
3795 * deep comparisons and tracks traversed objects enabling objects with circular
3796 * references to be compared.
3797 *
3798 * @private
3799 * @param {Object} object The object to compare.
3800 * @param {Object} other The other object to compare.
3801 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
3802 * @param {Function} customizer The function to customize comparisons.
3803 * @param {Function} equalFunc The function to determine equivalents of values.
3804 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
3805 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
3806 */
3807 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
3808 var objIsArr = isArray(object),
3809 othIsArr = isArray(other),
3810 objTag = objIsArr ? arrayTag : getTag(object),
3811 othTag = othIsArr ? arrayTag : getTag(other);
3812
3813 objTag = objTag == argsTag ? objectTag : objTag;
3814 othTag = othTag == argsTag ? objectTag : othTag;
3815
3816 var objIsObj = objTag == objectTag,
3817 othIsObj = othTag == objectTag,
3818 isSameTag = objTag == othTag;
3819
3820 if (isSameTag && isBuffer(object)) {
3821 if (!isBuffer(other)) {
3822 return false;
3823 }
3824 objIsArr = true;
3825 objIsObj = false;
3826 }
3827 if (isSameTag && !objIsObj) {
3828 stack || (stack = new Stack);
3829 return (objIsArr || isTypedArray(object))
3830 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
3831 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
3832 }
3833 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
3834 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
3835 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
3836
3837 if (objIsWrapped || othIsWrapped) {
3838 var objUnwrapped = objIsWrapped ? object.value() : object,
3839 othUnwrapped = othIsWrapped ? other.value() : other;
3840
3841 stack || (stack = new Stack);
3842 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
3843 }
3844 }
3845 if (!isSameTag) {
3846 return false;
3847 }
3848 stack || (stack = new Stack);
3849 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
3850 }
3851
3852 /**
3853 * The base implementation of `_.isMap` without Node.js optimizations.
3854 *
3855 * @private
3856 * @param {*} value The value to check.
3857 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
3858 */
3859 function baseIsMap(value) {
3860 return isObjectLike(value) && getTag(value) == mapTag;
3861 }
3862
3863 /**
3864 * The base implementation of `_.isMatch` without support for iteratee shorthands.
3865 *
3866 * @private
3867 * @param {Object} object The object to inspect.
3868 * @param {Object} source The object of property values to match.
3869 * @param {Array} matchData The property names, values, and compare flags to match.
3870 * @param {Function} [customizer] The function to customize comparisons.
3871 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
3872 */
3873 function baseIsMatch(object, source, matchData, customizer) {
3874 var index = matchData.length,
3875 length = index,
3876 noCustomizer = !customizer;
3877
3878 if (object == null) {
3879 return !length;
3880 }
3881 object = Object(object);
3882 while (index--) {
3883 var data = matchData[index];
3884 if ((noCustomizer && data[2])
3885 ? data[1] !== object[data[0]]
3886 : !(data[0] in object)
3887 ) {
3888 return false;
3889 }
3890 }
3891 while (++index < length) {
3892 data = matchData[index];
3893 var key = data[0],
3894 objValue = object[key],
3895 srcValue = data[1];
3896
3897 if (noCustomizer && data[2]) {
3898 if (objValue === undefined && !(key in object)) {
3899 return false;
3900 }
3901 } else {
3902 var stack = new Stack;
3903 if (customizer) {
3904 var result = customizer(objValue, srcValue, key, object, source, stack);
3905 }
3906 if (!(result === undefined
3907 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
3908 : result
3909 )) {
3910 return false;
3911 }
3912 }
3913 }
3914 return true;
3915 }
3916
3917 /**
3918 * The base implementation of `_.isNative` without bad shim checks.
3919 *
3920 * @private
3921 * @param {*} value The value to check.
3922 * @returns {boolean} Returns `true` if `value` is a native function,
3923 * else `false`.
3924 */
3925 function baseIsNative(value) {
3926 if (!isObject(value) || isMasked(value)) {
3927 return false;
3928 }
3929 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
3930 return pattern.test(toSource(value));
3931 }
3932
3933 /**
3934 * The base implementation of `_.isRegExp` without Node.js optimizations.
3935 *
3936 * @private
3937 * @param {*} value The value to check.
3938 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
3939 */
3940 function baseIsRegExp(value) {
3941 return isObjectLike(value) && baseGetTag(value) == regexpTag;
3942 }
3943
3944 /**
3945 * The base implementation of `_.isSet` without Node.js optimizations.
3946 *
3947 * @private
3948 * @param {*} value The value to check.
3949 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
3950 */
3951 function baseIsSet(value) {
3952 return isObjectLike(value) && getTag(value) == setTag;
3953 }
3954
3955 /**
3956 * The base implementation of `_.isTypedArray` without Node.js optimizations.
3957 *
3958 * @private
3959 * @param {*} value The value to check.
3960 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
3961 */
3962 function baseIsTypedArray(value) {
3963 return isObjectLike(value) &&
3964 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
3965 }
3966
3967 /**
3968 * The base implementation of `_.iteratee`.
3969 *
3970 * @private
3971 * @param {*} [value=_.identity] The value to convert to an iteratee.
3972 * @returns {Function} Returns the iteratee.
3973 */
3974 function baseIteratee(value) {
3975 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
3976 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
3977 if (typeof value == 'function') {
3978 return value;
3979 }
3980 if (value == null) {
3981 return identity;
3982 }
3983 if (typeof value == 'object') {
3984 return isArray(value)
3985 ? baseMatchesProperty(value[0], value[1])
3986 : baseMatches(value);
3987 }
3988 return property(value);
3989 }
3990
3991 /**
3992 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
3993 *
3994 * @private
3995 * @param {Object} object The object to query.
3996 * @returns {Array} Returns the array of property names.
3997 */
3998 function baseKeys(object) {
3999 if (!isPrototype(object)) {
4000 return nativeKeys(object);
4001 }
4002 var result = [];
4003 for (var key in Object(object)) {
4004 if (hasOwnProperty.call(object, key) && key != 'constructor') {
4005 result.push(key);
4006 }
4007 }
4008 return result;
4009 }
4010
4011 /**
4012 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
4013 *
4014 * @private
4015 * @param {Object} object The object to query.
4016 * @returns {Array} Returns the array of property names.
4017 */
4018 function baseKeysIn(object) {
4019 if (!isObject(object)) {
4020 return nativeKeysIn(object);
4021 }
4022 var isProto = isPrototype(object),
4023 result = [];
4024
4025 for (var key in object) {
4026 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
4027 result.push(key);
4028 }
4029 }
4030 return result;
4031 }
4032
4033 /**
4034 * The base implementation of `_.lt` which doesn't coerce arguments.
4035 *
4036 * @private
4037 * @param {*} value The value to compare.
4038 * @param {*} other The other value to compare.
4039 * @returns {boolean} Returns `true` if `value` is less than `other`,
4040 * else `false`.
4041 */
4042 function baseLt(value, other) {
4043 return value < other;
4044 }
4045
4046 /**
4047 * The base implementation of `_.map` without support for iteratee shorthands.
4048 *
4049 * @private
4050 * @param {Array|Object} collection The collection to iterate over.
4051 * @param {Function} iteratee The function invoked per iteration.
4052 * @returns {Array} Returns the new mapped array.
4053 */
4054 function baseMap(collection, iteratee) {
4055 var index = -1,
4056 result = isArrayLike(collection) ? Array(collection.length) : [];
4057
4058 baseEach(collection, function(value, key, collection) {
4059 result[++index] = iteratee(value, key, collection);
4060 });
4061 return result;
4062 }
4063
4064 /**
4065 * The base implementation of `_.matches` which doesn't clone `source`.
4066 *
4067 * @private
4068 * @param {Object} source The object of property values to match.
4069 * @returns {Function} Returns the new spec function.
4070 */
4071 function baseMatches(source) {
4072 var matchData = getMatchData(source);
4073 if (matchData.length == 1 && matchData[0][2]) {
4074 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
4075 }
4076 return function(object) {
4077 return object === source || baseIsMatch(object, source, matchData);
4078 };
4079 }
4080
4081 /**
4082 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
4083 *
4084 * @private
4085 * @param {string} path The path of the property to get.
4086 * @param {*} srcValue The value to match.
4087 * @returns {Function} Returns the new spec function.
4088 */
4089 function baseMatchesProperty(path, srcValue) {
4090 if (isKey(path) && isStrictComparable(srcValue)) {
4091 return matchesStrictComparable(toKey(path), srcValue);
4092 }
4093 return function(object) {
4094 var objValue = get(object, path);
4095 return (objValue === undefined && objValue === srcValue)
4096 ? hasIn(object, path)
4097 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
4098 };
4099 }
4100
4101 /**
4102 * The base implementation of `_.merge` without support for multiple sources.
4103 *
4104 * @private
4105 * @param {Object} object The destination object.
4106 * @param {Object} source The source object.
4107 * @param {number} srcIndex The index of `source`.
4108 * @param {Function} [customizer] The function to customize merged values.
4109 * @param {Object} [stack] Tracks traversed source values and their merged
4110 * counterparts.
4111 */
4112 function baseMerge(object, source, srcIndex, customizer, stack) {
4113 if (object === source) {
4114 return;
4115 }
4116 baseFor(source, function(srcValue, key) {
4117 if (isObject(srcValue)) {
4118 stack || (stack = new Stack);
4119 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
4120 }
4121 else {
4122 var newValue = customizer
4123 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
4124 : undefined;
4125
4126 if (newValue === undefined) {
4127 newValue = srcValue;
4128 }
4129 assignMergeValue(object, key, newValue);
4130 }
4131 }, keysIn);
4132 }
4133
4134 /**
4135 * A specialized version of `baseMerge` for arrays and objects which performs
4136 * deep merges and tracks traversed objects enabling objects with circular
4137 * references to be merged.
4138 *
4139 * @private
4140 * @param {Object} object The destination object.
4141 * @param {Object} source The source object.
4142 * @param {string} key The key of the value to merge.
4143 * @param {number} srcIndex The index of `source`.
4144 * @param {Function} mergeFunc The function to merge values.
4145 * @param {Function} [customizer] The function to customize assigned values.
4146 * @param {Object} [stack] Tracks traversed source values and their merged
4147 * counterparts.
4148 */
4149 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
4150 var objValue = safeGet(object, key),
4151 srcValue = safeGet(source, key),
4152 stacked = stack.get(srcValue);
4153
4154 if (stacked) {
4155 assignMergeValue(object, key, stacked);
4156 return;
4157 }
4158 var newValue = customizer
4159 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
4160 : undefined;
4161
4162 var isCommon = newValue === undefined;
4163
4164 if (isCommon) {
4165 var isArr = isArray(srcValue),
4166 isBuff = !isArr && isBuffer(srcValue),
4167 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
4168
4169 newValue = srcValue;
4170 if (isArr || isBuff || isTyped) {
4171 if (isArray(objValue)) {
4172 newValue = objValue;
4173 }
4174 else if (isArrayLikeObject(objValue)) {
4175 newValue = copyArray(objValue);
4176 }
4177 else if (isBuff) {
4178 isCommon = false;
4179 newValue = cloneBuffer(srcValue, true);
4180 }
4181 else if (isTyped) {
4182 isCommon = false;
4183 newValue = cloneTypedArray(srcValue, true);
4184 }
4185 else {
4186 newValue = [];
4187 }
4188 }
4189 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
4190 newValue = objValue;
4191 if (isArguments(objValue)) {
4192 newValue = toPlainObject(objValue);
4193 }
4194 else if (!isObject(objValue) || isFunction(objValue)) {
4195 newValue = initCloneObject(srcValue);
4196 }
4197 }
4198 else {
4199 isCommon = false;
4200 }
4201 }
4202 if (isCommon) {
4203 // Recursively merge objects and arrays (susceptible to call stack limits).
4204 stack.set(srcValue, newValue);
4205 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
4206 stack['delete'](srcValue);
4207 }
4208 assignMergeValue(object, key, newValue);
4209 }
4210
4211 /**
4212 * The base implementation of `_.nth` which doesn't coerce arguments.
4213 *
4214 * @private
4215 * @param {Array} array The array to query.
4216 * @param {number} n The index of the element to return.
4217 * @returns {*} Returns the nth element of `array`.
4218 */
4219 function baseNth(array, n) {
4220 var length = array.length;
4221 if (!length) {
4222 return;
4223 }
4224 n += n < 0 ? length : 0;
4225 return isIndex(n, length) ? array[n] : undefined;
4226 }
4227
4228 /**
4229 * The base implementation of `_.orderBy` without param guards.
4230 *
4231 * @private
4232 * @param {Array|Object} collection The collection to iterate over.
4233 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
4234 * @param {string[]} orders The sort orders of `iteratees`.
4235 * @returns {Array} Returns the new sorted array.
4236 */
4237 function baseOrderBy(collection, iteratees, orders) {
4238 var index = -1;
4239 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
4240
4241 var result = baseMap(collection, function(value, key, collection) {
4242 var criteria = arrayMap(iteratees, function(iteratee) {
4243 return iteratee(value);
4244 });
4245 return { 'criteria': criteria, 'index': ++index, 'value': value };
4246 });
4247
4248 return baseSortBy(result, function(object, other) {
4249 return compareMultiple(object, other, orders);
4250 });
4251 }
4252
4253 /**
4254 * The base implementation of `_.pick` without support for individual
4255 * property identifiers.
4256 *
4257 * @private
4258 * @param {Object} object The source object.
4259 * @param {string[]} paths The property paths to pick.
4260 * @returns {Object} Returns the new object.
4261 */
4262 function basePick(object, paths) {
4263 return basePickBy(object, paths, function(value, path) {
4264 return hasIn(object, path);
4265 });
4266 }
4267
4268 /**
4269 * The base implementation of `_.pickBy` without support for iteratee shorthands.
4270 *
4271 * @private
4272 * @param {Object} object The source object.
4273 * @param {string[]} paths The property paths to pick.
4274 * @param {Function} predicate The function invoked per property.
4275 * @returns {Object} Returns the new object.
4276 */
4277 function basePickBy(object, paths, predicate) {
4278 var index = -1,
4279 length = paths.length,
4280 result = {};
4281
4282 while (++index < length) {
4283 var path = paths[index],
4284 value = baseGet(object, path);
4285
4286 if (predicate(value, path)) {
4287 baseSet(result, castPath(path, object), value);
4288 }
4289 }
4290 return result;
4291 }
4292
4293 /**
4294 * A specialized version of `baseProperty` which supports deep paths.
4295 *
4296 * @private
4297 * @param {Array|string} path The path of the property to get.
4298 * @returns {Function} Returns the new accessor function.
4299 */
4300 function basePropertyDeep(path) {
4301 return function(object) {
4302 return baseGet(object, path);
4303 };
4304 }
4305
4306 /**
4307 * The base implementation of `_.pullAllBy` without support for iteratee
4308 * shorthands.
4309 *
4310 * @private
4311 * @param {Array} array The array to modify.
4312 * @param {Array} values The values to remove.
4313 * @param {Function} [iteratee] The iteratee invoked per element.
4314 * @param {Function} [comparator] The comparator invoked per element.
4315 * @returns {Array} Returns `array`.
4316 */
4317 function basePullAll(array, values, iteratee, comparator) {
4318 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
4319 index = -1,
4320 length = values.length,
4321 seen = array;
4322
4323 if (array === values) {
4324 values = copyArray(values);
4325 }
4326 if (iteratee) {
4327 seen = arrayMap(array, baseUnary(iteratee));
4328 }
4329 while (++index < length) {
4330 var fromIndex = 0,
4331 value = values[index],
4332 computed = iteratee ? iteratee(value) : value;
4333
4334 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
4335 if (seen !== array) {
4336 splice.call(seen, fromIndex, 1);
4337 }
4338 splice.call(array, fromIndex, 1);
4339 }
4340 }
4341 return array;
4342 }
4343
4344 /**
4345 * The base implementation of `_.pullAt` without support for individual
4346 * indexes or capturing the removed elements.
4347 *
4348 * @private
4349 * @param {Array} array The array to modify.
4350 * @param {number[]} indexes The indexes of elements to remove.
4351 * @returns {Array} Returns `array`.
4352 */
4353 function basePullAt(array, indexes) {
4354 var length = array ? indexes.length : 0,
4355 lastIndex = length - 1;
4356
4357 while (length--) {
4358 var index = indexes[length];
4359 if (length == lastIndex || index !== previous) {
4360 var previous = index;
4361 if (isIndex(index)) {
4362 splice.call(array, index, 1);
4363 } else {
4364 baseUnset(array, index);
4365 }
4366 }
4367 }
4368 return array;
4369 }
4370
4371 /**
4372 * The base implementation of `_.random` without support for returning
4373 * floating-point numbers.
4374 *
4375 * @private
4376 * @param {number} lower The lower bound.
4377 * @param {number} upper The upper bound.
4378 * @returns {number} Returns the random number.
4379 */
4380 function baseRandom(lower, upper) {
4381 return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
4382 }
4383
4384 /**
4385 * The base implementation of `_.range` and `_.rangeRight` which doesn't
4386 * coerce arguments.
4387 *
4388 * @private
4389 * @param {number} start The start of the range.
4390 * @param {number} end The end of the range.
4391 * @param {number} step The value to increment or decrement by.
4392 * @param {boolean} [fromRight] Specify iterating from right to left.
4393 * @returns {Array} Returns the range of numbers.
4394 */
4395 function baseRange(start, end, step, fromRight) {
4396 var index = -1,
4397 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
4398 result = Array(length);
4399
4400 while (length--) {
4401 result[fromRight ? length : ++index] = start;
4402 start += step;
4403 }
4404 return result;
4405 }
4406
4407 /**
4408 * The base implementation of `_.repeat` which doesn't coerce arguments.
4409 *
4410 * @private
4411 * @param {string} string The string to repeat.
4412 * @param {number} n The number of times to repeat the string.
4413 * @returns {string} Returns the repeated string.
4414 */
4415 function baseRepeat(string, n) {
4416 var result = '';
4417 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
4418 return result;
4419 }
4420 // Leverage the exponentiation by squaring algorithm for a faster repeat.
4421 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
4422 do {
4423 if (n % 2) {
4424 result += string;
4425 }
4426 n = nativeFloor(n / 2);
4427 if (n) {
4428 string += string;
4429 }
4430 } while (n);
4431
4432 return result;
4433 }
4434
4435 /**
4436 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
4437 *
4438 * @private
4439 * @param {Function} func The function to apply a rest parameter to.
4440 * @param {number} [start=func.length-1] The start position of the rest parameter.
4441 * @returns {Function} Returns the new function.
4442 */
4443 function baseRest(func, start) {
4444 return setToString(overRest(func, start, identity), func + '');
4445 }
4446
4447 /**
4448 * The base implementation of `_.sample`.
4449 *
4450 * @private
4451 * @param {Array|Object} collection The collection to sample.
4452 * @returns {*} Returns the random element.
4453 */
4454 function baseSample(collection) {
4455 return arraySample(values(collection));
4456 }
4457
4458 /**
4459 * The base implementation of `_.sampleSize` without param guards.
4460 *
4461 * @private
4462 * @param {Array|Object} collection The collection to sample.
4463 * @param {number} n The number of elements to sample.
4464 * @returns {Array} Returns the random elements.
4465 */
4466 function baseSampleSize(collection, n) {
4467 var array = values(collection);
4468 return shuffleSelf(array, baseClamp(n, 0, array.length));
4469 }
4470
4471 /**
4472 * The base implementation of `_.set`.
4473 *
4474 * @private
4475 * @param {Object} object The object to modify.
4476 * @param {Array|string} path The path of the property to set.
4477 * @param {*} value The value to set.
4478 * @param {Function} [customizer] The function to customize path creation.
4479 * @returns {Object} Returns `object`.
4480 */
4481 function baseSet(object, path, value, customizer) {
4482 if (!isObject(object)) {
4483 return object;
4484 }
4485 path = castPath(path, object);
4486
4487 var index = -1,
4488 length = path.length,
4489 lastIndex = length - 1,
4490 nested = object;
4491
4492 while (nested != null && ++index < length) {
4493 var key = toKey(path[index]),
4494 newValue = value;
4495
4496 if (index != lastIndex) {
4497 var objValue = nested[key];
4498 newValue = customizer ? customizer(objValue, key, nested) : undefined;
4499 if (newValue === undefined) {
4500 newValue = isObject(objValue)
4501 ? objValue
4502 : (isIndex(path[index + 1]) ? [] : {});
4503 }
4504 }
4505 assignValue(nested, key, newValue);
4506 nested = nested[key];
4507 }
4508 return object;
4509 }
4510
4511 /**
4512 * The base implementation of `setData` without support for hot loop shorting.
4513 *
4514 * @private
4515 * @param {Function} func The function to associate metadata with.
4516 * @param {*} data The metadata.
4517 * @returns {Function} Returns `func`.
4518 */
4519 var baseSetData = !metaMap ? identity : function(func, data) {
4520 metaMap.set(func, data);
4521 return func;
4522 };
4523
4524 /**
4525 * The base implementation of `setToString` without support for hot loop shorting.
4526 *
4527 * @private
4528 * @param {Function} func The function to modify.
4529 * @param {Function} string The `toString` result.
4530 * @returns {Function} Returns `func`.
4531 */
4532 var baseSetToString = !defineProperty ? identity : function(func, string) {
4533 return defineProperty(func, 'toString', {
4534 'configurable': true,
4535 'enumerable': false,
4536 'value': constant(string),
4537 'writable': true
4538 });
4539 };
4540
4541 /**
4542 * The base implementation of `_.shuffle`.
4543 *
4544 * @private
4545 * @param {Array|Object} collection The collection to shuffle.
4546 * @returns {Array} Returns the new shuffled array.
4547 */
4548 function baseShuffle(collection) {
4549 return shuffleSelf(values(collection));
4550 }
4551
4552 /**
4553 * The base implementation of `_.slice` without an iteratee call guard.
4554 *
4555 * @private
4556 * @param {Array} array The array to slice.
4557 * @param {number} [start=0] The start position.
4558 * @param {number} [end=array.length] The end position.
4559 * @returns {Array} Returns the slice of `array`.
4560 */
4561 function baseSlice(array, start, end) {
4562 var index = -1,
4563 length = array.length;
4564
4565 if (start < 0) {
4566 start = -start > length ? 0 : (length + start);
4567 }
4568 end = end > length ? length : end;
4569 if (end < 0) {
4570 end += length;
4571 }
4572 length = start > end ? 0 : ((end - start) >>> 0);
4573 start >>>= 0;
4574
4575 var result = Array(length);
4576 while (++index < length) {
4577 result[index] = array[index + start];
4578 }
4579 return result;
4580 }
4581
4582 /**
4583 * The base implementation of `_.some` without support for iteratee shorthands.
4584 *
4585 * @private
4586 * @param {Array|Object} collection The collection to iterate over.
4587 * @param {Function} predicate The function invoked per iteration.
4588 * @returns {boolean} Returns `true` if any element passes the predicate check,
4589 * else `false`.
4590 */
4591 function baseSome(collection, predicate) {
4592 var result;
4593
4594 baseEach(collection, function(value, index, collection) {
4595 result = predicate(value, index, collection);
4596 return !result;
4597 });
4598 return !!result;
4599 }
4600
4601 /**
4602 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
4603 * performs a binary search of `array` to determine the index at which `value`
4604 * should be inserted into `array` in order to maintain its sort order.
4605 *
4606 * @private
4607 * @param {Array} array The sorted array to inspect.
4608 * @param {*} value The value to evaluate.
4609 * @param {boolean} [retHighest] Specify returning the highest qualified index.
4610 * @returns {number} Returns the index at which `value` should be inserted
4611 * into `array`.
4612 */
4613 function baseSortedIndex(array, value, retHighest) {
4614 var low = 0,
4615 high = array == null ? low : array.length;
4616
4617 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
4618 while (low < high) {
4619 var mid = (low + high) >>> 1,
4620 computed = array[mid];
4621
4622 if (computed !== null && !isSymbol(computed) &&
4623 (retHighest ? (computed <= value) : (computed < value))) {
4624 low = mid + 1;
4625 } else {
4626 high = mid;
4627 }
4628 }
4629 return high;
4630 }
4631 return baseSortedIndexBy(array, value, identity, retHighest);
4632 }
4633
4634 /**
4635 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
4636 * which invokes `iteratee` for `value` and each element of `array` to compute
4637 * their sort ranking. The iteratee is invoked with one argument; (value).
4638 *
4639 * @private
4640 * @param {Array} array The sorted array to inspect.
4641 * @param {*} value The value to evaluate.
4642 * @param {Function} iteratee The iteratee invoked per element.
4643 * @param {boolean} [retHighest] Specify returning the highest qualified index.
4644 * @returns {number} Returns the index at which `value` should be inserted
4645 * into `array`.
4646 */
4647 function baseSortedIndexBy(array, value, iteratee, retHighest) {
4648 value = iteratee(value);
4649
4650 var low = 0,
4651 high = array == null ? 0 : array.length,
4652 valIsNaN = value !== value,
4653 valIsNull = value === null,
4654 valIsSymbol = isSymbol(value),
4655 valIsUndefined = value === undefined;
4656
4657 while (low < high) {
4658 var mid = nativeFloor((low + high) / 2),
4659 computed = iteratee(array[mid]),
4660 othIsDefined = computed !== undefined,
4661 othIsNull = computed === null,
4662 othIsReflexive = computed === computed,
4663 othIsSymbol = isSymbol(computed);
4664
4665 if (valIsNaN) {
4666 var setLow = retHighest || othIsReflexive;
4667 } else if (valIsUndefined) {
4668 setLow = othIsReflexive && (retHighest || othIsDefined);
4669 } else if (valIsNull) {
4670 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
4671 } else if (valIsSymbol) {
4672 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
4673 } else if (othIsNull || othIsSymbol) {
4674 setLow = false;
4675 } else {
4676 setLow = retHighest ? (computed <= value) : (computed < value);
4677 }
4678 if (setLow) {
4679 low = mid + 1;
4680 } else {
4681 high = mid;
4682 }
4683 }
4684 return nativeMin(high, MAX_ARRAY_INDEX);
4685 }
4686
4687 /**
4688 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
4689 * support for iteratee shorthands.
4690 *
4691 * @private
4692 * @param {Array} array The array to inspect.
4693 * @param {Function} [iteratee] The iteratee invoked per element.
4694 * @returns {Array} Returns the new duplicate free array.
4695 */
4696 function baseSortedUniq(array, iteratee) {
4697 var index = -1,
4698 length = array.length,
4699 resIndex = 0,
4700 result = [];
4701
4702 while (++index < length) {
4703 var value = array[index],
4704 computed = iteratee ? iteratee(value) : value;
4705
4706 if (!index || !eq(computed, seen)) {
4707 var seen = computed;
4708 result[resIndex++] = value === 0 ? 0 : value;
4709 }
4710 }
4711 return result;
4712 }
4713
4714 /**
4715 * The base implementation of `_.toNumber` which doesn't ensure correct
4716 * conversions of binary, hexadecimal, or octal string values.
4717 *
4718 * @private
4719 * @param {*} value The value to process.
4720 * @returns {number} Returns the number.
4721 */
4722 function baseToNumber(value) {
4723 if (typeof value == 'number') {
4724 return value;
4725 }
4726 if (isSymbol(value)) {
4727 return NAN;
4728 }
4729 return +value;
4730 }
4731
4732 /**
4733 * The base implementation of `_.toString` which doesn't convert nullish
4734 * values to empty strings.
4735 *
4736 * @private
4737 * @param {*} value The value to process.
4738 * @returns {string} Returns the string.
4739 */
4740 function baseToString(value) {
4741 // Exit early for strings to avoid a performance hit in some environments.
4742 if (typeof value == 'string') {
4743 return value;
4744 }
4745 if (isArray(value)) {
4746 // Recursively convert values (susceptible to call stack limits).
4747 return arrayMap(value, baseToString) + '';
4748 }
4749 if (isSymbol(value)) {
4750 return symbolToString ? symbolToString.call(value) : '';
4751 }
4752 var result = (value + '');
4753 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
4754 }
4755
4756 /**
4757 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
4758 *
4759 * @private
4760 * @param {Array} array The array to inspect.
4761 * @param {Function} [iteratee] The iteratee invoked per element.
4762 * @param {Function} [comparator] The comparator invoked per element.
4763 * @returns {Array} Returns the new duplicate free array.
4764 */
4765 function baseUniq(array, iteratee, comparator) {
4766 var index = -1,
4767 includes = arrayIncludes,
4768 length = array.length,
4769 isCommon = true,
4770 result = [],
4771 seen = result;
4772
4773 if (comparator) {
4774 isCommon = false;
4775 includes = arrayIncludesWith;
4776 }
4777 else if (length >= LARGE_ARRAY_SIZE) {
4778 var set = iteratee ? null : createSet(array);
4779 if (set) {
4780 return setToArray(set);
4781 }
4782 isCommon = false;
4783 includes = cacheHas;
4784 seen = new SetCache;
4785 }
4786 else {
4787 seen = iteratee ? [] : result;
4788 }
4789 outer:
4790 while (++index < length) {
4791 var value = array[index],
4792 computed = iteratee ? iteratee(value) : value;
4793
4794 value = (comparator || value !== 0) ? value : 0;
4795 if (isCommon && computed === computed) {
4796 var seenIndex = seen.length;
4797 while (seenIndex--) {
4798 if (seen[seenIndex] === computed) {
4799 continue outer;
4800 }
4801 }
4802 if (iteratee) {
4803 seen.push(computed);
4804 }
4805 result.push(value);
4806 }
4807 else if (!includes(seen, computed, comparator)) {
4808 if (seen !== result) {
4809 seen.push(computed);
4810 }
4811 result.push(value);
4812 }
4813 }
4814 return result;
4815 }
4816
4817 /**
4818 * The base implementation of `_.unset`.
4819 *
4820 * @private
4821 * @param {Object} object The object to modify.
4822 * @param {Array|string} path The property path to unset.
4823 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
4824 */
4825 function baseUnset(object, path) {
4826 path = castPath(path, object);
4827 object = parent(object, path);
4828 return object == null || delete object[toKey(last(path))];
4829 }
4830
4831 /**
4832 * The base implementation of `_.update`.
4833 *
4834 * @private
4835 * @param {Object} object The object to modify.
4836 * @param {Array|string} path The path of the property to update.
4837 * @param {Function} updater The function to produce the updated value.
4838 * @param {Function} [customizer] The function to customize path creation.
4839 * @returns {Object} Returns `object`.
4840 */
4841 function baseUpdate(object, path, updater, customizer) {
4842 return baseSet(object, path, updater(baseGet(object, path)), customizer);
4843 }
4844
4845 /**
4846 * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
4847 * without support for iteratee shorthands.
4848 *
4849 * @private
4850 * @param {Array} array The array to query.
4851 * @param {Function} predicate The function invoked per iteration.
4852 * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
4853 * @param {boolean} [fromRight] Specify iterating from right to left.
4854 * @returns {Array} Returns the slice of `array`.
4855 */
4856 function baseWhile(array, predicate, isDrop, fromRight) {
4857 var length = array.length,
4858 index = fromRight ? length : -1;
4859
4860 while ((fromRight ? index-- : ++index < length) &&
4861 predicate(array[index], index, array)) {}
4862
4863 return isDrop
4864 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
4865 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
4866 }
4867
4868 /**
4869 * The base implementation of `wrapperValue` which returns the result of
4870 * performing a sequence of actions on the unwrapped `value`, where each
4871 * successive action is supplied the return value of the previous.
4872 *
4873 * @private
4874 * @param {*} value The unwrapped value.
4875 * @param {Array} actions Actions to perform to resolve the unwrapped value.
4876 * @returns {*} Returns the resolved value.
4877 */
4878 function baseWrapperValue(value, actions) {
4879 var result = value;
4880 if (result instanceof LazyWrapper) {
4881 result = result.value();
4882 }
4883 return arrayReduce(actions, function(result, action) {
4884 return action.func.apply(action.thisArg, arrayPush([result], action.args));
4885 }, result);
4886 }
4887
4888 /**
4889 * The base implementation of methods like `_.xor`, without support for
4890 * iteratee shorthands, that accepts an array of arrays to inspect.
4891 *
4892 * @private
4893 * @param {Array} arrays The arrays to inspect.
4894 * @param {Function} [iteratee] The iteratee invoked per element.
4895 * @param {Function} [comparator] The comparator invoked per element.
4896 * @returns {Array} Returns the new array of values.
4897 */
4898 function baseXor(arrays, iteratee, comparator) {
4899 var length = arrays.length;
4900 if (length < 2) {
4901 return length ? baseUniq(arrays[0]) : [];
4902 }
4903 var index = -1,
4904 result = Array(length);
4905
4906 while (++index < length) {
4907 var array = arrays[index],
4908 othIndex = -1;
4909
4910 while (++othIndex < length) {
4911 if (othIndex != index) {
4912 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
4913 }
4914 }
4915 }
4916 return baseUniq(baseFlatten(result, 1), iteratee, comparator);
4917 }
4918
4919 /**
4920 * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
4921 *
4922 * @private
4923 * @param {Array} props The property identifiers.
4924 * @param {Array} values The property values.
4925 * @param {Function} assignFunc The function to assign values.
4926 * @returns {Object} Returns the new object.
4927 */
4928 function baseZipObject(props, values, assignFunc) {
4929 var index = -1,
4930 length = props.length,
4931 valsLength = values.length,
4932 result = {};
4933
4934 while (++index < length) {
4935 var value = index < valsLength ? values[index] : undefined;
4936 assignFunc(result, props[index], value);
4937 }
4938 return result;
4939 }
4940
4941 /**
4942 * Casts `value` to an empty array if it's not an array like object.
4943 *
4944 * @private
4945 * @param {*} value The value to inspect.
4946 * @returns {Array|Object} Returns the cast array-like object.
4947 */
4948 function castArrayLikeObject(value) {
4949 return isArrayLikeObject(value) ? value : [];
4950 }
4951
4952 /**
4953 * Casts `value` to `identity` if it's not a function.
4954 *
4955 * @private
4956 * @param {*} value The value to inspect.
4957 * @returns {Function} Returns cast function.
4958 */
4959 function castFunction(value) {
4960 return typeof value == 'function' ? value : identity;
4961 }
4962
4963 /**
4964 * Casts `value` to a path array if it's not one.
4965 *
4966 * @private
4967 * @param {*} value The value to inspect.
4968 * @param {Object} [object] The object to query keys on.
4969 * @returns {Array} Returns the cast property path array.
4970 */
4971 function castPath(value, object) {
4972 if (isArray(value)) {
4973 return value;
4974 }
4975 return isKey(value, object) ? [value] : stringToPath(toString(value));
4976 }
4977
4978 /**
4979 * A `baseRest` alias which can be replaced with `identity` by module
4980 * replacement plugins.
4981 *
4982 * @private
4983 * @type {Function}
4984 * @param {Function} func The function to apply a rest parameter to.
4985 * @returns {Function} Returns the new function.
4986 */
4987 var castRest = baseRest;
4988
4989 /**
4990 * Casts `array` to a slice if it's needed.
4991 *
4992 * @private
4993 * @param {Array} array The array to inspect.
4994 * @param {number} start The start position.
4995 * @param {number} [end=array.length] The end position.
4996 * @returns {Array} Returns the cast slice.
4997 */
4998 function castSlice(array, start, end) {
4999 var length = array.length;
5000 end = end === undefined ? length : end;
5001 return (!start && end >= length) ? array : baseSlice(array, start, end);
5002 }
5003
5004 /**
5005 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
5006 *
5007 * @private
5008 * @param {number|Object} id The timer id or timeout object of the timer to clear.
5009 */
5010 var clearTimeout = ctxClearTimeout || function(id) {
5011 return root.clearTimeout(id);
5012 };
5013
5014 /**
5015 * Creates a clone of `buffer`.
5016 *
5017 * @private
5018 * @param {Buffer} buffer The buffer to clone.
5019 * @param {boolean} [isDeep] Specify a deep clone.
5020 * @returns {Buffer} Returns the cloned buffer.
5021 */
5022 function cloneBuffer(buffer, isDeep) {
5023 if (isDeep) {
5024 return buffer.slice();
5025 }
5026 var length = buffer.length,
5027 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
5028
5029 buffer.copy(result);
5030 return result;
5031 }
5032
5033 /**
5034 * Creates a clone of `arrayBuffer`.
5035 *
5036 * @private
5037 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
5038 * @returns {ArrayBuffer} Returns the cloned array buffer.
5039 */
5040 function cloneArrayBuffer(arrayBuffer) {
5041 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
5042 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
5043 return result;
5044 }
5045
5046 /**
5047 * Creates a clone of `dataView`.
5048 *
5049 * @private
5050 * @param {Object} dataView The data view to clone.
5051 * @param {boolean} [isDeep] Specify a deep clone.
5052 * @returns {Object} Returns the cloned data view.
5053 */
5054 function cloneDataView(dataView, isDeep) {
5055 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
5056 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
5057 }
5058
5059 /**
5060 * Creates a clone of `regexp`.
5061 *
5062 * @private
5063 * @param {Object} regexp The regexp to clone.
5064 * @returns {Object} Returns the cloned regexp.
5065 */
5066 function cloneRegExp(regexp) {
5067 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
5068 result.lastIndex = regexp.lastIndex;
5069 return result;
5070 }
5071
5072 /**
5073 * Creates a clone of the `symbol` object.
5074 *
5075 * @private
5076 * @param {Object} symbol The symbol object to clone.
5077 * @returns {Object} Returns the cloned symbol object.
5078 */
5079 function cloneSymbol(symbol) {
5080 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
5081 }
5082
5083 /**
5084 * Creates a clone of `typedArray`.
5085 *
5086 * @private
5087 * @param {Object} typedArray The typed array to clone.
5088 * @param {boolean} [isDeep] Specify a deep clone.
5089 * @returns {Object} Returns the cloned typed array.
5090 */
5091 function cloneTypedArray(typedArray, isDeep) {
5092 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
5093 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
5094 }
5095
5096 /**
5097 * Compares values to sort them in ascending order.
5098 *
5099 * @private
5100 * @param {*} value The value to compare.
5101 * @param {*} other The other value to compare.
5102 * @returns {number} Returns the sort order indicator for `value`.
5103 */
5104 function compareAscending(value, other) {
5105 if (value !== other) {
5106 var valIsDefined = value !== undefined,
5107 valIsNull = value === null,
5108 valIsReflexive = value === value,
5109 valIsSymbol = isSymbol(value);
5110
5111 var othIsDefined = other !== undefined,
5112 othIsNull = other === null,
5113 othIsReflexive = other === other,
5114 othIsSymbol = isSymbol(other);
5115
5116 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
5117 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
5118 (valIsNull && othIsDefined && othIsReflexive) ||
5119 (!valIsDefined && othIsReflexive) ||
5120 !valIsReflexive) {
5121 return 1;
5122 }
5123 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
5124 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
5125 (othIsNull && valIsDefined && valIsReflexive) ||
5126 (!othIsDefined && valIsReflexive) ||
5127 !othIsReflexive) {
5128 return -1;
5129 }
5130 }
5131 return 0;
5132 }
5133
5134 /**
5135 * Used by `_.orderBy` to compare multiple properties of a value to another
5136 * and stable sort them.
5137 *
5138 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
5139 * specify an order of "desc" for descending or "asc" for ascending sort order
5140 * of corresponding values.
5141 *
5142 * @private
5143 * @param {Object} object The object to compare.
5144 * @param {Object} other The other object to compare.
5145 * @param {boolean[]|string[]} orders The order to sort by for each property.
5146 * @returns {number} Returns the sort order indicator for `object`.
5147 */
5148 function compareMultiple(object, other, orders) {
5149 var index = -1,
5150 objCriteria = object.criteria,
5151 othCriteria = other.criteria,
5152 length = objCriteria.length,
5153 ordersLength = orders.length;
5154
5155 while (++index < length) {
5156 var result = compareAscending(objCriteria[index], othCriteria[index]);
5157 if (result) {
5158 if (index >= ordersLength) {
5159 return result;
5160 }
5161 var order = orders[index];
5162 return result * (order == 'desc' ? -1 : 1);
5163 }
5164 }
5165 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
5166 // that causes it, under certain circumstances, to provide the same value for
5167 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
5168 // for more details.
5169 //
5170 // This also ensures a stable sort in V8 and other engines.
5171 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
5172 return object.index - other.index;
5173 }
5174
5175 /**
5176 * Creates an array that is the composition of partially applied arguments,
5177 * placeholders, and provided arguments into a single array of arguments.
5178 *
5179 * @private
5180 * @param {Array} args The provided arguments.
5181 * @param {Array} partials The arguments to prepend to those provided.
5182 * @param {Array} holders The `partials` placeholder indexes.
5183 * @params {boolean} [isCurried] Specify composing for a curried function.
5184 * @returns {Array} Returns the new array of composed arguments.
5185 */
5186 function composeArgs(args, partials, holders, isCurried) {
5187 var argsIndex = -1,
5188 argsLength = args.length,
5189 holdersLength = holders.length,
5190 leftIndex = -1,
5191 leftLength = partials.length,
5192 rangeLength = nativeMax(argsLength - holdersLength, 0),
5193 result = Array(leftLength + rangeLength),
5194 isUncurried = !isCurried;
5195
5196 while (++leftIndex < leftLength) {
5197 result[leftIndex] = partials[leftIndex];
5198 }
5199 while (++argsIndex < holdersLength) {
5200 if (isUncurried || argsIndex < argsLength) {
5201 result[holders[argsIndex]] = args[argsIndex];
5202 }
5203 }
5204 while (rangeLength--) {
5205 result[leftIndex++] = args[argsIndex++];
5206 }
5207 return result;
5208 }
5209
5210 /**
5211 * This function is like `composeArgs` except that the arguments composition
5212 * is tailored for `_.partialRight`.
5213 *
5214 * @private
5215 * @param {Array} args The provided arguments.
5216 * @param {Array} partials The arguments to append to those provided.
5217 * @param {Array} holders The `partials` placeholder indexes.
5218 * @params {boolean} [isCurried] Specify composing for a curried function.
5219 * @returns {Array} Returns the new array of composed arguments.
5220 */
5221 function composeArgsRight(args, partials, holders, isCurried) {
5222 var argsIndex = -1,
5223 argsLength = args.length,
5224 holdersIndex = -1,
5225 holdersLength = holders.length,
5226 rightIndex = -1,
5227 rightLength = partials.length,
5228 rangeLength = nativeMax(argsLength - holdersLength, 0),
5229 result = Array(rangeLength + rightLength),
5230 isUncurried = !isCurried;
5231
5232 while (++argsIndex < rangeLength) {
5233 result[argsIndex] = args[argsIndex];
5234 }
5235 var offset = argsIndex;
5236 while (++rightIndex < rightLength) {
5237 result[offset + rightIndex] = partials[rightIndex];
5238 }
5239 while (++holdersIndex < holdersLength) {
5240 if (isUncurried || argsIndex < argsLength) {
5241 result[offset + holders[holdersIndex]] = args[argsIndex++];
5242 }
5243 }
5244 return result;
5245 }
5246
5247 /**
5248 * Copies the values of `source` to `array`.
5249 *
5250 * @private
5251 * @param {Array} source The array to copy values from.
5252 * @param {Array} [array=[]] The array to copy values to.
5253 * @returns {Array} Returns `array`.
5254 */
5255 function copyArray(source, array) {
5256 var index = -1,
5257 length = source.length;
5258
5259 array || (array = Array(length));
5260 while (++index < length) {
5261 array[index] = source[index];
5262 }
5263 return array;
5264 }
5265
5266 /**
5267 * Copies properties of `source` to `object`.
5268 *
5269 * @private
5270 * @param {Object} source The object to copy properties from.
5271 * @param {Array} props The property identifiers to copy.
5272 * @param {Object} [object={}] The object to copy properties to.
5273 * @param {Function} [customizer] The function to customize copied values.
5274 * @returns {Object} Returns `object`.
5275 */
5276 function copyObject(source, props, object, customizer) {
5277 var isNew = !object;
5278 object || (object = {});
5279
5280 var index = -1,
5281 length = props.length;
5282
5283 while (++index < length) {
5284 var key = props[index];
5285
5286 var newValue = customizer
5287 ? customizer(object[key], source[key], key, object, source)
5288 : undefined;
5289
5290 if (newValue === undefined) {
5291 newValue = source[key];
5292 }
5293 if (isNew) {
5294 baseAssignValue(object, key, newValue);
5295 } else {
5296 assignValue(object, key, newValue);
5297 }
5298 }
5299 return object;
5300 }
5301
5302 /**
5303 * Copies own symbols of `source` to `object`.
5304 *
5305 * @private
5306 * @param {Object} source The object to copy symbols from.
5307 * @param {Object} [object={}] The object to copy symbols to.
5308 * @returns {Object} Returns `object`.
5309 */
5310 function copySymbols(source, object) {
5311 return copyObject(source, getSymbols(source), object);
5312 }
5313
5314 /**
5315 * Copies own and inherited symbols of `source` to `object`.
5316 *
5317 * @private
5318 * @param {Object} source The object to copy symbols from.
5319 * @param {Object} [object={}] The object to copy symbols to.
5320 * @returns {Object} Returns `object`.
5321 */
5322 function copySymbolsIn(source, object) {
5323 return copyObject(source, getSymbolsIn(source), object);
5324 }
5325
5326 /**
5327 * Creates a function like `_.groupBy`.
5328 *
5329 * @private
5330 * @param {Function} setter The function to set accumulator values.
5331 * @param {Function} [initializer] The accumulator object initializer.
5332 * @returns {Function} Returns the new aggregator function.
5333 */
5334 function createAggregator(setter, initializer) {
5335 return function(collection, iteratee) {
5336 var func = isArray(collection) ? arrayAggregator : baseAggregator,
5337 accumulator = initializer ? initializer() : {};
5338
5339 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
5340 };
5341 }
5342
5343 /**
5344 * Creates a function like `_.assign`.
5345 *
5346 * @private
5347 * @param {Function} assigner The function to assign values.
5348 * @returns {Function} Returns the new assigner function.
5349 */
5350 function createAssigner(assigner) {
5351 return baseRest(function(object, sources) {
5352 var index = -1,
5353 length = sources.length,
5354 customizer = length > 1 ? sources[length - 1] : undefined,
5355 guard = length > 2 ? sources[2] : undefined;
5356
5357 customizer = (assigner.length > 3 && typeof customizer == 'function')
5358 ? (length--, customizer)
5359 : undefined;
5360
5361 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
5362 customizer = length < 3 ? undefined : customizer;
5363 length = 1;
5364 }
5365 object = Object(object);
5366 while (++index < length) {
5367 var source = sources[index];
5368 if (source) {
5369 assigner(object, source, index, customizer);
5370 }
5371 }
5372 return object;
5373 });
5374 }
5375
5376 /**
5377 * Creates a `baseEach` or `baseEachRight` function.
5378 *
5379 * @private
5380 * @param {Function} eachFunc The function to iterate over a collection.
5381 * @param {boolean} [fromRight] Specify iterating from right to left.
5382 * @returns {Function} Returns the new base function.
5383 */
5384 function createBaseEach(eachFunc, fromRight) {
5385 return function(collection, iteratee) {
5386 if (collection == null) {
5387 return collection;
5388 }
5389 if (!isArrayLike(collection)) {
5390 return eachFunc(collection, iteratee);
5391 }
5392 var length = collection.length,
5393 index = fromRight ? length : -1,
5394 iterable = Object(collection);
5395
5396 while ((fromRight ? index-- : ++index < length)) {
5397 if (iteratee(iterable[index], index, iterable) === false) {
5398 break;
5399 }
5400 }
5401 return collection;
5402 };
5403 }
5404
5405 /**
5406 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
5407 *
5408 * @private
5409 * @param {boolean} [fromRight] Specify iterating from right to left.
5410 * @returns {Function} Returns the new base function.
5411 */
5412 function createBaseFor(fromRight) {
5413 return function(object, iteratee, keysFunc) {
5414 var index = -1,
5415 iterable = Object(object),
5416 props = keysFunc(object),
5417 length = props.length;
5418
5419 while (length--) {
5420 var key = props[fromRight ? length : ++index];
5421 if (iteratee(iterable[key], key, iterable) === false) {
5422 break;
5423 }
5424 }
5425 return object;
5426 };
5427 }
5428
5429 /**
5430 * Creates a function that wraps `func` to invoke it with the optional `this`
5431 * binding of `thisArg`.
5432 *
5433 * @private
5434 * @param {Function} func The function to wrap.
5435 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
5436 * @param {*} [thisArg] The `this` binding of `func`.
5437 * @returns {Function} Returns the new wrapped function.
5438 */
5439 function createBind(func, bitmask, thisArg) {
5440 var isBind = bitmask & WRAP_BIND_FLAG,
5441 Ctor = createCtor(func);
5442
5443 function wrapper() {
5444 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
5445 return fn.apply(isBind ? thisArg : this, arguments);
5446 }
5447 return wrapper;
5448 }
5449
5450 /**
5451 * Creates a function like `_.lowerFirst`.
5452 *
5453 * @private
5454 * @param {string} methodName The name of the `String` case method to use.
5455 * @returns {Function} Returns the new case function.
5456 */
5457 function createCaseFirst(methodName) {
5458 return function(string) {
5459 string = toString(string);
5460
5461 var strSymbols = hasUnicode(string)
5462 ? stringToArray(string)
5463 : undefined;
5464
5465 var chr = strSymbols
5466 ? strSymbols[0]
5467 : string.charAt(0);
5468
5469 var trailing = strSymbols
5470 ? castSlice(strSymbols, 1).join('')
5471 : string.slice(1);
5472
5473 return chr[methodName]() + trailing;
5474 };
5475 }
5476
5477 /**
5478 * Creates a function like `_.camelCase`.
5479 *
5480 * @private
5481 * @param {Function} callback The function to combine each word.
5482 * @returns {Function} Returns the new compounder function.
5483 */
5484 function createCompounder(callback) {
5485 return function(string) {
5486 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
5487 };
5488 }
5489
5490 /**
5491 * Creates a function that produces an instance of `Ctor` regardless of
5492 * whether it was invoked as part of a `new` expression or by `call` or `apply`.
5493 *
5494 * @private
5495 * @param {Function} Ctor The constructor to wrap.
5496 * @returns {Function} Returns the new wrapped function.
5497 */
5498 function createCtor(Ctor) {
5499 return function() {
5500 // Use a `switch` statement to work with class constructors. See
5501 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
5502 // for more details.
5503 var args = arguments;
5504 switch (args.length) {
5505 case 0: return new Ctor;
5506 case 1: return new Ctor(args[0]);
5507 case 2: return new Ctor(args[0], args[1]);
5508 case 3: return new Ctor(args[0], args[1], args[2]);
5509 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
5510 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
5511 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
5512 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
5513 }
5514 var thisBinding = baseCreate(Ctor.prototype),
5515 result = Ctor.apply(thisBinding, args);
5516
5517 // Mimic the constructor's `return` behavior.
5518 // See https://es5.github.io/#x13.2.2 for more details.
5519 return isObject(result) ? result : thisBinding;
5520 };
5521 }
5522
5523 /**
5524 * Creates a function that wraps `func` to enable currying.
5525 *
5526 * @private
5527 * @param {Function} func The function to wrap.
5528 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
5529 * @param {number} arity The arity of `func`.
5530 * @returns {Function} Returns the new wrapped function.
5531 */
5532 function createCurry(func, bitmask, arity) {
5533 var Ctor = createCtor(func);
5534
5535 function wrapper() {
5536 var length = arguments.length,
5537 args = Array(length),
5538 index = length,
5539 placeholder = getHolder(wrapper);
5540
5541 while (index--) {
5542 args[index] = arguments[index];
5543 }
5544 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
5545 ? []
5546 : replaceHolders(args, placeholder);
5547
5548 length -= holders.length;
5549 if (length < arity) {
5550 return createRecurry(
5551 func, bitmask, createHybrid, wrapper.placeholder, undefined,
5552 args, holders, undefined, undefined, arity - length);
5553 }
5554 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
5555 return apply(fn, this, args);
5556 }
5557 return wrapper;
5558 }
5559
5560 /**
5561 * Creates a `_.find` or `_.findLast` function.
5562 *
5563 * @private
5564 * @param {Function} findIndexFunc The function to find the collection index.
5565 * @returns {Function} Returns the new find function.
5566 */
5567 function createFind(findIndexFunc) {
5568 return function(collection, predicate, fromIndex) {
5569 var iterable = Object(collection);
5570 if (!isArrayLike(collection)) {
5571 var iteratee = getIteratee(predicate, 3);
5572 collection = keys(collection);
5573 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
5574 }
5575 var index = findIndexFunc(collection, predicate, fromIndex);
5576 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
5577 };
5578 }
5579
5580 /**
5581 * Creates a `_.flow` or `_.flowRight` function.
5582 *
5583 * @private
5584 * @param {boolean} [fromRight] Specify iterating from right to left.
5585 * @returns {Function} Returns the new flow function.
5586 */
5587 function createFlow(fromRight) {
5588 return flatRest(function(funcs) {
5589 var length = funcs.length,
5590 index = length,
5591 prereq = LodashWrapper.prototype.thru;
5592
5593 if (fromRight) {
5594 funcs.reverse();
5595 }
5596 while (index--) {
5597 var func = funcs[index];
5598 if (typeof func != 'function') {
5599 throw new TypeError(FUNC_ERROR_TEXT);
5600 }
5601 if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
5602 var wrapper = new LodashWrapper([], true);
5603 }
5604 }
5605 index = wrapper ? index : length;
5606 while (++index < length) {
5607 func = funcs[index];
5608
5609 var funcName = getFuncName(func),
5610 data = funcName == 'wrapper' ? getData(func) : undefined;
5611
5612 if (data && isLaziable(data[0]) &&
5613 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
5614 !data[4].length && data[9] == 1
5615 ) {
5616 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
5617 } else {
5618 wrapper = (func.length == 1 && isLaziable(func))
5619 ? wrapper[funcName]()
5620 : wrapper.thru(func);
5621 }
5622 }
5623 return function() {
5624 var args = arguments,
5625 value = args[0];
5626
5627 if (wrapper && args.length == 1 && isArray(value)) {
5628 return wrapper.plant(value).value();
5629 }
5630 var index = 0,
5631 result = length ? funcs[index].apply(this, args) : value;
5632
5633 while (++index < length) {
5634 result = funcs[index].call(this, result);
5635 }
5636 return result;
5637 };
5638 });
5639 }
5640
5641 /**
5642 * Creates a function that wraps `func` to invoke it with optional `this`
5643 * binding of `thisArg`, partial application, and currying.
5644 *
5645 * @private
5646 * @param {Function|string} func The function or method name to wrap.
5647 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
5648 * @param {*} [thisArg] The `this` binding of `func`.
5649 * @param {Array} [partials] The arguments to prepend to those provided to
5650 * the new function.
5651 * @param {Array} [holders] The `partials` placeholder indexes.
5652 * @param {Array} [partialsRight] The arguments to append to those provided
5653 * to the new function.
5654 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
5655 * @param {Array} [argPos] The argument positions of the new function.
5656 * @param {number} [ary] The arity cap of `func`.
5657 * @param {number} [arity] The arity of `func`.
5658 * @returns {Function} Returns the new wrapped function.
5659 */
5660 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
5661 var isAry = bitmask & WRAP_ARY_FLAG,
5662 isBind = bitmask & WRAP_BIND_FLAG,
5663 isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
5664 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
5665 isFlip = bitmask & WRAP_FLIP_FLAG,
5666 Ctor = isBindKey ? undefined : createCtor(func);
5667
5668 function wrapper() {
5669 var length = arguments.length,
5670 args = Array(length),
5671 index = length;
5672
5673 while (index--) {
5674 args[index] = arguments[index];
5675 }
5676 if (isCurried) {
5677 var placeholder = getHolder(wrapper),
5678 holdersCount = countHolders(args, placeholder);
5679 }
5680 if (partials) {
5681 args = composeArgs(args, partials, holders, isCurried);
5682 }
5683 if (partialsRight) {
5684 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
5685 }
5686 length -= holdersCount;
5687 if (isCurried && length < arity) {
5688 var newHolders = replaceHolders(args, placeholder);
5689 return createRecurry(
5690 func, bitmask, createHybrid, wrapper.placeholder, thisArg,
5691 args, newHolders, argPos, ary, arity - length
5692 );
5693 }
5694 var thisBinding = isBind ? thisArg : this,
5695 fn = isBindKey ? thisBinding[func] : func;
5696
5697 length = args.length;
5698 if (argPos) {
5699 args = reorder(args, argPos);
5700 } else if (isFlip && length > 1) {
5701 args.reverse();
5702 }
5703 if (isAry && ary < length) {
5704 args.length = ary;
5705 }
5706 if (this && this !== root && this instanceof wrapper) {
5707 fn = Ctor || createCtor(fn);
5708 }
5709 return fn.apply(thisBinding, args);
5710 }
5711 return wrapper;
5712 }
5713
5714 /**
5715 * Creates a function like `_.invertBy`.
5716 *
5717 * @private
5718 * @param {Function} setter The function to set accumulator values.
5719 * @param {Function} toIteratee The function to resolve iteratees.
5720 * @returns {Function} Returns the new inverter function.
5721 */
5722 function createInverter(setter, toIteratee) {
5723 return function(object, iteratee) {
5724 return baseInverter(object, setter, toIteratee(iteratee), {});
5725 };
5726 }
5727
5728 /**
5729 * Creates a function that performs a mathematical operation on two values.
5730 *
5731 * @private
5732 * @param {Function} operator The function to perform the operation.
5733 * @param {number} [defaultValue] The value used for `undefined` arguments.
5734 * @returns {Function} Returns the new mathematical operation function.
5735 */
5736 function createMathOperation(operator, defaultValue) {
5737 return function(value, other) {
5738 var result;
5739 if (value === undefined && other === undefined) {
5740 return defaultValue;
5741 }
5742 if (value !== undefined) {
5743 result = value;
5744 }
5745 if (other !== undefined) {
5746 if (result === undefined) {
5747 return other;
5748 }
5749 if (typeof value == 'string' || typeof other == 'string') {
5750 value = baseToString(value);
5751 other = baseToString(other);
5752 } else {
5753 value = baseToNumber(value);
5754 other = baseToNumber(other);
5755 }
5756 result = operator(value, other);
5757 }
5758 return result;
5759 };
5760 }
5761
5762 /**
5763 * Creates a function like `_.over`.
5764 *
5765 * @private
5766 * @param {Function} arrayFunc The function to iterate over iteratees.
5767 * @returns {Function} Returns the new over function.
5768 */
5769 function createOver(arrayFunc) {
5770 return flatRest(function(iteratees) {
5771 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
5772 return baseRest(function(args) {
5773 var thisArg = this;
5774 return arrayFunc(iteratees, function(iteratee) {
5775 return apply(iteratee, thisArg, args);
5776 });
5777 });
5778 });
5779 }
5780
5781 /**
5782 * Creates the padding for `string` based on `length`. The `chars` string
5783 * is truncated if the number of characters exceeds `length`.
5784 *
5785 * @private
5786 * @param {number} length The padding length.
5787 * @param {string} [chars=' '] The string used as padding.
5788 * @returns {string} Returns the padding for `string`.
5789 */
5790 function createPadding(length, chars) {
5791 chars = chars === undefined ? ' ' : baseToString(chars);
5792
5793 var charsLength = chars.length;
5794 if (charsLength < 2) {
5795 return charsLength ? baseRepeat(chars, length) : chars;
5796 }
5797 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
5798 return hasUnicode(chars)
5799 ? castSlice(stringToArray(result), 0, length).join('')
5800 : result.slice(0, length);
5801 }
5802
5803 /**
5804 * Creates a function that wraps `func` to invoke it with the `this` binding
5805 * of `thisArg` and `partials` prepended to the arguments it receives.
5806 *
5807 * @private
5808 * @param {Function} func The function to wrap.
5809 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
5810 * @param {*} thisArg The `this` binding of `func`.
5811 * @param {Array} partials The arguments to prepend to those provided to
5812 * the new function.
5813 * @returns {Function} Returns the new wrapped function.
5814 */
5815 function createPartial(func, bitmask, thisArg, partials) {
5816 var isBind = bitmask & WRAP_BIND_FLAG,
5817 Ctor = createCtor(func);
5818
5819 function wrapper() {
5820 var argsIndex = -1,
5821 argsLength = arguments.length,
5822 leftIndex = -1,
5823 leftLength = partials.length,
5824 args = Array(leftLength + argsLength),
5825 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
5826
5827 while (++leftIndex < leftLength) {
5828 args[leftIndex] = partials[leftIndex];
5829 }
5830 while (argsLength--) {
5831 args[leftIndex++] = arguments[++argsIndex];
5832 }
5833 return apply(fn, isBind ? thisArg : this, args);
5834 }
5835 return wrapper;
5836 }
5837
5838 /**
5839 * Creates a `_.range` or `_.rangeRight` function.
5840 *
5841 * @private
5842 * @param {boolean} [fromRight] Specify iterating from right to left.
5843 * @returns {Function} Returns the new range function.
5844 */
5845 function createRange(fromRight) {
5846 return function(start, end, step) {
5847 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
5848 end = step = undefined;
5849 }
5850 // Ensure the sign of `-0` is preserved.
5851 start = toFinite(start);
5852 if (end === undefined) {
5853 end = start;
5854 start = 0;
5855 } else {
5856 end = toFinite(end);
5857 }
5858 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
5859 return baseRange(start, end, step, fromRight);
5860 };
5861 }
5862
5863 /**
5864 * Creates a function that performs a relational operation on two values.
5865 *
5866 * @private
5867 * @param {Function} operator The function to perform the operation.
5868 * @returns {Function} Returns the new relational operation function.
5869 */
5870 function createRelationalOperation(operator) {
5871 return function(value, other) {
5872 if (!(typeof value == 'string' && typeof other == 'string')) {
5873 value = toNumber(value);
5874 other = toNumber(other);
5875 }
5876 return operator(value, other);
5877 };
5878 }
5879
5880 /**
5881 * Creates a function that wraps `func` to continue currying.
5882 *
5883 * @private
5884 * @param {Function} func The function to wrap.
5885 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
5886 * @param {Function} wrapFunc The function to create the `func` wrapper.
5887 * @param {*} placeholder The placeholder value.
5888 * @param {*} [thisArg] The `this` binding of `func`.
5889 * @param {Array} [partials] The arguments to prepend to those provided to
5890 * the new function.
5891 * @param {Array} [holders] The `partials` placeholder indexes.
5892 * @param {Array} [argPos] The argument positions of the new function.
5893 * @param {number} [ary] The arity cap of `func`.
5894 * @param {number} [arity] The arity of `func`.
5895 * @returns {Function} Returns the new wrapped function.
5896 */
5897 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
5898 var isCurry = bitmask & WRAP_CURRY_FLAG,
5899 newHolders = isCurry ? holders : undefined,
5900 newHoldersRight = isCurry ? undefined : holders,
5901 newPartials = isCurry ? partials : undefined,
5902 newPartialsRight = isCurry ? undefined : partials;
5903
5904 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
5905 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
5906
5907 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
5908 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
5909 }
5910 var newData = [
5911 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
5912 newHoldersRight, argPos, ary, arity
5913 ];
5914
5915 var result = wrapFunc.apply(undefined, newData);
5916 if (isLaziable(func)) {
5917 setData(result, newData);
5918 }
5919 result.placeholder = placeholder;
5920 return setWrapToString(result, func, bitmask);
5921 }
5922
5923 /**
5924 * Creates a function like `_.round`.
5925 *
5926 * @private
5927 * @param {string} methodName The name of the `Math` method to use when rounding.
5928 * @returns {Function} Returns the new round function.
5929 */
5930 function createRound(methodName) {
5931 var func = Math[methodName];
5932 return function(number, precision) {
5933 number = toNumber(number);
5934 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
5935 if (precision) {
5936 // Shift with exponential notation to avoid floating-point issues.
5937 // See [MDN](https://mdn.io/round#Examples) for more details.
5938 var pair = (toString(number) + 'e').split('e'),
5939 value = func(pair[0] + 'e' + (+pair[1] + precision));
5940
5941 pair = (toString(value) + 'e').split('e');
5942 return +(pair[0] + 'e' + (+pair[1] - precision));
5943 }
5944 return func(number);
5945 };
5946 }
5947
5948 /**
5949 * Creates a set object of `values`.
5950 *
5951 * @private
5952 * @param {Array} values The values to add to the set.
5953 * @returns {Object} Returns the new set.
5954 */
5955 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
5956 return new Set(values);
5957 };
5958
5959 /**
5960 * Creates a `_.toPairs` or `_.toPairsIn` function.
5961 *
5962 * @private
5963 * @param {Function} keysFunc The function to get the keys of a given object.
5964 * @returns {Function} Returns the new pairs function.
5965 */
5966 function createToPairs(keysFunc) {
5967 return function(object) {
5968 var tag = getTag(object);
5969 if (tag == mapTag) {
5970 return mapToArray(object);
5971 }
5972 if (tag == setTag) {
5973 return setToPairs(object);
5974 }
5975 return baseToPairs(object, keysFunc(object));
5976 };
5977 }
5978
5979 /**
5980 * Creates a function that either curries or invokes `func` with optional
5981 * `this` binding and partially applied arguments.
5982 *
5983 * @private
5984 * @param {Function|string} func The function or method name to wrap.
5985 * @param {number} bitmask The bitmask flags.
5986 * 1 - `_.bind`
5987 * 2 - `_.bindKey`
5988 * 4 - `_.curry` or `_.curryRight` of a bound function
5989 * 8 - `_.curry`
5990 * 16 - `_.curryRight`
5991 * 32 - `_.partial`
5992 * 64 - `_.partialRight`
5993 * 128 - `_.rearg`
5994 * 256 - `_.ary`
5995 * 512 - `_.flip`
5996 * @param {*} [thisArg] The `this` binding of `func`.
5997 * @param {Array} [partials] The arguments to be partially applied.
5998 * @param {Array} [holders] The `partials` placeholder indexes.
5999 * @param {Array} [argPos] The argument positions of the new function.
6000 * @param {number} [ary] The arity cap of `func`.
6001 * @param {number} [arity] The arity of `func`.
6002 * @returns {Function} Returns the new wrapped function.
6003 */
6004 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
6005 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
6006 if (!isBindKey && typeof func != 'function') {
6007 throw new TypeError(FUNC_ERROR_TEXT);
6008 }
6009 var length = partials ? partials.length : 0;
6010 if (!length) {
6011 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
6012 partials = holders = undefined;
6013 }
6014 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
6015 arity = arity === undefined ? arity : toInteger(arity);
6016 length -= holders ? holders.length : 0;
6017
6018 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
6019 var partialsRight = partials,
6020 holdersRight = holders;
6021
6022 partials = holders = undefined;
6023 }
6024 var data = isBindKey ? undefined : getData(func);
6025
6026 var newData = [
6027 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
6028 argPos, ary, arity
6029 ];
6030
6031 if (data) {
6032 mergeData(newData, data);
6033 }
6034 func = newData[0];
6035 bitmask = newData[1];
6036 thisArg = newData[2];
6037 partials = newData[3];
6038 holders = newData[4];
6039 arity = newData[9] = newData[9] === undefined
6040 ? (isBindKey ? 0 : func.length)
6041 : nativeMax(newData[9] - length, 0);
6042
6043 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
6044 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
6045 }
6046 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
6047 var result = createBind(func, bitmask, thisArg);
6048 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
6049 result = createCurry(func, bitmask, arity);
6050 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
6051 result = createPartial(func, bitmask, thisArg, partials);
6052 } else {
6053 result = createHybrid.apply(undefined, newData);
6054 }
6055 var setter = data ? baseSetData : setData;
6056 return setWrapToString(setter(result, newData), func, bitmask);
6057 }
6058
6059 /**
6060 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
6061 * of source objects to the destination object for all destination properties
6062 * that resolve to `undefined`.
6063 *
6064 * @private
6065 * @param {*} objValue The destination value.
6066 * @param {*} srcValue The source value.
6067 * @param {string} key The key of the property to assign.
6068 * @param {Object} object The parent object of `objValue`.
6069 * @returns {*} Returns the value to assign.
6070 */
6071 function customDefaultsAssignIn(objValue, srcValue, key, object) {
6072 if (objValue === undefined ||
6073 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
6074 return srcValue;
6075 }
6076 return objValue;
6077 }
6078
6079 /**
6080 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
6081 * objects into destination objects that are passed thru.
6082 *
6083 * @private
6084 * @param {*} objValue The destination value.
6085 * @param {*} srcValue The source value.
6086 * @param {string} key The key of the property to merge.
6087 * @param {Object} object The parent object of `objValue`.
6088 * @param {Object} source The parent object of `srcValue`.
6089 * @param {Object} [stack] Tracks traversed source values and their merged
6090 * counterparts.
6091 * @returns {*} Returns the value to assign.
6092 */
6093 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
6094 if (isObject(objValue) && isObject(srcValue)) {
6095 // Recursively merge objects and arrays (susceptible to call stack limits).
6096 stack.set(srcValue, objValue);
6097 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
6098 stack['delete'](srcValue);
6099 }
6100 return objValue;
6101 }
6102
6103 /**
6104 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
6105 * objects.
6106 *
6107 * @private
6108 * @param {*} value The value to inspect.
6109 * @param {string} key The key of the property to inspect.
6110 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
6111 */
6112 function customOmitClone(value) {
6113 return isPlainObject(value) ? undefined : value;
6114 }
6115
6116 /**
6117 * A specialized version of `baseIsEqualDeep` for arrays with support for
6118 * partial deep comparisons.
6119 *
6120 * @private
6121 * @param {Array} array The array to compare.
6122 * @param {Array} other The other array to compare.
6123 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6124 * @param {Function} customizer The function to customize comparisons.
6125 * @param {Function} equalFunc The function to determine equivalents of values.
6126 * @param {Object} stack Tracks traversed `array` and `other` objects.
6127 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
6128 */
6129 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
6130 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
6131 arrLength = array.length,
6132 othLength = other.length;
6133
6134 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
6135 return false;
6136 }
6137 // Assume cyclic values are equal.
6138 var stacked = stack.get(array);
6139 if (stacked && stack.get(other)) {
6140 return stacked == other;
6141 }
6142 var index = -1,
6143 result = true,
6144 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
6145
6146 stack.set(array, other);
6147 stack.set(other, array);
6148
6149 // Ignore non-index properties.
6150 while (++index < arrLength) {
6151 var arrValue = array[index],
6152 othValue = other[index];
6153
6154 if (customizer) {
6155 var compared = isPartial
6156 ? customizer(othValue, arrValue, index, other, array, stack)
6157 : customizer(arrValue, othValue, index, array, other, stack);
6158 }
6159 if (compared !== undefined) {
6160 if (compared) {
6161 continue;
6162 }
6163 result = false;
6164 break;
6165 }
6166 // Recursively compare arrays (susceptible to call stack limits).
6167 if (seen) {
6168 if (!arraySome(other, function(othValue, othIndex) {
6169 if (!cacheHas(seen, othIndex) &&
6170 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
6171 return seen.push(othIndex);
6172 }
6173 })) {
6174 result = false;
6175 break;
6176 }
6177 } else if (!(
6178 arrValue === othValue ||
6179 equalFunc(arrValue, othValue, bitmask, customizer, stack)
6180 )) {
6181 result = false;
6182 break;
6183 }
6184 }
6185 stack['delete'](array);
6186 stack['delete'](other);
6187 return result;
6188 }
6189
6190 /**
6191 * A specialized version of `baseIsEqualDeep` for comparing objects of
6192 * the same `toStringTag`.
6193 *
6194 * **Note:** This function only supports comparing values with tags of
6195 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
6196 *
6197 * @private
6198 * @param {Object} object The object to compare.
6199 * @param {Object} other The other object to compare.
6200 * @param {string} tag The `toStringTag` of the objects to compare.
6201 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6202 * @param {Function} customizer The function to customize comparisons.
6203 * @param {Function} equalFunc The function to determine equivalents of values.
6204 * @param {Object} stack Tracks traversed `object` and `other` objects.
6205 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6206 */
6207 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6208 switch (tag) {
6209 case dataViewTag:
6210 if ((object.byteLength != other.byteLength) ||
6211 (object.byteOffset != other.byteOffset)) {
6212 return false;
6213 }
6214 object = object.buffer;
6215 other = other.buffer;
6216
6217 case arrayBufferTag:
6218 if ((object.byteLength != other.byteLength) ||
6219 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
6220 return false;
6221 }
6222 return true;
6223
6224 case boolTag:
6225 case dateTag:
6226 case numberTag:
6227 // Coerce booleans to `1` or `0` and dates to milliseconds.
6228 // Invalid dates are coerced to `NaN`.
6229 return eq(+object, +other);
6230
6231 case errorTag:
6232 return object.name == other.name && object.message == other.message;
6233
6234 case regexpTag:
6235 case stringTag:
6236 // Coerce regexes to strings and treat strings, primitives and objects,
6237 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
6238 // for more details.
6239 return object == (other + '');
6240
6241 case mapTag:
6242 var convert = mapToArray;
6243
6244 case setTag:
6245 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
6246 convert || (convert = setToArray);
6247
6248 if (object.size != other.size && !isPartial) {
6249 return false;
6250 }
6251 // Assume cyclic values are equal.
6252 var stacked = stack.get(object);
6253 if (stacked) {
6254 return stacked == other;
6255 }
6256 bitmask |= COMPARE_UNORDERED_FLAG;
6257
6258 // Recursively compare objects (susceptible to call stack limits).
6259 stack.set(object, other);
6260 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
6261 stack['delete'](object);
6262 return result;
6263
6264 case symbolTag:
6265 if (symbolValueOf) {
6266 return symbolValueOf.call(object) == symbolValueOf.call(other);
6267 }
6268 }
6269 return false;
6270 }
6271
6272 /**
6273 * A specialized version of `baseIsEqualDeep` for objects with support for
6274 * partial deep comparisons.
6275 *
6276 * @private
6277 * @param {Object} object The object to compare.
6278 * @param {Object} other The other object to compare.
6279 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6280 * @param {Function} customizer The function to customize comparisons.
6281 * @param {Function} equalFunc The function to determine equivalents of values.
6282 * @param {Object} stack Tracks traversed `object` and `other` objects.
6283 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6284 */
6285 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6286 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
6287 objProps = getAllKeys(object),
6288 objLength = objProps.length,
6289 othProps = getAllKeys(other),
6290 othLength = othProps.length;
6291
6292 if (objLength != othLength && !isPartial) {
6293 return false;
6294 }
6295 var index = objLength;
6296 while (index--) {
6297 var key = objProps[index];
6298 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
6299 return false;
6300 }
6301 }
6302 // Assume cyclic values are equal.
6303 var stacked = stack.get(object);
6304 if (stacked && stack.get(other)) {
6305 return stacked == other;
6306 }
6307 var result = true;
6308 stack.set(object, other);
6309 stack.set(other, object);
6310
6311 var skipCtor = isPartial;
6312 while (++index < objLength) {
6313 key = objProps[index];
6314 var objValue = object[key],
6315 othValue = other[key];
6316
6317 if (customizer) {
6318 var compared = isPartial
6319 ? customizer(othValue, objValue, key, other, object, stack)
6320 : customizer(objValue, othValue, key, object, other, stack);
6321 }
6322 // Recursively compare objects (susceptible to call stack limits).
6323 if (!(compared === undefined
6324 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
6325 : compared
6326 )) {
6327 result = false;
6328 break;
6329 }
6330 skipCtor || (skipCtor = key == 'constructor');
6331 }
6332 if (result && !skipCtor) {
6333 var objCtor = object.constructor,
6334 othCtor = other.constructor;
6335
6336 // Non `Object` object instances with different constructors are not equal.
6337 if (objCtor != othCtor &&
6338 ('constructor' in object && 'constructor' in other) &&
6339 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
6340 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
6341 result = false;
6342 }
6343 }
6344 stack['delete'](object);
6345 stack['delete'](other);
6346 return result;
6347 }
6348
6349 /**
6350 * A specialized version of `baseRest` which flattens the rest array.
6351 *
6352 * @private
6353 * @param {Function} func The function to apply a rest parameter to.
6354 * @returns {Function} Returns the new function.
6355 */
6356 function flatRest(func) {
6357 return setToString(overRest(func, undefined, flatten), func + '');
6358 }
6359
6360 /**
6361 * Creates an array of own enumerable property names and symbols of `object`.
6362 *
6363 * @private
6364 * @param {Object} object The object to query.
6365 * @returns {Array} Returns the array of property names and symbols.
6366 */
6367 function getAllKeys(object) {
6368 return baseGetAllKeys(object, keys, getSymbols);
6369 }
6370
6371 /**
6372 * Creates an array of own and inherited enumerable property names and
6373 * symbols of `object`.
6374 *
6375 * @private
6376 * @param {Object} object The object to query.
6377 * @returns {Array} Returns the array of property names and symbols.
6378 */
6379 function getAllKeysIn(object) {
6380 return baseGetAllKeys(object, keysIn, getSymbolsIn);
6381 }
6382
6383 /**
6384 * Gets metadata for `func`.
6385 *
6386 * @private
6387 * @param {Function} func The function to query.
6388 * @returns {*} Returns the metadata for `func`.
6389 */
6390 var getData = !metaMap ? noop : function(func) {
6391 return metaMap.get(func);
6392 };
6393
6394 /**
6395 * Gets the name of `func`.
6396 *
6397 * @private
6398 * @param {Function} func The function to query.
6399 * @returns {string} Returns the function name.
6400 */
6401 function getFuncName(func) {
6402 var result = (func.name + ''),
6403 array = realNames[result],
6404 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
6405
6406 while (length--) {
6407 var data = array[length],
6408 otherFunc = data.func;
6409 if (otherFunc == null || otherFunc == func) {
6410 return data.name;
6411 }
6412 }
6413 return result;
6414 }
6415
6416 /**
6417 * Gets the argument placeholder value for `func`.
6418 *
6419 * @private
6420 * @param {Function} func The function to inspect.
6421 * @returns {*} Returns the placeholder value.
6422 */
6423 function getHolder(func) {
6424 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
6425 return object.placeholder;
6426 }
6427
6428 /**
6429 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
6430 * this function returns the custom method, otherwise it returns `baseIteratee`.
6431 * If arguments are provided, the chosen function is invoked with them and
6432 * its result is returned.
6433 *
6434 * @private
6435 * @param {*} [value] The value to convert to an iteratee.
6436 * @param {number} [arity] The arity of the created iteratee.
6437 * @returns {Function} Returns the chosen function or its result.
6438 */
6439 function getIteratee() {
6440 var result = lodash.iteratee || iteratee;
6441 result = result === iteratee ? baseIteratee : result;
6442 return arguments.length ? result(arguments[0], arguments[1]) : result;
6443 }
6444
6445 /**
6446 * Gets the data for `map`.
6447 *
6448 * @private
6449 * @param {Object} map The map to query.
6450 * @param {string} key The reference key.
6451 * @returns {*} Returns the map data.
6452 */
6453 function getMapData(map, key) {
6454 var data = map.__data__;
6455 return isKeyable(key)
6456 ? data[typeof key == 'string' ? 'string' : 'hash']
6457 : data.map;
6458 }
6459
6460 /**
6461 * Gets the property names, values, and compare flags of `object`.
6462 *
6463 * @private
6464 * @param {Object} object The object to query.
6465 * @returns {Array} Returns the match data of `object`.
6466 */
6467 function getMatchData(object) {
6468 var result = keys(object),
6469 length = result.length;
6470
6471 while (length--) {
6472 var key = result[length],
6473 value = object[key];
6474
6475 result[length] = [key, value, isStrictComparable(value)];
6476 }
6477 return result;
6478 }
6479
6480 /**
6481 * Gets the native function at `key` of `object`.
6482 *
6483 * @private
6484 * @param {Object} object The object to query.
6485 * @param {string} key The key of the method to get.
6486 * @returns {*} Returns the function if it's native, else `undefined`.
6487 */
6488 function getNative(object, key) {
6489 var value = getValue(object, key);
6490 return baseIsNative(value) ? value : undefined;
6491 }
6492
6493 /**
6494 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
6495 *
6496 * @private
6497 * @param {*} value The value to query.
6498 * @returns {string} Returns the raw `toStringTag`.
6499 */
6500 function getRawTag(value) {
6501 var isOwn = hasOwnProperty.call(value, symToStringTag),
6502 tag = value[symToStringTag];
6503
6504 try {
6505 value[symToStringTag] = undefined;
6506 var unmasked = true;
6507 } catch (e) {}
6508
6509 var result = nativeObjectToString.call(value);
6510 if (unmasked) {
6511 if (isOwn) {
6512 value[symToStringTag] = tag;
6513 } else {
6514 delete value[symToStringTag];
6515 }
6516 }
6517 return result;
6518 }
6519
6520 /**
6521 * Creates an array of the own enumerable symbols of `object`.
6522 *
6523 * @private
6524 * @param {Object} object The object to query.
6525 * @returns {Array} Returns the array of symbols.
6526 */
6527 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
6528 if (object == null) {
6529 return [];
6530 }
6531 object = Object(object);
6532 return arrayFilter(nativeGetSymbols(object), function(symbol) {
6533 return propertyIsEnumerable.call(object, symbol);
6534 });
6535 };
6536
6537 /**
6538 * Creates an array of the own and inherited enumerable symbols of `object`.
6539 *
6540 * @private
6541 * @param {Object} object The object to query.
6542 * @returns {Array} Returns the array of symbols.
6543 */
6544 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
6545 var result = [];
6546 while (object) {
6547 arrayPush(result, getSymbols(object));
6548 object = getPrototype(object);
6549 }
6550 return result;
6551 };
6552
6553 /**
6554 * Gets the `toStringTag` of `value`.
6555 *
6556 * @private
6557 * @param {*} value The value to query.
6558 * @returns {string} Returns the `toStringTag`.
6559 */
6560 var getTag = baseGetTag;
6561
6562 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
6563 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
6564 (Map && getTag(new Map) != mapTag) ||
6565 (Promise && getTag(Promise.resolve()) != promiseTag) ||
6566 (Set && getTag(new Set) != setTag) ||
6567 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
6568 getTag = function(value) {
6569 var result = baseGetTag(value),
6570 Ctor = result == objectTag ? value.constructor : undefined,
6571 ctorString = Ctor ? toSource(Ctor) : '';
6572
6573 if (ctorString) {
6574 switch (ctorString) {
6575 case dataViewCtorString: return dataViewTag;
6576 case mapCtorString: return mapTag;
6577 case promiseCtorString: return promiseTag;
6578 case setCtorString: return setTag;
6579 case weakMapCtorString: return weakMapTag;
6580 }
6581 }
6582 return result;
6583 };
6584 }
6585
6586 /**
6587 * Gets the view, applying any `transforms` to the `start` and `end` positions.
6588 *
6589 * @private
6590 * @param {number} start The start of the view.
6591 * @param {number} end The end of the view.
6592 * @param {Array} transforms The transformations to apply to the view.
6593 * @returns {Object} Returns an object containing the `start` and `end`
6594 * positions of the view.
6595 */
6596 function getView(start, end, transforms) {
6597 var index = -1,
6598 length = transforms.length;
6599
6600 while (++index < length) {
6601 var data = transforms[index],
6602 size = data.size;
6603
6604 switch (data.type) {
6605 case 'drop': start += size; break;
6606 case 'dropRight': end -= size; break;
6607 case 'take': end = nativeMin(end, start + size); break;
6608 case 'takeRight': start = nativeMax(start, end - size); break;
6609 }
6610 }
6611 return { 'start': start, 'end': end };
6612 }
6613
6614 /**
6615 * Extracts wrapper details from the `source` body comment.
6616 *
6617 * @private
6618 * @param {string} source The source to inspect.
6619 * @returns {Array} Returns the wrapper details.
6620 */
6621 function getWrapDetails(source) {
6622 var match = source.match(reWrapDetails);
6623 return match ? match[1].split(reSplitDetails) : [];
6624 }
6625
6626 /**
6627 * Checks if `path` exists on `object`.
6628 *
6629 * @private
6630 * @param {Object} object The object to query.
6631 * @param {Array|string} path The path to check.
6632 * @param {Function} hasFunc The function to check properties.
6633 * @returns {boolean} Returns `true` if `path` exists, else `false`.
6634 */
6635 function hasPath(object, path, hasFunc) {
6636 path = castPath(path, object);
6637
6638 var index = -1,
6639 length = path.length,
6640 result = false;
6641
6642 while (++index < length) {
6643 var key = toKey(path[index]);
6644 if (!(result = object != null && hasFunc(object, key))) {
6645 break;
6646 }
6647 object = object[key];
6648 }
6649 if (result || ++index != length) {
6650 return result;
6651 }
6652 length = object == null ? 0 : object.length;
6653 return !!length && isLength(length) && isIndex(key, length) &&
6654 (isArray(object) || isArguments(object));
6655 }
6656
6657 /**
6658 * Initializes an array clone.
6659 *
6660 * @private
6661 * @param {Array} array The array to clone.
6662 * @returns {Array} Returns the initialized clone.
6663 */
6664 function initCloneArray(array) {
6665 var length = array.length,
6666 result = new array.constructor(length);
6667
6668 // Add properties assigned by `RegExp#exec`.
6669 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
6670 result.index = array.index;
6671 result.input = array.input;
6672 }
6673 return result;
6674 }
6675
6676 /**
6677 * Initializes an object clone.
6678 *
6679 * @private
6680 * @param {Object} object The object to clone.
6681 * @returns {Object} Returns the initialized clone.
6682 */
6683 function initCloneObject(object) {
6684 return (typeof object.constructor == 'function' && !isPrototype(object))
6685 ? baseCreate(getPrototype(object))
6686 : {};
6687 }
6688
6689 /**
6690 * Initializes an object clone based on its `toStringTag`.
6691 *
6692 * **Note:** This function only supports cloning values with tags of
6693 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
6694 *
6695 * @private
6696 * @param {Object} object The object to clone.
6697 * @param {string} tag The `toStringTag` of the object to clone.
6698 * @param {boolean} [isDeep] Specify a deep clone.
6699 * @returns {Object} Returns the initialized clone.
6700 */
6701 function initCloneByTag(object, tag, isDeep) {
6702 var Ctor = object.constructor;
6703 switch (tag) {
6704 case arrayBufferTag:
6705 return cloneArrayBuffer(object);
6706
6707 case boolTag:
6708 case dateTag:
6709 return new Ctor(+object);
6710
6711 case dataViewTag:
6712 return cloneDataView(object, isDeep);
6713
6714 case float32Tag: case float64Tag:
6715 case int8Tag: case int16Tag: case int32Tag:
6716 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
6717 return cloneTypedArray(object, isDeep);
6718
6719 case mapTag:
6720 return new Ctor;
6721
6722 case numberTag:
6723 case stringTag:
6724 return new Ctor(object);
6725
6726 case regexpTag:
6727 return cloneRegExp(object);
6728
6729 case setTag:
6730 return new Ctor;
6731
6732 case symbolTag:
6733 return cloneSymbol(object);
6734 }
6735 }
6736
6737 /**
6738 * Inserts wrapper `details` in a comment at the top of the `source` body.
6739 *
6740 * @private
6741 * @param {string} source The source to modify.
6742 * @returns {Array} details The details to insert.
6743 * @returns {string} Returns the modified source.
6744 */
6745 function insertWrapDetails(source, details) {
6746 var length = details.length;
6747 if (!length) {
6748 return source;
6749 }
6750 var lastIndex = length - 1;
6751 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
6752 details = details.join(length > 2 ? ', ' : ' ');
6753 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
6754 }
6755
6756 /**
6757 * Checks if `value` is a flattenable `arguments` object or array.
6758 *
6759 * @private
6760 * @param {*} value The value to check.
6761 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
6762 */
6763 function isFlattenable(value) {
6764 return isArray(value) || isArguments(value) ||
6765 !!(spreadableSymbol && value && value[spreadableSymbol]);
6766 }
6767
6768 /**
6769 * Checks if `value` is a valid array-like index.
6770 *
6771 * @private
6772 * @param {*} value The value to check.
6773 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
6774 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
6775 */
6776 function isIndex(value, length) {
6777 var type = typeof value;
6778 length = length == null ? MAX_SAFE_INTEGER : length;
6779
6780 return !!length &&
6781 (type == 'number' ||
6782 (type != 'symbol' && reIsUint.test(value))) &&
6783 (value > -1 && value % 1 == 0 && value < length);
6784 }
6785
6786 /**
6787 * Checks if the given arguments are from an iteratee call.
6788 *
6789 * @private
6790 * @param {*} value The potential iteratee value argument.
6791 * @param {*} index The potential iteratee index or key argument.
6792 * @param {*} object The potential iteratee object argument.
6793 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
6794 * else `false`.
6795 */
6796 function isIterateeCall(value, index, object) {
6797 if (!isObject(object)) {
6798 return false;
6799 }
6800 var type = typeof index;
6801 if (type == 'number'
6802 ? (isArrayLike(object) && isIndex(index, object.length))
6803 : (type == 'string' && index in object)
6804 ) {
6805 return eq(object[index], value);
6806 }
6807 return false;
6808 }
6809
6810 /**
6811 * Checks if `value` is a property name and not a property path.
6812 *
6813 * @private
6814 * @param {*} value The value to check.
6815 * @param {Object} [object] The object to query keys on.
6816 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
6817 */
6818 function isKey(value, object) {
6819 if (isArray(value)) {
6820 return false;
6821 }
6822 var type = typeof value;
6823 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
6824 value == null || isSymbol(value)) {
6825 return true;
6826 }
6827 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
6828 (object != null && value in Object(object));
6829 }
6830
6831 /**
6832 * Checks if `value` is suitable for use as unique object key.
6833 *
6834 * @private
6835 * @param {*} value The value to check.
6836 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
6837 */
6838 function isKeyable(value) {
6839 var type = typeof value;
6840 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
6841 ? (value !== '__proto__')
6842 : (value === null);
6843 }
6844
6845 /**
6846 * Checks if `func` has a lazy counterpart.
6847 *
6848 * @private
6849 * @param {Function} func The function to check.
6850 * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
6851 * else `false`.
6852 */
6853 function isLaziable(func) {
6854 var funcName = getFuncName(func),
6855 other = lodash[funcName];
6856
6857 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
6858 return false;
6859 }
6860 if (func === other) {
6861 return true;
6862 }
6863 var data = getData(other);
6864 return !!data && func === data[0];
6865 }
6866
6867 /**
6868 * Checks if `func` has its source masked.
6869 *
6870 * @private
6871 * @param {Function} func The function to check.
6872 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
6873 */
6874 function isMasked(func) {
6875 return !!maskSrcKey && (maskSrcKey in func);
6876 }
6877
6878 /**
6879 * Checks if `func` is capable of being masked.
6880 *
6881 * @private
6882 * @param {*} value The value to check.
6883 * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
6884 */
6885 var isMaskable = coreJsData ? isFunction : stubFalse;
6886
6887 /**
6888 * Checks if `value` is likely a prototype object.
6889 *
6890 * @private
6891 * @param {*} value The value to check.
6892 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
6893 */
6894 function isPrototype(value) {
6895 var Ctor = value && value.constructor,
6896 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
6897
6898 return value === proto;
6899 }
6900
6901 /**
6902 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
6903 *
6904 * @private
6905 * @param {*} value The value to check.
6906 * @returns {boolean} Returns `true` if `value` if suitable for strict
6907 * equality comparisons, else `false`.
6908 */
6909 function isStrictComparable(value) {
6910 return value === value && !isObject(value);
6911 }
6912
6913 /**
6914 * A specialized version of `matchesProperty` for source values suitable
6915 * for strict equality comparisons, i.e. `===`.
6916 *
6917 * @private
6918 * @param {string} key The key of the property to get.
6919 * @param {*} srcValue The value to match.
6920 * @returns {Function} Returns the new spec function.
6921 */
6922 function matchesStrictComparable(key, srcValue) {
6923 return function(object) {
6924 if (object == null) {
6925 return false;
6926 }
6927 return object[key] === srcValue &&
6928 (srcValue !== undefined || (key in Object(object)));
6929 };
6930 }
6931
6932 /**
6933 * A specialized version of `_.memoize` which clears the memoized function's
6934 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
6935 *
6936 * @private
6937 * @param {Function} func The function to have its output memoized.
6938 * @returns {Function} Returns the new memoized function.
6939 */
6940 function memoizeCapped(func) {
6941 var result = memoize(func, function(key) {
6942 if (cache.size === MAX_MEMOIZE_SIZE) {
6943 cache.clear();
6944 }
6945 return key;
6946 });
6947
6948 var cache = result.cache;
6949 return result;
6950 }
6951
6952 /**
6953 * Merges the function metadata of `source` into `data`.
6954 *
6955 * Merging metadata reduces the number of wrappers used to invoke a function.
6956 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
6957 * may be applied regardless of execution order. Methods like `_.ary` and
6958 * `_.rearg` modify function arguments, making the order in which they are
6959 * executed important, preventing the merging of metadata. However, we make
6960 * an exception for a safe combined case where curried functions have `_.ary`
6961 * and or `_.rearg` applied.
6962 *
6963 * @private
6964 * @param {Array} data The destination metadata.
6965 * @param {Array} source The source metadata.
6966 * @returns {Array} Returns `data`.
6967 */
6968 function mergeData(data, source) {
6969 var bitmask = data[1],
6970 srcBitmask = source[1],
6971 newBitmask = bitmask | srcBitmask,
6972 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
6973
6974 var isCombo =
6975 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
6976 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
6977 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
6978
6979 // Exit early if metadata can't be merged.
6980 if (!(isCommon || isCombo)) {
6981 return data;
6982 }
6983 // Use source `thisArg` if available.
6984 if (srcBitmask & WRAP_BIND_FLAG) {
6985 data[2] = source[2];
6986 // Set when currying a bound function.
6987 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
6988 }
6989 // Compose partial arguments.
6990 var value = source[3];
6991 if (value) {
6992 var partials = data[3];
6993 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
6994 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
6995 }
6996 // Compose partial right arguments.
6997 value = source[5];
6998 if (value) {
6999 partials = data[5];
7000 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
7001 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
7002 }
7003 // Use source `argPos` if available.
7004 value = source[7];
7005 if (value) {
7006 data[7] = value;
7007 }
7008 // Use source `ary` if it's smaller.
7009 if (srcBitmask & WRAP_ARY_FLAG) {
7010 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
7011 }
7012 // Use source `arity` if one is not provided.
7013 if (data[9] == null) {
7014 data[9] = source[9];
7015 }
7016 // Use source `func` and merge bitmasks.
7017 data[0] = source[0];
7018 data[1] = newBitmask;
7019
7020 return data;
7021 }
7022
7023 /**
7024 * This function is like
7025 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
7026 * except that it includes inherited enumerable properties.
7027 *
7028 * @private
7029 * @param {Object} object The object to query.
7030 * @returns {Array} Returns the array of property names.
7031 */
7032 function nativeKeysIn(object) {
7033 var result = [];
7034 if (object != null) {
7035 for (var key in Object(object)) {
7036 result.push(key);
7037 }
7038 }
7039 return result;
7040 }
7041
7042 /**
7043 * Converts `value` to a string using `Object.prototype.toString`.
7044 *
7045 * @private
7046 * @param {*} value The value to convert.
7047 * @returns {string} Returns the converted string.
7048 */
7049 function objectToString(value) {
7050 return nativeObjectToString.call(value);
7051 }
7052
7053 /**
7054 * A specialized version of `baseRest` which transforms the rest array.
7055 *
7056 * @private
7057 * @param {Function} func The function to apply a rest parameter to.
7058 * @param {number} [start=func.length-1] The start position of the rest parameter.
7059 * @param {Function} transform The rest array transform.
7060 * @returns {Function} Returns the new function.
7061 */
7062 function overRest(func, start, transform) {
7063 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
7064 return function() {
7065 var args = arguments,
7066 index = -1,
7067 length = nativeMax(args.length - start, 0),
7068 array = Array(length);
7069
7070 while (++index < length) {
7071 array[index] = args[start + index];
7072 }
7073 index = -1;
7074 var otherArgs = Array(start + 1);
7075 while (++index < start) {
7076 otherArgs[index] = args[index];
7077 }
7078 otherArgs[start] = transform(array);
7079 return apply(func, this, otherArgs);
7080 };
7081 }
7082
7083 /**
7084 * Gets the parent value at `path` of `object`.
7085 *
7086 * @private
7087 * @param {Object} object The object to query.
7088 * @param {Array} path The path to get the parent value of.
7089 * @returns {*} Returns the parent value.
7090 */
7091 function parent(object, path) {
7092 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
7093 }
7094
7095 /**
7096 * Reorder `array` according to the specified indexes where the element at
7097 * the first index is assigned as the first element, the element at
7098 * the second index is assigned as the second element, and so on.
7099 *
7100 * @private
7101 * @param {Array} array The array to reorder.
7102 * @param {Array} indexes The arranged array indexes.
7103 * @returns {Array} Returns `array`.
7104 */
7105 function reorder(array, indexes) {
7106 var arrLength = array.length,
7107 length = nativeMin(indexes.length, arrLength),
7108 oldArray = copyArray(array);
7109
7110 while (length--) {
7111 var index = indexes[length];
7112 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
7113 }
7114 return array;
7115 }
7116
7117 /**
7118 * Gets the value at `key`, unless `key` is "__proto__".
7119 *
7120 * @private
7121 * @param {Object} object The object to query.
7122 * @param {string} key The key of the property to get.
7123 * @returns {*} Returns the property value.
7124 */
7125 function safeGet(object, key) {
7126 if (key == '__proto__') {
7127 return;
7128 }
7129
7130 return object[key];
7131 }
7132
7133 /**
7134 * Sets metadata for `func`.
7135 *
7136 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
7137 * period of time, it will trip its breaker and transition to an identity
7138 * function to avoid garbage collection pauses in V8. See
7139 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
7140 * for more details.
7141 *
7142 * @private
7143 * @param {Function} func The function to associate metadata with.
7144 * @param {*} data The metadata.
7145 * @returns {Function} Returns `func`.
7146 */
7147 var setData = shortOut(baseSetData);
7148
7149 /**
7150 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
7151 *
7152 * @private
7153 * @param {Function} func The function to delay.
7154 * @param {number} wait The number of milliseconds to delay invocation.
7155 * @returns {number|Object} Returns the timer id or timeout object.
7156 */
7157 var setTimeout = ctxSetTimeout || function(func, wait) {
7158 return root.setTimeout(func, wait);
7159 };
7160
7161 /**
7162 * Sets the `toString` method of `func` to return `string`.
7163 *
7164 * @private
7165 * @param {Function} func The function to modify.
7166 * @param {Function} string The `toString` result.
7167 * @returns {Function} Returns `func`.
7168 */
7169 var setToString = shortOut(baseSetToString);
7170
7171 /**
7172 * Sets the `toString` method of `wrapper` to mimic the source of `reference`
7173 * with wrapper details in a comment at the top of the source body.
7174 *
7175 * @private
7176 * @param {Function} wrapper The function to modify.
7177 * @param {Function} reference The reference function.
7178 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
7179 * @returns {Function} Returns `wrapper`.
7180 */
7181 function setWrapToString(wrapper, reference, bitmask) {
7182 var source = (reference + '');
7183 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
7184 }
7185
7186 /**
7187 * Creates a function that'll short out and invoke `identity` instead
7188 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
7189 * milliseconds.
7190 *
7191 * @private
7192 * @param {Function} func The function to restrict.
7193 * @returns {Function} Returns the new shortable function.
7194 */
7195 function shortOut(func) {
7196 var count = 0,
7197 lastCalled = 0;
7198
7199 return function() {
7200 var stamp = nativeNow(),
7201 remaining = HOT_SPAN - (stamp - lastCalled);
7202
7203 lastCalled = stamp;
7204 if (remaining > 0) {
7205 if (++count >= HOT_COUNT) {
7206 return arguments[0];
7207 }
7208 } else {
7209 count = 0;
7210 }
7211 return func.apply(undefined, arguments);
7212 };
7213 }
7214
7215 /**
7216 * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
7217 *
7218 * @private
7219 * @param {Array} array The array to shuffle.
7220 * @param {number} [size=array.length] The size of `array`.
7221 * @returns {Array} Returns `array`.
7222 */
7223 function shuffleSelf(array, size) {
7224 var index = -1,
7225 length = array.length,
7226 lastIndex = length - 1;
7227
7228 size = size === undefined ? length : size;
7229 while (++index < size) {
7230 var rand = baseRandom(index, lastIndex),
7231 value = array[rand];
7232
7233 array[rand] = array[index];
7234 array[index] = value;
7235 }
7236 array.length = size;
7237 return array;
7238 }
7239
7240 /**
7241 * Converts `string` to a property path array.
7242 *
7243 * @private
7244 * @param {string} string The string to convert.
7245 * @returns {Array} Returns the property path array.
7246 */
7247 var stringToPath = memoizeCapped(function(string) {
7248 var result = [];
7249 if (string.charCodeAt(0) === 46 /* . */) {
7250 result.push('');
7251 }
7252 string.replace(rePropName, function(match, number, quote, subString) {
7253 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
7254 });
7255 return result;
7256 });
7257
7258 /**
7259 * Converts `value` to a string key if it's not a string or symbol.
7260 *
7261 * @private
7262 * @param {*} value The value to inspect.
7263 * @returns {string|symbol} Returns the key.
7264 */
7265 function toKey(value) {
7266 if (typeof value == 'string' || isSymbol(value)) {
7267 return value;
7268 }
7269 var result = (value + '');
7270 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
7271 }
7272
7273 /**
7274 * Converts `func` to its source code.
7275 *
7276 * @private
7277 * @param {Function} func The function to convert.
7278 * @returns {string} Returns the source code.
7279 */
7280 function toSource(func) {
7281 if (func != null) {
7282 try {
7283 return funcToString.call(func);
7284 } catch (e) {}
7285 try {
7286 return (func + '');
7287 } catch (e) {}
7288 }
7289 return '';
7290 }
7291
7292 /**
7293 * Updates wrapper `details` based on `bitmask` flags.
7294 *
7295 * @private
7296 * @returns {Array} details The details to modify.
7297 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
7298 * @returns {Array} Returns `details`.
7299 */
7300 function updateWrapDetails(details, bitmask) {
7301 arrayEach(wrapFlags, function(pair) {
7302 var value = '_.' + pair[0];
7303 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
7304 details.push(value);
7305 }
7306 });
7307 return details.sort();
7308 }
7309
7310 /**
7311 * Creates a clone of `wrapper`.
7312 *
7313 * @private
7314 * @param {Object} wrapper The wrapper to clone.
7315 * @returns {Object} Returns the cloned wrapper.
7316 */
7317 function wrapperClone(wrapper) {
7318 if (wrapper instanceof LazyWrapper) {
7319 return wrapper.clone();
7320 }
7321 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
7322 result.__actions__ = copyArray(wrapper.__actions__);
7323 result.__index__ = wrapper.__index__;
7324 result.__values__ = wrapper.__values__;
7325 return result;
7326 }
7327
7328 /*------------------------------------------------------------------------*/
7329
7330 /**
7331 * Creates an array of elements split into groups the length of `size`.
7332 * If `array` can't be split evenly, the final chunk will be the remaining
7333 * elements.
7334 *
7335 * @static
7336 * @memberOf _
7337 * @since 3.0.0
7338 * @category Array
7339 * @param {Array} array The array to process.
7340 * @param {number} [size=1] The length of each chunk
7341 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
7342 * @returns {Array} Returns the new array of chunks.
7343 * @example
7344 *
7345 * _.chunk(['a', 'b', 'c', 'd'], 2);
7346 * // => [['a', 'b'], ['c', 'd']]
7347 *
7348 * _.chunk(['a', 'b', 'c', 'd'], 3);
7349 * // => [['a', 'b', 'c'], ['d']]
7350 */
7351 function chunk(array, size, guard) {
7352 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
7353 size = 1;
7354 } else {
7355 size = nativeMax(toInteger(size), 0);
7356 }
7357 var length = array == null ? 0 : array.length;
7358 if (!length || size < 1) {
7359 return [];
7360 }
7361 var index = 0,
7362 resIndex = 0,
7363 result = Array(nativeCeil(length / size));
7364
7365 while (index < length) {
7366 result[resIndex++] = baseSlice(array, index, (index += size));
7367 }
7368 return result;
7369 }
7370
7371 /**
7372 * Creates an array with all falsey values removed. The values `false`, `null`,
7373 * `0`, `""`, `undefined`, and `NaN` are falsey.
7374 *
7375 * @static
7376 * @memberOf _
7377 * @since 0.1.0
7378 * @category Array
7379 * @param {Array} array The array to compact.
7380 * @returns {Array} Returns the new array of filtered values.
7381 * @example
7382 *
7383 * _.compact([0, 1, false, 2, '', 3]);
7384 * // => [1, 2, 3]
7385 */
7386 function compact(array) {
7387 var index = -1,
7388 length = array == null ? 0 : array.length,
7389 resIndex = 0,
7390 result = [];
7391
7392 while (++index < length) {
7393 var value = array[index];
7394 if (value) {
7395 result[resIndex++] = value;
7396 }
7397 }
7398 return result;
7399 }
7400
7401 /**
7402 * Creates a new array concatenating `array` with any additional arrays
7403 * and/or values.
7404 *
7405 * @static
7406 * @memberOf _
7407 * @since 4.0.0
7408 * @category Array
7409 * @param {Array} array The array to concatenate.
7410 * @param {...*} [values] The values to concatenate.
7411 * @returns {Array} Returns the new concatenated array.
7412 * @example
7413 *
7414 * var array = [1];
7415 * var other = _.concat(array, 2, [3], [[4]]);
7416 *
7417 * console.log(other);
7418 * // => [1, 2, 3, [4]]
7419 *
7420 * console.log(array);
7421 * // => [1]
7422 */
7423 function concat() {
7424 var length = arguments.length;
7425 if (!length) {
7426 return [];
7427 }
7428 var args = Array(length - 1),
7429 array = arguments[0],
7430 index = length;
7431
7432 while (index--) {
7433 args[index - 1] = arguments[index];
7434 }
7435 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
7436 }
7437
7438 /**
7439 * Creates an array of `array` values not included in the other given arrays
7440 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
7441 * for equality comparisons. The order and references of result values are
7442 * determined by the first array.
7443 *
7444 * **Note:** Unlike `_.pullAll`, this method returns a new array.
7445 *
7446 * @static
7447 * @memberOf _
7448 * @since 0.1.0
7449 * @category Array
7450 * @param {Array} array The array to inspect.
7451 * @param {...Array} [values] The values to exclude.
7452 * @returns {Array} Returns the new array of filtered values.
7453 * @see _.without, _.xor
7454 * @example
7455 *
7456 * _.difference([2, 1], [2, 3]);
7457 * // => [1]
7458 */
7459 var difference = baseRest(function(array, values) {
7460 return isArrayLikeObject(array)
7461 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
7462 : [];
7463 });
7464
7465 /**
7466 * This method is like `_.difference` except that it accepts `iteratee` which
7467 * is invoked for each element of `array` and `values` to generate the criterion
7468 * by which they're compared. The order and references of result values are
7469 * determined by the first array. The iteratee is invoked with one argument:
7470 * (value).
7471 *
7472 * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
7473 *
7474 * @static
7475 * @memberOf _
7476 * @since 4.0.0
7477 * @category Array
7478 * @param {Array} array The array to inspect.
7479 * @param {...Array} [values] The values to exclude.
7480 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
7481 * @returns {Array} Returns the new array of filtered values.
7482 * @example
7483 *
7484 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
7485 * // => [1.2]
7486 *
7487 * // The `_.property` iteratee shorthand.
7488 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
7489 * // => [{ 'x': 2 }]
7490 */
7491 var differenceBy = baseRest(function(array, values) {
7492 var iteratee = last(values);
7493 if (isArrayLikeObject(iteratee)) {
7494 iteratee = undefined;
7495 }
7496 return isArrayLikeObject(array)
7497 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
7498 : [];
7499 });
7500
7501 /**
7502 * This method is like `_.difference` except that it accepts `comparator`
7503 * which is invoked to compare elements of `array` to `values`. The order and
7504 * references of result values are determined by the first array. The comparator
7505 * is invoked with two arguments: (arrVal, othVal).
7506 *
7507 * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
7508 *
7509 * @static
7510 * @memberOf _
7511 * @since 4.0.0
7512 * @category Array
7513 * @param {Array} array The array to inspect.
7514 * @param {...Array} [values] The values to exclude.
7515 * @param {Function} [comparator] The comparator invoked per element.
7516 * @returns {Array} Returns the new array of filtered values.
7517 * @example
7518 *
7519 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
7520 *
7521 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
7522 * // => [{ 'x': 2, 'y': 1 }]
7523 */
7524 var differenceWith = baseRest(function(array, values) {
7525 var comparator = last(values);
7526 if (isArrayLikeObject(comparator)) {
7527 comparator = undefined;
7528 }
7529 return isArrayLikeObject(array)
7530 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
7531 : [];
7532 });
7533
7534 /**
7535 * Creates a slice of `array` with `n` elements dropped from the beginning.
7536 *
7537 * @static
7538 * @memberOf _
7539 * @since 0.5.0
7540 * @category Array
7541 * @param {Array} array The array to query.
7542 * @param {number} [n=1] The number of elements to drop.
7543 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
7544 * @returns {Array} Returns the slice of `array`.
7545 * @example
7546 *
7547 * _.drop([1, 2, 3]);
7548 * // => [2, 3]
7549 *
7550 * _.drop([1, 2, 3], 2);
7551 * // => [3]
7552 *
7553 * _.drop([1, 2, 3], 5);
7554 * // => []
7555 *
7556 * _.drop([1, 2, 3], 0);
7557 * // => [1, 2, 3]
7558 */
7559 function drop(array, n, guard) {
7560 var length = array == null ? 0 : array.length;
7561 if (!length) {
7562 return [];
7563 }
7564 n = (guard || n === undefined) ? 1 : toInteger(n);
7565 return baseSlice(array, n < 0 ? 0 : n, length);
7566 }
7567
7568 /**
7569 * Creates a slice of `array` with `n` elements dropped from the end.
7570 *
7571 * @static
7572 * @memberOf _
7573 * @since 3.0.0
7574 * @category Array
7575 * @param {Array} array The array to query.
7576 * @param {number} [n=1] The number of elements to drop.
7577 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
7578 * @returns {Array} Returns the slice of `array`.
7579 * @example
7580 *
7581 * _.dropRight([1, 2, 3]);
7582 * // => [1, 2]
7583 *
7584 * _.dropRight([1, 2, 3], 2);
7585 * // => [1]
7586 *
7587 * _.dropRight([1, 2, 3], 5);
7588 * // => []
7589 *
7590 * _.dropRight([1, 2, 3], 0);
7591 * // => [1, 2, 3]
7592 */
7593 function dropRight(array, n, guard) {
7594 var length = array == null ? 0 : array.length;
7595 if (!length) {
7596 return [];
7597 }
7598 n = (guard || n === undefined) ? 1 : toInteger(n);
7599 n = length - n;
7600 return baseSlice(array, 0, n < 0 ? 0 : n);
7601 }
7602
7603 /**
7604 * Creates a slice of `array` excluding elements dropped from the end.
7605 * Elements are dropped until `predicate` returns falsey. The predicate is
7606 * invoked with three arguments: (value, index, array).
7607 *
7608 * @static
7609 * @memberOf _
7610 * @since 3.0.0
7611 * @category Array
7612 * @param {Array} array The array to query.
7613 * @param {Function} [predicate=_.identity] The function invoked per iteration.
7614 * @returns {Array} Returns the slice of `array`.
7615 * @example
7616 *
7617 * var users = [
7618 * { 'user': 'barney', 'active': true },
7619 * { 'user': 'fred', 'active': false },
7620 * { 'user': 'pebbles', 'active': false }
7621 * ];
7622 *
7623 * _.dropRightWhile(users, function(o) { return !o.active; });
7624 * // => objects for ['barney']
7625 *
7626 * // The `_.matches` iteratee shorthand.
7627 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
7628 * // => objects for ['barney', 'fred']
7629 *
7630 * // The `_.matchesProperty` iteratee shorthand.
7631 * _.dropRightWhile(users, ['active', false]);
7632 * // => objects for ['barney']
7633 *
7634 * // The `_.property` iteratee shorthand.
7635 * _.dropRightWhile(users, 'active');
7636 * // => objects for ['barney', 'fred', 'pebbles']
7637 */
7638 function dropRightWhile(array, predicate) {
7639 return (array && array.length)
7640 ? baseWhile(array, getIteratee(predicate, 3), true, true)
7641 : [];
7642 }
7643
7644 /**
7645 * Creates a slice of `array` excluding elements dropped from the beginning.
7646 * Elements are dropped until `predicate` returns falsey. The predicate is
7647 * invoked with three arguments: (value, index, array).
7648 *
7649 * @static
7650 * @memberOf _
7651 * @since 3.0.0
7652 * @category Array
7653 * @param {Array} array The array to query.
7654 * @param {Function} [predicate=_.identity] The function invoked per iteration.
7655 * @returns {Array} Returns the slice of `array`.
7656 * @example
7657 *
7658 * var users = [
7659 * { 'user': 'barney', 'active': false },
7660 * { 'user': 'fred', 'active': false },
7661 * { 'user': 'pebbles', 'active': true }
7662 * ];
7663 *
7664 * _.dropWhile(users, function(o) { return !o.active; });
7665 * // => objects for ['pebbles']
7666 *
7667 * // The `_.matches` iteratee shorthand.
7668 * _.dropWhile(users, { 'user': 'barney', 'active': false });
7669 * // => objects for ['fred', 'pebbles']
7670 *
7671 * // The `_.matchesProperty` iteratee shorthand.
7672 * _.dropWhile(users, ['active', false]);
7673 * // => objects for ['pebbles']
7674 *
7675 * // The `_.property` iteratee shorthand.
7676 * _.dropWhile(users, 'active');
7677 * // => objects for ['barney', 'fred', 'pebbles']
7678 */
7679 function dropWhile(array, predicate) {
7680 return (array && array.length)
7681 ? baseWhile(array, getIteratee(predicate, 3), true)
7682 : [];
7683 }
7684
7685 /**
7686 * Fills elements of `array` with `value` from `start` up to, but not
7687 * including, `end`.
7688 *
7689 * **Note:** This method mutates `array`.
7690 *
7691 * @static
7692 * @memberOf _
7693 * @since 3.2.0
7694 * @category Array
7695 * @param {Array} array The array to fill.
7696 * @param {*} value The value to fill `array` with.
7697 * @param {number} [start=0] The start position.
7698 * @param {number} [end=array.length] The end position.
7699 * @returns {Array} Returns `array`.
7700 * @example
7701 *
7702 * var array = [1, 2, 3];
7703 *
7704 * _.fill(array, 'a');
7705 * console.log(array);
7706 * // => ['a', 'a', 'a']
7707 *
7708 * _.fill(Array(3), 2);
7709 * // => [2, 2, 2]
7710 *
7711 * _.fill([4, 6, 8, 10], '*', 1, 3);
7712 * // => [4, '*', '*', 10]
7713 */
7714 function fill(array, value, start, end) {
7715 var length = array == null ? 0 : array.length;
7716 if (!length) {
7717 return [];
7718 }
7719 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
7720 start = 0;
7721 end = length;
7722 }
7723 return baseFill(array, value, start, end);
7724 }
7725
7726 /**
7727 * This method is like `_.find` except that it returns the index of the first
7728 * element `predicate` returns truthy for instead of the element itself.
7729 *
7730 * @static
7731 * @memberOf _
7732 * @since 1.1.0
7733 * @category Array
7734 * @param {Array} array The array to inspect.
7735 * @param {Function} [predicate=_.identity] The function invoked per iteration.
7736 * @param {number} [fromIndex=0] The index to search from.
7737 * @returns {number} Returns the index of the found element, else `-1`.
7738 * @example
7739 *
7740 * var users = [
7741 * { 'user': 'barney', 'active': false },
7742 * { 'user': 'fred', 'active': false },
7743 * { 'user': 'pebbles', 'active': true }
7744 * ];
7745 *
7746 * _.findIndex(users, function(o) { return o.user == 'barney'; });
7747 * // => 0
7748 *
7749 * // The `_.matches` iteratee shorthand.
7750 * _.findIndex(users, { 'user': 'fred', 'active': false });
7751 * // => 1
7752 *
7753 * // The `_.matchesProperty` iteratee shorthand.
7754 * _.findIndex(users, ['active', false]);
7755 * // => 0
7756 *
7757 * // The `_.property` iteratee shorthand.
7758 * _.findIndex(users, 'active');
7759 * // => 2
7760 */
7761 function findIndex(array, predicate, fromIndex) {
7762 var length = array == null ? 0 : array.length;
7763 if (!length) {
7764 return -1;
7765 }
7766 var index = fromIndex == null ? 0 : toInteger(fromIndex);
7767 if (index < 0) {
7768 index = nativeMax(length + index, 0);
7769 }
7770 return baseFindIndex(array, getIteratee(predicate, 3), index);
7771 }
7772
7773 /**
7774 * This method is like `_.findIndex` except that it iterates over elements
7775 * of `collection` from right to left.
7776 *
7777 * @static
7778 * @memberOf _
7779 * @since 2.0.0
7780 * @category Array
7781 * @param {Array} array The array to inspect.
7782 * @param {Function} [predicate=_.identity] The function invoked per iteration.
7783 * @param {number} [fromIndex=array.length-1] The index to search from.
7784 * @returns {number} Returns the index of the found element, else `-1`.
7785 * @example
7786 *
7787 * var users = [
7788 * { 'user': 'barney', 'active': true },
7789 * { 'user': 'fred', 'active': false },
7790 * { 'user': 'pebbles', 'active': false }
7791 * ];
7792 *
7793 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
7794 * // => 2
7795 *
7796 * // The `_.matches` iteratee shorthand.
7797 * _.findLastIndex(users, { 'user': 'barney', 'active': true });
7798 * // => 0
7799 *
7800 * // The `_.matchesProperty` iteratee shorthand.
7801 * _.findLastIndex(users, ['active', false]);
7802 * // => 2
7803 *
7804 * // The `_.property` iteratee shorthand.
7805 * _.findLastIndex(users, 'active');
7806 * // => 0
7807 */
7808 function findLastIndex(array, predicate, fromIndex) {
7809 var length = array == null ? 0 : array.length;
7810 if (!length) {
7811 return -1;
7812 }
7813 var index = length - 1;
7814 if (fromIndex !== undefined) {
7815 index = toInteger(fromIndex);
7816 index = fromIndex < 0
7817 ? nativeMax(length + index, 0)
7818 : nativeMin(index, length - 1);
7819 }
7820 return baseFindIndex(array, getIteratee(predicate, 3), index, true);
7821 }
7822
7823 /**
7824 * Flattens `array` a single level deep.
7825 *
7826 * @static
7827 * @memberOf _
7828 * @since 0.1.0
7829 * @category Array
7830 * @param {Array} array The array to flatten.
7831 * @returns {Array} Returns the new flattened array.
7832 * @example
7833 *
7834 * _.flatten([1, [2, [3, [4]], 5]]);
7835 * // => [1, 2, [3, [4]], 5]
7836 */
7837 function flatten(array) {
7838 var length = array == null ? 0 : array.length;
7839 return length ? baseFlatten(array, 1) : [];
7840 }
7841
7842 /**
7843 * Recursively flattens `array`.
7844 *
7845 * @static
7846 * @memberOf _
7847 * @since 3.0.0
7848 * @category Array
7849 * @param {Array} array The array to flatten.
7850 * @returns {Array} Returns the new flattened array.
7851 * @example
7852 *
7853 * _.flattenDeep([1, [2, [3, [4]], 5]]);
7854 * // => [1, 2, 3, 4, 5]
7855 */
7856 function flattenDeep(array) {
7857 var length = array == null ? 0 : array.length;
7858 return length ? baseFlatten(array, INFINITY) : [];
7859 }
7860
7861 /**
7862 * Recursively flatten `array` up to `depth` times.
7863 *
7864 * @static
7865 * @memberOf _
7866 * @since 4.4.0
7867 * @category Array
7868 * @param {Array} array The array to flatten.
7869 * @param {number} [depth=1] The maximum recursion depth.
7870 * @returns {Array} Returns the new flattened array.
7871 * @example
7872 *
7873 * var array = [1, [2, [3, [4]], 5]];
7874 *
7875 * _.flattenDepth(array, 1);
7876 * // => [1, 2, [3, [4]], 5]
7877 *
7878 * _.flattenDepth(array, 2);
7879 * // => [1, 2, 3, [4], 5]
7880 */
7881 function flattenDepth(array, depth) {
7882 var length = array == null ? 0 : array.length;
7883 if (!length) {
7884 return [];
7885 }
7886 depth = depth === undefined ? 1 : toInteger(depth);
7887 return baseFlatten(array, depth);
7888 }
7889
7890 /**
7891 * The inverse of `_.toPairs`; this method returns an object composed
7892 * from key-value `pairs`.
7893 *
7894 * @static
7895 * @memberOf _
7896 * @since 4.0.0
7897 * @category Array
7898 * @param {Array} pairs The key-value pairs.
7899 * @returns {Object} Returns the new object.
7900 * @example
7901 *
7902 * _.fromPairs([['a', 1], ['b', 2]]);
7903 * // => { 'a': 1, 'b': 2 }
7904 */
7905 function fromPairs(pairs) {
7906 var index = -1,
7907 length = pairs == null ? 0 : pairs.length,
7908 result = {};
7909
7910 while (++index < length) {
7911 var pair = pairs[index];
7912 result[pair[0]] = pair[1];
7913 }
7914 return result;
7915 }
7916
7917 /**
7918 * Gets the first element of `array`.
7919 *
7920 * @static
7921 * @memberOf _
7922 * @since 0.1.0
7923 * @alias first
7924 * @category Array
7925 * @param {Array} array The array to query.
7926 * @returns {*} Returns the first element of `array`.
7927 * @example
7928 *
7929 * _.head([1, 2, 3]);
7930 * // => 1
7931 *
7932 * _.head([]);
7933 * // => undefined
7934 */
7935 function head(array) {
7936 return (array && array.length) ? array[0] : undefined;
7937 }
7938
7939 /**
7940 * Gets the index at which the first occurrence of `value` is found in `array`
7941 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
7942 * for equality comparisons. If `fromIndex` is negative, it's used as the
7943 * offset from the end of `array`.
7944 *
7945 * @static
7946 * @memberOf _
7947 * @since 0.1.0
7948 * @category Array
7949 * @param {Array} array The array to inspect.
7950 * @param {*} value The value to search for.
7951 * @param {number} [fromIndex=0] The index to search from.
7952 * @returns {number} Returns the index of the matched value, else `-1`.
7953 * @example
7954 *
7955 * _.indexOf([1, 2, 1, 2], 2);
7956 * // => 1
7957 *
7958 * // Search from the `fromIndex`.
7959 * _.indexOf([1, 2, 1, 2], 2, 2);
7960 * // => 3
7961 */
7962 function indexOf(array, value, fromIndex) {
7963 var length = array == null ? 0 : array.length;
7964 if (!length) {
7965 return -1;
7966 }
7967 var index = fromIndex == null ? 0 : toInteger(fromIndex);
7968 if (index < 0) {
7969 index = nativeMax(length + index, 0);
7970 }
7971 return baseIndexOf(array, value, index);
7972 }
7973
7974 /**
7975 * Gets all but the last element of `array`.
7976 *
7977 * @static
7978 * @memberOf _
7979 * @since 0.1.0
7980 * @category Array
7981 * @param {Array} array The array to query.
7982 * @returns {Array} Returns the slice of `array`.
7983 * @example
7984 *
7985 * _.initial([1, 2, 3]);
7986 * // => [1, 2]
7987 */
7988 function initial(array) {
7989 var length = array == null ? 0 : array.length;
7990 return length ? baseSlice(array, 0, -1) : [];
7991 }
7992
7993 /**
7994 * Creates an array of unique values that are included in all given arrays
7995 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
7996 * for equality comparisons. The order and references of result values are
7997 * determined by the first array.
7998 *
7999 * @static
8000 * @memberOf _
8001 * @since 0.1.0
8002 * @category Array
8003 * @param {...Array} [arrays] The arrays to inspect.
8004 * @returns {Array} Returns the new array of intersecting values.
8005 * @example
8006 *
8007 * _.intersection([2, 1], [2, 3]);
8008 * // => [2]
8009 */
8010 var intersection = baseRest(function(arrays) {
8011 var mapped = arrayMap(arrays, castArrayLikeObject);
8012 return (mapped.length && mapped[0] === arrays[0])
8013 ? baseIntersection(mapped)
8014 : [];
8015 });
8016
8017 /**
8018 * This method is like `_.intersection` except that it accepts `iteratee`
8019 * which is invoked for each element of each `arrays` to generate the criterion
8020 * by which they're compared. The order and references of result values are
8021 * determined by the first array. The iteratee is invoked with one argument:
8022 * (value).
8023 *
8024 * @static
8025 * @memberOf _
8026 * @since 4.0.0
8027 * @category Array
8028 * @param {...Array} [arrays] The arrays to inspect.
8029 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8030 * @returns {Array} Returns the new array of intersecting values.
8031 * @example
8032 *
8033 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
8034 * // => [2.1]
8035 *
8036 * // The `_.property` iteratee shorthand.
8037 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
8038 * // => [{ 'x': 1 }]
8039 */
8040 var intersectionBy = baseRest(function(arrays) {
8041 var iteratee = last(arrays),
8042 mapped = arrayMap(arrays, castArrayLikeObject);
8043
8044 if (iteratee === last(mapped)) {
8045 iteratee = undefined;
8046 } else {
8047 mapped.pop();
8048 }
8049 return (mapped.length && mapped[0] === arrays[0])
8050 ? baseIntersection(mapped, getIteratee(iteratee, 2))
8051 : [];
8052 });
8053
8054 /**
8055 * This method is like `_.intersection` except that it accepts `comparator`
8056 * which is invoked to compare elements of `arrays`. The order and references
8057 * of result values are determined by the first array. The comparator is
8058 * invoked with two arguments: (arrVal, othVal).
8059 *
8060 * @static
8061 * @memberOf _
8062 * @since 4.0.0
8063 * @category Array
8064 * @param {...Array} [arrays] The arrays to inspect.
8065 * @param {Function} [comparator] The comparator invoked per element.
8066 * @returns {Array} Returns the new array of intersecting values.
8067 * @example
8068 *
8069 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
8070 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
8071 *
8072 * _.intersectionWith(objects, others, _.isEqual);
8073 * // => [{ 'x': 1, 'y': 2 }]
8074 */
8075 var intersectionWith = baseRest(function(arrays) {
8076 var comparator = last(arrays),
8077 mapped = arrayMap(arrays, castArrayLikeObject);
8078
8079 comparator = typeof comparator == 'function' ? comparator : undefined;
8080 if (comparator) {
8081 mapped.pop();
8082 }
8083 return (mapped.length && mapped[0] === arrays[0])
8084 ? baseIntersection(mapped, undefined, comparator)
8085 : [];
8086 });
8087
8088 /**
8089 * Converts all elements in `array` into a string separated by `separator`.
8090 *
8091 * @static
8092 * @memberOf _
8093 * @since 4.0.0
8094 * @category Array
8095 * @param {Array} array The array to convert.
8096 * @param {string} [separator=','] The element separator.
8097 * @returns {string} Returns the joined string.
8098 * @example
8099 *
8100 * _.join(['a', 'b', 'c'], '~');
8101 * // => 'a~b~c'
8102 */
8103 function join(array, separator) {
8104 return array == null ? '' : nativeJoin.call(array, separator);
8105 }
8106
8107 /**
8108 * Gets the last element of `array`.
8109 *
8110 * @static
8111 * @memberOf _
8112 * @since 0.1.0
8113 * @category Array
8114 * @param {Array} array The array to query.
8115 * @returns {*} Returns the last element of `array`.
8116 * @example
8117 *
8118 * _.last([1, 2, 3]);
8119 * // => 3
8120 */
8121 function last(array) {
8122 var length = array == null ? 0 : array.length;
8123 return length ? array[length - 1] : undefined;
8124 }
8125
8126 /**
8127 * This method is like `_.indexOf` except that it iterates over elements of
8128 * `array` from right to left.
8129 *
8130 * @static
8131 * @memberOf _
8132 * @since 0.1.0
8133 * @category Array
8134 * @param {Array} array The array to inspect.
8135 * @param {*} value The value to search for.
8136 * @param {number} [fromIndex=array.length-1] The index to search from.
8137 * @returns {number} Returns the index of the matched value, else `-1`.
8138 * @example
8139 *
8140 * _.lastIndexOf([1, 2, 1, 2], 2);
8141 * // => 3
8142 *
8143 * // Search from the `fromIndex`.
8144 * _.lastIndexOf([1, 2, 1, 2], 2, 2);
8145 * // => 1
8146 */
8147 function lastIndexOf(array, value, fromIndex) {
8148 var length = array == null ? 0 : array.length;
8149 if (!length) {
8150 return -1;
8151 }
8152 var index = length;
8153 if (fromIndex !== undefined) {
8154 index = toInteger(fromIndex);
8155 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
8156 }
8157 return value === value
8158 ? strictLastIndexOf(array, value, index)
8159 : baseFindIndex(array, baseIsNaN, index, true);
8160 }
8161
8162 /**
8163 * Gets the element at index `n` of `array`. If `n` is negative, the nth
8164 * element from the end is returned.
8165 *
8166 * @static
8167 * @memberOf _
8168 * @since 4.11.0
8169 * @category Array
8170 * @param {Array} array The array to query.
8171 * @param {number} [n=0] The index of the element to return.
8172 * @returns {*} Returns the nth element of `array`.
8173 * @example
8174 *
8175 * var array = ['a', 'b', 'c', 'd'];
8176 *
8177 * _.nth(array, 1);
8178 * // => 'b'
8179 *
8180 * _.nth(array, -2);
8181 * // => 'c';
8182 */
8183 function nth(array, n) {
8184 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
8185 }
8186
8187 /**
8188 * Removes all given values from `array` using
8189 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8190 * for equality comparisons.
8191 *
8192 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
8193 * to remove elements from an array by predicate.
8194 *
8195 * @static
8196 * @memberOf _
8197 * @since 2.0.0
8198 * @category Array
8199 * @param {Array} array The array to modify.
8200 * @param {...*} [values] The values to remove.
8201 * @returns {Array} Returns `array`.
8202 * @example
8203 *
8204 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
8205 *
8206 * _.pull(array, 'a', 'c');
8207 * console.log(array);
8208 * // => ['b', 'b']
8209 */
8210 var pull = baseRest(pullAll);
8211
8212 /**
8213 * This method is like `_.pull` except that it accepts an array of values to remove.
8214 *
8215 * **Note:** Unlike `_.difference`, this method mutates `array`.
8216 *
8217 * @static
8218 * @memberOf _
8219 * @since 4.0.0
8220 * @category Array
8221 * @param {Array} array The array to modify.
8222 * @param {Array} values The values to remove.
8223 * @returns {Array} Returns `array`.
8224 * @example
8225 *
8226 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
8227 *
8228 * _.pullAll(array, ['a', 'c']);
8229 * console.log(array);
8230 * // => ['b', 'b']
8231 */
8232 function pullAll(array, values) {
8233 return (array && array.length && values && values.length)
8234 ? basePullAll(array, values)
8235 : array;
8236 }
8237
8238 /**
8239 * This method is like `_.pullAll` except that it accepts `iteratee` which is
8240 * invoked for each element of `array` and `values` to generate the criterion
8241 * by which they're compared. The iteratee is invoked with one argument: (value).
8242 *
8243 * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
8244 *
8245 * @static
8246 * @memberOf _
8247 * @since 4.0.0
8248 * @category Array
8249 * @param {Array} array The array to modify.
8250 * @param {Array} values The values to remove.
8251 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8252 * @returns {Array} Returns `array`.
8253 * @example
8254 *
8255 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
8256 *
8257 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
8258 * console.log(array);
8259 * // => [{ 'x': 2 }]
8260 */
8261 function pullAllBy(array, values, iteratee) {
8262 return (array && array.length && values && values.length)
8263 ? basePullAll(array, values, getIteratee(iteratee, 2))
8264 : array;
8265 }
8266
8267 /**
8268 * This method is like `_.pullAll` except that it accepts `comparator` which
8269 * is invoked to compare elements of `array` to `values`. The comparator is
8270 * invoked with two arguments: (arrVal, othVal).
8271 *
8272 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
8273 *
8274 * @static
8275 * @memberOf _
8276 * @since 4.6.0
8277 * @category Array
8278 * @param {Array} array The array to modify.
8279 * @param {Array} values The values to remove.
8280 * @param {Function} [comparator] The comparator invoked per element.
8281 * @returns {Array} Returns `array`.
8282 * @example
8283 *
8284 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
8285 *
8286 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
8287 * console.log(array);
8288 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
8289 */
8290 function pullAllWith(array, values, comparator) {
8291 return (array && array.length && values && values.length)
8292 ? basePullAll(array, values, undefined, comparator)
8293 : array;
8294 }
8295
8296 /**
8297 * Removes elements from `array` corresponding to `indexes` and returns an
8298 * array of removed elements.
8299 *
8300 * **Note:** Unlike `_.at`, this method mutates `array`.
8301 *
8302 * @static
8303 * @memberOf _
8304 * @since 3.0.0
8305 * @category Array
8306 * @param {Array} array The array to modify.
8307 * @param {...(number|number[])} [indexes] The indexes of elements to remove.
8308 * @returns {Array} Returns the new array of removed elements.
8309 * @example
8310 *
8311 * var array = ['a', 'b', 'c', 'd'];
8312 * var pulled = _.pullAt(array, [1, 3]);
8313 *
8314 * console.log(array);
8315 * // => ['a', 'c']
8316 *
8317 * console.log(pulled);
8318 * // => ['b', 'd']
8319 */
8320 var pullAt = flatRest(function(array, indexes) {
8321 var length = array == null ? 0 : array.length,
8322 result = baseAt(array, indexes);
8323
8324 basePullAt(array, arrayMap(indexes, function(index) {
8325 return isIndex(index, length) ? +index : index;
8326 }).sort(compareAscending));
8327
8328 return result;
8329 });
8330
8331 /**
8332 * Removes all elements from `array` that `predicate` returns truthy for
8333 * and returns an array of the removed elements. The predicate is invoked
8334 * with three arguments: (value, index, array).
8335 *
8336 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
8337 * to pull elements from an array by value.
8338 *
8339 * @static
8340 * @memberOf _
8341 * @since 2.0.0
8342 * @category Array
8343 * @param {Array} array The array to modify.
8344 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8345 * @returns {Array} Returns the new array of removed elements.
8346 * @example
8347 *
8348 * var array = [1, 2, 3, 4];
8349 * var evens = _.remove(array, function(n) {
8350 * return n % 2 == 0;
8351 * });
8352 *
8353 * console.log(array);
8354 * // => [1, 3]
8355 *
8356 * console.log(evens);
8357 * // => [2, 4]
8358 */
8359 function remove(array, predicate) {
8360 var result = [];
8361 if (!(array && array.length)) {
8362 return result;
8363 }
8364 var index = -1,
8365 indexes = [],
8366 length = array.length;
8367
8368 predicate = getIteratee(predicate, 3);
8369 while (++index < length) {
8370 var value = array[index];
8371 if (predicate(value, index, array)) {
8372 result.push(value);
8373 indexes.push(index);
8374 }
8375 }
8376 basePullAt(array, indexes);
8377 return result;
8378 }
8379
8380 /**
8381 * Reverses `array` so that the first element becomes the last, the second
8382 * element becomes the second to last, and so on.
8383 *
8384 * **Note:** This method mutates `array` and is based on
8385 * [`Array#reverse`](https://mdn.io/Array/reverse).
8386 *
8387 * @static
8388 * @memberOf _
8389 * @since 4.0.0
8390 * @category Array
8391 * @param {Array} array The array to modify.
8392 * @returns {Array} Returns `array`.
8393 * @example
8394 *
8395 * var array = [1, 2, 3];
8396 *
8397 * _.reverse(array);
8398 * // => [3, 2, 1]
8399 *
8400 * console.log(array);
8401 * // => [3, 2, 1]
8402 */
8403 function reverse(array) {
8404 return array == null ? array : nativeReverse.call(array);
8405 }
8406
8407 /**
8408 * Creates a slice of `array` from `start` up to, but not including, `end`.
8409 *
8410 * **Note:** This method is used instead of
8411 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
8412 * returned.
8413 *
8414 * @static
8415 * @memberOf _
8416 * @since 3.0.0
8417 * @category Array
8418 * @param {Array} array The array to slice.
8419 * @param {number} [start=0] The start position.
8420 * @param {number} [end=array.length] The end position.
8421 * @returns {Array} Returns the slice of `array`.
8422 */
8423 function slice(array, start, end) {
8424 var length = array == null ? 0 : array.length;
8425 if (!length) {
8426 return [];
8427 }
8428 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
8429 start = 0;
8430 end = length;
8431 }
8432 else {
8433 start = start == null ? 0 : toInteger(start);
8434 end = end === undefined ? length : toInteger(end);
8435 }
8436 return baseSlice(array, start, end);
8437 }
8438
8439 /**
8440 * Uses a binary search to determine the lowest index at which `value`
8441 * should be inserted into `array` in order to maintain its sort order.
8442 *
8443 * @static
8444 * @memberOf _
8445 * @since 0.1.0
8446 * @category Array
8447 * @param {Array} array The sorted array to inspect.
8448 * @param {*} value The value to evaluate.
8449 * @returns {number} Returns the index at which `value` should be inserted
8450 * into `array`.
8451 * @example
8452 *
8453 * _.sortedIndex([30, 50], 40);
8454 * // => 1
8455 */
8456 function sortedIndex(array, value) {
8457 return baseSortedIndex(array, value);
8458 }
8459
8460 /**
8461 * This method is like `_.sortedIndex` except that it accepts `iteratee`
8462 * which is invoked for `value` and each element of `array` to compute their
8463 * sort ranking. The iteratee is invoked with one argument: (value).
8464 *
8465 * @static
8466 * @memberOf _
8467 * @since 4.0.0
8468 * @category Array
8469 * @param {Array} array The sorted array to inspect.
8470 * @param {*} value The value to evaluate.
8471 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8472 * @returns {number} Returns the index at which `value` should be inserted
8473 * into `array`.
8474 * @example
8475 *
8476 * var objects = [{ 'x': 4 }, { 'x': 5 }];
8477 *
8478 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
8479 * // => 0
8480 *
8481 * // The `_.property` iteratee shorthand.
8482 * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
8483 * // => 0
8484 */
8485 function sortedIndexBy(array, value, iteratee) {
8486 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
8487 }
8488
8489 /**
8490 * This method is like `_.indexOf` except that it performs a binary
8491 * search on a sorted `array`.
8492 *
8493 * @static
8494 * @memberOf _
8495 * @since 4.0.0
8496 * @category Array
8497 * @param {Array} array The array to inspect.
8498 * @param {*} value The value to search for.
8499 * @returns {number} Returns the index of the matched value, else `-1`.
8500 * @example
8501 *
8502 * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
8503 * // => 1
8504 */
8505 function sortedIndexOf(array, value) {
8506 var length = array == null ? 0 : array.length;
8507 if (length) {
8508 var index = baseSortedIndex(array, value);
8509 if (index < length && eq(array[index], value)) {
8510 return index;
8511 }
8512 }
8513 return -1;
8514 }
8515
8516 /**
8517 * This method is like `_.sortedIndex` except that it returns the highest
8518 * index at which `value` should be inserted into `array` in order to
8519 * maintain its sort order.
8520 *
8521 * @static
8522 * @memberOf _
8523 * @since 3.0.0
8524 * @category Array
8525 * @param {Array} array The sorted array to inspect.
8526 * @param {*} value The value to evaluate.
8527 * @returns {number} Returns the index at which `value` should be inserted
8528 * into `array`.
8529 * @example
8530 *
8531 * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
8532 * // => 4
8533 */
8534 function sortedLastIndex(array, value) {
8535 return baseSortedIndex(array, value, true);
8536 }
8537
8538 /**
8539 * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
8540 * which is invoked for `value` and each element of `array` to compute their
8541 * sort ranking. The iteratee is invoked with one argument: (value).
8542 *
8543 * @static
8544 * @memberOf _
8545 * @since 4.0.0
8546 * @category Array
8547 * @param {Array} array The sorted array to inspect.
8548 * @param {*} value The value to evaluate.
8549 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8550 * @returns {number} Returns the index at which `value` should be inserted
8551 * into `array`.
8552 * @example
8553 *
8554 * var objects = [{ 'x': 4 }, { 'x': 5 }];
8555 *
8556 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
8557 * // => 1
8558 *
8559 * // The `_.property` iteratee shorthand.
8560 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
8561 * // => 1
8562 */
8563 function sortedLastIndexBy(array, value, iteratee) {
8564 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
8565 }
8566
8567 /**
8568 * This method is like `_.lastIndexOf` except that it performs a binary
8569 * search on a sorted `array`.
8570 *
8571 * @static
8572 * @memberOf _
8573 * @since 4.0.0
8574 * @category Array
8575 * @param {Array} array The array to inspect.
8576 * @param {*} value The value to search for.
8577 * @returns {number} Returns the index of the matched value, else `-1`.
8578 * @example
8579 *
8580 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
8581 * // => 3
8582 */
8583 function sortedLastIndexOf(array, value) {
8584 var length = array == null ? 0 : array.length;
8585 if (length) {
8586 var index = baseSortedIndex(array, value, true) - 1;
8587 if (eq(array[index], value)) {
8588 return index;
8589 }
8590 }
8591 return -1;
8592 }
8593
8594 /**
8595 * This method is like `_.uniq` except that it's designed and optimized
8596 * for sorted arrays.
8597 *
8598 * @static
8599 * @memberOf _
8600 * @since 4.0.0
8601 * @category Array
8602 * @param {Array} array The array to inspect.
8603 * @returns {Array} Returns the new duplicate free array.
8604 * @example
8605 *
8606 * _.sortedUniq([1, 1, 2]);
8607 * // => [1, 2]
8608 */
8609 function sortedUniq(array) {
8610 return (array && array.length)
8611 ? baseSortedUniq(array)
8612 : [];
8613 }
8614
8615 /**
8616 * This method is like `_.uniqBy` except that it's designed and optimized
8617 * for sorted arrays.
8618 *
8619 * @static
8620 * @memberOf _
8621 * @since 4.0.0
8622 * @category Array
8623 * @param {Array} array The array to inspect.
8624 * @param {Function} [iteratee] The iteratee invoked per element.
8625 * @returns {Array} Returns the new duplicate free array.
8626 * @example
8627 *
8628 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
8629 * // => [1.1, 2.3]
8630 */
8631 function sortedUniqBy(array, iteratee) {
8632 return (array && array.length)
8633 ? baseSortedUniq(array, getIteratee(iteratee, 2))
8634 : [];
8635 }
8636
8637 /**
8638 * Gets all but the first element of `array`.
8639 *
8640 * @static
8641 * @memberOf _
8642 * @since 4.0.0
8643 * @category Array
8644 * @param {Array} array The array to query.
8645 * @returns {Array} Returns the slice of `array`.
8646 * @example
8647 *
8648 * _.tail([1, 2, 3]);
8649 * // => [2, 3]
8650 */
8651 function tail(array) {
8652 var length = array == null ? 0 : array.length;
8653 return length ? baseSlice(array, 1, length) : [];
8654 }
8655
8656 /**
8657 * Creates a slice of `array` with `n` elements taken from the beginning.
8658 *
8659 * @static
8660 * @memberOf _
8661 * @since 0.1.0
8662 * @category Array
8663 * @param {Array} array The array to query.
8664 * @param {number} [n=1] The number of elements to take.
8665 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8666 * @returns {Array} Returns the slice of `array`.
8667 * @example
8668 *
8669 * _.take([1, 2, 3]);
8670 * // => [1]
8671 *
8672 * _.take([1, 2, 3], 2);
8673 * // => [1, 2]
8674 *
8675 * _.take([1, 2, 3], 5);
8676 * // => [1, 2, 3]
8677 *
8678 * _.take([1, 2, 3], 0);
8679 * // => []
8680 */
8681 function take(array, n, guard) {
8682 if (!(array && array.length)) {
8683 return [];
8684 }
8685 n = (guard || n === undefined) ? 1 : toInteger(n);
8686 return baseSlice(array, 0, n < 0 ? 0 : n);
8687 }
8688
8689 /**
8690 * Creates a slice of `array` with `n` elements taken from the end.
8691 *
8692 * @static
8693 * @memberOf _
8694 * @since 3.0.0
8695 * @category Array
8696 * @param {Array} array The array to query.
8697 * @param {number} [n=1] The number of elements to take.
8698 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8699 * @returns {Array} Returns the slice of `array`.
8700 * @example
8701 *
8702 * _.takeRight([1, 2, 3]);
8703 * // => [3]
8704 *
8705 * _.takeRight([1, 2, 3], 2);
8706 * // => [2, 3]
8707 *
8708 * _.takeRight([1, 2, 3], 5);
8709 * // => [1, 2, 3]
8710 *
8711 * _.takeRight([1, 2, 3], 0);
8712 * // => []
8713 */
8714 function takeRight(array, n, guard) {
8715 var length = array == null ? 0 : array.length;
8716 if (!length) {
8717 return [];
8718 }
8719 n = (guard || n === undefined) ? 1 : toInteger(n);
8720 n = length - n;
8721 return baseSlice(array, n < 0 ? 0 : n, length);
8722 }
8723
8724 /**
8725 * Creates a slice of `array` with elements taken from the end. Elements are
8726 * taken until `predicate` returns falsey. The predicate is invoked with
8727 * three arguments: (value, index, array).
8728 *
8729 * @static
8730 * @memberOf _
8731 * @since 3.0.0
8732 * @category Array
8733 * @param {Array} array The array to query.
8734 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8735 * @returns {Array} Returns the slice of `array`.
8736 * @example
8737 *
8738 * var users = [
8739 * { 'user': 'barney', 'active': true },
8740 * { 'user': 'fred', 'active': false },
8741 * { 'user': 'pebbles', 'active': false }
8742 * ];
8743 *
8744 * _.takeRightWhile(users, function(o) { return !o.active; });
8745 * // => objects for ['fred', 'pebbles']
8746 *
8747 * // The `_.matches` iteratee shorthand.
8748 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
8749 * // => objects for ['pebbles']
8750 *
8751 * // The `_.matchesProperty` iteratee shorthand.
8752 * _.takeRightWhile(users, ['active', false]);
8753 * // => objects for ['fred', 'pebbles']
8754 *
8755 * // The `_.property` iteratee shorthand.
8756 * _.takeRightWhile(users, 'active');
8757 * // => []
8758 */
8759 function takeRightWhile(array, predicate) {
8760 return (array && array.length)
8761 ? baseWhile(array, getIteratee(predicate, 3), false, true)
8762 : [];
8763 }
8764
8765 /**
8766 * Creates a slice of `array` with elements taken from the beginning. Elements
8767 * are taken until `predicate` returns falsey. The predicate is invoked with
8768 * three arguments: (value, index, array).
8769 *
8770 * @static
8771 * @memberOf _
8772 * @since 3.0.0
8773 * @category Array
8774 * @param {Array} array The array to query.
8775 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8776 * @returns {Array} Returns the slice of `array`.
8777 * @example
8778 *
8779 * var users = [
8780 * { 'user': 'barney', 'active': false },
8781 * { 'user': 'fred', 'active': false },
8782 * { 'user': 'pebbles', 'active': true }
8783 * ];
8784 *
8785 * _.takeWhile(users, function(o) { return !o.active; });
8786 * // => objects for ['barney', 'fred']
8787 *
8788 * // The `_.matches` iteratee shorthand.
8789 * _.takeWhile(users, { 'user': 'barney', 'active': false });
8790 * // => objects for ['barney']
8791 *
8792 * // The `_.matchesProperty` iteratee shorthand.
8793 * _.takeWhile(users, ['active', false]);
8794 * // => objects for ['barney', 'fred']
8795 *
8796 * // The `_.property` iteratee shorthand.
8797 * _.takeWhile(users, 'active');
8798 * // => []
8799 */
8800 function takeWhile(array, predicate) {
8801 return (array && array.length)
8802 ? baseWhile(array, getIteratee(predicate, 3))
8803 : [];
8804 }
8805
8806 /**
8807 * Creates an array of unique values, in order, from all given arrays using
8808 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8809 * for equality comparisons.
8810 *
8811 * @static
8812 * @memberOf _
8813 * @since 0.1.0
8814 * @category Array
8815 * @param {...Array} [arrays] The arrays to inspect.
8816 * @returns {Array} Returns the new array of combined values.
8817 * @example
8818 *
8819 * _.union([2], [1, 2]);
8820 * // => [2, 1]
8821 */
8822 var union = baseRest(function(arrays) {
8823 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
8824 });
8825
8826 /**
8827 * This method is like `_.union` except that it accepts `iteratee` which is
8828 * invoked for each element of each `arrays` to generate the criterion by
8829 * which uniqueness is computed. Result values are chosen from the first
8830 * array in which the value occurs. The iteratee is invoked with one argument:
8831 * (value).
8832 *
8833 * @static
8834 * @memberOf _
8835 * @since 4.0.0
8836 * @category Array
8837 * @param {...Array} [arrays] The arrays to inspect.
8838 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8839 * @returns {Array} Returns the new array of combined values.
8840 * @example
8841 *
8842 * _.unionBy([2.1], [1.2, 2.3], Math.floor);
8843 * // => [2.1, 1.2]
8844 *
8845 * // The `_.property` iteratee shorthand.
8846 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
8847 * // => [{ 'x': 1 }, { 'x': 2 }]
8848 */
8849 var unionBy = baseRest(function(arrays) {
8850 var iteratee = last(arrays);
8851 if (isArrayLikeObject(iteratee)) {
8852 iteratee = undefined;
8853 }
8854 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
8855 });
8856
8857 /**
8858 * This method is like `_.union` except that it accepts `comparator` which
8859 * is invoked to compare elements of `arrays`. Result values are chosen from
8860 * the first array in which the value occurs. The comparator is invoked
8861 * with two arguments: (arrVal, othVal).
8862 *
8863 * @static
8864 * @memberOf _
8865 * @since 4.0.0
8866 * @category Array
8867 * @param {...Array} [arrays] The arrays to inspect.
8868 * @param {Function} [comparator] The comparator invoked per element.
8869 * @returns {Array} Returns the new array of combined values.
8870 * @example
8871 *
8872 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
8873 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
8874 *
8875 * _.unionWith(objects, others, _.isEqual);
8876 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
8877 */
8878 var unionWith = baseRest(function(arrays) {
8879 var comparator = last(arrays);
8880 comparator = typeof comparator == 'function' ? comparator : undefined;
8881 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
8882 });
8883
8884 /**
8885 * Creates a duplicate-free version of an array, using
8886 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8887 * for equality comparisons, in which only the first occurrence of each element
8888 * is kept. The order of result values is determined by the order they occur
8889 * in the array.
8890 *
8891 * @static
8892 * @memberOf _
8893 * @since 0.1.0
8894 * @category Array
8895 * @param {Array} array The array to inspect.
8896 * @returns {Array} Returns the new duplicate free array.
8897 * @example
8898 *
8899 * _.uniq([2, 1, 2]);
8900 * // => [2, 1]
8901 */
8902 function uniq(array) {
8903 return (array && array.length) ? baseUniq(array) : [];
8904 }
8905
8906 /**
8907 * This method is like `_.uniq` except that it accepts `iteratee` which is
8908 * invoked for each element in `array` to generate the criterion by which
8909 * uniqueness is computed. The order of result values is determined by the
8910 * order they occur in the array. The iteratee is invoked with one argument:
8911 * (value).
8912 *
8913 * @static
8914 * @memberOf _
8915 * @since 4.0.0
8916 * @category Array
8917 * @param {Array} array The array to inspect.
8918 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8919 * @returns {Array} Returns the new duplicate free array.
8920 * @example
8921 *
8922 * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
8923 * // => [2.1, 1.2]
8924 *
8925 * // The `_.property` iteratee shorthand.
8926 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
8927 * // => [{ 'x': 1 }, { 'x': 2 }]
8928 */
8929 function uniqBy(array, iteratee) {
8930 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
8931 }
8932
8933 /**
8934 * This method is like `_.uniq` except that it accepts `comparator` which
8935 * is invoked to compare elements of `array`. The order of result values is
8936 * determined by the order they occur in the array.The comparator is invoked
8937 * with two arguments: (arrVal, othVal).
8938 *
8939 * @static
8940 * @memberOf _
8941 * @since 4.0.0
8942 * @category Array
8943 * @param {Array} array The array to inspect.
8944 * @param {Function} [comparator] The comparator invoked per element.
8945 * @returns {Array} Returns the new duplicate free array.
8946 * @example
8947 *
8948 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
8949 *
8950 * _.uniqWith(objects, _.isEqual);
8951 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
8952 */
8953 function uniqWith(array, comparator) {
8954 comparator = typeof comparator == 'function' ? comparator : undefined;
8955 return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
8956 }
8957
8958 /**
8959 * This method is like `_.zip` except that it accepts an array of grouped
8960 * elements and creates an array regrouping the elements to their pre-zip
8961 * configuration.
8962 *
8963 * @static
8964 * @memberOf _
8965 * @since 1.2.0
8966 * @category Array
8967 * @param {Array} array The array of grouped elements to process.
8968 * @returns {Array} Returns the new array of regrouped elements.
8969 * @example
8970 *
8971 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
8972 * // => [['a', 1, true], ['b', 2, false]]
8973 *
8974 * _.unzip(zipped);
8975 * // => [['a', 'b'], [1, 2], [true, false]]
8976 */
8977 function unzip(array) {
8978 if (!(array && array.length)) {
8979 return [];
8980 }
8981 var length = 0;
8982 array = arrayFilter(array, function(group) {
8983 if (isArrayLikeObject(group)) {
8984 length = nativeMax(group.length, length);
8985 return true;
8986 }
8987 });
8988 return baseTimes(length, function(index) {
8989 return arrayMap(array, baseProperty(index));
8990 });
8991 }
8992
8993 /**
8994 * This method is like `_.unzip` except that it accepts `iteratee` to specify
8995 * how regrouped values should be combined. The iteratee is invoked with the
8996 * elements of each group: (...group).
8997 *
8998 * @static
8999 * @memberOf _
9000 * @since 3.8.0
9001 * @category Array
9002 * @param {Array} array The array of grouped elements to process.
9003 * @param {Function} [iteratee=_.identity] The function to combine
9004 * regrouped values.
9005 * @returns {Array} Returns the new array of regrouped elements.
9006 * @example
9007 *
9008 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
9009 * // => [[1, 10, 100], [2, 20, 200]]
9010 *
9011 * _.unzipWith(zipped, _.add);
9012 * // => [3, 30, 300]
9013 */
9014 function unzipWith(array, iteratee) {
9015 if (!(array && array.length)) {
9016 return [];
9017 }
9018 var result = unzip(array);
9019 if (iteratee == null) {
9020 return result;
9021 }
9022 return arrayMap(result, function(group) {
9023 return apply(iteratee, undefined, group);
9024 });
9025 }
9026
9027 /**
9028 * Creates an array excluding all given values using
9029 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9030 * for equality comparisons.
9031 *
9032 * **Note:** Unlike `_.pull`, this method returns a new array.
9033 *
9034 * @static
9035 * @memberOf _
9036 * @since 0.1.0
9037 * @category Array
9038 * @param {Array} array The array to inspect.
9039 * @param {...*} [values] The values to exclude.
9040 * @returns {Array} Returns the new array of filtered values.
9041 * @see _.difference, _.xor
9042 * @example
9043 *
9044 * _.without([2, 1, 2, 3], 1, 2);
9045 * // => [3]
9046 */
9047 var without = baseRest(function(array, values) {
9048 return isArrayLikeObject(array)
9049 ? baseDifference(array, values)
9050 : [];
9051 });
9052
9053 /**
9054 * Creates an array of unique values that is the
9055 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
9056 * of the given arrays. The order of result values is determined by the order
9057 * they occur in the arrays.
9058 *
9059 * @static
9060 * @memberOf _
9061 * @since 2.4.0
9062 * @category Array
9063 * @param {...Array} [arrays] The arrays to inspect.
9064 * @returns {Array} Returns the new array of filtered values.
9065 * @see _.difference, _.without
9066 * @example
9067 *
9068 * _.xor([2, 1], [2, 3]);
9069 * // => [1, 3]
9070 */
9071 var xor = baseRest(function(arrays) {
9072 return baseXor(arrayFilter(arrays, isArrayLikeObject));
9073 });
9074
9075 /**
9076 * This method is like `_.xor` except that it accepts `iteratee` which is
9077 * invoked for each element of each `arrays` to generate the criterion by
9078 * which by which they're compared. The order of result values is determined
9079 * by the order they occur in the arrays. The iteratee is invoked with one
9080 * argument: (value).
9081 *
9082 * @static
9083 * @memberOf _
9084 * @since 4.0.0
9085 * @category Array
9086 * @param {...Array} [arrays] The arrays to inspect.
9087 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9088 * @returns {Array} Returns the new array of filtered values.
9089 * @example
9090 *
9091 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
9092 * // => [1.2, 3.4]
9093 *
9094 * // The `_.property` iteratee shorthand.
9095 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
9096 * // => [{ 'x': 2 }]
9097 */
9098 var xorBy = baseRest(function(arrays) {
9099 var iteratee = last(arrays);
9100 if (isArrayLikeObject(iteratee)) {
9101 iteratee = undefined;
9102 }
9103 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
9104 });
9105
9106 /**
9107 * This method is like `_.xor` except that it accepts `comparator` which is
9108 * invoked to compare elements of `arrays`. The order of result values is
9109 * determined by the order they occur in the arrays. The comparator is invoked
9110 * with two arguments: (arrVal, othVal).
9111 *
9112 * @static
9113 * @memberOf _
9114 * @since 4.0.0
9115 * @category Array
9116 * @param {...Array} [arrays] The arrays to inspect.
9117 * @param {Function} [comparator] The comparator invoked per element.
9118 * @returns {Array} Returns the new array of filtered values.
9119 * @example
9120 *
9121 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
9122 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
9123 *
9124 * _.xorWith(objects, others, _.isEqual);
9125 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
9126 */
9127 var xorWith = baseRest(function(arrays) {
9128 var comparator = last(arrays);
9129 comparator = typeof comparator == 'function' ? comparator : undefined;
9130 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
9131 });
9132
9133 /**
9134 * Creates an array of grouped elements, the first of which contains the
9135 * first elements of the given arrays, the second of which contains the
9136 * second elements of the given arrays, and so on.
9137 *
9138 * @static
9139 * @memberOf _
9140 * @since 0.1.0
9141 * @category Array
9142 * @param {...Array} [arrays] The arrays to process.
9143 * @returns {Array} Returns the new array of grouped elements.
9144 * @example
9145 *
9146 * _.zip(['a', 'b'], [1, 2], [true, false]);
9147 * // => [['a', 1, true], ['b', 2, false]]
9148 */
9149 var zip = baseRest(unzip);
9150
9151 /**
9152 * This method is like `_.fromPairs` except that it accepts two arrays,
9153 * one of property identifiers and one of corresponding values.
9154 *
9155 * @static
9156 * @memberOf _
9157 * @since 0.4.0
9158 * @category Array
9159 * @param {Array} [props=[]] The property identifiers.
9160 * @param {Array} [values=[]] The property values.
9161 * @returns {Object} Returns the new object.
9162 * @example
9163 *
9164 * _.zipObject(['a', 'b'], [1, 2]);
9165 * // => { 'a': 1, 'b': 2 }
9166 */
9167 function zipObject(props, values) {
9168 return baseZipObject(props || [], values || [], assignValue);
9169 }
9170
9171 /**
9172 * This method is like `_.zipObject` except that it supports property paths.
9173 *
9174 * @static
9175 * @memberOf _
9176 * @since 4.1.0
9177 * @category Array
9178 * @param {Array} [props=[]] The property identifiers.
9179 * @param {Array} [values=[]] The property values.
9180 * @returns {Object} Returns the new object.
9181 * @example
9182 *
9183 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
9184 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
9185 */
9186 function zipObjectDeep(props, values) {
9187 return baseZipObject(props || [], values || [], baseSet);
9188 }
9189
9190 /**
9191 * This method is like `_.zip` except that it accepts `iteratee` to specify
9192 * how grouped values should be combined. The iteratee is invoked with the
9193 * elements of each group: (...group).
9194 *
9195 * @static
9196 * @memberOf _
9197 * @since 3.8.0
9198 * @category Array
9199 * @param {...Array} [arrays] The arrays to process.
9200 * @param {Function} [iteratee=_.identity] The function to combine
9201 * grouped values.
9202 * @returns {Array} Returns the new array of grouped elements.
9203 * @example
9204 *
9205 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
9206 * return a + b + c;
9207 * });
9208 * // => [111, 222]
9209 */
9210 var zipWith = baseRest(function(arrays) {
9211 var length = arrays.length,
9212 iteratee = length > 1 ? arrays[length - 1] : undefined;
9213
9214 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
9215 return unzipWith(arrays, iteratee);
9216 });
9217
9218 /*------------------------------------------------------------------------*/
9219
9220 /**
9221 * Creates a `lodash` wrapper instance that wraps `value` with explicit method
9222 * chain sequences enabled. The result of such sequences must be unwrapped
9223 * with `_#value`.
9224 *
9225 * @static
9226 * @memberOf _
9227 * @since 1.3.0
9228 * @category Seq
9229 * @param {*} value The value to wrap.
9230 * @returns {Object} Returns the new `lodash` wrapper instance.
9231 * @example
9232 *
9233 * var users = [
9234 * { 'user': 'barney', 'age': 36 },
9235 * { 'user': 'fred', 'age': 40 },
9236 * { 'user': 'pebbles', 'age': 1 }
9237 * ];
9238 *
9239 * var youngest = _
9240 * .chain(users)
9241 * .sortBy('age')
9242 * .map(function(o) {
9243 * return o.user + ' is ' + o.age;
9244 * })
9245 * .head()
9246 * .value();
9247 * // => 'pebbles is 1'
9248 */
9249 function chain(value) {
9250 var result = lodash(value);
9251 result.__chain__ = true;
9252 return result;
9253 }
9254
9255 /**
9256 * This method invokes `interceptor` and returns `value`. The interceptor
9257 * is invoked with one argument; (value). The purpose of this method is to
9258 * "tap into" a method chain sequence in order to modify intermediate results.
9259 *
9260 * @static
9261 * @memberOf _
9262 * @since 0.1.0
9263 * @category Seq
9264 * @param {*} value The value to provide to `interceptor`.
9265 * @param {Function} interceptor The function to invoke.
9266 * @returns {*} Returns `value`.
9267 * @example
9268 *
9269 * _([1, 2, 3])
9270 * .tap(function(array) {
9271 * // Mutate input array.
9272 * array.pop();
9273 * })
9274 * .reverse()
9275 * .value();
9276 * // => [2, 1]
9277 */
9278 function tap(value, interceptor) {
9279 interceptor(value);
9280 return value;
9281 }
9282
9283 /**
9284 * This method is like `_.tap` except that it returns the result of `interceptor`.
9285 * The purpose of this method is to "pass thru" values replacing intermediate
9286 * results in a method chain sequence.
9287 *
9288 * @static
9289 * @memberOf _
9290 * @since 3.0.0
9291 * @category Seq
9292 * @param {*} value The value to provide to `interceptor`.
9293 * @param {Function} interceptor The function to invoke.
9294 * @returns {*} Returns the result of `interceptor`.
9295 * @example
9296 *
9297 * _(' abc ')
9298 * .chain()
9299 * .trim()
9300 * .thru(function(value) {
9301 * return [value];
9302 * })
9303 * .value();
9304 * // => ['abc']
9305 */
9306 function thru(value, interceptor) {
9307 return interceptor(value);
9308 }
9309
9310 /**
9311 * This method is the wrapper version of `_.at`.
9312 *
9313 * @name at
9314 * @memberOf _
9315 * @since 1.0.0
9316 * @category Seq
9317 * @param {...(string|string[])} [paths] The property paths to pick.
9318 * @returns {Object} Returns the new `lodash` wrapper instance.
9319 * @example
9320 *
9321 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
9322 *
9323 * _(object).at(['a[0].b.c', 'a[1]']).value();
9324 * // => [3, 4]
9325 */
9326 var wrapperAt = flatRest(function(paths) {
9327 var length = paths.length,
9328 start = length ? paths[0] : 0,
9329 value = this.__wrapped__,
9330 interceptor = function(object) { return baseAt(object, paths); };
9331
9332 if (length > 1 || this.__actions__.length ||
9333 !(value instanceof LazyWrapper) || !isIndex(start)) {
9334 return this.thru(interceptor);
9335 }
9336 value = value.slice(start, +start + (length ? 1 : 0));
9337 value.__actions__.push({
9338 'func': thru,
9339 'args': [interceptor],
9340 'thisArg': undefined
9341 });
9342 return new LodashWrapper(value, this.__chain__).thru(function(array) {
9343 if (length && !array.length) {
9344 array.push(undefined);
9345 }
9346 return array;
9347 });
9348 });
9349
9350 /**
9351 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
9352 *
9353 * @name chain
9354 * @memberOf _
9355 * @since 0.1.0
9356 * @category Seq
9357 * @returns {Object} Returns the new `lodash` wrapper instance.
9358 * @example
9359 *
9360 * var users = [
9361 * { 'user': 'barney', 'age': 36 },
9362 * { 'user': 'fred', 'age': 40 }
9363 * ];
9364 *
9365 * // A sequence without explicit chaining.
9366 * _(users).head();
9367 * // => { 'user': 'barney', 'age': 36 }
9368 *
9369 * // A sequence with explicit chaining.
9370 * _(users)
9371 * .chain()
9372 * .head()
9373 * .pick('user')
9374 * .value();
9375 * // => { 'user': 'barney' }
9376 */
9377 function wrapperChain() {
9378 return chain(this);
9379 }
9380
9381 /**
9382 * Executes the chain sequence and returns the wrapped result.
9383 *
9384 * @name commit
9385 * @memberOf _
9386 * @since 3.2.0
9387 * @category Seq
9388 * @returns {Object} Returns the new `lodash` wrapper instance.
9389 * @example
9390 *
9391 * var array = [1, 2];
9392 * var wrapped = _(array).push(3);
9393 *
9394 * console.log(array);
9395 * // => [1, 2]
9396 *
9397 * wrapped = wrapped.commit();
9398 * console.log(array);
9399 * // => [1, 2, 3]
9400 *
9401 * wrapped.last();
9402 * // => 3
9403 *
9404 * console.log(array);
9405 * // => [1, 2, 3]
9406 */
9407 function wrapperCommit() {
9408 return new LodashWrapper(this.value(), this.__chain__);
9409 }
9410
9411 /**
9412 * Gets the next value on a wrapped object following the
9413 * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
9414 *
9415 * @name next
9416 * @memberOf _
9417 * @since 4.0.0
9418 * @category Seq
9419 * @returns {Object} Returns the next iterator value.
9420 * @example
9421 *
9422 * var wrapped = _([1, 2]);
9423 *
9424 * wrapped.next();
9425 * // => { 'done': false, 'value': 1 }
9426 *
9427 * wrapped.next();
9428 * // => { 'done': false, 'value': 2 }
9429 *
9430 * wrapped.next();
9431 * // => { 'done': true, 'value': undefined }
9432 */
9433 function wrapperNext() {
9434 if (this.__values__ === undefined) {
9435 this.__values__ = toArray(this.value());
9436 }
9437 var done = this.__index__ >= this.__values__.length,
9438 value = done ? undefined : this.__values__[this.__index__++];
9439
9440 return { 'done': done, 'value': value };
9441 }
9442
9443 /**
9444 * Enables the wrapper to be iterable.
9445 *
9446 * @name Symbol.iterator
9447 * @memberOf _
9448 * @since 4.0.0
9449 * @category Seq
9450 * @returns {Object} Returns the wrapper object.
9451 * @example
9452 *
9453 * var wrapped = _([1, 2]);
9454 *
9455 * wrapped[Symbol.iterator]() === wrapped;
9456 * // => true
9457 *
9458 * Array.from(wrapped);
9459 * // => [1, 2]
9460 */
9461 function wrapperToIterator() {
9462 return this;
9463 }
9464
9465 /**
9466 * Creates a clone of the chain sequence planting `value` as the wrapped value.
9467 *
9468 * @name plant
9469 * @memberOf _
9470 * @since 3.2.0
9471 * @category Seq
9472 * @param {*} value The value to plant.
9473 * @returns {Object} Returns the new `lodash` wrapper instance.
9474 * @example
9475 *
9476 * function square(n) {
9477 * return n * n;
9478 * }
9479 *
9480 * var wrapped = _([1, 2]).map(square);
9481 * var other = wrapped.plant([3, 4]);
9482 *
9483 * other.value();
9484 * // => [9, 16]
9485 *
9486 * wrapped.value();
9487 * // => [1, 4]
9488 */
9489 function wrapperPlant(value) {
9490 var result,
9491 parent = this;
9492
9493 while (parent instanceof baseLodash) {
9494 var clone = wrapperClone(parent);
9495 clone.__index__ = 0;
9496 clone.__values__ = undefined;
9497 if (result) {
9498 previous.__wrapped__ = clone;
9499 } else {
9500 result = clone;
9501 }
9502 var previous = clone;
9503 parent = parent.__wrapped__;
9504 }
9505 previous.__wrapped__ = value;
9506 return result;
9507 }
9508
9509 /**
9510 * This method is the wrapper version of `_.reverse`.
9511 *
9512 * **Note:** This method mutates the wrapped array.
9513 *
9514 * @name reverse
9515 * @memberOf _
9516 * @since 0.1.0
9517 * @category Seq
9518 * @returns {Object} Returns the new `lodash` wrapper instance.
9519 * @example
9520 *
9521 * var array = [1, 2, 3];
9522 *
9523 * _(array).reverse().value()
9524 * // => [3, 2, 1]
9525 *
9526 * console.log(array);
9527 * // => [3, 2, 1]
9528 */
9529 function wrapperReverse() {
9530 var value = this.__wrapped__;
9531 if (value instanceof LazyWrapper) {
9532 var wrapped = value;
9533 if (this.__actions__.length) {
9534 wrapped = new LazyWrapper(this);
9535 }
9536 wrapped = wrapped.reverse();
9537 wrapped.__actions__.push({
9538 'func': thru,
9539 'args': [reverse],
9540 'thisArg': undefined
9541 });
9542 return new LodashWrapper(wrapped, this.__chain__);
9543 }
9544 return this.thru(reverse);
9545 }
9546
9547 /**
9548 * Executes the chain sequence to resolve the unwrapped value.
9549 *
9550 * @name value
9551 * @memberOf _
9552 * @since 0.1.0
9553 * @alias toJSON, valueOf
9554 * @category Seq
9555 * @returns {*} Returns the resolved unwrapped value.
9556 * @example
9557 *
9558 * _([1, 2, 3]).value();
9559 * // => [1, 2, 3]
9560 */
9561 function wrapperValue() {
9562 return baseWrapperValue(this.__wrapped__, this.__actions__);
9563 }
9564
9565 /*------------------------------------------------------------------------*/
9566
9567 /**
9568 * Creates an object composed of keys generated from the results of running
9569 * each element of `collection` thru `iteratee`. The corresponding value of
9570 * each key is the number of times the key was returned by `iteratee`. The
9571 * iteratee is invoked with one argument: (value).
9572 *
9573 * @static
9574 * @memberOf _
9575 * @since 0.5.0
9576 * @category Collection
9577 * @param {Array|Object} collection The collection to iterate over.
9578 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
9579 * @returns {Object} Returns the composed aggregate object.
9580 * @example
9581 *
9582 * _.countBy([6.1, 4.2, 6.3], Math.floor);
9583 * // => { '4': 1, '6': 2 }
9584 *
9585 * // The `_.property` iteratee shorthand.
9586 * _.countBy(['one', 'two', 'three'], 'length');
9587 * // => { '3': 2, '5': 1 }
9588 */
9589 var countBy = createAggregator(function(result, value, key) {
9590 if (hasOwnProperty.call(result, key)) {
9591 ++result[key];
9592 } else {
9593 baseAssignValue(result, key, 1);
9594 }
9595 });
9596
9597 /**
9598 * Checks if `predicate` returns truthy for **all** elements of `collection`.
9599 * Iteration is stopped once `predicate` returns falsey. The predicate is
9600 * invoked with three arguments: (value, index|key, collection).
9601 *
9602 * **Note:** This method returns `true` for
9603 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
9604 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
9605 * elements of empty collections.
9606 *
9607 * @static
9608 * @memberOf _
9609 * @since 0.1.0
9610 * @category Collection
9611 * @param {Array|Object} collection The collection to iterate over.
9612 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9613 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
9614 * @returns {boolean} Returns `true` if all elements pass the predicate check,
9615 * else `false`.
9616 * @example
9617 *
9618 * _.every([true, 1, null, 'yes'], Boolean);
9619 * // => false
9620 *
9621 * var users = [
9622 * { 'user': 'barney', 'age': 36, 'active': false },
9623 * { 'user': 'fred', 'age': 40, 'active': false }
9624 * ];
9625 *
9626 * // The `_.matches` iteratee shorthand.
9627 * _.every(users, { 'user': 'barney', 'active': false });
9628 * // => false
9629 *
9630 * // The `_.matchesProperty` iteratee shorthand.
9631 * _.every(users, ['active', false]);
9632 * // => true
9633 *
9634 * // The `_.property` iteratee shorthand.
9635 * _.every(users, 'active');
9636 * // => false
9637 */
9638 function every(collection, predicate, guard) {
9639 var func = isArray(collection) ? arrayEvery : baseEvery;
9640 if (guard && isIterateeCall(collection, predicate, guard)) {
9641 predicate = undefined;
9642 }
9643 return func(collection, getIteratee(predicate, 3));
9644 }
9645
9646 /**
9647 * Iterates over elements of `collection`, returning an array of all elements
9648 * `predicate` returns truthy for. The predicate is invoked with three
9649 * arguments: (value, index|key, collection).
9650 *
9651 * **Note:** Unlike `_.remove`, this method returns a new array.
9652 *
9653 * @static
9654 * @memberOf _
9655 * @since 0.1.0
9656 * @category Collection
9657 * @param {Array|Object} collection The collection to iterate over.
9658 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9659 * @returns {Array} Returns the new filtered array.
9660 * @see _.reject
9661 * @example
9662 *
9663 * var users = [
9664 * { 'user': 'barney', 'age': 36, 'active': true },
9665 * { 'user': 'fred', 'age': 40, 'active': false }
9666 * ];
9667 *
9668 * _.filter(users, function(o) { return !o.active; });
9669 * // => objects for ['fred']
9670 *
9671 * // The `_.matches` iteratee shorthand.
9672 * _.filter(users, { 'age': 36, 'active': true });
9673 * // => objects for ['barney']
9674 *
9675 * // The `_.matchesProperty` iteratee shorthand.
9676 * _.filter(users, ['active', false]);
9677 * // => objects for ['fred']
9678 *
9679 * // The `_.property` iteratee shorthand.
9680 * _.filter(users, 'active');
9681 * // => objects for ['barney']
9682 */
9683 function filter(collection, predicate) {
9684 var func = isArray(collection) ? arrayFilter : baseFilter;
9685 return func(collection, getIteratee(predicate, 3));
9686 }
9687
9688 /**
9689 * Iterates over elements of `collection`, returning the first element
9690 * `predicate` returns truthy for. The predicate is invoked with three
9691 * arguments: (value, index|key, collection).
9692 *
9693 * @static
9694 * @memberOf _
9695 * @since 0.1.0
9696 * @category Collection
9697 * @param {Array|Object} collection The collection to inspect.
9698 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9699 * @param {number} [fromIndex=0] The index to search from.
9700 * @returns {*} Returns the matched element, else `undefined`.
9701 * @example
9702 *
9703 * var users = [
9704 * { 'user': 'barney', 'age': 36, 'active': true },
9705 * { 'user': 'fred', 'age': 40, 'active': false },
9706 * { 'user': 'pebbles', 'age': 1, 'active': true }
9707 * ];
9708 *
9709 * _.find(users, function(o) { return o.age < 40; });
9710 * // => object for 'barney'
9711 *
9712 * // The `_.matches` iteratee shorthand.
9713 * _.find(users, { 'age': 1, 'active': true });
9714 * // => object for 'pebbles'
9715 *
9716 * // The `_.matchesProperty` iteratee shorthand.
9717 * _.find(users, ['active', false]);
9718 * // => object for 'fred'
9719 *
9720 * // The `_.property` iteratee shorthand.
9721 * _.find(users, 'active');
9722 * // => object for 'barney'
9723 */
9724 var find = createFind(findIndex);
9725
9726 /**
9727 * This method is like `_.find` except that it iterates over elements of
9728 * `collection` from right to left.
9729 *
9730 * @static
9731 * @memberOf _
9732 * @since 2.0.0
9733 * @category Collection
9734 * @param {Array|Object} collection The collection to inspect.
9735 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9736 * @param {number} [fromIndex=collection.length-1] The index to search from.
9737 * @returns {*} Returns the matched element, else `undefined`.
9738 * @example
9739 *
9740 * _.findLast([1, 2, 3, 4], function(n) {
9741 * return n % 2 == 1;
9742 * });
9743 * // => 3
9744 */
9745 var findLast = createFind(findLastIndex);
9746
9747 /**
9748 * Creates a flattened array of values by running each element in `collection`
9749 * thru `iteratee` and flattening the mapped results. The iteratee is invoked
9750 * with three arguments: (value, index|key, collection).
9751 *
9752 * @static
9753 * @memberOf _
9754 * @since 4.0.0
9755 * @category Collection
9756 * @param {Array|Object} collection The collection to iterate over.
9757 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
9758 * @returns {Array} Returns the new flattened array.
9759 * @example
9760 *
9761 * function duplicate(n) {
9762 * return [n, n];
9763 * }
9764 *
9765 * _.flatMap([1, 2], duplicate);
9766 * // => [1, 1, 2, 2]
9767 */
9768 function flatMap(collection, iteratee) {
9769 return baseFlatten(map(collection, iteratee), 1);
9770 }
9771
9772 /**
9773 * This method is like `_.flatMap` except that it recursively flattens the
9774 * mapped results.
9775 *
9776 * @static
9777 * @memberOf _
9778 * @since 4.7.0
9779 * @category Collection
9780 * @param {Array|Object} collection The collection to iterate over.
9781 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
9782 * @returns {Array} Returns the new flattened array.
9783 * @example
9784 *
9785 * function duplicate(n) {
9786 * return [[[n, n]]];
9787 * }
9788 *
9789 * _.flatMapDeep([1, 2], duplicate);
9790 * // => [1, 1, 2, 2]
9791 */
9792 function flatMapDeep(collection, iteratee) {
9793 return baseFlatten(map(collection, iteratee), INFINITY);
9794 }
9795
9796 /**
9797 * This method is like `_.flatMap` except that it recursively flattens the
9798 * mapped results up to `depth` times.
9799 *
9800 * @static
9801 * @memberOf _
9802 * @since 4.7.0
9803 * @category Collection
9804 * @param {Array|Object} collection The collection to iterate over.
9805 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
9806 * @param {number} [depth=1] The maximum recursion depth.
9807 * @returns {Array} Returns the new flattened array.
9808 * @example
9809 *
9810 * function duplicate(n) {
9811 * return [[[n, n]]];
9812 * }
9813 *
9814 * _.flatMapDepth([1, 2], duplicate, 2);
9815 * // => [[1, 1], [2, 2]]
9816 */
9817 function flatMapDepth(collection, iteratee, depth) {
9818 depth = depth === undefined ? 1 : toInteger(depth);
9819 return baseFlatten(map(collection, iteratee), depth);
9820 }
9821
9822 /**
9823 * Iterates over elements of `collection` and invokes `iteratee` for each element.
9824 * The iteratee is invoked with three arguments: (value, index|key, collection).
9825 * Iteratee functions may exit iteration early by explicitly returning `false`.
9826 *
9827 * **Note:** As with other "Collections" methods, objects with a "length"
9828 * property are iterated like arrays. To avoid this behavior use `_.forIn`
9829 * or `_.forOwn` for object iteration.
9830 *
9831 * @static
9832 * @memberOf _
9833 * @since 0.1.0
9834 * @alias each
9835 * @category Collection
9836 * @param {Array|Object} collection The collection to iterate over.
9837 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
9838 * @returns {Array|Object} Returns `collection`.
9839 * @see _.forEachRight
9840 * @example
9841 *
9842 * _.forEach([1, 2], function(value) {
9843 * console.log(value);
9844 * });
9845 * // => Logs `1` then `2`.
9846 *
9847 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
9848 * console.log(key);
9849 * });
9850 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
9851 */
9852 function forEach(collection, iteratee) {
9853 var func = isArray(collection) ? arrayEach : baseEach;
9854 return func(collection, getIteratee(iteratee, 3));
9855 }
9856
9857 /**
9858 * This method is like `_.forEach` except that it iterates over elements of
9859 * `collection` from right to left.
9860 *
9861 * @static
9862 * @memberOf _
9863 * @since 2.0.0
9864 * @alias eachRight
9865 * @category Collection
9866 * @param {Array|Object} collection The collection to iterate over.
9867 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
9868 * @returns {Array|Object} Returns `collection`.
9869 * @see _.forEach
9870 * @example
9871 *
9872 * _.forEachRight([1, 2], function(value) {
9873 * console.log(value);
9874 * });
9875 * // => Logs `2` then `1`.
9876 */
9877 function forEachRight(collection, iteratee) {
9878 var func = isArray(collection) ? arrayEachRight : baseEachRight;
9879 return func(collection, getIteratee(iteratee, 3));
9880 }
9881
9882 /**
9883 * Creates an object composed of keys generated from the results of running
9884 * each element of `collection` thru `iteratee`. The order of grouped values
9885 * is determined by the order they occur in `collection`. The corresponding
9886 * value of each key is an array of elements responsible for generating the
9887 * key. The iteratee is invoked with one argument: (value).
9888 *
9889 * @static
9890 * @memberOf _
9891 * @since 0.1.0
9892 * @category Collection
9893 * @param {Array|Object} collection The collection to iterate over.
9894 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
9895 * @returns {Object} Returns the composed aggregate object.
9896 * @example
9897 *
9898 * _.groupBy([6.1, 4.2, 6.3], Math.floor);
9899 * // => { '4': [4.2], '6': [6.1, 6.3] }
9900 *
9901 * // The `_.property` iteratee shorthand.
9902 * _.groupBy(['one', 'two', 'three'], 'length');
9903 * // => { '3': ['one', 'two'], '5': ['three'] }
9904 */
9905 var groupBy = createAggregator(function(result, value, key) {
9906 if (hasOwnProperty.call(result, key)) {
9907 result[key].push(value);
9908 } else {
9909 baseAssignValue(result, key, [value]);
9910 }
9911 });
9912
9913 /**
9914 * Checks if `value` is in `collection`. If `collection` is a string, it's
9915 * checked for a substring of `value`, otherwise
9916 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9917 * is used for equality comparisons. If `fromIndex` is negative, it's used as
9918 * the offset from the end of `collection`.
9919 *
9920 * @static
9921 * @memberOf _
9922 * @since 0.1.0
9923 * @category Collection
9924 * @param {Array|Object|string} collection The collection to inspect.
9925 * @param {*} value The value to search for.
9926 * @param {number} [fromIndex=0] The index to search from.
9927 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
9928 * @returns {boolean} Returns `true` if `value` is found, else `false`.
9929 * @example
9930 *
9931 * _.includes([1, 2, 3], 1);
9932 * // => true
9933 *
9934 * _.includes([1, 2, 3], 1, 2);
9935 * // => false
9936 *
9937 * _.includes({ 'a': 1, 'b': 2 }, 1);
9938 * // => true
9939 *
9940 * _.includes('abcd', 'bc');
9941 * // => true
9942 */
9943 function includes(collection, value, fromIndex, guard) {
9944 collection = isArrayLike(collection) ? collection : values(collection);
9945 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
9946
9947 var length = collection.length;
9948 if (fromIndex < 0) {
9949 fromIndex = nativeMax(length + fromIndex, 0);
9950 }
9951 return isString(collection)
9952 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
9953 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
9954 }
9955
9956 /**
9957 * Invokes the method at `path` of each element in `collection`, returning
9958 * an array of the results of each invoked method. Any additional arguments
9959 * are provided to each invoked method. If `path` is a function, it's invoked
9960 * for, and `this` bound to, each element in `collection`.
9961 *
9962 * @static
9963 * @memberOf _
9964 * @since 4.0.0
9965 * @category Collection
9966 * @param {Array|Object} collection The collection to iterate over.
9967 * @param {Array|Function|string} path The path of the method to invoke or
9968 * the function invoked per iteration.
9969 * @param {...*} [args] The arguments to invoke each method with.
9970 * @returns {Array} Returns the array of results.
9971 * @example
9972 *
9973 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
9974 * // => [[1, 5, 7], [1, 2, 3]]
9975 *
9976 * _.invokeMap([123, 456], String.prototype.split, '');
9977 * // => [['1', '2', '3'], ['4', '5', '6']]
9978 */
9979 var invokeMap = baseRest(function(collection, path, args) {
9980 var index = -1,
9981 isFunc = typeof path == 'function',
9982 result = isArrayLike(collection) ? Array(collection.length) : [];
9983
9984 baseEach(collection, function(value) {
9985 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
9986 });
9987 return result;
9988 });
9989
9990 /**
9991 * Creates an object composed of keys generated from the results of running
9992 * each element of `collection` thru `iteratee`. The corresponding value of
9993 * each key is the last element responsible for generating the key. The
9994 * iteratee is invoked with one argument: (value).
9995 *
9996 * @static
9997 * @memberOf _
9998 * @since 4.0.0
9999 * @category Collection
10000 * @param {Array|Object} collection The collection to iterate over.
10001 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
10002 * @returns {Object} Returns the composed aggregate object.
10003 * @example
10004 *
10005 * var array = [
10006 * { 'dir': 'left', 'code': 97 },
10007 * { 'dir': 'right', 'code': 100 }
10008 * ];
10009 *
10010 * _.keyBy(array, function(o) {
10011 * return String.fromCharCode(o.code);
10012 * });
10013 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
10014 *
10015 * _.keyBy(array, 'dir');
10016 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
10017 */
10018 var keyBy = createAggregator(function(result, value, key) {
10019 baseAssignValue(result, key, value);
10020 });
10021
10022 /**
10023 * Creates an array of values by running each element in `collection` thru
10024 * `iteratee`. The iteratee is invoked with three arguments:
10025 * (value, index|key, collection).
10026 *
10027 * Many lodash methods are guarded to work as iteratees for methods like
10028 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
10029 *
10030 * The guarded methods are:
10031 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
10032 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
10033 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
10034 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
10035 *
10036 * @static
10037 * @memberOf _
10038 * @since 0.1.0
10039 * @category Collection
10040 * @param {Array|Object} collection The collection to iterate over.
10041 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10042 * @returns {Array} Returns the new mapped array.
10043 * @example
10044 *
10045 * function square(n) {
10046 * return n * n;
10047 * }
10048 *
10049 * _.map([4, 8], square);
10050 * // => [16, 64]
10051 *
10052 * _.map({ 'a': 4, 'b': 8 }, square);
10053 * // => [16, 64] (iteration order is not guaranteed)
10054 *
10055 * var users = [
10056 * { 'user': 'barney' },
10057 * { 'user': 'fred' }
10058 * ];
10059 *
10060 * // The `_.property` iteratee shorthand.
10061 * _.map(users, 'user');
10062 * // => ['barney', 'fred']
10063 */
10064 function map(collection, iteratee) {
10065 var func = isArray(collection) ? arrayMap : baseMap;
10066 return func(collection, getIteratee(iteratee, 3));
10067 }
10068
10069 /**
10070 * This method is like `_.sortBy` except that it allows specifying the sort
10071 * orders of the iteratees to sort by. If `orders` is unspecified, all values
10072 * are sorted in ascending order. Otherwise, specify an order of "desc" for
10073 * descending or "asc" for ascending sort order of corresponding values.
10074 *
10075 * @static
10076 * @memberOf _
10077 * @since 4.0.0
10078 * @category Collection
10079 * @param {Array|Object} collection The collection to iterate over.
10080 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
10081 * The iteratees to sort by.
10082 * @param {string[]} [orders] The sort orders of `iteratees`.
10083 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
10084 * @returns {Array} Returns the new sorted array.
10085 * @example
10086 *
10087 * var users = [
10088 * { 'user': 'fred', 'age': 48 },
10089 * { 'user': 'barney', 'age': 34 },
10090 * { 'user': 'fred', 'age': 40 },
10091 * { 'user': 'barney', 'age': 36 }
10092 * ];
10093 *
10094 * // Sort by `user` in ascending order and by `age` in descending order.
10095 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
10096 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
10097 */
10098 function orderBy(collection, iteratees, orders, guard) {
10099 if (collection == null) {
10100 return [];
10101 }
10102 if (!isArray(iteratees)) {
10103 iteratees = iteratees == null ? [] : [iteratees];
10104 }
10105 orders = guard ? undefined : orders;
10106 if (!isArray(orders)) {
10107 orders = orders == null ? [] : [orders];
10108 }
10109 return baseOrderBy(collection, iteratees, orders);
10110 }
10111
10112 /**
10113 * Creates an array of elements split into two groups, the first of which
10114 * contains elements `predicate` returns truthy for, the second of which
10115 * contains elements `predicate` returns falsey for. The predicate is
10116 * invoked with one argument: (value).
10117 *
10118 * @static
10119 * @memberOf _
10120 * @since 3.0.0
10121 * @category Collection
10122 * @param {Array|Object} collection The collection to iterate over.
10123 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10124 * @returns {Array} Returns the array of grouped elements.
10125 * @example
10126 *
10127 * var users = [
10128 * { 'user': 'barney', 'age': 36, 'active': false },
10129 * { 'user': 'fred', 'age': 40, 'active': true },
10130 * { 'user': 'pebbles', 'age': 1, 'active': false }
10131 * ];
10132 *
10133 * _.partition(users, function(o) { return o.active; });
10134 * // => objects for [['fred'], ['barney', 'pebbles']]
10135 *
10136 * // The `_.matches` iteratee shorthand.
10137 * _.partition(users, { 'age': 1, 'active': false });
10138 * // => objects for [['pebbles'], ['barney', 'fred']]
10139 *
10140 * // The `_.matchesProperty` iteratee shorthand.
10141 * _.partition(users, ['active', false]);
10142 * // => objects for [['barney', 'pebbles'], ['fred']]
10143 *
10144 * // The `_.property` iteratee shorthand.
10145 * _.partition(users, 'active');
10146 * // => objects for [['fred'], ['barney', 'pebbles']]
10147 */
10148 var partition = createAggregator(function(result, value, key) {
10149 result[key ? 0 : 1].push(value);
10150 }, function() { return [[], []]; });
10151
10152 /**
10153 * Reduces `collection` to a value which is the accumulated result of running
10154 * each element in `collection` thru `iteratee`, where each successive
10155 * invocation is supplied the return value of the previous. If `accumulator`
10156 * is not given, the first element of `collection` is used as the initial
10157 * value. The iteratee is invoked with four arguments:
10158 * (accumulator, value, index|key, collection).
10159 *
10160 * Many lodash methods are guarded to work as iteratees for methods like
10161 * `_.reduce`, `_.reduceRight`, and `_.transform`.
10162 *
10163 * The guarded methods are:
10164 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
10165 * and `sortBy`
10166 *
10167 * @static
10168 * @memberOf _
10169 * @since 0.1.0
10170 * @category Collection
10171 * @param {Array|Object} collection The collection to iterate over.
10172 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10173 * @param {*} [accumulator] The initial value.
10174 * @returns {*} Returns the accumulated value.
10175 * @see _.reduceRight
10176 * @example
10177 *
10178 * _.reduce([1, 2], function(sum, n) {
10179 * return sum + n;
10180 * }, 0);
10181 * // => 3
10182 *
10183 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
10184 * (result[value] || (result[value] = [])).push(key);
10185 * return result;
10186 * }, {});
10187 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
10188 */
10189 function reduce(collection, iteratee, accumulator) {
10190 var func = isArray(collection) ? arrayReduce : baseReduce,
10191 initAccum = arguments.length < 3;
10192
10193 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
10194 }
10195
10196 /**
10197 * This method is like `_.reduce` except that it iterates over elements of
10198 * `collection` from right to left.
10199 *
10200 * @static
10201 * @memberOf _
10202 * @since 0.1.0
10203 * @category Collection
10204 * @param {Array|Object} collection The collection to iterate over.
10205 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10206 * @param {*} [accumulator] The initial value.
10207 * @returns {*} Returns the accumulated value.
10208 * @see _.reduce
10209 * @example
10210 *
10211 * var array = [[0, 1], [2, 3], [4, 5]];
10212 *
10213 * _.reduceRight(array, function(flattened, other) {
10214 * return flattened.concat(other);
10215 * }, []);
10216 * // => [4, 5, 2, 3, 0, 1]
10217 */
10218 function reduceRight(collection, iteratee, accumulator) {
10219 var func = isArray(collection) ? arrayReduceRight : baseReduce,
10220 initAccum = arguments.length < 3;
10221
10222 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
10223 }
10224
10225 /**
10226 * The opposite of `_.filter`; this method returns the elements of `collection`
10227 * that `predicate` does **not** return truthy for.
10228 *
10229 * @static
10230 * @memberOf _
10231 * @since 0.1.0
10232 * @category Collection
10233 * @param {Array|Object} collection The collection to iterate over.
10234 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10235 * @returns {Array} Returns the new filtered array.
10236 * @see _.filter
10237 * @example
10238 *
10239 * var users = [
10240 * { 'user': 'barney', 'age': 36, 'active': false },
10241 * { 'user': 'fred', 'age': 40, 'active': true }
10242 * ];
10243 *
10244 * _.reject(users, function(o) { return !o.active; });
10245 * // => objects for ['fred']
10246 *
10247 * // The `_.matches` iteratee shorthand.
10248 * _.reject(users, { 'age': 40, 'active': true });
10249 * // => objects for ['barney']
10250 *
10251 * // The `_.matchesProperty` iteratee shorthand.
10252 * _.reject(users, ['active', false]);
10253 * // => objects for ['fred']
10254 *
10255 * // The `_.property` iteratee shorthand.
10256 * _.reject(users, 'active');
10257 * // => objects for ['barney']
10258 */
10259 function reject(collection, predicate) {
10260 var func = isArray(collection) ? arrayFilter : baseFilter;
10261 return func(collection, negate(getIteratee(predicate, 3)));
10262 }
10263
10264 /**
10265 * Gets a random element from `collection`.
10266 *
10267 * @static
10268 * @memberOf _
10269 * @since 2.0.0
10270 * @category Collection
10271 * @param {Array|Object} collection The collection to sample.
10272 * @returns {*} Returns the random element.
10273 * @example
10274 *
10275 * _.sample([1, 2, 3, 4]);
10276 * // => 2
10277 */
10278 function sample(collection) {
10279 var func = isArray(collection) ? arraySample : baseSample;
10280 return func(collection);
10281 }
10282
10283 /**
10284 * Gets `n` random elements at unique keys from `collection` up to the
10285 * size of `collection`.
10286 *
10287 * @static
10288 * @memberOf _
10289 * @since 4.0.0
10290 * @category Collection
10291 * @param {Array|Object} collection The collection to sample.
10292 * @param {number} [n=1] The number of elements to sample.
10293 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10294 * @returns {Array} Returns the random elements.
10295 * @example
10296 *
10297 * _.sampleSize([1, 2, 3], 2);
10298 * // => [3, 1]
10299 *
10300 * _.sampleSize([1, 2, 3], 4);
10301 * // => [2, 3, 1]
10302 */
10303 function sampleSize(collection, n, guard) {
10304 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
10305 n = 1;
10306 } else {
10307 n = toInteger(n);
10308 }
10309 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
10310 return func(collection, n);
10311 }
10312
10313 /**
10314 * Creates an array of shuffled values, using a version of the
10315 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
10316 *
10317 * @static
10318 * @memberOf _
10319 * @since 0.1.0
10320 * @category Collection
10321 * @param {Array|Object} collection The collection to shuffle.
10322 * @returns {Array} Returns the new shuffled array.
10323 * @example
10324 *
10325 * _.shuffle([1, 2, 3, 4]);
10326 * // => [4, 1, 3, 2]
10327 */
10328 function shuffle(collection) {
10329 var func = isArray(collection) ? arrayShuffle : baseShuffle;
10330 return func(collection);
10331 }
10332
10333 /**
10334 * Gets the size of `collection` by returning its length for array-like
10335 * values or the number of own enumerable string keyed properties for objects.
10336 *
10337 * @static
10338 * @memberOf _
10339 * @since 0.1.0
10340 * @category Collection
10341 * @param {Array|Object|string} collection The collection to inspect.
10342 * @returns {number} Returns the collection size.
10343 * @example
10344 *
10345 * _.size([1, 2, 3]);
10346 * // => 3
10347 *
10348 * _.size({ 'a': 1, 'b': 2 });
10349 * // => 2
10350 *
10351 * _.size('pebbles');
10352 * // => 7
10353 */
10354 function size(collection) {
10355 if (collection == null) {
10356 return 0;
10357 }
10358 if (isArrayLike(collection)) {
10359 return isString(collection) ? stringSize(collection) : collection.length;
10360 }
10361 var tag = getTag(collection);
10362 if (tag == mapTag || tag == setTag) {
10363 return collection.size;
10364 }
10365 return baseKeys(collection).length;
10366 }
10367
10368 /**
10369 * Checks if `predicate` returns truthy for **any** element of `collection`.
10370 * Iteration is stopped once `predicate` returns truthy. The predicate is
10371 * invoked with three arguments: (value, index|key, collection).
10372 *
10373 * @static
10374 * @memberOf _
10375 * @since 0.1.0
10376 * @category Collection
10377 * @param {Array|Object} collection The collection to iterate over.
10378 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10379 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10380 * @returns {boolean} Returns `true` if any element passes the predicate check,
10381 * else `false`.
10382 * @example
10383 *
10384 * _.some([null, 0, 'yes', false], Boolean);
10385 * // => true
10386 *
10387 * var users = [
10388 * { 'user': 'barney', 'active': true },
10389 * { 'user': 'fred', 'active': false }
10390 * ];
10391 *
10392 * // The `_.matches` iteratee shorthand.
10393 * _.some(users, { 'user': 'barney', 'active': false });
10394 * // => false
10395 *
10396 * // The `_.matchesProperty` iteratee shorthand.
10397 * _.some(users, ['active', false]);
10398 * // => true
10399 *
10400 * // The `_.property` iteratee shorthand.
10401 * _.some(users, 'active');
10402 * // => true
10403 */
10404 function some(collection, predicate, guard) {
10405 var func = isArray(collection) ? arraySome : baseSome;
10406 if (guard && isIterateeCall(collection, predicate, guard)) {
10407 predicate = undefined;
10408 }
10409 return func(collection, getIteratee(predicate, 3));
10410 }
10411
10412 /**
10413 * Creates an array of elements, sorted in ascending order by the results of
10414 * running each element in a collection thru each iteratee. This method
10415 * performs a stable sort, that is, it preserves the original sort order of
10416 * equal elements. The iteratees are invoked with one argument: (value).
10417 *
10418 * @static
10419 * @memberOf _
10420 * @since 0.1.0
10421 * @category Collection
10422 * @param {Array|Object} collection The collection to iterate over.
10423 * @param {...(Function|Function[])} [iteratees=[_.identity]]
10424 * The iteratees to sort by.
10425 * @returns {Array} Returns the new sorted array.
10426 * @example
10427 *
10428 * var users = [
10429 * { 'user': 'fred', 'age': 48 },
10430 * { 'user': 'barney', 'age': 36 },
10431 * { 'user': 'fred', 'age': 40 },
10432 * { 'user': 'barney', 'age': 34 }
10433 * ];
10434 *
10435 * _.sortBy(users, [function(o) { return o.user; }]);
10436 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
10437 *
10438 * _.sortBy(users, ['user', 'age']);
10439 * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
10440 */
10441 var sortBy = baseRest(function(collection, iteratees) {
10442 if (collection == null) {
10443 return [];
10444 }
10445 var length = iteratees.length;
10446 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
10447 iteratees = [];
10448 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
10449 iteratees = [iteratees[0]];
10450 }
10451 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
10452 });
10453
10454 /*------------------------------------------------------------------------*/
10455
10456 /**
10457 * Gets the timestamp of the number of milliseconds that have elapsed since
10458 * the Unix epoch (1 January 1970 00:00:00 UTC).
10459 *
10460 * @static
10461 * @memberOf _
10462 * @since 2.4.0
10463 * @category Date
10464 * @returns {number} Returns the timestamp.
10465 * @example
10466 *
10467 * _.defer(function(stamp) {
10468 * console.log(_.now() - stamp);
10469 * }, _.now());
10470 * // => Logs the number of milliseconds it took for the deferred invocation.
10471 */
10472 var now = ctxNow || function() {
10473 return root.Date.now();
10474 };
10475
10476 /*------------------------------------------------------------------------*/
10477
10478 /**
10479 * The opposite of `_.before`; this method creates a function that invokes
10480 * `func` once it's called `n` or more times.
10481 *
10482 * @static
10483 * @memberOf _
10484 * @since 0.1.0
10485 * @category Function
10486 * @param {number} n The number of calls before `func` is invoked.
10487 * @param {Function} func The function to restrict.
10488 * @returns {Function} Returns the new restricted function.
10489 * @example
10490 *
10491 * var saves = ['profile', 'settings'];
10492 *
10493 * var done = _.after(saves.length, function() {
10494 * console.log('done saving!');
10495 * });
10496 *
10497 * _.forEach(saves, function(type) {
10498 * asyncSave({ 'type': type, 'complete': done });
10499 * });
10500 * // => Logs 'done saving!' after the two async saves have completed.
10501 */
10502 function after(n, func) {
10503 if (typeof func != 'function') {
10504 throw new TypeError(FUNC_ERROR_TEXT);
10505 }
10506 n = toInteger(n);
10507 return function() {
10508 if (--n < 1) {
10509 return func.apply(this, arguments);
10510 }
10511 };
10512 }
10513
10514 /**
10515 * Creates a function that invokes `func`, with up to `n` arguments,
10516 * ignoring any additional arguments.
10517 *
10518 * @static
10519 * @memberOf _
10520 * @since 3.0.0
10521 * @category Function
10522 * @param {Function} func The function to cap arguments for.
10523 * @param {number} [n=func.length] The arity cap.
10524 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10525 * @returns {Function} Returns the new capped function.
10526 * @example
10527 *
10528 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
10529 * // => [6, 8, 10]
10530 */
10531 function ary(func, n, guard) {
10532 n = guard ? undefined : n;
10533 n = (func && n == null) ? func.length : n;
10534 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
10535 }
10536
10537 /**
10538 * Creates a function that invokes `func`, with the `this` binding and arguments
10539 * of the created function, while it's called less than `n` times. Subsequent
10540 * calls to the created function return the result of the last `func` invocation.
10541 *
10542 * @static
10543 * @memberOf _
10544 * @since 3.0.0
10545 * @category Function
10546 * @param {number} n The number of calls at which `func` is no longer invoked.
10547 * @param {Function} func The function to restrict.
10548 * @returns {Function} Returns the new restricted function.
10549 * @example
10550 *
10551 * jQuery(element).on('click', _.before(5, addContactToList));
10552 * // => Allows adding up to 4 contacts to the list.
10553 */
10554 function before(n, func) {
10555 var result;
10556 if (typeof func != 'function') {
10557 throw new TypeError(FUNC_ERROR_TEXT);
10558 }
10559 n = toInteger(n);
10560 return function() {
10561 if (--n > 0) {
10562 result = func.apply(this, arguments);
10563 }
10564 if (n <= 1) {
10565 func = undefined;
10566 }
10567 return result;
10568 };
10569 }
10570
10571 /**
10572 * Creates a function that invokes `func` with the `this` binding of `thisArg`
10573 * and `partials` prepended to the arguments it receives.
10574 *
10575 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
10576 * may be used as a placeholder for partially applied arguments.
10577 *
10578 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
10579 * property of bound functions.
10580 *
10581 * @static
10582 * @memberOf _
10583 * @since 0.1.0
10584 * @category Function
10585 * @param {Function} func The function to bind.
10586 * @param {*} thisArg The `this` binding of `func`.
10587 * @param {...*} [partials] The arguments to be partially applied.
10588 * @returns {Function} Returns the new bound function.
10589 * @example
10590 *
10591 * function greet(greeting, punctuation) {
10592 * return greeting + ' ' + this.user + punctuation;
10593 * }
10594 *
10595 * var object = { 'user': 'fred' };
10596 *
10597 * var bound = _.bind(greet, object, 'hi');
10598 * bound('!');
10599 * // => 'hi fred!'
10600 *
10601 * // Bound with placeholders.
10602 * var bound = _.bind(greet, object, _, '!');
10603 * bound('hi');
10604 * // => 'hi fred!'
10605 */
10606 var bind = baseRest(function(func, thisArg, partials) {
10607 var bitmask = WRAP_BIND_FLAG;
10608 if (partials.length) {
10609 var holders = replaceHolders(partials, getHolder(bind));
10610 bitmask |= WRAP_PARTIAL_FLAG;
10611 }
10612 return createWrap(func, bitmask, thisArg, partials, holders);
10613 });
10614
10615 /**
10616 * Creates a function that invokes the method at `object[key]` with `partials`
10617 * prepended to the arguments it receives.
10618 *
10619 * This method differs from `_.bind` by allowing bound functions to reference
10620 * methods that may be redefined or don't yet exist. See
10621 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
10622 * for more details.
10623 *
10624 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
10625 * builds, may be used as a placeholder for partially applied arguments.
10626 *
10627 * @static
10628 * @memberOf _
10629 * @since 0.10.0
10630 * @category Function
10631 * @param {Object} object The object to invoke the method on.
10632 * @param {string} key The key of the method.
10633 * @param {...*} [partials] The arguments to be partially applied.
10634 * @returns {Function} Returns the new bound function.
10635 * @example
10636 *
10637 * var object = {
10638 * 'user': 'fred',
10639 * 'greet': function(greeting, punctuation) {
10640 * return greeting + ' ' + this.user + punctuation;
10641 * }
10642 * };
10643 *
10644 * var bound = _.bindKey(object, 'greet', 'hi');
10645 * bound('!');
10646 * // => 'hi fred!'
10647 *
10648 * object.greet = function(greeting, punctuation) {
10649 * return greeting + 'ya ' + this.user + punctuation;
10650 * };
10651 *
10652 * bound('!');
10653 * // => 'hiya fred!'
10654 *
10655 * // Bound with placeholders.
10656 * var bound = _.bindKey(object, 'greet', _, '!');
10657 * bound('hi');
10658 * // => 'hiya fred!'
10659 */
10660 var bindKey = baseRest(function(object, key, partials) {
10661 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
10662 if (partials.length) {
10663 var holders = replaceHolders(partials, getHolder(bindKey));
10664 bitmask |= WRAP_PARTIAL_FLAG;
10665 }
10666 return createWrap(key, bitmask, object, partials, holders);
10667 });
10668
10669 /**
10670 * Creates a function that accepts arguments of `func` and either invokes
10671 * `func` returning its result, if at least `arity` number of arguments have
10672 * been provided, or returns a function that accepts the remaining `func`
10673 * arguments, and so on. The arity of `func` may be specified if `func.length`
10674 * is not sufficient.
10675 *
10676 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
10677 * may be used as a placeholder for provided arguments.
10678 *
10679 * **Note:** This method doesn't set the "length" property of curried functions.
10680 *
10681 * @static
10682 * @memberOf _
10683 * @since 2.0.0
10684 * @category Function
10685 * @param {Function} func The function to curry.
10686 * @param {number} [arity=func.length] The arity of `func`.
10687 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10688 * @returns {Function} Returns the new curried function.
10689 * @example
10690 *
10691 * var abc = function(a, b, c) {
10692 * return [a, b, c];
10693 * };
10694 *
10695 * var curried = _.curry(abc);
10696 *
10697 * curried(1)(2)(3);
10698 * // => [1, 2, 3]
10699 *
10700 * curried(1, 2)(3);
10701 * // => [1, 2, 3]
10702 *
10703 * curried(1, 2, 3);
10704 * // => [1, 2, 3]
10705 *
10706 * // Curried with placeholders.
10707 * curried(1)(_, 3)(2);
10708 * // => [1, 2, 3]
10709 */
10710 function curry(func, arity, guard) {
10711 arity = guard ? undefined : arity;
10712 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
10713 result.placeholder = curry.placeholder;
10714 return result;
10715 }
10716
10717 /**
10718 * This method is like `_.curry` except that arguments are applied to `func`
10719 * in the manner of `_.partialRight` instead of `_.partial`.
10720 *
10721 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
10722 * builds, may be used as a placeholder for provided arguments.
10723 *
10724 * **Note:** This method doesn't set the "length" property of curried functions.
10725 *
10726 * @static
10727 * @memberOf _
10728 * @since 3.0.0
10729 * @category Function
10730 * @param {Function} func The function to curry.
10731 * @param {number} [arity=func.length] The arity of `func`.
10732 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10733 * @returns {Function} Returns the new curried function.
10734 * @example
10735 *
10736 * var abc = function(a, b, c) {
10737 * return [a, b, c];
10738 * };
10739 *
10740 * var curried = _.curryRight(abc);
10741 *
10742 * curried(3)(2)(1);
10743 * // => [1, 2, 3]
10744 *
10745 * curried(2, 3)(1);
10746 * // => [1, 2, 3]
10747 *
10748 * curried(1, 2, 3);
10749 * // => [1, 2, 3]
10750 *
10751 * // Curried with placeholders.
10752 * curried(3)(1, _)(2);
10753 * // => [1, 2, 3]
10754 */
10755 function curryRight(func, arity, guard) {
10756 arity = guard ? undefined : arity;
10757 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
10758 result.placeholder = curryRight.placeholder;
10759 return result;
10760 }
10761
10762 /**
10763 * Creates a debounced function that delays invoking `func` until after `wait`
10764 * milliseconds have elapsed since the last time the debounced function was
10765 * invoked. The debounced function comes with a `cancel` method to cancel
10766 * delayed `func` invocations and a `flush` method to immediately invoke them.
10767 * Provide `options` to indicate whether `func` should be invoked on the
10768 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
10769 * with the last arguments provided to the debounced function. Subsequent
10770 * calls to the debounced function return the result of the last `func`
10771 * invocation.
10772 *
10773 * **Note:** If `leading` and `trailing` options are `true`, `func` is
10774 * invoked on the trailing edge of the timeout only if the debounced function
10775 * is invoked more than once during the `wait` timeout.
10776 *
10777 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
10778 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
10779 *
10780 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
10781 * for details over the differences between `_.debounce` and `_.throttle`.
10782 *
10783 * @static
10784 * @memberOf _
10785 * @since 0.1.0
10786 * @category Function
10787 * @param {Function} func The function to debounce.
10788 * @param {number} [wait=0] The number of milliseconds to delay.
10789 * @param {Object} [options={}] The options object.
10790 * @param {boolean} [options.leading=false]
10791 * Specify invoking on the leading edge of the timeout.
10792 * @param {number} [options.maxWait]
10793 * The maximum time `func` is allowed to be delayed before it's invoked.
10794 * @param {boolean} [options.trailing=true]
10795 * Specify invoking on the trailing edge of the timeout.
10796 * @returns {Function} Returns the new debounced function.
10797 * @example
10798 *
10799 * // Avoid costly calculations while the window size is in flux.
10800 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
10801 *
10802 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
10803 * jQuery(element).on('click', _.debounce(sendMail, 300, {
10804 * 'leading': true,
10805 * 'trailing': false
10806 * }));
10807 *
10808 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
10809 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
10810 * var source = new EventSource('/stream');
10811 * jQuery(source).on('message', debounced);
10812 *
10813 * // Cancel the trailing debounced invocation.
10814 * jQuery(window).on('popstate', debounced.cancel);
10815 */
10816 function debounce(func, wait, options) {
10817 var lastArgs,
10818 lastThis,
10819 maxWait,
10820 result,
10821 timerId,
10822 lastCallTime,
10823 lastInvokeTime = 0,
10824 leading = false,
10825 maxing = false,
10826 trailing = true;
10827
10828 if (typeof func != 'function') {
10829 throw new TypeError(FUNC_ERROR_TEXT);
10830 }
10831 wait = toNumber(wait) || 0;
10832 if (isObject(options)) {
10833 leading = !!options.leading;
10834 maxing = 'maxWait' in options;
10835 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
10836 trailing = 'trailing' in options ? !!options.trailing : trailing;
10837 }
10838
10839 function invokeFunc(time) {
10840 var args = lastArgs,
10841 thisArg = lastThis;
10842
10843 lastArgs = lastThis = undefined;
10844 lastInvokeTime = time;
10845 result = func.apply(thisArg, args);
10846 return result;
10847 }
10848
10849 function leadingEdge(time) {
10850 // Reset any `maxWait` timer.
10851 lastInvokeTime = time;
10852 // Start the timer for the trailing edge.
10853 timerId = setTimeout(timerExpired, wait);
10854 // Invoke the leading edge.
10855 return leading ? invokeFunc(time) : result;
10856 }
10857
10858 function remainingWait(time) {
10859 var timeSinceLastCall = time - lastCallTime,
10860 timeSinceLastInvoke = time - lastInvokeTime,
10861 timeWaiting = wait - timeSinceLastCall;
10862
10863 return maxing
10864 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
10865 : timeWaiting;
10866 }
10867
10868 function shouldInvoke(time) {
10869 var timeSinceLastCall = time - lastCallTime,
10870 timeSinceLastInvoke = time - lastInvokeTime;
10871
10872 // Either this is the first call, activity has stopped and we're at the
10873 // trailing edge, the system time has gone backwards and we're treating
10874 // it as the trailing edge, or we've hit the `maxWait` limit.
10875 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
10876 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
10877 }
10878
10879 function timerExpired() {
10880 var time = now();
10881 if (shouldInvoke(time)) {
10882 return trailingEdge(time);
10883 }
10884 // Restart the timer.
10885 timerId = setTimeout(timerExpired, remainingWait(time));
10886 }
10887
10888 function trailingEdge(time) {
10889 timerId = undefined;
10890
10891 // Only invoke if we have `lastArgs` which means `func` has been
10892 // debounced at least once.
10893 if (trailing && lastArgs) {
10894 return invokeFunc(time);
10895 }
10896 lastArgs = lastThis = undefined;
10897 return result;
10898 }
10899
10900 function cancel() {
10901 if (timerId !== undefined) {
10902 clearTimeout(timerId);
10903 }
10904 lastInvokeTime = 0;
10905 lastArgs = lastCallTime = lastThis = timerId = undefined;
10906 }
10907
10908 function flush() {
10909 return timerId === undefined ? result : trailingEdge(now());
10910 }
10911
10912 function debounced() {
10913 var time = now(),
10914 isInvoking = shouldInvoke(time);
10915
10916 lastArgs = arguments;
10917 lastThis = this;
10918 lastCallTime = time;
10919
10920 if (isInvoking) {
10921 if (timerId === undefined) {
10922 return leadingEdge(lastCallTime);
10923 }
10924 if (maxing) {
10925 // Handle invocations in a tight loop.
10926 timerId = setTimeout(timerExpired, wait);
10927 return invokeFunc(lastCallTime);
10928 }
10929 }
10930 if (timerId === undefined) {
10931 timerId = setTimeout(timerExpired, wait);
10932 }
10933 return result;
10934 }
10935 debounced.cancel = cancel;
10936 debounced.flush = flush;
10937 return debounced;
10938 }
10939
10940 /**
10941 * Defers invoking the `func` until the current call stack has cleared. Any
10942 * additional arguments are provided to `func` when it's invoked.
10943 *
10944 * @static
10945 * @memberOf _
10946 * @since 0.1.0
10947 * @category Function
10948 * @param {Function} func The function to defer.
10949 * @param {...*} [args] The arguments to invoke `func` with.
10950 * @returns {number} Returns the timer id.
10951 * @example
10952 *
10953 * _.defer(function(text) {
10954 * console.log(text);
10955 * }, 'deferred');
10956 * // => Logs 'deferred' after one millisecond.
10957 */
10958 var defer = baseRest(function(func, args) {
10959 return baseDelay(func, 1, args);
10960 });
10961
10962 /**
10963 * Invokes `func` after `wait` milliseconds. Any additional arguments are
10964 * provided to `func` when it's invoked.
10965 *
10966 * @static
10967 * @memberOf _
10968 * @since 0.1.0
10969 * @category Function
10970 * @param {Function} func The function to delay.
10971 * @param {number} wait The number of milliseconds to delay invocation.
10972 * @param {...*} [args] The arguments to invoke `func` with.
10973 * @returns {number} Returns the timer id.
10974 * @example
10975 *
10976 * _.delay(function(text) {
10977 * console.log(text);
10978 * }, 1000, 'later');
10979 * // => Logs 'later' after one second.
10980 */
10981 var delay = baseRest(function(func, wait, args) {
10982 return baseDelay(func, toNumber(wait) || 0, args);
10983 });
10984
10985 /**
10986 * Creates a function that invokes `func` with arguments reversed.
10987 *
10988 * @static
10989 * @memberOf _
10990 * @since 4.0.0
10991 * @category Function
10992 * @param {Function} func The function to flip arguments for.
10993 * @returns {Function} Returns the new flipped function.
10994 * @example
10995 *
10996 * var flipped = _.flip(function() {
10997 * return _.toArray(arguments);
10998 * });
10999 *
11000 * flipped('a', 'b', 'c', 'd');
11001 * // => ['d', 'c', 'b', 'a']
11002 */
11003 function flip(func) {
11004 return createWrap(func, WRAP_FLIP_FLAG);
11005 }
11006
11007 /**
11008 * Creates a function that memoizes the result of `func`. If `resolver` is
11009 * provided, it determines the cache key for storing the result based on the
11010 * arguments provided to the memoized function. By default, the first argument
11011 * provided to the memoized function is used as the map cache key. The `func`
11012 * is invoked with the `this` binding of the memoized function.
11013 *
11014 * **Note:** The cache is exposed as the `cache` property on the memoized
11015 * function. Its creation may be customized by replacing the `_.memoize.Cache`
11016 * constructor with one whose instances implement the
11017 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
11018 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
11019 *
11020 * @static
11021 * @memberOf _
11022 * @since 0.1.0
11023 * @category Function
11024 * @param {Function} func The function to have its output memoized.
11025 * @param {Function} [resolver] The function to resolve the cache key.
11026 * @returns {Function} Returns the new memoized function.
11027 * @example
11028 *
11029 * var object = { 'a': 1, 'b': 2 };
11030 * var other = { 'c': 3, 'd': 4 };
11031 *
11032 * var values = _.memoize(_.values);
11033 * values(object);
11034 * // => [1, 2]
11035 *
11036 * values(other);
11037 * // => [3, 4]
11038 *
11039 * object.a = 2;
11040 * values(object);
11041 * // => [1, 2]
11042 *
11043 * // Modify the result cache.
11044 * values.cache.set(object, ['a', 'b']);
11045 * values(object);
11046 * // => ['a', 'b']
11047 *
11048 * // Replace `_.memoize.Cache`.
11049 * _.memoize.Cache = WeakMap;
11050 */
11051 function memoize(func, resolver) {
11052 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
11053 throw new TypeError(FUNC_ERROR_TEXT);
11054 }
11055 var memoized = function() {
11056 var args = arguments,
11057 key = resolver ? resolver.apply(this, args) : args[0],
11058 cache = memoized.cache;
11059
11060 if (cache.has(key)) {
11061 return cache.get(key);
11062 }
11063 var result = func.apply(this, args);
11064 memoized.cache = cache.set(key, result) || cache;
11065 return result;
11066 };
11067 memoized.cache = new (memoize.Cache || MapCache);
11068 return memoized;
11069 }
11070
11071 // Expose `MapCache`.
11072 memoize.Cache = MapCache;
11073
11074 /**
11075 * Creates a function that negates the result of the predicate `func`. The
11076 * `func` predicate is invoked with the `this` binding and arguments of the
11077 * created function.
11078 *
11079 * @static
11080 * @memberOf _
11081 * @since 3.0.0
11082 * @category Function
11083 * @param {Function} predicate The predicate to negate.
11084 * @returns {Function} Returns the new negated function.
11085 * @example
11086 *
11087 * function isEven(n) {
11088 * return n % 2 == 0;
11089 * }
11090 *
11091 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
11092 * // => [1, 3, 5]
11093 */
11094 function negate(predicate) {
11095 if (typeof predicate != 'function') {
11096 throw new TypeError(FUNC_ERROR_TEXT);
11097 }
11098 return function() {
11099 var args = arguments;
11100 switch (args.length) {
11101 case 0: return !predicate.call(this);
11102 case 1: return !predicate.call(this, args[0]);
11103 case 2: return !predicate.call(this, args[0], args[1]);
11104 case 3: return !predicate.call(this, args[0], args[1], args[2]);
11105 }
11106 return !predicate.apply(this, args);
11107 };
11108 }
11109
11110 /**
11111 * Creates a function that is restricted to invoking `func` once. Repeat calls
11112 * to the function return the value of the first invocation. The `func` is
11113 * invoked with the `this` binding and arguments of the created function.
11114 *
11115 * @static
11116 * @memberOf _
11117 * @since 0.1.0
11118 * @category Function
11119 * @param {Function} func The function to restrict.
11120 * @returns {Function} Returns the new restricted function.
11121 * @example
11122 *
11123 * var initialize = _.once(createApplication);
11124 * initialize();
11125 * initialize();
11126 * // => `createApplication` is invoked once
11127 */
11128 function once(func) {
11129 return before(2, func);
11130 }
11131
11132 /**
11133 * Creates a function that invokes `func` with its arguments transformed.
11134 *
11135 * @static
11136 * @since 4.0.0
11137 * @memberOf _
11138 * @category Function
11139 * @param {Function} func The function to wrap.
11140 * @param {...(Function|Function[])} [transforms=[_.identity]]
11141 * The argument transforms.
11142 * @returns {Function} Returns the new function.
11143 * @example
11144 *
11145 * function doubled(n) {
11146 * return n * 2;
11147 * }
11148 *
11149 * function square(n) {
11150 * return n * n;
11151 * }
11152 *
11153 * var func = _.overArgs(function(x, y) {
11154 * return [x, y];
11155 * }, [square, doubled]);
11156 *
11157 * func(9, 3);
11158 * // => [81, 6]
11159 *
11160 * func(10, 5);
11161 * // => [100, 10]
11162 */
11163 var overArgs = castRest(function(func, transforms) {
11164 transforms = (transforms.length == 1 && isArray(transforms[0]))
11165 ? arrayMap(transforms[0], baseUnary(getIteratee()))
11166 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
11167
11168 var funcsLength = transforms.length;
11169 return baseRest(function(args) {
11170 var index = -1,
11171 length = nativeMin(args.length, funcsLength);
11172
11173 while (++index < length) {
11174 args[index] = transforms[index].call(this, args[index]);
11175 }
11176 return apply(func, this, args);
11177 });
11178 });
11179
11180 /**
11181 * Creates a function that invokes `func` with `partials` prepended to the
11182 * arguments it receives. This method is like `_.bind` except it does **not**
11183 * alter the `this` binding.
11184 *
11185 * The `_.partial.placeholder` value, which defaults to `_` in monolithic
11186 * builds, may be used as a placeholder for partially applied arguments.
11187 *
11188 * **Note:** This method doesn't set the "length" property of partially
11189 * applied functions.
11190 *
11191 * @static
11192 * @memberOf _
11193 * @since 0.2.0
11194 * @category Function
11195 * @param {Function} func The function to partially apply arguments to.
11196 * @param {...*} [partials] The arguments to be partially applied.
11197 * @returns {Function} Returns the new partially applied function.
11198 * @example
11199 *
11200 * function greet(greeting, name) {
11201 * return greeting + ' ' + name;
11202 * }
11203 *
11204 * var sayHelloTo = _.partial(greet, 'hello');
11205 * sayHelloTo('fred');
11206 * // => 'hello fred'
11207 *
11208 * // Partially applied with placeholders.
11209 * var greetFred = _.partial(greet, _, 'fred');
11210 * greetFred('hi');
11211 * // => 'hi fred'
11212 */
11213 var partial = baseRest(function(func, partials) {
11214 var holders = replaceHolders(partials, getHolder(partial));
11215 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
11216 });
11217
11218 /**
11219 * This method is like `_.partial` except that partially applied arguments
11220 * are appended to the arguments it receives.
11221 *
11222 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
11223 * builds, may be used as a placeholder for partially applied arguments.
11224 *
11225 * **Note:** This method doesn't set the "length" property of partially
11226 * applied functions.
11227 *
11228 * @static
11229 * @memberOf _
11230 * @since 1.0.0
11231 * @category Function
11232 * @param {Function} func The function to partially apply arguments to.
11233 * @param {...*} [partials] The arguments to be partially applied.
11234 * @returns {Function} Returns the new partially applied function.
11235 * @example
11236 *
11237 * function greet(greeting, name) {
11238 * return greeting + ' ' + name;
11239 * }
11240 *
11241 * var greetFred = _.partialRight(greet, 'fred');
11242 * greetFred('hi');
11243 * // => 'hi fred'
11244 *
11245 * // Partially applied with placeholders.
11246 * var sayHelloTo = _.partialRight(greet, 'hello', _);
11247 * sayHelloTo('fred');
11248 * // => 'hello fred'
11249 */
11250 var partialRight = baseRest(function(func, partials) {
11251 var holders = replaceHolders(partials, getHolder(partialRight));
11252 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
11253 });
11254
11255 /**
11256 * Creates a function that invokes `func` with arguments arranged according
11257 * to the specified `indexes` where the argument value at the first index is
11258 * provided as the first argument, the argument value at the second index is
11259 * provided as the second argument, and so on.
11260 *
11261 * @static
11262 * @memberOf _
11263 * @since 3.0.0
11264 * @category Function
11265 * @param {Function} func The function to rearrange arguments for.
11266 * @param {...(number|number[])} indexes The arranged argument indexes.
11267 * @returns {Function} Returns the new function.
11268 * @example
11269 *
11270 * var rearged = _.rearg(function(a, b, c) {
11271 * return [a, b, c];
11272 * }, [2, 0, 1]);
11273 *
11274 * rearged('b', 'c', 'a')
11275 * // => ['a', 'b', 'c']
11276 */
11277 var rearg = flatRest(function(func, indexes) {
11278 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
11279 });
11280
11281 /**
11282 * Creates a function that invokes `func` with the `this` binding of the
11283 * created function and arguments from `start` and beyond provided as
11284 * an array.
11285 *
11286 * **Note:** This method is based on the
11287 * [rest parameter](https://mdn.io/rest_parameters).
11288 *
11289 * @static
11290 * @memberOf _
11291 * @since 4.0.0
11292 * @category Function
11293 * @param {Function} func The function to apply a rest parameter to.
11294 * @param {number} [start=func.length-1] The start position of the rest parameter.
11295 * @returns {Function} Returns the new function.
11296 * @example
11297 *
11298 * var say = _.rest(function(what, names) {
11299 * return what + ' ' + _.initial(names).join(', ') +
11300 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
11301 * });
11302 *
11303 * say('hello', 'fred', 'barney', 'pebbles');
11304 * // => 'hello fred, barney, & pebbles'
11305 */
11306 function rest(func, start) {
11307 if (typeof func != 'function') {
11308 throw new TypeError(FUNC_ERROR_TEXT);
11309 }
11310 start = start === undefined ? start : toInteger(start);
11311 return baseRest(func, start);
11312 }
11313
11314 /**
11315 * Creates a function that invokes `func` with the `this` binding of the
11316 * create function and an array of arguments much like
11317 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
11318 *
11319 * **Note:** This method is based on the
11320 * [spread operator](https://mdn.io/spread_operator).
11321 *
11322 * @static
11323 * @memberOf _
11324 * @since 3.2.0
11325 * @category Function
11326 * @param {Function} func The function to spread arguments over.
11327 * @param {number} [start=0] The start position of the spread.
11328 * @returns {Function} Returns the new function.
11329 * @example
11330 *
11331 * var say = _.spread(function(who, what) {
11332 * return who + ' says ' + what;
11333 * });
11334 *
11335 * say(['fred', 'hello']);
11336 * // => 'fred says hello'
11337 *
11338 * var numbers = Promise.all([
11339 * Promise.resolve(40),
11340 * Promise.resolve(36)
11341 * ]);
11342 *
11343 * numbers.then(_.spread(function(x, y) {
11344 * return x + y;
11345 * }));
11346 * // => a Promise of 76
11347 */
11348 function spread(func, start) {
11349 if (typeof func != 'function') {
11350 throw new TypeError(FUNC_ERROR_TEXT);
11351 }
11352 start = start == null ? 0 : nativeMax(toInteger(start), 0);
11353 return baseRest(function(args) {
11354 var array = args[start],
11355 otherArgs = castSlice(args, 0, start);
11356
11357 if (array) {
11358 arrayPush(otherArgs, array);
11359 }
11360 return apply(func, this, otherArgs);
11361 });
11362 }
11363
11364 /**
11365 * Creates a throttled function that only invokes `func` at most once per
11366 * every `wait` milliseconds. The throttled function comes with a `cancel`
11367 * method to cancel delayed `func` invocations and a `flush` method to
11368 * immediately invoke them. Provide `options` to indicate whether `func`
11369 * should be invoked on the leading and/or trailing edge of the `wait`
11370 * timeout. The `func` is invoked with the last arguments provided to the
11371 * throttled function. Subsequent calls to the throttled function return the
11372 * result of the last `func` invocation.
11373 *
11374 * **Note:** If `leading` and `trailing` options are `true`, `func` is
11375 * invoked on the trailing edge of the timeout only if the throttled function
11376 * is invoked more than once during the `wait` timeout.
11377 *
11378 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
11379 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
11380 *
11381 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
11382 * for details over the differences between `_.throttle` and `_.debounce`.
11383 *
11384 * @static
11385 * @memberOf _
11386 * @since 0.1.0
11387 * @category Function
11388 * @param {Function} func The function to throttle.
11389 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
11390 * @param {Object} [options={}] The options object.
11391 * @param {boolean} [options.leading=true]
11392 * Specify invoking on the leading edge of the timeout.
11393 * @param {boolean} [options.trailing=true]
11394 * Specify invoking on the trailing edge of the timeout.
11395 * @returns {Function} Returns the new throttled function.
11396 * @example
11397 *
11398 * // Avoid excessively updating the position while scrolling.
11399 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
11400 *
11401 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
11402 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
11403 * jQuery(element).on('click', throttled);
11404 *
11405 * // Cancel the trailing throttled invocation.
11406 * jQuery(window).on('popstate', throttled.cancel);
11407 */
11408 function throttle(func, wait, options) {
11409 var leading = true,
11410 trailing = true;
11411
11412 if (typeof func != 'function') {
11413 throw new TypeError(FUNC_ERROR_TEXT);
11414 }
11415 if (isObject(options)) {
11416 leading = 'leading' in options ? !!options.leading : leading;
11417 trailing = 'trailing' in options ? !!options.trailing : trailing;
11418 }
11419 return debounce(func, wait, {
11420 'leading': leading,
11421 'maxWait': wait,
11422 'trailing': trailing
11423 });
11424 }
11425
11426 /**
11427 * Creates a function that accepts up to one argument, ignoring any
11428 * additional arguments.
11429 *
11430 * @static
11431 * @memberOf _
11432 * @since 4.0.0
11433 * @category Function
11434 * @param {Function} func The function to cap arguments for.
11435 * @returns {Function} Returns the new capped function.
11436 * @example
11437 *
11438 * _.map(['6', '8', '10'], _.unary(parseInt));
11439 * // => [6, 8, 10]
11440 */
11441 function unary(func) {
11442 return ary(func, 1);
11443 }
11444
11445 /**
11446 * Creates a function that provides `value` to `wrapper` as its first
11447 * argument. Any additional arguments provided to the function are appended
11448 * to those provided to the `wrapper`. The wrapper is invoked with the `this`
11449 * binding of the created function.
11450 *
11451 * @static
11452 * @memberOf _
11453 * @since 0.1.0
11454 * @category Function
11455 * @param {*} value The value to wrap.
11456 * @param {Function} [wrapper=identity] The wrapper function.
11457 * @returns {Function} Returns the new function.
11458 * @example
11459 *
11460 * var p = _.wrap(_.escape, function(func, text) {
11461 * return '<p>' + func(text) + '</p>';
11462 * });
11463 *
11464 * p('fred, barney, & pebbles');
11465 * // => '<p>fred, barney, &amp; pebbles</p>'
11466 */
11467 function wrap(value, wrapper) {
11468 return partial(castFunction(wrapper), value);
11469 }
11470
11471 /*------------------------------------------------------------------------*/
11472
11473 /**
11474 * Casts `value` as an array if it's not one.
11475 *
11476 * @static
11477 * @memberOf _
11478 * @since 4.4.0
11479 * @category Lang
11480 * @param {*} value The value to inspect.
11481 * @returns {Array} Returns the cast array.
11482 * @example
11483 *
11484 * _.castArray(1);
11485 * // => [1]
11486 *
11487 * _.castArray({ 'a': 1 });
11488 * // => [{ 'a': 1 }]
11489 *
11490 * _.castArray('abc');
11491 * // => ['abc']
11492 *
11493 * _.castArray(null);
11494 * // => [null]
11495 *
11496 * _.castArray(undefined);
11497 * // => [undefined]
11498 *
11499 * _.castArray();
11500 * // => []
11501 *
11502 * var array = [1, 2, 3];
11503 * console.log(_.castArray(array) === array);
11504 * // => true
11505 */
11506 function castArray() {
11507 if (!arguments.length) {
11508 return [];
11509 }
11510 var value = arguments[0];
11511 return isArray(value) ? value : [value];
11512 }
11513
11514 /**
11515 * Creates a shallow clone of `value`.
11516 *
11517 * **Note:** This method is loosely based on the
11518 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
11519 * and supports cloning arrays, array buffers, booleans, date objects, maps,
11520 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
11521 * arrays. The own enumerable properties of `arguments` objects are cloned
11522 * as plain objects. An empty object is returned for uncloneable values such
11523 * as error objects, functions, DOM nodes, and WeakMaps.
11524 *
11525 * @static
11526 * @memberOf _
11527 * @since 0.1.0
11528 * @category Lang
11529 * @param {*} value The value to clone.
11530 * @returns {*} Returns the cloned value.
11531 * @see _.cloneDeep
11532 * @example
11533 *
11534 * var objects = [{ 'a': 1 }, { 'b': 2 }];
11535 *
11536 * var shallow = _.clone(objects);
11537 * console.log(shallow[0] === objects[0]);
11538 * // => true
11539 */
11540 function clone(value) {
11541 return baseClone(value, CLONE_SYMBOLS_FLAG);
11542 }
11543
11544 /**
11545 * This method is like `_.clone` except that it accepts `customizer` which
11546 * is invoked to produce the cloned value. If `customizer` returns `undefined`,
11547 * cloning is handled by the method instead. The `customizer` is invoked with
11548 * up to four arguments; (value [, index|key, object, stack]).
11549 *
11550 * @static
11551 * @memberOf _
11552 * @since 4.0.0
11553 * @category Lang
11554 * @param {*} value The value to clone.
11555 * @param {Function} [customizer] The function to customize cloning.
11556 * @returns {*} Returns the cloned value.
11557 * @see _.cloneDeepWith
11558 * @example
11559 *
11560 * function customizer(value) {
11561 * if (_.isElement(value)) {
11562 * return value.cloneNode(false);
11563 * }
11564 * }
11565 *
11566 * var el = _.cloneWith(document.body, customizer);
11567 *
11568 * console.log(el === document.body);
11569 * // => false
11570 * console.log(el.nodeName);
11571 * // => 'BODY'
11572 * console.log(el.childNodes.length);
11573 * // => 0
11574 */
11575 function cloneWith(value, customizer) {
11576 customizer = typeof customizer == 'function' ? customizer : undefined;
11577 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
11578 }
11579
11580 /**
11581 * This method is like `_.clone` except that it recursively clones `value`.
11582 *
11583 * @static
11584 * @memberOf _
11585 * @since 1.0.0
11586 * @category Lang
11587 * @param {*} value The value to recursively clone.
11588 * @returns {*} Returns the deep cloned value.
11589 * @see _.clone
11590 * @example
11591 *
11592 * var objects = [{ 'a': 1 }, { 'b': 2 }];
11593 *
11594 * var deep = _.cloneDeep(objects);
11595 * console.log(deep[0] === objects[0]);
11596 * // => false
11597 */
11598 function cloneDeep(value) {
11599 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
11600 }
11601
11602 /**
11603 * This method is like `_.cloneWith` except that it recursively clones `value`.
11604 *
11605 * @static
11606 * @memberOf _
11607 * @since 4.0.0
11608 * @category Lang
11609 * @param {*} value The value to recursively clone.
11610 * @param {Function} [customizer] The function to customize cloning.
11611 * @returns {*} Returns the deep cloned value.
11612 * @see _.cloneWith
11613 * @example
11614 *
11615 * function customizer(value) {
11616 * if (_.isElement(value)) {
11617 * return value.cloneNode(true);
11618 * }
11619 * }
11620 *
11621 * var el = _.cloneDeepWith(document.body, customizer);
11622 *
11623 * console.log(el === document.body);
11624 * // => false
11625 * console.log(el.nodeName);
11626 * // => 'BODY'
11627 * console.log(el.childNodes.length);
11628 * // => 20
11629 */
11630 function cloneDeepWith(value, customizer) {
11631 customizer = typeof customizer == 'function' ? customizer : undefined;
11632 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
11633 }
11634
11635 /**
11636 * Checks if `object` conforms to `source` by invoking the predicate
11637 * properties of `source` with the corresponding property values of `object`.
11638 *
11639 * **Note:** This method is equivalent to `_.conforms` when `source` is
11640 * partially applied.
11641 *
11642 * @static
11643 * @memberOf _
11644 * @since 4.14.0
11645 * @category Lang
11646 * @param {Object} object The object to inspect.
11647 * @param {Object} source The object of property predicates to conform to.
11648 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
11649 * @example
11650 *
11651 * var object = { 'a': 1, 'b': 2 };
11652 *
11653 * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
11654 * // => true
11655 *
11656 * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
11657 * // => false
11658 */
11659 function conformsTo(object, source) {
11660 return source == null || baseConformsTo(object, source, keys(source));
11661 }
11662
11663 /**
11664 * Performs a
11665 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
11666 * comparison between two values to determine if they are equivalent.
11667 *
11668 * @static
11669 * @memberOf _
11670 * @since 4.0.0
11671 * @category Lang
11672 * @param {*} value The value to compare.
11673 * @param {*} other The other value to compare.
11674 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
11675 * @example
11676 *
11677 * var object = { 'a': 1 };
11678 * var other = { 'a': 1 };
11679 *
11680 * _.eq(object, object);
11681 * // => true
11682 *
11683 * _.eq(object, other);
11684 * // => false
11685 *
11686 * _.eq('a', 'a');
11687 * // => true
11688 *
11689 * _.eq('a', Object('a'));
11690 * // => false
11691 *
11692 * _.eq(NaN, NaN);
11693 * // => true
11694 */
11695 function eq(value, other) {
11696 return value === other || (value !== value && other !== other);
11697 }
11698
11699 /**
11700 * Checks if `value` is greater than `other`.
11701 *
11702 * @static
11703 * @memberOf _
11704 * @since 3.9.0
11705 * @category Lang
11706 * @param {*} value The value to compare.
11707 * @param {*} other The other value to compare.
11708 * @returns {boolean} Returns `true` if `value` is greater than `other`,
11709 * else `false`.
11710 * @see _.lt
11711 * @example
11712 *
11713 * _.gt(3, 1);
11714 * // => true
11715 *
11716 * _.gt(3, 3);
11717 * // => false
11718 *
11719 * _.gt(1, 3);
11720 * // => false
11721 */
11722 var gt = createRelationalOperation(baseGt);
11723
11724 /**
11725 * Checks if `value` is greater than or equal to `other`.
11726 *
11727 * @static
11728 * @memberOf _
11729 * @since 3.9.0
11730 * @category Lang
11731 * @param {*} value The value to compare.
11732 * @param {*} other The other value to compare.
11733 * @returns {boolean} Returns `true` if `value` is greater than or equal to
11734 * `other`, else `false`.
11735 * @see _.lte
11736 * @example
11737 *
11738 * _.gte(3, 1);
11739 * // => true
11740 *
11741 * _.gte(3, 3);
11742 * // => true
11743 *
11744 * _.gte(1, 3);
11745 * // => false
11746 */
11747 var gte = createRelationalOperation(function(value, other) {
11748 return value >= other;
11749 });
11750
11751 /**
11752 * Checks if `value` is likely an `arguments` object.
11753 *
11754 * @static
11755 * @memberOf _
11756 * @since 0.1.0
11757 * @category Lang
11758 * @param {*} value The value to check.
11759 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
11760 * else `false`.
11761 * @example
11762 *
11763 * _.isArguments(function() { return arguments; }());
11764 * // => true
11765 *
11766 * _.isArguments([1, 2, 3]);
11767 * // => false
11768 */
11769 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
11770 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
11771 !propertyIsEnumerable.call(value, 'callee');
11772 };
11773
11774 /**
11775 * Checks if `value` is classified as an `Array` object.
11776 *
11777 * @static
11778 * @memberOf _
11779 * @since 0.1.0
11780 * @category Lang
11781 * @param {*} value The value to check.
11782 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
11783 * @example
11784 *
11785 * _.isArray([1, 2, 3]);
11786 * // => true
11787 *
11788 * _.isArray(document.body.children);
11789 * // => false
11790 *
11791 * _.isArray('abc');
11792 * // => false
11793 *
11794 * _.isArray(_.noop);
11795 * // => false
11796 */
11797 var isArray = Array.isArray;
11798
11799 /**
11800 * Checks if `value` is classified as an `ArrayBuffer` object.
11801 *
11802 * @static
11803 * @memberOf _
11804 * @since 4.3.0
11805 * @category Lang
11806 * @param {*} value The value to check.
11807 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
11808 * @example
11809 *
11810 * _.isArrayBuffer(new ArrayBuffer(2));
11811 * // => true
11812 *
11813 * _.isArrayBuffer(new Array(2));
11814 * // => false
11815 */
11816 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
11817
11818 /**
11819 * Checks if `value` is array-like. A value is considered array-like if it's
11820 * not a function and has a `value.length` that's an integer greater than or
11821 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
11822 *
11823 * @static
11824 * @memberOf _
11825 * @since 4.0.0
11826 * @category Lang
11827 * @param {*} value The value to check.
11828 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
11829 * @example
11830 *
11831 * _.isArrayLike([1, 2, 3]);
11832 * // => true
11833 *
11834 * _.isArrayLike(document.body.children);
11835 * // => true
11836 *
11837 * _.isArrayLike('abc');
11838 * // => true
11839 *
11840 * _.isArrayLike(_.noop);
11841 * // => false
11842 */
11843 function isArrayLike(value) {
11844 return value != null && isLength(value.length) && !isFunction(value);
11845 }
11846
11847 /**
11848 * This method is like `_.isArrayLike` except that it also checks if `value`
11849 * is an object.
11850 *
11851 * @static
11852 * @memberOf _
11853 * @since 4.0.0
11854 * @category Lang
11855 * @param {*} value The value to check.
11856 * @returns {boolean} Returns `true` if `value` is an array-like object,
11857 * else `false`.
11858 * @example
11859 *
11860 * _.isArrayLikeObject([1, 2, 3]);
11861 * // => true
11862 *
11863 * _.isArrayLikeObject(document.body.children);
11864 * // => true
11865 *
11866 * _.isArrayLikeObject('abc');
11867 * // => false
11868 *
11869 * _.isArrayLikeObject(_.noop);
11870 * // => false
11871 */
11872 function isArrayLikeObject(value) {
11873 return isObjectLike(value) && isArrayLike(value);
11874 }
11875
11876 /**
11877 * Checks if `value` is classified as a boolean primitive or object.
11878 *
11879 * @static
11880 * @memberOf _
11881 * @since 0.1.0
11882 * @category Lang
11883 * @param {*} value The value to check.
11884 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
11885 * @example
11886 *
11887 * _.isBoolean(false);
11888 * // => true
11889 *
11890 * _.isBoolean(null);
11891 * // => false
11892 */
11893 function isBoolean(value) {
11894 return value === true || value === false ||
11895 (isObjectLike(value) && baseGetTag(value) == boolTag);
11896 }
11897
11898 /**
11899 * Checks if `value` is a buffer.
11900 *
11901 * @static
11902 * @memberOf _
11903 * @since 4.3.0
11904 * @category Lang
11905 * @param {*} value The value to check.
11906 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
11907 * @example
11908 *
11909 * _.isBuffer(new Buffer(2));
11910 * // => true
11911 *
11912 * _.isBuffer(new Uint8Array(2));
11913 * // => false
11914 */
11915 var isBuffer = nativeIsBuffer || stubFalse;
11916
11917 /**
11918 * Checks if `value` is classified as a `Date` object.
11919 *
11920 * @static
11921 * @memberOf _
11922 * @since 0.1.0
11923 * @category Lang
11924 * @param {*} value The value to check.
11925 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
11926 * @example
11927 *
11928 * _.isDate(new Date);
11929 * // => true
11930 *
11931 * _.isDate('Mon April 23 2012');
11932 * // => false
11933 */
11934 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
11935
11936 /**
11937 * Checks if `value` is likely a DOM element.
11938 *
11939 * @static
11940 * @memberOf _
11941 * @since 0.1.0
11942 * @category Lang
11943 * @param {*} value The value to check.
11944 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
11945 * @example
11946 *
11947 * _.isElement(document.body);
11948 * // => true
11949 *
11950 * _.isElement('<body>');
11951 * // => false
11952 */
11953 function isElement(value) {
11954 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
11955 }
11956
11957 /**
11958 * Checks if `value` is an empty object, collection, map, or set.
11959 *
11960 * Objects are considered empty if they have no own enumerable string keyed
11961 * properties.
11962 *
11963 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
11964 * jQuery-like collections are considered empty if they have a `length` of `0`.
11965 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
11966 *
11967 * @static
11968 * @memberOf _
11969 * @since 0.1.0
11970 * @category Lang
11971 * @param {*} value The value to check.
11972 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
11973 * @example
11974 *
11975 * _.isEmpty(null);
11976 * // => true
11977 *
11978 * _.isEmpty(true);
11979 * // => true
11980 *
11981 * _.isEmpty(1);
11982 * // => true
11983 *
11984 * _.isEmpty([1, 2, 3]);
11985 * // => false
11986 *
11987 * _.isEmpty({ 'a': 1 });
11988 * // => false
11989 */
11990 function isEmpty(value) {
11991 if (value == null) {
11992 return true;
11993 }
11994 if (isArrayLike(value) &&
11995 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
11996 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
11997 return !value.length;
11998 }
11999 var tag = getTag(value);
12000 if (tag == mapTag || tag == setTag) {
12001 return !value.size;
12002 }
12003 if (isPrototype(value)) {
12004 return !baseKeys(value).length;
12005 }
12006 for (var key in value) {
12007 if (hasOwnProperty.call(value, key)) {
12008 return false;
12009 }
12010 }
12011 return true;
12012 }
12013
12014 /**
12015 * Performs a deep comparison between two values to determine if they are
12016 * equivalent.
12017 *
12018 * **Note:** This method supports comparing arrays, array buffers, booleans,
12019 * date objects, error objects, maps, numbers, `Object` objects, regexes,
12020 * sets, strings, symbols, and typed arrays. `Object` objects are compared
12021 * by their own, not inherited, enumerable properties. Functions and DOM
12022 * nodes are compared by strict equality, i.e. `===`.
12023 *
12024 * @static
12025 * @memberOf _
12026 * @since 0.1.0
12027 * @category Lang
12028 * @param {*} value The value to compare.
12029 * @param {*} other The other value to compare.
12030 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12031 * @example
12032 *
12033 * var object = { 'a': 1 };
12034 * var other = { 'a': 1 };
12035 *
12036 * _.isEqual(object, other);
12037 * // => true
12038 *
12039 * object === other;
12040 * // => false
12041 */
12042 function isEqual(value, other) {
12043 return baseIsEqual(value, other);
12044 }
12045
12046 /**
12047 * This method is like `_.isEqual` except that it accepts `customizer` which
12048 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
12049 * are handled by the method instead. The `customizer` is invoked with up to
12050 * six arguments: (objValue, othValue [, index|key, object, other, stack]).
12051 *
12052 * @static
12053 * @memberOf _
12054 * @since 4.0.0
12055 * @category Lang
12056 * @param {*} value The value to compare.
12057 * @param {*} other The other value to compare.
12058 * @param {Function} [customizer] The function to customize comparisons.
12059 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12060 * @example
12061 *
12062 * function isGreeting(value) {
12063 * return /^h(?:i|ello)$/.test(value);
12064 * }
12065 *
12066 * function customizer(objValue, othValue) {
12067 * if (isGreeting(objValue) && isGreeting(othValue)) {
12068 * return true;
12069 * }
12070 * }
12071 *
12072 * var array = ['hello', 'goodbye'];
12073 * var other = ['hi', 'goodbye'];
12074 *
12075 * _.isEqualWith(array, other, customizer);
12076 * // => true
12077 */
12078 function isEqualWith(value, other, customizer) {
12079 customizer = typeof customizer == 'function' ? customizer : undefined;
12080 var result = customizer ? customizer(value, other) : undefined;
12081 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
12082 }
12083
12084 /**
12085 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
12086 * `SyntaxError`, `TypeError`, or `URIError` object.
12087 *
12088 * @static
12089 * @memberOf _
12090 * @since 3.0.0
12091 * @category Lang
12092 * @param {*} value The value to check.
12093 * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
12094 * @example
12095 *
12096 * _.isError(new Error);
12097 * // => true
12098 *
12099 * _.isError(Error);
12100 * // => false
12101 */
12102 function isError(value) {
12103 if (!isObjectLike(value)) {
12104 return false;
12105 }
12106 var tag = baseGetTag(value);
12107 return tag == errorTag || tag == domExcTag ||
12108 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
12109 }
12110
12111 /**
12112 * Checks if `value` is a finite primitive number.
12113 *
12114 * **Note:** This method is based on
12115 * [`Number.isFinite`](https://mdn.io/Number/isFinite).
12116 *
12117 * @static
12118 * @memberOf _
12119 * @since 0.1.0
12120 * @category Lang
12121 * @param {*} value The value to check.
12122 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
12123 * @example
12124 *
12125 * _.isFinite(3);
12126 * // => true
12127 *
12128 * _.isFinite(Number.MIN_VALUE);
12129 * // => true
12130 *
12131 * _.isFinite(Infinity);
12132 * // => false
12133 *
12134 * _.isFinite('3');
12135 * // => false
12136 */
12137 function isFinite(value) {
12138 return typeof value == 'number' && nativeIsFinite(value);
12139 }
12140
12141 /**
12142 * Checks if `value` is classified as a `Function` object.
12143 *
12144 * @static
12145 * @memberOf _
12146 * @since 0.1.0
12147 * @category Lang
12148 * @param {*} value The value to check.
12149 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
12150 * @example
12151 *
12152 * _.isFunction(_);
12153 * // => true
12154 *
12155 * _.isFunction(/abc/);
12156 * // => false
12157 */
12158 function isFunction(value) {
12159 if (!isObject(value)) {
12160 return false;
12161 }
12162 // The use of `Object#toString` avoids issues with the `typeof` operator
12163 // in Safari 9 which returns 'object' for typed arrays and other constructors.
12164 var tag = baseGetTag(value);
12165 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
12166 }
12167
12168 /**
12169 * Checks if `value` is an integer.
12170 *
12171 * **Note:** This method is based on
12172 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
12173 *
12174 * @static
12175 * @memberOf _
12176 * @since 4.0.0
12177 * @category Lang
12178 * @param {*} value The value to check.
12179 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
12180 * @example
12181 *
12182 * _.isInteger(3);
12183 * // => true
12184 *
12185 * _.isInteger(Number.MIN_VALUE);
12186 * // => false
12187 *
12188 * _.isInteger(Infinity);
12189 * // => false
12190 *
12191 * _.isInteger('3');
12192 * // => false
12193 */
12194 function isInteger(value) {
12195 return typeof value == 'number' && value == toInteger(value);
12196 }
12197
12198 /**
12199 * Checks if `value` is a valid array-like length.
12200 *
12201 * **Note:** This method is loosely based on
12202 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
12203 *
12204 * @static
12205 * @memberOf _
12206 * @since 4.0.0
12207 * @category Lang
12208 * @param {*} value The value to check.
12209 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12210 * @example
12211 *
12212 * _.isLength(3);
12213 * // => true
12214 *
12215 * _.isLength(Number.MIN_VALUE);
12216 * // => false
12217 *
12218 * _.isLength(Infinity);
12219 * // => false
12220 *
12221 * _.isLength('3');
12222 * // => false
12223 */
12224 function isLength(value) {
12225 return typeof value == 'number' &&
12226 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12227 }
12228
12229 /**
12230 * Checks if `value` is the
12231 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
12232 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12233 *
12234 * @static
12235 * @memberOf _
12236 * @since 0.1.0
12237 * @category Lang
12238 * @param {*} value The value to check.
12239 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12240 * @example
12241 *
12242 * _.isObject({});
12243 * // => true
12244 *
12245 * _.isObject([1, 2, 3]);
12246 * // => true
12247 *
12248 * _.isObject(_.noop);
12249 * // => true
12250 *
12251 * _.isObject(null);
12252 * // => false
12253 */
12254 function isObject(value) {
12255 var type = typeof value;
12256 return value != null && (type == 'object' || type == 'function');
12257 }
12258
12259 /**
12260 * Checks if `value` is object-like. A value is object-like if it's not `null`
12261 * and has a `typeof` result of "object".
12262 *
12263 * @static
12264 * @memberOf _
12265 * @since 4.0.0
12266 * @category Lang
12267 * @param {*} value The value to check.
12268 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
12269 * @example
12270 *
12271 * _.isObjectLike({});
12272 * // => true
12273 *
12274 * _.isObjectLike([1, 2, 3]);
12275 * // => true
12276 *
12277 * _.isObjectLike(_.noop);
12278 * // => false
12279 *
12280 * _.isObjectLike(null);
12281 * // => false
12282 */
12283 function isObjectLike(value) {
12284 return value != null && typeof value == 'object';
12285 }
12286
12287 /**
12288 * Checks if `value` is classified as a `Map` object.
12289 *
12290 * @static
12291 * @memberOf _
12292 * @since 4.3.0
12293 * @category Lang
12294 * @param {*} value The value to check.
12295 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
12296 * @example
12297 *
12298 * _.isMap(new Map);
12299 * // => true
12300 *
12301 * _.isMap(new WeakMap);
12302 * // => false
12303 */
12304 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
12305
12306 /**
12307 * Performs a partial deep comparison between `object` and `source` to
12308 * determine if `object` contains equivalent property values.
12309 *
12310 * **Note:** This method is equivalent to `_.matches` when `source` is
12311 * partially applied.
12312 *
12313 * Partial comparisons will match empty array and empty object `source`
12314 * values against any array or object value, respectively. See `_.isEqual`
12315 * for a list of supported value comparisons.
12316 *
12317 * @static
12318 * @memberOf _
12319 * @since 3.0.0
12320 * @category Lang
12321 * @param {Object} object The object to inspect.
12322 * @param {Object} source The object of property values to match.
12323 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
12324 * @example
12325 *
12326 * var object = { 'a': 1, 'b': 2 };
12327 *
12328 * _.isMatch(object, { 'b': 2 });
12329 * // => true
12330 *
12331 * _.isMatch(object, { 'b': 1 });
12332 * // => false
12333 */
12334 function isMatch(object, source) {
12335 return object === source || baseIsMatch(object, source, getMatchData(source));
12336 }
12337
12338 /**
12339 * This method is like `_.isMatch` except that it accepts `customizer` which
12340 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
12341 * are handled by the method instead. The `customizer` is invoked with five
12342 * arguments: (objValue, srcValue, index|key, object, source).
12343 *
12344 * @static
12345 * @memberOf _
12346 * @since 4.0.0
12347 * @category Lang
12348 * @param {Object} object The object to inspect.
12349 * @param {Object} source The object of property values to match.
12350 * @param {Function} [customizer] The function to customize comparisons.
12351 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
12352 * @example
12353 *
12354 * function isGreeting(value) {
12355 * return /^h(?:i|ello)$/.test(value);
12356 * }
12357 *
12358 * function customizer(objValue, srcValue) {
12359 * if (isGreeting(objValue) && isGreeting(srcValue)) {
12360 * return true;
12361 * }
12362 * }
12363 *
12364 * var object = { 'greeting': 'hello' };
12365 * var source = { 'greeting': 'hi' };
12366 *
12367 * _.isMatchWith(object, source, customizer);
12368 * // => true
12369 */
12370 function isMatchWith(object, source, customizer) {
12371 customizer = typeof customizer == 'function' ? customizer : undefined;
12372 return baseIsMatch(object, source, getMatchData(source), customizer);
12373 }
12374
12375 /**
12376 * Checks if `value` is `NaN`.
12377 *
12378 * **Note:** This method is based on
12379 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
12380 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
12381 * `undefined` and other non-number values.
12382 *
12383 * @static
12384 * @memberOf _
12385 * @since 0.1.0
12386 * @category Lang
12387 * @param {*} value The value to check.
12388 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
12389 * @example
12390 *
12391 * _.isNaN(NaN);
12392 * // => true
12393 *
12394 * _.isNaN(new Number(NaN));
12395 * // => true
12396 *
12397 * isNaN(undefined);
12398 * // => true
12399 *
12400 * _.isNaN(undefined);
12401 * // => false
12402 */
12403 function isNaN(value) {
12404 // An `NaN` primitive is the only value that is not equal to itself.
12405 // Perform the `toStringTag` check first to avoid errors with some
12406 // ActiveX objects in IE.
12407 return isNumber(value) && value != +value;
12408 }
12409
12410 /**
12411 * Checks if `value` is a pristine native function.
12412 *
12413 * **Note:** This method can't reliably detect native functions in the presence
12414 * of the core-js package because core-js circumvents this kind of detection.
12415 * Despite multiple requests, the core-js maintainer has made it clear: any
12416 * attempt to fix the detection will be obstructed. As a result, we're left
12417 * with little choice but to throw an error. Unfortunately, this also affects
12418 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
12419 * which rely on core-js.
12420 *
12421 * @static
12422 * @memberOf _
12423 * @since 3.0.0
12424 * @category Lang
12425 * @param {*} value The value to check.
12426 * @returns {boolean} Returns `true` if `value` is a native function,
12427 * else `false`.
12428 * @example
12429 *
12430 * _.isNative(Array.prototype.push);
12431 * // => true
12432 *
12433 * _.isNative(_);
12434 * // => false
12435 */
12436 function isNative(value) {
12437 if (isMaskable(value)) {
12438 throw new Error(CORE_ERROR_TEXT);
12439 }
12440 return baseIsNative(value);
12441 }
12442
12443 /**
12444 * Checks if `value` is `null`.
12445 *
12446 * @static
12447 * @memberOf _
12448 * @since 0.1.0
12449 * @category Lang
12450 * @param {*} value The value to check.
12451 * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
12452 * @example
12453 *
12454 * _.isNull(null);
12455 * // => true
12456 *
12457 * _.isNull(void 0);
12458 * // => false
12459 */
12460 function isNull(value) {
12461 return value === null;
12462 }
12463
12464 /**
12465 * Checks if `value` is `null` or `undefined`.
12466 *
12467 * @static
12468 * @memberOf _
12469 * @since 4.0.0
12470 * @category Lang
12471 * @param {*} value The value to check.
12472 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
12473 * @example
12474 *
12475 * _.isNil(null);
12476 * // => true
12477 *
12478 * _.isNil(void 0);
12479 * // => true
12480 *
12481 * _.isNil(NaN);
12482 * // => false
12483 */
12484 function isNil(value) {
12485 return value == null;
12486 }
12487
12488 /**
12489 * Checks if `value` is classified as a `Number` primitive or object.
12490 *
12491 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
12492 * classified as numbers, use the `_.isFinite` method.
12493 *
12494 * @static
12495 * @memberOf _
12496 * @since 0.1.0
12497 * @category Lang
12498 * @param {*} value The value to check.
12499 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
12500 * @example
12501 *
12502 * _.isNumber(3);
12503 * // => true
12504 *
12505 * _.isNumber(Number.MIN_VALUE);
12506 * // => true
12507 *
12508 * _.isNumber(Infinity);
12509 * // => true
12510 *
12511 * _.isNumber('3');
12512 * // => false
12513 */
12514 function isNumber(value) {
12515 return typeof value == 'number' ||
12516 (isObjectLike(value) && baseGetTag(value) == numberTag);
12517 }
12518
12519 /**
12520 * Checks if `value` is a plain object, that is, an object created by the
12521 * `Object` constructor or one with a `[[Prototype]]` of `null`.
12522 *
12523 * @static
12524 * @memberOf _
12525 * @since 0.8.0
12526 * @category Lang
12527 * @param {*} value The value to check.
12528 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
12529 * @example
12530 *
12531 * function Foo() {
12532 * this.a = 1;
12533 * }
12534 *
12535 * _.isPlainObject(new Foo);
12536 * // => false
12537 *
12538 * _.isPlainObject([1, 2, 3]);
12539 * // => false
12540 *
12541 * _.isPlainObject({ 'x': 0, 'y': 0 });
12542 * // => true
12543 *
12544 * _.isPlainObject(Object.create(null));
12545 * // => true
12546 */
12547 function isPlainObject(value) {
12548 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
12549 return false;
12550 }
12551 var proto = getPrototype(value);
12552 if (proto === null) {
12553 return true;
12554 }
12555 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
12556 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
12557 funcToString.call(Ctor) == objectCtorString;
12558 }
12559
12560 /**
12561 * Checks if `value` is classified as a `RegExp` object.
12562 *
12563 * @static
12564 * @memberOf _
12565 * @since 0.1.0
12566 * @category Lang
12567 * @param {*} value The value to check.
12568 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
12569 * @example
12570 *
12571 * _.isRegExp(/abc/);
12572 * // => true
12573 *
12574 * _.isRegExp('/abc/');
12575 * // => false
12576 */
12577 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
12578
12579 /**
12580 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
12581 * double precision number which isn't the result of a rounded unsafe integer.
12582 *
12583 * **Note:** This method is based on
12584 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
12585 *
12586 * @static
12587 * @memberOf _
12588 * @since 4.0.0
12589 * @category Lang
12590 * @param {*} value The value to check.
12591 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
12592 * @example
12593 *
12594 * _.isSafeInteger(3);
12595 * // => true
12596 *
12597 * _.isSafeInteger(Number.MIN_VALUE);
12598 * // => false
12599 *
12600 * _.isSafeInteger(Infinity);
12601 * // => false
12602 *
12603 * _.isSafeInteger('3');
12604 * // => false
12605 */
12606 function isSafeInteger(value) {
12607 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
12608 }
12609
12610 /**
12611 * Checks if `value` is classified as a `Set` object.
12612 *
12613 * @static
12614 * @memberOf _
12615 * @since 4.3.0
12616 * @category Lang
12617 * @param {*} value The value to check.
12618 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
12619 * @example
12620 *
12621 * _.isSet(new Set);
12622 * // => true
12623 *
12624 * _.isSet(new WeakSet);
12625 * // => false
12626 */
12627 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
12628
12629 /**
12630 * Checks if `value` is classified as a `String` primitive or object.
12631 *
12632 * @static
12633 * @since 0.1.0
12634 * @memberOf _
12635 * @category Lang
12636 * @param {*} value The value to check.
12637 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
12638 * @example
12639 *
12640 * _.isString('abc');
12641 * // => true
12642 *
12643 * _.isString(1);
12644 * // => false
12645 */
12646 function isString(value) {
12647 return typeof value == 'string' ||
12648 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
12649 }
12650
12651 /**
12652 * Checks if `value` is classified as a `Symbol` primitive or object.
12653 *
12654 * @static
12655 * @memberOf _
12656 * @since 4.0.0
12657 * @category Lang
12658 * @param {*} value The value to check.
12659 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
12660 * @example
12661 *
12662 * _.isSymbol(Symbol.iterator);
12663 * // => true
12664 *
12665 * _.isSymbol('abc');
12666 * // => false
12667 */
12668 function isSymbol(value) {
12669 return typeof value == 'symbol' ||
12670 (isObjectLike(value) && baseGetTag(value) == symbolTag);
12671 }
12672
12673 /**
12674 * Checks if `value` is classified as a typed array.
12675 *
12676 * @static
12677 * @memberOf _
12678 * @since 3.0.0
12679 * @category Lang
12680 * @param {*} value The value to check.
12681 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
12682 * @example
12683 *
12684 * _.isTypedArray(new Uint8Array);
12685 * // => true
12686 *
12687 * _.isTypedArray([]);
12688 * // => false
12689 */
12690 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
12691
12692 /**
12693 * Checks if `value` is `undefined`.
12694 *
12695 * @static
12696 * @since 0.1.0
12697 * @memberOf _
12698 * @category Lang
12699 * @param {*} value The value to check.
12700 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
12701 * @example
12702 *
12703 * _.isUndefined(void 0);
12704 * // => true
12705 *
12706 * _.isUndefined(null);
12707 * // => false
12708 */
12709 function isUndefined(value) {
12710 return value === undefined;
12711 }
12712
12713 /**
12714 * Checks if `value` is classified as a `WeakMap` object.
12715 *
12716 * @static
12717 * @memberOf _
12718 * @since 4.3.0
12719 * @category Lang
12720 * @param {*} value The value to check.
12721 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
12722 * @example
12723 *
12724 * _.isWeakMap(new WeakMap);
12725 * // => true
12726 *
12727 * _.isWeakMap(new Map);
12728 * // => false
12729 */
12730 function isWeakMap(value) {
12731 return isObjectLike(value) && getTag(value) == weakMapTag;
12732 }
12733
12734 /**
12735 * Checks if `value` is classified as a `WeakSet` object.
12736 *
12737 * @static
12738 * @memberOf _
12739 * @since 4.3.0
12740 * @category Lang
12741 * @param {*} value The value to check.
12742 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
12743 * @example
12744 *
12745 * _.isWeakSet(new WeakSet);
12746 * // => true
12747 *
12748 * _.isWeakSet(new Set);
12749 * // => false
12750 */
12751 function isWeakSet(value) {
12752 return isObjectLike(value) && baseGetTag(value) == weakSetTag;
12753 }
12754
12755 /**
12756 * Checks if `value` is less than `other`.
12757 *
12758 * @static
12759 * @memberOf _
12760 * @since 3.9.0
12761 * @category Lang
12762 * @param {*} value The value to compare.
12763 * @param {*} other The other value to compare.
12764 * @returns {boolean} Returns `true` if `value` is less than `other`,
12765 * else `false`.
12766 * @see _.gt
12767 * @example
12768 *
12769 * _.lt(1, 3);
12770 * // => true
12771 *
12772 * _.lt(3, 3);
12773 * // => false
12774 *
12775 * _.lt(3, 1);
12776 * // => false
12777 */
12778 var lt = createRelationalOperation(baseLt);
12779
12780 /**
12781 * Checks if `value` is less than or equal to `other`.
12782 *
12783 * @static
12784 * @memberOf _
12785 * @since 3.9.0
12786 * @category Lang
12787 * @param {*} value The value to compare.
12788 * @param {*} other The other value to compare.
12789 * @returns {boolean} Returns `true` if `value` is less than or equal to
12790 * `other`, else `false`.
12791 * @see _.gte
12792 * @example
12793 *
12794 * _.lte(1, 3);
12795 * // => true
12796 *
12797 * _.lte(3, 3);
12798 * // => true
12799 *
12800 * _.lte(3, 1);
12801 * // => false
12802 */
12803 var lte = createRelationalOperation(function(value, other) {
12804 return value <= other;
12805 });
12806
12807 /**
12808 * Converts `value` to an array.
12809 *
12810 * @static
12811 * @since 0.1.0
12812 * @memberOf _
12813 * @category Lang
12814 * @param {*} value The value to convert.
12815 * @returns {Array} Returns the converted array.
12816 * @example
12817 *
12818 * _.toArray({ 'a': 1, 'b': 2 });
12819 * // => [1, 2]
12820 *
12821 * _.toArray('abc');
12822 * // => ['a', 'b', 'c']
12823 *
12824 * _.toArray(1);
12825 * // => []
12826 *
12827 * _.toArray(null);
12828 * // => []
12829 */
12830 function toArray(value) {
12831 if (!value) {
12832 return [];
12833 }
12834 if (isArrayLike(value)) {
12835 return isString(value) ? stringToArray(value) : copyArray(value);
12836 }
12837 if (symIterator && value[symIterator]) {
12838 return iteratorToArray(value[symIterator]());
12839 }
12840 var tag = getTag(value),
12841 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
12842
12843 return func(value);
12844 }
12845
12846 /**
12847 * Converts `value` to a finite number.
12848 *
12849 * @static
12850 * @memberOf _
12851 * @since 4.12.0
12852 * @category Lang
12853 * @param {*} value The value to convert.
12854 * @returns {number} Returns the converted number.
12855 * @example
12856 *
12857 * _.toFinite(3.2);
12858 * // => 3.2
12859 *
12860 * _.toFinite(Number.MIN_VALUE);
12861 * // => 5e-324
12862 *
12863 * _.toFinite(Infinity);
12864 * // => 1.7976931348623157e+308
12865 *
12866 * _.toFinite('3.2');
12867 * // => 3.2
12868 */
12869 function toFinite(value) {
12870 if (!value) {
12871 return value === 0 ? value : 0;
12872 }
12873 value = toNumber(value);
12874 if (value === INFINITY || value === -INFINITY) {
12875 var sign = (value < 0 ? -1 : 1);
12876 return sign * MAX_INTEGER;
12877 }
12878 return value === value ? value : 0;
12879 }
12880
12881 /**
12882 * Converts `value` to an integer.
12883 *
12884 * **Note:** This method is loosely based on
12885 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
12886 *
12887 * @static
12888 * @memberOf _
12889 * @since 4.0.0
12890 * @category Lang
12891 * @param {*} value The value to convert.
12892 * @returns {number} Returns the converted integer.
12893 * @example
12894 *
12895 * _.toInteger(3.2);
12896 * // => 3
12897 *
12898 * _.toInteger(Number.MIN_VALUE);
12899 * // => 0
12900 *
12901 * _.toInteger(Infinity);
12902 * // => 1.7976931348623157e+308
12903 *
12904 * _.toInteger('3.2');
12905 * // => 3
12906 */
12907 function toInteger(value) {
12908 var result = toFinite(value),
12909 remainder = result % 1;
12910
12911 return result === result ? (remainder ? result - remainder : result) : 0;
12912 }
12913
12914 /**
12915 * Converts `value` to an integer suitable for use as the length of an
12916 * array-like object.
12917 *
12918 * **Note:** This method is based on
12919 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
12920 *
12921 * @static
12922 * @memberOf _
12923 * @since 4.0.0
12924 * @category Lang
12925 * @param {*} value The value to convert.
12926 * @returns {number} Returns the converted integer.
12927 * @example
12928 *
12929 * _.toLength(3.2);
12930 * // => 3
12931 *
12932 * _.toLength(Number.MIN_VALUE);
12933 * // => 0
12934 *
12935 * _.toLength(Infinity);
12936 * // => 4294967295
12937 *
12938 * _.toLength('3.2');
12939 * // => 3
12940 */
12941 function toLength(value) {
12942 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
12943 }
12944
12945 /**
12946 * Converts `value` to a number.
12947 *
12948 * @static
12949 * @memberOf _
12950 * @since 4.0.0
12951 * @category Lang
12952 * @param {*} value The value to process.
12953 * @returns {number} Returns the number.
12954 * @example
12955 *
12956 * _.toNumber(3.2);
12957 * // => 3.2
12958 *
12959 * _.toNumber(Number.MIN_VALUE);
12960 * // => 5e-324
12961 *
12962 * _.toNumber(Infinity);
12963 * // => Infinity
12964 *
12965 * _.toNumber('3.2');
12966 * // => 3.2
12967 */
12968 function toNumber(value) {
12969 if (typeof value == 'number') {
12970 return value;
12971 }
12972 if (isSymbol(value)) {
12973 return NAN;
12974 }
12975 if (isObject(value)) {
12976 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
12977 value = isObject(other) ? (other + '') : other;
12978 }
12979 if (typeof value != 'string') {
12980 return value === 0 ? value : +value;
12981 }
12982 value = value.replace(reTrim, '');
12983 var isBinary = reIsBinary.test(value);
12984 return (isBinary || reIsOctal.test(value))
12985 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
12986 : (reIsBadHex.test(value) ? NAN : +value);
12987 }
12988
12989 /**
12990 * Converts `value` to a plain object flattening inherited enumerable string
12991 * keyed properties of `value` to own properties of the plain object.
12992 *
12993 * @static
12994 * @memberOf _
12995 * @since 3.0.0
12996 * @category Lang
12997 * @param {*} value The value to convert.
12998 * @returns {Object} Returns the converted plain object.
12999 * @example
13000 *
13001 * function Foo() {
13002 * this.b = 2;
13003 * }
13004 *
13005 * Foo.prototype.c = 3;
13006 *
13007 * _.assign({ 'a': 1 }, new Foo);
13008 * // => { 'a': 1, 'b': 2 }
13009 *
13010 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
13011 * // => { 'a': 1, 'b': 2, 'c': 3 }
13012 */
13013 function toPlainObject(value) {
13014 return copyObject(value, keysIn(value));
13015 }
13016
13017 /**
13018 * Converts `value` to a safe integer. A safe integer can be compared and
13019 * represented correctly.
13020 *
13021 * @static
13022 * @memberOf _
13023 * @since 4.0.0
13024 * @category Lang
13025 * @param {*} value The value to convert.
13026 * @returns {number} Returns the converted integer.
13027 * @example
13028 *
13029 * _.toSafeInteger(3.2);
13030 * // => 3
13031 *
13032 * _.toSafeInteger(Number.MIN_VALUE);
13033 * // => 0
13034 *
13035 * _.toSafeInteger(Infinity);
13036 * // => 9007199254740991
13037 *
13038 * _.toSafeInteger('3.2');
13039 * // => 3
13040 */
13041 function toSafeInteger(value) {
13042 return value
13043 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
13044 : (value === 0 ? value : 0);
13045 }
13046
13047 /**
13048 * Converts `value` to a string. An empty string is returned for `null`
13049 * and `undefined` values. The sign of `-0` is preserved.
13050 *
13051 * @static
13052 * @memberOf _
13053 * @since 4.0.0
13054 * @category Lang
13055 * @param {*} value The value to convert.
13056 * @returns {string} Returns the converted string.
13057 * @example
13058 *
13059 * _.toString(null);
13060 * // => ''
13061 *
13062 * _.toString(-0);
13063 * // => '-0'
13064 *
13065 * _.toString([1, 2, 3]);
13066 * // => '1,2,3'
13067 */
13068 function toString(value) {
13069 return value == null ? '' : baseToString(value);
13070 }
13071
13072 /*------------------------------------------------------------------------*/
13073
13074 /**
13075 * Assigns own enumerable string keyed properties of source objects to the
13076 * destination object. Source objects are applied from left to right.
13077 * Subsequent sources overwrite property assignments of previous sources.
13078 *
13079 * **Note:** This method mutates `object` and is loosely based on
13080 * [`Object.assign`](https://mdn.io/Object/assign).
13081 *
13082 * @static
13083 * @memberOf _
13084 * @since 0.10.0
13085 * @category Object
13086 * @param {Object} object The destination object.
13087 * @param {...Object} [sources] The source objects.
13088 * @returns {Object} Returns `object`.
13089 * @see _.assignIn
13090 * @example
13091 *
13092 * function Foo() {
13093 * this.a = 1;
13094 * }
13095 *
13096 * function Bar() {
13097 * this.c = 3;
13098 * }
13099 *
13100 * Foo.prototype.b = 2;
13101 * Bar.prototype.d = 4;
13102 *
13103 * _.assign({ 'a': 0 }, new Foo, new Bar);
13104 * // => { 'a': 1, 'c': 3 }
13105 */
13106 var assign = createAssigner(function(object, source) {
13107 if (isPrototype(source) || isArrayLike(source)) {
13108 copyObject(source, keys(source), object);
13109 return;
13110 }
13111 for (var key in source) {
13112 if (hasOwnProperty.call(source, key)) {
13113 assignValue(object, key, source[key]);
13114 }
13115 }
13116 });
13117
13118 /**
13119 * This method is like `_.assign` except that it iterates over own and
13120 * inherited source properties.
13121 *
13122 * **Note:** This method mutates `object`.
13123 *
13124 * @static
13125 * @memberOf _
13126 * @since 4.0.0
13127 * @alias extend
13128 * @category Object
13129 * @param {Object} object The destination object.
13130 * @param {...Object} [sources] The source objects.
13131 * @returns {Object} Returns `object`.
13132 * @see _.assign
13133 * @example
13134 *
13135 * function Foo() {
13136 * this.a = 1;
13137 * }
13138 *
13139 * function Bar() {
13140 * this.c = 3;
13141 * }
13142 *
13143 * Foo.prototype.b = 2;
13144 * Bar.prototype.d = 4;
13145 *
13146 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
13147 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
13148 */
13149 var assignIn = createAssigner(function(object, source) {
13150 copyObject(source, keysIn(source), object);
13151 });
13152
13153 /**
13154 * This method is like `_.assignIn` except that it accepts `customizer`
13155 * which is invoked to produce the assigned values. If `customizer` returns
13156 * `undefined`, assignment is handled by the method instead. The `customizer`
13157 * is invoked with five arguments: (objValue, srcValue, key, object, source).
13158 *
13159 * **Note:** This method mutates `object`.
13160 *
13161 * @static
13162 * @memberOf _
13163 * @since 4.0.0
13164 * @alias extendWith
13165 * @category Object
13166 * @param {Object} object The destination object.
13167 * @param {...Object} sources The source objects.
13168 * @param {Function} [customizer] The function to customize assigned values.
13169 * @returns {Object} Returns `object`.
13170 * @see _.assignWith
13171 * @example
13172 *
13173 * function customizer(objValue, srcValue) {
13174 * return _.isUndefined(objValue) ? srcValue : objValue;
13175 * }
13176 *
13177 * var defaults = _.partialRight(_.assignInWith, customizer);
13178 *
13179 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13180 * // => { 'a': 1, 'b': 2 }
13181 */
13182 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
13183 copyObject(source, keysIn(source), object, customizer);
13184 });
13185
13186 /**
13187 * This method is like `_.assign` except that it accepts `customizer`
13188 * which is invoked to produce the assigned values. If `customizer` returns
13189 * `undefined`, assignment is handled by the method instead. The `customizer`
13190 * is invoked with five arguments: (objValue, srcValue, key, object, source).
13191 *
13192 * **Note:** This method mutates `object`.
13193 *
13194 * @static
13195 * @memberOf _
13196 * @since 4.0.0
13197 * @category Object
13198 * @param {Object} object The destination object.
13199 * @param {...Object} sources The source objects.
13200 * @param {Function} [customizer] The function to customize assigned values.
13201 * @returns {Object} Returns `object`.
13202 * @see _.assignInWith
13203 * @example
13204 *
13205 * function customizer(objValue, srcValue) {
13206 * return _.isUndefined(objValue) ? srcValue : objValue;
13207 * }
13208 *
13209 * var defaults = _.partialRight(_.assignWith, customizer);
13210 *
13211 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13212 * // => { 'a': 1, 'b': 2 }
13213 */
13214 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
13215 copyObject(source, keys(source), object, customizer);
13216 });
13217
13218 /**
13219 * Creates an array of values corresponding to `paths` of `object`.
13220 *
13221 * @static
13222 * @memberOf _
13223 * @since 1.0.0
13224 * @category Object
13225 * @param {Object} object The object to iterate over.
13226 * @param {...(string|string[])} [paths] The property paths to pick.
13227 * @returns {Array} Returns the picked values.
13228 * @example
13229 *
13230 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
13231 *
13232 * _.at(object, ['a[0].b.c', 'a[1]']);
13233 * // => [3, 4]
13234 */
13235 var at = flatRest(baseAt);
13236
13237 /**
13238 * Creates an object that inherits from the `prototype` object. If a
13239 * `properties` object is given, its own enumerable string keyed properties
13240 * are assigned to the created object.
13241 *
13242 * @static
13243 * @memberOf _
13244 * @since 2.3.0
13245 * @category Object
13246 * @param {Object} prototype The object to inherit from.
13247 * @param {Object} [properties] The properties to assign to the object.
13248 * @returns {Object} Returns the new object.
13249 * @example
13250 *
13251 * function Shape() {
13252 * this.x = 0;
13253 * this.y = 0;
13254 * }
13255 *
13256 * function Circle() {
13257 * Shape.call(this);
13258 * }
13259 *
13260 * Circle.prototype = _.create(Shape.prototype, {
13261 * 'constructor': Circle
13262 * });
13263 *
13264 * var circle = new Circle;
13265 * circle instanceof Circle;
13266 * // => true
13267 *
13268 * circle instanceof Shape;
13269 * // => true
13270 */
13271 function create(prototype, properties) {
13272 var result = baseCreate(prototype);
13273 return properties == null ? result : baseAssign(result, properties);
13274 }
13275
13276 /**
13277 * Assigns own and inherited enumerable string keyed properties of source
13278 * objects to the destination object for all destination properties that
13279 * resolve to `undefined`. Source objects are applied from left to right.
13280 * Once a property is set, additional values of the same property are ignored.
13281 *
13282 * **Note:** This method mutates `object`.
13283 *
13284 * @static
13285 * @since 0.1.0
13286 * @memberOf _
13287 * @category Object
13288 * @param {Object} object The destination object.
13289 * @param {...Object} [sources] The source objects.
13290 * @returns {Object} Returns `object`.
13291 * @see _.defaultsDeep
13292 * @example
13293 *
13294 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13295 * // => { 'a': 1, 'b': 2 }
13296 */
13297 var defaults = baseRest(function(object, sources) {
13298 object = Object(object);
13299
13300 var index = -1;
13301 var length = sources.length;
13302 var guard = length > 2 ? sources[2] : undefined;
13303
13304 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
13305 length = 1;
13306 }
13307
13308 while (++index < length) {
13309 var source = sources[index];
13310 var props = keysIn(source);
13311 var propsIndex = -1;
13312 var propsLength = props.length;
13313
13314 while (++propsIndex < propsLength) {
13315 var key = props[propsIndex];
13316 var value = object[key];
13317
13318 if (value === undefined ||
13319 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
13320 object[key] = source[key];
13321 }
13322 }
13323 }
13324
13325 return object;
13326 });
13327
13328 /**
13329 * This method is like `_.defaults` except that it recursively assigns
13330 * default properties.
13331 *
13332 * **Note:** This method mutates `object`.
13333 *
13334 * @static
13335 * @memberOf _
13336 * @since 3.10.0
13337 * @category Object
13338 * @param {Object} object The destination object.
13339 * @param {...Object} [sources] The source objects.
13340 * @returns {Object} Returns `object`.
13341 * @see _.defaults
13342 * @example
13343 *
13344 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
13345 * // => { 'a': { 'b': 2, 'c': 3 } }
13346 */
13347 var defaultsDeep = baseRest(function(args) {
13348 args.push(undefined, customDefaultsMerge);
13349 return apply(mergeWith, undefined, args);
13350 });
13351
13352 /**
13353 * This method is like `_.find` except that it returns the key of the first
13354 * element `predicate` returns truthy for instead of the element itself.
13355 *
13356 * @static
13357 * @memberOf _
13358 * @since 1.1.0
13359 * @category Object
13360 * @param {Object} object The object to inspect.
13361 * @param {Function} [predicate=_.identity] The function invoked per iteration.
13362 * @returns {string|undefined} Returns the key of the matched element,
13363 * else `undefined`.
13364 * @example
13365 *
13366 * var users = {
13367 * 'barney': { 'age': 36, 'active': true },
13368 * 'fred': { 'age': 40, 'active': false },
13369 * 'pebbles': { 'age': 1, 'active': true }
13370 * };
13371 *
13372 * _.findKey(users, function(o) { return o.age < 40; });
13373 * // => 'barney' (iteration order is not guaranteed)
13374 *
13375 * // The `_.matches` iteratee shorthand.
13376 * _.findKey(users, { 'age': 1, 'active': true });
13377 * // => 'pebbles'
13378 *
13379 * // The `_.matchesProperty` iteratee shorthand.
13380 * _.findKey(users, ['active', false]);
13381 * // => 'fred'
13382 *
13383 * // The `_.property` iteratee shorthand.
13384 * _.findKey(users, 'active');
13385 * // => 'barney'
13386 */
13387 function findKey(object, predicate) {
13388 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
13389 }
13390
13391 /**
13392 * This method is like `_.findKey` except that it iterates over elements of
13393 * a collection in the opposite order.
13394 *
13395 * @static
13396 * @memberOf _
13397 * @since 2.0.0
13398 * @category Object
13399 * @param {Object} object The object to inspect.
13400 * @param {Function} [predicate=_.identity] The function invoked per iteration.
13401 * @returns {string|undefined} Returns the key of the matched element,
13402 * else `undefined`.
13403 * @example
13404 *
13405 * var users = {
13406 * 'barney': { 'age': 36, 'active': true },
13407 * 'fred': { 'age': 40, 'active': false },
13408 * 'pebbles': { 'age': 1, 'active': true }
13409 * };
13410 *
13411 * _.findLastKey(users, function(o) { return o.age < 40; });
13412 * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
13413 *
13414 * // The `_.matches` iteratee shorthand.
13415 * _.findLastKey(users, { 'age': 36, 'active': true });
13416 * // => 'barney'
13417 *
13418 * // The `_.matchesProperty` iteratee shorthand.
13419 * _.findLastKey(users, ['active', false]);
13420 * // => 'fred'
13421 *
13422 * // The `_.property` iteratee shorthand.
13423 * _.findLastKey(users, 'active');
13424 * // => 'pebbles'
13425 */
13426 function findLastKey(object, predicate) {
13427 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
13428 }
13429
13430 /**
13431 * Iterates over own and inherited enumerable string keyed properties of an
13432 * object and invokes `iteratee` for each property. The iteratee is invoked
13433 * with three arguments: (value, key, object). Iteratee functions may exit
13434 * iteration early by explicitly returning `false`.
13435 *
13436 * @static
13437 * @memberOf _
13438 * @since 0.3.0
13439 * @category Object
13440 * @param {Object} object The object to iterate over.
13441 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13442 * @returns {Object} Returns `object`.
13443 * @see _.forInRight
13444 * @example
13445 *
13446 * function Foo() {
13447 * this.a = 1;
13448 * this.b = 2;
13449 * }
13450 *
13451 * Foo.prototype.c = 3;
13452 *
13453 * _.forIn(new Foo, function(value, key) {
13454 * console.log(key);
13455 * });
13456 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
13457 */
13458 function forIn(object, iteratee) {
13459 return object == null
13460 ? object
13461 : baseFor(object, getIteratee(iteratee, 3), keysIn);
13462 }
13463
13464 /**
13465 * This method is like `_.forIn` except that it iterates over properties of
13466 * `object` in the opposite order.
13467 *
13468 * @static
13469 * @memberOf _
13470 * @since 2.0.0
13471 * @category Object
13472 * @param {Object} object The object to iterate over.
13473 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13474 * @returns {Object} Returns `object`.
13475 * @see _.forIn
13476 * @example
13477 *
13478 * function Foo() {
13479 * this.a = 1;
13480 * this.b = 2;
13481 * }
13482 *
13483 * Foo.prototype.c = 3;
13484 *
13485 * _.forInRight(new Foo, function(value, key) {
13486 * console.log(key);
13487 * });
13488 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
13489 */
13490 function forInRight(object, iteratee) {
13491 return object == null
13492 ? object
13493 : baseForRight(object, getIteratee(iteratee, 3), keysIn);
13494 }
13495
13496 /**
13497 * Iterates over own enumerable string keyed properties of an object and
13498 * invokes `iteratee` for each property. The iteratee is invoked with three
13499 * arguments: (value, key, object). Iteratee functions may exit iteration
13500 * early by explicitly returning `false`.
13501 *
13502 * @static
13503 * @memberOf _
13504 * @since 0.3.0
13505 * @category Object
13506 * @param {Object} object The object to iterate over.
13507 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13508 * @returns {Object} Returns `object`.
13509 * @see _.forOwnRight
13510 * @example
13511 *
13512 * function Foo() {
13513 * this.a = 1;
13514 * this.b = 2;
13515 * }
13516 *
13517 * Foo.prototype.c = 3;
13518 *
13519 * _.forOwn(new Foo, function(value, key) {
13520 * console.log(key);
13521 * });
13522 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
13523 */
13524 function forOwn(object, iteratee) {
13525 return object && baseForOwn(object, getIteratee(iteratee, 3));
13526 }
13527
13528 /**
13529 * This method is like `_.forOwn` except that it iterates over properties of
13530 * `object` in the opposite order.
13531 *
13532 * @static
13533 * @memberOf _
13534 * @since 2.0.0
13535 * @category Object
13536 * @param {Object} object The object to iterate over.
13537 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13538 * @returns {Object} Returns `object`.
13539 * @see _.forOwn
13540 * @example
13541 *
13542 * function Foo() {
13543 * this.a = 1;
13544 * this.b = 2;
13545 * }
13546 *
13547 * Foo.prototype.c = 3;
13548 *
13549 * _.forOwnRight(new Foo, function(value, key) {
13550 * console.log(key);
13551 * });
13552 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
13553 */
13554 function forOwnRight(object, iteratee) {
13555 return object && baseForOwnRight(object, getIteratee(iteratee, 3));
13556 }
13557
13558 /**
13559 * Creates an array of function property names from own enumerable properties
13560 * of `object`.
13561 *
13562 * @static
13563 * @since 0.1.0
13564 * @memberOf _
13565 * @category Object
13566 * @param {Object} object The object to inspect.
13567 * @returns {Array} Returns the function names.
13568 * @see _.functionsIn
13569 * @example
13570 *
13571 * function Foo() {
13572 * this.a = _.constant('a');
13573 * this.b = _.constant('b');
13574 * }
13575 *
13576 * Foo.prototype.c = _.constant('c');
13577 *
13578 * _.functions(new Foo);
13579 * // => ['a', 'b']
13580 */
13581 function functions(object) {
13582 return object == null ? [] : baseFunctions(object, keys(object));
13583 }
13584
13585 /**
13586 * Creates an array of function property names from own and inherited
13587 * enumerable properties of `object`.
13588 *
13589 * @static
13590 * @memberOf _
13591 * @since 4.0.0
13592 * @category Object
13593 * @param {Object} object The object to inspect.
13594 * @returns {Array} Returns the function names.
13595 * @see _.functions
13596 * @example
13597 *
13598 * function Foo() {
13599 * this.a = _.constant('a');
13600 * this.b = _.constant('b');
13601 * }
13602 *
13603 * Foo.prototype.c = _.constant('c');
13604 *
13605 * _.functionsIn(new Foo);
13606 * // => ['a', 'b', 'c']
13607 */
13608 function functionsIn(object) {
13609 return object == null ? [] : baseFunctions(object, keysIn(object));
13610 }
13611
13612 /**
13613 * Gets the value at `path` of `object`. If the resolved value is
13614 * `undefined`, the `defaultValue` is returned in its place.
13615 *
13616 * @static
13617 * @memberOf _
13618 * @since 3.7.0
13619 * @category Object
13620 * @param {Object} object The object to query.
13621 * @param {Array|string} path The path of the property to get.
13622 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
13623 * @returns {*} Returns the resolved value.
13624 * @example
13625 *
13626 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
13627 *
13628 * _.get(object, 'a[0].b.c');
13629 * // => 3
13630 *
13631 * _.get(object, ['a', '0', 'b', 'c']);
13632 * // => 3
13633 *
13634 * _.get(object, 'a.b.c', 'default');
13635 * // => 'default'
13636 */
13637 function get(object, path, defaultValue) {
13638 var result = object == null ? undefined : baseGet(object, path);
13639 return result === undefined ? defaultValue : result;
13640 }
13641
13642 /**
13643 * Checks if `path` is a direct property of `object`.
13644 *
13645 * @static
13646 * @since 0.1.0
13647 * @memberOf _
13648 * @category Object
13649 * @param {Object} object The object to query.
13650 * @param {Array|string} path The path to check.
13651 * @returns {boolean} Returns `true` if `path` exists, else `false`.
13652 * @example
13653 *
13654 * var object = { 'a': { 'b': 2 } };
13655 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
13656 *
13657 * _.has(object, 'a');
13658 * // => true
13659 *
13660 * _.has(object, 'a.b');
13661 * // => true
13662 *
13663 * _.has(object, ['a', 'b']);
13664 * // => true
13665 *
13666 * _.has(other, 'a');
13667 * // => false
13668 */
13669 function has(object, path) {
13670 return object != null && hasPath(object, path, baseHas);
13671 }
13672
13673 /**
13674 * Checks if `path` is a direct or inherited property of `object`.
13675 *
13676 * @static
13677 * @memberOf _
13678 * @since 4.0.0
13679 * @category Object
13680 * @param {Object} object The object to query.
13681 * @param {Array|string} path The path to check.
13682 * @returns {boolean} Returns `true` if `path` exists, else `false`.
13683 * @example
13684 *
13685 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
13686 *
13687 * _.hasIn(object, 'a');
13688 * // => true
13689 *
13690 * _.hasIn(object, 'a.b');
13691 * // => true
13692 *
13693 * _.hasIn(object, ['a', 'b']);
13694 * // => true
13695 *
13696 * _.hasIn(object, 'b');
13697 * // => false
13698 */
13699 function hasIn(object, path) {
13700 return object != null && hasPath(object, path, baseHasIn);
13701 }
13702
13703 /**
13704 * Creates an object composed of the inverted keys and values of `object`.
13705 * If `object` contains duplicate values, subsequent values overwrite
13706 * property assignments of previous values.
13707 *
13708 * @static
13709 * @memberOf _
13710 * @since 0.7.0
13711 * @category Object
13712 * @param {Object} object The object to invert.
13713 * @returns {Object} Returns the new inverted object.
13714 * @example
13715 *
13716 * var object = { 'a': 1, 'b': 2, 'c': 1 };
13717 *
13718 * _.invert(object);
13719 * // => { '1': 'c', '2': 'b' }
13720 */
13721 var invert = createInverter(function(result, value, key) {
13722 if (value != null &&
13723 typeof value.toString != 'function') {
13724 value = nativeObjectToString.call(value);
13725 }
13726
13727 result[value] = key;
13728 }, constant(identity));
13729
13730 /**
13731 * This method is like `_.invert` except that the inverted object is generated
13732 * from the results of running each element of `object` thru `iteratee`. The
13733 * corresponding inverted value of each inverted key is an array of keys
13734 * responsible for generating the inverted value. The iteratee is invoked
13735 * with one argument: (value).
13736 *
13737 * @static
13738 * @memberOf _
13739 * @since 4.1.0
13740 * @category Object
13741 * @param {Object} object The object to invert.
13742 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
13743 * @returns {Object} Returns the new inverted object.
13744 * @example
13745 *
13746 * var object = { 'a': 1, 'b': 2, 'c': 1 };
13747 *
13748 * _.invertBy(object);
13749 * // => { '1': ['a', 'c'], '2': ['b'] }
13750 *
13751 * _.invertBy(object, function(value) {
13752 * return 'group' + value;
13753 * });
13754 * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
13755 */
13756 var invertBy = createInverter(function(result, value, key) {
13757 if (value != null &&
13758 typeof value.toString != 'function') {
13759 value = nativeObjectToString.call(value);
13760 }
13761
13762 if (hasOwnProperty.call(result, value)) {
13763 result[value].push(key);
13764 } else {
13765 result[value] = [key];
13766 }
13767 }, getIteratee);
13768
13769 /**
13770 * Invokes the method at `path` of `object`.
13771 *
13772 * @static
13773 * @memberOf _
13774 * @since 4.0.0
13775 * @category Object
13776 * @param {Object} object The object to query.
13777 * @param {Array|string} path The path of the method to invoke.
13778 * @param {...*} [args] The arguments to invoke the method with.
13779 * @returns {*} Returns the result of the invoked method.
13780 * @example
13781 *
13782 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
13783 *
13784 * _.invoke(object, 'a[0].b.c.slice', 1, 3);
13785 * // => [2, 3]
13786 */
13787 var invoke = baseRest(baseInvoke);
13788
13789 /**
13790 * Creates an array of the own enumerable property names of `object`.
13791 *
13792 * **Note:** Non-object values are coerced to objects. See the
13793 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
13794 * for more details.
13795 *
13796 * @static
13797 * @since 0.1.0
13798 * @memberOf _
13799 * @category Object
13800 * @param {Object} object The object to query.
13801 * @returns {Array} Returns the array of property names.
13802 * @example
13803 *
13804 * function Foo() {
13805 * this.a = 1;
13806 * this.b = 2;
13807 * }
13808 *
13809 * Foo.prototype.c = 3;
13810 *
13811 * _.keys(new Foo);
13812 * // => ['a', 'b'] (iteration order is not guaranteed)
13813 *
13814 * _.keys('hi');
13815 * // => ['0', '1']
13816 */
13817 function keys(object) {
13818 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
13819 }
13820
13821 /**
13822 * Creates an array of the own and inherited enumerable property names of `object`.
13823 *
13824 * **Note:** Non-object values are coerced to objects.
13825 *
13826 * @static
13827 * @memberOf _
13828 * @since 3.0.0
13829 * @category Object
13830 * @param {Object} object The object to query.
13831 * @returns {Array} Returns the array of property names.
13832 * @example
13833 *
13834 * function Foo() {
13835 * this.a = 1;
13836 * this.b = 2;
13837 * }
13838 *
13839 * Foo.prototype.c = 3;
13840 *
13841 * _.keysIn(new Foo);
13842 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
13843 */
13844 function keysIn(object) {
13845 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
13846 }
13847
13848 /**
13849 * The opposite of `_.mapValues`; this method creates an object with the
13850 * same values as `object` and keys generated by running each own enumerable
13851 * string keyed property of `object` thru `iteratee`. The iteratee is invoked
13852 * with three arguments: (value, key, object).
13853 *
13854 * @static
13855 * @memberOf _
13856 * @since 3.8.0
13857 * @category Object
13858 * @param {Object} object The object to iterate over.
13859 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13860 * @returns {Object} Returns the new mapped object.
13861 * @see _.mapValues
13862 * @example
13863 *
13864 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
13865 * return key + value;
13866 * });
13867 * // => { 'a1': 1, 'b2': 2 }
13868 */
13869 function mapKeys(object, iteratee) {
13870 var result = {};
13871 iteratee = getIteratee(iteratee, 3);
13872
13873 baseForOwn(object, function(value, key, object) {
13874 baseAssignValue(result, iteratee(value, key, object), value);
13875 });
13876 return result;
13877 }
13878
13879 /**
13880 * Creates an object with the same keys as `object` and values generated
13881 * by running each own enumerable string keyed property of `object` thru
13882 * `iteratee`. The iteratee is invoked with three arguments:
13883 * (value, key, object).
13884 *
13885 * @static
13886 * @memberOf _
13887 * @since 2.4.0
13888 * @category Object
13889 * @param {Object} object The object to iterate over.
13890 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
13891 * @returns {Object} Returns the new mapped object.
13892 * @see _.mapKeys
13893 * @example
13894 *
13895 * var users = {
13896 * 'fred': { 'user': 'fred', 'age': 40 },
13897 * 'pebbles': { 'user': 'pebbles', 'age': 1 }
13898 * };
13899 *
13900 * _.mapValues(users, function(o) { return o.age; });
13901 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
13902 *
13903 * // The `_.property` iteratee shorthand.
13904 * _.mapValues(users, 'age');
13905 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
13906 */
13907 function mapValues(object, iteratee) {
13908 var result = {};
13909 iteratee = getIteratee(iteratee, 3);
13910
13911 baseForOwn(object, function(value, key, object) {
13912 baseAssignValue(result, key, iteratee(value, key, object));
13913 });
13914 return result;
13915 }
13916
13917 /**
13918 * This method is like `_.assign` except that it recursively merges own and
13919 * inherited enumerable string keyed properties of source objects into the
13920 * destination object. Source properties that resolve to `undefined` are
13921 * skipped if a destination value exists. Array and plain object properties
13922 * are merged recursively. Other objects and value types are overridden by
13923 * assignment. Source objects are applied from left to right. Subsequent
13924 * sources overwrite property assignments of previous sources.
13925 *
13926 * **Note:** This method mutates `object`.
13927 *
13928 * @static
13929 * @memberOf _
13930 * @since 0.5.0
13931 * @category Object
13932 * @param {Object} object The destination object.
13933 * @param {...Object} [sources] The source objects.
13934 * @returns {Object} Returns `object`.
13935 * @example
13936 *
13937 * var object = {
13938 * 'a': [{ 'b': 2 }, { 'd': 4 }]
13939 * };
13940 *
13941 * var other = {
13942 * 'a': [{ 'c': 3 }, { 'e': 5 }]
13943 * };
13944 *
13945 * _.merge(object, other);
13946 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
13947 */
13948 var merge = createAssigner(function(object, source, srcIndex) {
13949 baseMerge(object, source, srcIndex);
13950 });
13951
13952 /**
13953 * This method is like `_.merge` except that it accepts `customizer` which
13954 * is invoked to produce the merged values of the destination and source
13955 * properties. If `customizer` returns `undefined`, merging is handled by the
13956 * method instead. The `customizer` is invoked with six arguments:
13957 * (objValue, srcValue, key, object, source, stack).
13958 *
13959 * **Note:** This method mutates `object`.
13960 *
13961 * @static
13962 * @memberOf _
13963 * @since 4.0.0
13964 * @category Object
13965 * @param {Object} object The destination object.
13966 * @param {...Object} sources The source objects.
13967 * @param {Function} customizer The function to customize assigned values.
13968 * @returns {Object} Returns `object`.
13969 * @example
13970 *
13971 * function customizer(objValue, srcValue) {
13972 * if (_.isArray(objValue)) {
13973 * return objValue.concat(srcValue);
13974 * }
13975 * }
13976 *
13977 * var object = { 'a': [1], 'b': [2] };
13978 * var other = { 'a': [3], 'b': [4] };
13979 *
13980 * _.mergeWith(object, other, customizer);
13981 * // => { 'a': [1, 3], 'b': [2, 4] }
13982 */
13983 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
13984 baseMerge(object, source, srcIndex, customizer);
13985 });
13986
13987 /**
13988 * The opposite of `_.pick`; this method creates an object composed of the
13989 * own and inherited enumerable property paths of `object` that are not omitted.
13990 *
13991 * **Note:** This method is considerably slower than `_.pick`.
13992 *
13993 * @static
13994 * @since 0.1.0
13995 * @memberOf _
13996 * @category Object
13997 * @param {Object} object The source object.
13998 * @param {...(string|string[])} [paths] The property paths to omit.
13999 * @returns {Object} Returns the new object.
14000 * @example
14001 *
14002 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14003 *
14004 * _.omit(object, ['a', 'c']);
14005 * // => { 'b': '2' }
14006 */
14007 var omit = flatRest(function(object, paths) {
14008 var result = {};
14009 if (object == null) {
14010 return result;
14011 }
14012 var isDeep = false;
14013 paths = arrayMap(paths, function(path) {
14014 path = castPath(path, object);
14015 isDeep || (isDeep = path.length > 1);
14016 return path;
14017 });
14018 copyObject(object, getAllKeysIn(object), result);
14019 if (isDeep) {
14020 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
14021 }
14022 var length = paths.length;
14023 while (length--) {
14024 baseUnset(result, paths[length]);
14025 }
14026 return result;
14027 });
14028
14029 /**
14030 * The opposite of `_.pickBy`; this method creates an object composed of
14031 * the own and inherited enumerable string keyed properties of `object` that
14032 * `predicate` doesn't return truthy for. The predicate is invoked with two
14033 * arguments: (value, key).
14034 *
14035 * @static
14036 * @memberOf _
14037 * @since 4.0.0
14038 * @category Object
14039 * @param {Object} object The source object.
14040 * @param {Function} [predicate=_.identity] The function invoked per property.
14041 * @returns {Object} Returns the new object.
14042 * @example
14043 *
14044 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14045 *
14046 * _.omitBy(object, _.isNumber);
14047 * // => { 'b': '2' }
14048 */
14049 function omitBy(object, predicate) {
14050 return pickBy(object, negate(getIteratee(predicate)));
14051 }
14052
14053 /**
14054 * Creates an object composed of the picked `object` properties.
14055 *
14056 * @static
14057 * @since 0.1.0
14058 * @memberOf _
14059 * @category Object
14060 * @param {Object} object The source object.
14061 * @param {...(string|string[])} [paths] The property paths to pick.
14062 * @returns {Object} Returns the new object.
14063 * @example
14064 *
14065 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14066 *
14067 * _.pick(object, ['a', 'c']);
14068 * // => { 'a': 1, 'c': 3 }
14069 */
14070 var pick = flatRest(function(object, paths) {
14071 return object == null ? {} : basePick(object, paths);
14072 });
14073
14074 /**
14075 * Creates an object composed of the `object` properties `predicate` returns
14076 * truthy for. The predicate is invoked with two arguments: (value, key).
14077 *
14078 * @static
14079 * @memberOf _
14080 * @since 4.0.0
14081 * @category Object
14082 * @param {Object} object The source object.
14083 * @param {Function} [predicate=_.identity] The function invoked per property.
14084 * @returns {Object} Returns the new object.
14085 * @example
14086 *
14087 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14088 *
14089 * _.pickBy(object, _.isNumber);
14090 * // => { 'a': 1, 'c': 3 }
14091 */
14092 function pickBy(object, predicate) {
14093 if (object == null) {
14094 return {};
14095 }
14096 var props = arrayMap(getAllKeysIn(object), function(prop) {
14097 return [prop];
14098 });
14099 predicate = getIteratee(predicate);
14100 return basePickBy(object, props, function(value, path) {
14101 return predicate(value, path[0]);
14102 });
14103 }
14104
14105 /**
14106 * This method is like `_.get` except that if the resolved value is a
14107 * function it's invoked with the `this` binding of its parent object and
14108 * its result is returned.
14109 *
14110 * @static
14111 * @since 0.1.0
14112 * @memberOf _
14113 * @category Object
14114 * @param {Object} object The object to query.
14115 * @param {Array|string} path The path of the property to resolve.
14116 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
14117 * @returns {*} Returns the resolved value.
14118 * @example
14119 *
14120 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
14121 *
14122 * _.result(object, 'a[0].b.c1');
14123 * // => 3
14124 *
14125 * _.result(object, 'a[0].b.c2');
14126 * // => 4
14127 *
14128 * _.result(object, 'a[0].b.c3', 'default');
14129 * // => 'default'
14130 *
14131 * _.result(object, 'a[0].b.c3', _.constant('default'));
14132 * // => 'default'
14133 */
14134 function result(object, path, defaultValue) {
14135 path = castPath(path, object);
14136
14137 var index = -1,
14138 length = path.length;
14139
14140 // Ensure the loop is entered when path is empty.
14141 if (!length) {
14142 length = 1;
14143 object = undefined;
14144 }
14145 while (++index < length) {
14146 var value = object == null ? undefined : object[toKey(path[index])];
14147 if (value === undefined) {
14148 index = length;
14149 value = defaultValue;
14150 }
14151 object = isFunction(value) ? value.call(object) : value;
14152 }
14153 return object;
14154 }
14155
14156 /**
14157 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
14158 * it's created. Arrays are created for missing index properties while objects
14159 * are created for all other missing properties. Use `_.setWith` to customize
14160 * `path` creation.
14161 *
14162 * **Note:** This method mutates `object`.
14163 *
14164 * @static
14165 * @memberOf _
14166 * @since 3.7.0
14167 * @category Object
14168 * @param {Object} object The object to modify.
14169 * @param {Array|string} path The path of the property to set.
14170 * @param {*} value The value to set.
14171 * @returns {Object} Returns `object`.
14172 * @example
14173 *
14174 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
14175 *
14176 * _.set(object, 'a[0].b.c', 4);
14177 * console.log(object.a[0].b.c);
14178 * // => 4
14179 *
14180 * _.set(object, ['x', '0', 'y', 'z'], 5);
14181 * console.log(object.x[0].y.z);
14182 * // => 5
14183 */
14184 function set(object, path, value) {
14185 return object == null ? object : baseSet(object, path, value);
14186 }
14187
14188 /**
14189 * This method is like `_.set` except that it accepts `customizer` which is
14190 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
14191 * path creation is handled by the method instead. The `customizer` is invoked
14192 * with three arguments: (nsValue, key, nsObject).
14193 *
14194 * **Note:** This method mutates `object`.
14195 *
14196 * @static
14197 * @memberOf _
14198 * @since 4.0.0
14199 * @category Object
14200 * @param {Object} object The object to modify.
14201 * @param {Array|string} path The path of the property to set.
14202 * @param {*} value The value to set.
14203 * @param {Function} [customizer] The function to customize assigned values.
14204 * @returns {Object} Returns `object`.
14205 * @example
14206 *
14207 * var object = {};
14208 *
14209 * _.setWith(object, '[0][1]', 'a', Object);
14210 * // => { '0': { '1': 'a' } }
14211 */
14212 function setWith(object, path, value, customizer) {
14213 customizer = typeof customizer == 'function' ? customizer : undefined;
14214 return object == null ? object : baseSet(object, path, value, customizer);
14215 }
14216
14217 /**
14218 * Creates an array of own enumerable string keyed-value pairs for `object`
14219 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
14220 * entries are returned.
14221 *
14222 * @static
14223 * @memberOf _
14224 * @since 4.0.0
14225 * @alias entries
14226 * @category Object
14227 * @param {Object} object The object to query.
14228 * @returns {Array} Returns the key-value pairs.
14229 * @example
14230 *
14231 * function Foo() {
14232 * this.a = 1;
14233 * this.b = 2;
14234 * }
14235 *
14236 * Foo.prototype.c = 3;
14237 *
14238 * _.toPairs(new Foo);
14239 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
14240 */
14241 var toPairs = createToPairs(keys);
14242
14243 /**
14244 * Creates an array of own and inherited enumerable string keyed-value pairs
14245 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
14246 * or set, its entries are returned.
14247 *
14248 * @static
14249 * @memberOf _
14250 * @since 4.0.0
14251 * @alias entriesIn
14252 * @category Object
14253 * @param {Object} object The object to query.
14254 * @returns {Array} Returns the key-value pairs.
14255 * @example
14256 *
14257 * function Foo() {
14258 * this.a = 1;
14259 * this.b = 2;
14260 * }
14261 *
14262 * Foo.prototype.c = 3;
14263 *
14264 * _.toPairsIn(new Foo);
14265 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
14266 */
14267 var toPairsIn = createToPairs(keysIn);
14268
14269 /**
14270 * An alternative to `_.reduce`; this method transforms `object` to a new
14271 * `accumulator` object which is the result of running each of its own
14272 * enumerable string keyed properties thru `iteratee`, with each invocation
14273 * potentially mutating the `accumulator` object. If `accumulator` is not
14274 * provided, a new object with the same `[[Prototype]]` will be used. The
14275 * iteratee is invoked with four arguments: (accumulator, value, key, object).
14276 * Iteratee functions may exit iteration early by explicitly returning `false`.
14277 *
14278 * @static
14279 * @memberOf _
14280 * @since 1.3.0
14281 * @category Object
14282 * @param {Object} object The object to iterate over.
14283 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14284 * @param {*} [accumulator] The custom accumulator value.
14285 * @returns {*} Returns the accumulated value.
14286 * @example
14287 *
14288 * _.transform([2, 3, 4], function(result, n) {
14289 * result.push(n *= n);
14290 * return n % 2 == 0;
14291 * }, []);
14292 * // => [4, 9]
14293 *
14294 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
14295 * (result[value] || (result[value] = [])).push(key);
14296 * }, {});
14297 * // => { '1': ['a', 'c'], '2': ['b'] }
14298 */
14299 function transform(object, iteratee, accumulator) {
14300 var isArr = isArray(object),
14301 isArrLike = isArr || isBuffer(object) || isTypedArray(object);
14302
14303 iteratee = getIteratee(iteratee, 4);
14304 if (accumulator == null) {
14305 var Ctor = object && object.constructor;
14306 if (isArrLike) {
14307 accumulator = isArr ? new Ctor : [];
14308 }
14309 else if (isObject(object)) {
14310 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
14311 }
14312 else {
14313 accumulator = {};
14314 }
14315 }
14316 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
14317 return iteratee(accumulator, value, index, object);
14318 });
14319 return accumulator;
14320 }
14321
14322 /**
14323 * Removes the property at `path` of `object`.
14324 *
14325 * **Note:** This method mutates `object`.
14326 *
14327 * @static
14328 * @memberOf _
14329 * @since 4.0.0
14330 * @category Object
14331 * @param {Object} object The object to modify.
14332 * @param {Array|string} path The path of the property to unset.
14333 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
14334 * @example
14335 *
14336 * var object = { 'a': [{ 'b': { 'c': 7 } }] };
14337 * _.unset(object, 'a[0].b.c');
14338 * // => true
14339 *
14340 * console.log(object);
14341 * // => { 'a': [{ 'b': {} }] };
14342 *
14343 * _.unset(object, ['a', '0', 'b', 'c']);
14344 * // => true
14345 *
14346 * console.log(object);
14347 * // => { 'a': [{ 'b': {} }] };
14348 */
14349 function unset(object, path) {
14350 return object == null ? true : baseUnset(object, path);
14351 }
14352
14353 /**
14354 * This method is like `_.set` except that accepts `updater` to produce the
14355 * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
14356 * is invoked with one argument: (value).
14357 *
14358 * **Note:** This method mutates `object`.
14359 *
14360 * @static
14361 * @memberOf _
14362 * @since 4.6.0
14363 * @category Object
14364 * @param {Object} object The object to modify.
14365 * @param {Array|string} path The path of the property to set.
14366 * @param {Function} updater The function to produce the updated value.
14367 * @returns {Object} Returns `object`.
14368 * @example
14369 *
14370 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
14371 *
14372 * _.update(object, 'a[0].b.c', function(n) { return n * n; });
14373 * console.log(object.a[0].b.c);
14374 * // => 9
14375 *
14376 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
14377 * console.log(object.x[0].y.z);
14378 * // => 0
14379 */
14380 function update(object, path, updater) {
14381 return object == null ? object : baseUpdate(object, path, castFunction(updater));
14382 }
14383
14384 /**
14385 * This method is like `_.update` except that it accepts `customizer` which is
14386 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
14387 * path creation is handled by the method instead. The `customizer` is invoked
14388 * with three arguments: (nsValue, key, nsObject).
14389 *
14390 * **Note:** This method mutates `object`.
14391 *
14392 * @static
14393 * @memberOf _
14394 * @since 4.6.0
14395 * @category Object
14396 * @param {Object} object The object to modify.
14397 * @param {Array|string} path The path of the property to set.
14398 * @param {Function} updater The function to produce the updated value.
14399 * @param {Function} [customizer] The function to customize assigned values.
14400 * @returns {Object} Returns `object`.
14401 * @example
14402 *
14403 * var object = {};
14404 *
14405 * _.updateWith(object, '[0][1]', _.constant('a'), Object);
14406 * // => { '0': { '1': 'a' } }
14407 */
14408 function updateWith(object, path, updater, customizer) {
14409 customizer = typeof customizer == 'function' ? customizer : undefined;
14410 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
14411 }
14412
14413 /**
14414 * Creates an array of the own enumerable string keyed property values of `object`.
14415 *
14416 * **Note:** Non-object values are coerced to objects.
14417 *
14418 * @static
14419 * @since 0.1.0
14420 * @memberOf _
14421 * @category Object
14422 * @param {Object} object The object to query.
14423 * @returns {Array} Returns the array of property values.
14424 * @example
14425 *
14426 * function Foo() {
14427 * this.a = 1;
14428 * this.b = 2;
14429 * }
14430 *
14431 * Foo.prototype.c = 3;
14432 *
14433 * _.values(new Foo);
14434 * // => [1, 2] (iteration order is not guaranteed)
14435 *
14436 * _.values('hi');
14437 * // => ['h', 'i']
14438 */
14439 function values(object) {
14440 return object == null ? [] : baseValues(object, keys(object));
14441 }
14442
14443 /**
14444 * Creates an array of the own and inherited enumerable string keyed property
14445 * values of `object`.
14446 *
14447 * **Note:** Non-object values are coerced to objects.
14448 *
14449 * @static
14450 * @memberOf _
14451 * @since 3.0.0
14452 * @category Object
14453 * @param {Object} object The object to query.
14454 * @returns {Array} Returns the array of property values.
14455 * @example
14456 *
14457 * function Foo() {
14458 * this.a = 1;
14459 * this.b = 2;
14460 * }
14461 *
14462 * Foo.prototype.c = 3;
14463 *
14464 * _.valuesIn(new Foo);
14465 * // => [1, 2, 3] (iteration order is not guaranteed)
14466 */
14467 function valuesIn(object) {
14468 return object == null ? [] : baseValues(object, keysIn(object));
14469 }
14470
14471 /*------------------------------------------------------------------------*/
14472
14473 /**
14474 * Clamps `number` within the inclusive `lower` and `upper` bounds.
14475 *
14476 * @static
14477 * @memberOf _
14478 * @since 4.0.0
14479 * @category Number
14480 * @param {number} number The number to clamp.
14481 * @param {number} [lower] The lower bound.
14482 * @param {number} upper The upper bound.
14483 * @returns {number} Returns the clamped number.
14484 * @example
14485 *
14486 * _.clamp(-10, -5, 5);
14487 * // => -5
14488 *
14489 * _.clamp(10, -5, 5);
14490 * // => 5
14491 */
14492 function clamp(number, lower, upper) {
14493 if (upper === undefined) {
14494 upper = lower;
14495 lower = undefined;
14496 }
14497 if (upper !== undefined) {
14498 upper = toNumber(upper);
14499 upper = upper === upper ? upper : 0;
14500 }
14501 if (lower !== undefined) {
14502 lower = toNumber(lower);
14503 lower = lower === lower ? lower : 0;
14504 }
14505 return baseClamp(toNumber(number), lower, upper);
14506 }
14507
14508 /**
14509 * Checks if `n` is between `start` and up to, but not including, `end`. If
14510 * `end` is not specified, it's set to `start` with `start` then set to `0`.
14511 * If `start` is greater than `end` the params are swapped to support
14512 * negative ranges.
14513 *
14514 * @static
14515 * @memberOf _
14516 * @since 3.3.0
14517 * @category Number
14518 * @param {number} number The number to check.
14519 * @param {number} [start=0] The start of the range.
14520 * @param {number} end The end of the range.
14521 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
14522 * @see _.range, _.rangeRight
14523 * @example
14524 *
14525 * _.inRange(3, 2, 4);
14526 * // => true
14527 *
14528 * _.inRange(4, 8);
14529 * // => true
14530 *
14531 * _.inRange(4, 2);
14532 * // => false
14533 *
14534 * _.inRange(2, 2);
14535 * // => false
14536 *
14537 * _.inRange(1.2, 2);
14538 * // => true
14539 *
14540 * _.inRange(5.2, 4);
14541 * // => false
14542 *
14543 * _.inRange(-3, -2, -6);
14544 * // => true
14545 */
14546 function inRange(number, start, end) {
14547 start = toFinite(start);
14548 if (end === undefined) {
14549 end = start;
14550 start = 0;
14551 } else {
14552 end = toFinite(end);
14553 }
14554 number = toNumber(number);
14555 return baseInRange(number, start, end);
14556 }
14557
14558 /**
14559 * Produces a random number between the inclusive `lower` and `upper` bounds.
14560 * If only one argument is provided a number between `0` and the given number
14561 * is returned. If `floating` is `true`, or either `lower` or `upper` are
14562 * floats, a floating-point number is returned instead of an integer.
14563 *
14564 * **Note:** JavaScript follows the IEEE-754 standard for resolving
14565 * floating-point values which can produce unexpected results.
14566 *
14567 * @static
14568 * @memberOf _
14569 * @since 0.7.0
14570 * @category Number
14571 * @param {number} [lower=0] The lower bound.
14572 * @param {number} [upper=1] The upper bound.
14573 * @param {boolean} [floating] Specify returning a floating-point number.
14574 * @returns {number} Returns the random number.
14575 * @example
14576 *
14577 * _.random(0, 5);
14578 * // => an integer between 0 and 5
14579 *
14580 * _.random(5);
14581 * // => also an integer between 0 and 5
14582 *
14583 * _.random(5, true);
14584 * // => a floating-point number between 0 and 5
14585 *
14586 * _.random(1.2, 5.2);
14587 * // => a floating-point number between 1.2 and 5.2
14588 */
14589 function random(lower, upper, floating) {
14590 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
14591 upper = floating = undefined;
14592 }
14593 if (floating === undefined) {
14594 if (typeof upper == 'boolean') {
14595 floating = upper;
14596 upper = undefined;
14597 }
14598 else if (typeof lower == 'boolean') {
14599 floating = lower;
14600 lower = undefined;
14601 }
14602 }
14603 if (lower === undefined && upper === undefined) {
14604 lower = 0;
14605 upper = 1;
14606 }
14607 else {
14608 lower = toFinite(lower);
14609 if (upper === undefined) {
14610 upper = lower;
14611 lower = 0;
14612 } else {
14613 upper = toFinite(upper);
14614 }
14615 }
14616 if (lower > upper) {
14617 var temp = lower;
14618 lower = upper;
14619 upper = temp;
14620 }
14621 if (floating || lower % 1 || upper % 1) {
14622 var rand = nativeRandom();
14623 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
14624 }
14625 return baseRandom(lower, upper);
14626 }
14627
14628 /*------------------------------------------------------------------------*/
14629
14630 /**
14631 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
14632 *
14633 * @static
14634 * @memberOf _
14635 * @since 3.0.0
14636 * @category String
14637 * @param {string} [string=''] The string to convert.
14638 * @returns {string} Returns the camel cased string.
14639 * @example
14640 *
14641 * _.camelCase('Foo Bar');
14642 * // => 'fooBar'
14643 *
14644 * _.camelCase('--foo-bar--');
14645 * // => 'fooBar'
14646 *
14647 * _.camelCase('__FOO_BAR__');
14648 * // => 'fooBar'
14649 */
14650 var camelCase = createCompounder(function(result, word, index) {
14651 word = word.toLowerCase();
14652 return result + (index ? capitalize(word) : word);
14653 });
14654
14655 /**
14656 * Converts the first character of `string` to upper case and the remaining
14657 * to lower case.
14658 *
14659 * @static
14660 * @memberOf _
14661 * @since 3.0.0
14662 * @category String
14663 * @param {string} [string=''] The string to capitalize.
14664 * @returns {string} Returns the capitalized string.
14665 * @example
14666 *
14667 * _.capitalize('FRED');
14668 * // => 'Fred'
14669 */
14670 function capitalize(string) {
14671 return upperFirst(toString(string).toLowerCase());
14672 }
14673
14674 /**
14675 * Deburrs `string` by converting
14676 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
14677 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
14678 * letters to basic Latin letters and removing
14679 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
14680 *
14681 * @static
14682 * @memberOf _
14683 * @since 3.0.0
14684 * @category String
14685 * @param {string} [string=''] The string to deburr.
14686 * @returns {string} Returns the deburred string.
14687 * @example
14688 *
14689 * _.deburr('déjà vu');
14690 * // => 'deja vu'
14691 */
14692 function deburr(string) {
14693 string = toString(string);
14694 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
14695 }
14696
14697 /**
14698 * Checks if `string` ends with the given target string.
14699 *
14700 * @static
14701 * @memberOf _
14702 * @since 3.0.0
14703 * @category String
14704 * @param {string} [string=''] The string to inspect.
14705 * @param {string} [target] The string to search for.
14706 * @param {number} [position=string.length] The position to search up to.
14707 * @returns {boolean} Returns `true` if `string` ends with `target`,
14708 * else `false`.
14709 * @example
14710 *
14711 * _.endsWith('abc', 'c');
14712 * // => true
14713 *
14714 * _.endsWith('abc', 'b');
14715 * // => false
14716 *
14717 * _.endsWith('abc', 'b', 2);
14718 * // => true
14719 */
14720 function endsWith(string, target, position) {
14721 string = toString(string);
14722 target = baseToString(target);
14723
14724 var length = string.length;
14725 position = position === undefined
14726 ? length
14727 : baseClamp(toInteger(position), 0, length);
14728
14729 var end = position;
14730 position -= target.length;
14731 return position >= 0 && string.slice(position, end) == target;
14732 }
14733
14734 /**
14735 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
14736 * corresponding HTML entities.
14737 *
14738 * **Note:** No other characters are escaped. To escape additional
14739 * characters use a third-party library like [_he_](https://mths.be/he).
14740 *
14741 * Though the ">" character is escaped for symmetry, characters like
14742 * ">" and "/" don't need escaping in HTML and have no special meaning
14743 * unless they're part of a tag or unquoted attribute value. See
14744 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
14745 * (under "semi-related fun fact") for more details.
14746 *
14747 * When working with HTML you should always
14748 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
14749 * XSS vectors.
14750 *
14751 * @static
14752 * @since 0.1.0
14753 * @memberOf _
14754 * @category String
14755 * @param {string} [string=''] The string to escape.
14756 * @returns {string} Returns the escaped string.
14757 * @example
14758 *
14759 * _.escape('fred, barney, & pebbles');
14760 * // => 'fred, barney, &amp; pebbles'
14761 */
14762 function escape(string) {
14763 string = toString(string);
14764 return (string && reHasUnescapedHtml.test(string))
14765 ? string.replace(reUnescapedHtml, escapeHtmlChar)
14766 : string;
14767 }
14768
14769 /**
14770 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
14771 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
14772 *
14773 * @static
14774 * @memberOf _
14775 * @since 3.0.0
14776 * @category String
14777 * @param {string} [string=''] The string to escape.
14778 * @returns {string} Returns the escaped string.
14779 * @example
14780 *
14781 * _.escapeRegExp('[lodash](https://lodash.com/)');
14782 * // => '\[lodash\]\(https://lodash\.com/\)'
14783 */
14784 function escapeRegExp(string) {
14785 string = toString(string);
14786 return (string && reHasRegExpChar.test(string))
14787 ? string.replace(reRegExpChar, '\\$&')
14788 : string;
14789 }
14790
14791 /**
14792 * Converts `string` to
14793 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
14794 *
14795 * @static
14796 * @memberOf _
14797 * @since 3.0.0
14798 * @category String
14799 * @param {string} [string=''] The string to convert.
14800 * @returns {string} Returns the kebab cased string.
14801 * @example
14802 *
14803 * _.kebabCase('Foo Bar');
14804 * // => 'foo-bar'
14805 *
14806 * _.kebabCase('fooBar');
14807 * // => 'foo-bar'
14808 *
14809 * _.kebabCase('__FOO_BAR__');
14810 * // => 'foo-bar'
14811 */
14812 var kebabCase = createCompounder(function(result, word, index) {
14813 return result + (index ? '-' : '') + word.toLowerCase();
14814 });
14815
14816 /**
14817 * Converts `string`, as space separated words, to lower case.
14818 *
14819 * @static
14820 * @memberOf _
14821 * @since 4.0.0
14822 * @category String
14823 * @param {string} [string=''] The string to convert.
14824 * @returns {string} Returns the lower cased string.
14825 * @example
14826 *
14827 * _.lowerCase('--Foo-Bar--');
14828 * // => 'foo bar'
14829 *
14830 * _.lowerCase('fooBar');
14831 * // => 'foo bar'
14832 *
14833 * _.lowerCase('__FOO_BAR__');
14834 * // => 'foo bar'
14835 */
14836 var lowerCase = createCompounder(function(result, word, index) {
14837 return result + (index ? ' ' : '') + word.toLowerCase();
14838 });
14839
14840 /**
14841 * Converts the first character of `string` to lower case.
14842 *
14843 * @static
14844 * @memberOf _
14845 * @since 4.0.0
14846 * @category String
14847 * @param {string} [string=''] The string to convert.
14848 * @returns {string} Returns the converted string.
14849 * @example
14850 *
14851 * _.lowerFirst('Fred');
14852 * // => 'fred'
14853 *
14854 * _.lowerFirst('FRED');
14855 * // => 'fRED'
14856 */
14857 var lowerFirst = createCaseFirst('toLowerCase');
14858
14859 /**
14860 * Pads `string` on the left and right sides if it's shorter than `length`.
14861 * Padding characters are truncated if they can't be evenly divided by `length`.
14862 *
14863 * @static
14864 * @memberOf _
14865 * @since 3.0.0
14866 * @category String
14867 * @param {string} [string=''] The string to pad.
14868 * @param {number} [length=0] The padding length.
14869 * @param {string} [chars=' '] The string used as padding.
14870 * @returns {string} Returns the padded string.
14871 * @example
14872 *
14873 * _.pad('abc', 8);
14874 * // => ' abc '
14875 *
14876 * _.pad('abc', 8, '_-');
14877 * // => '_-abc_-_'
14878 *
14879 * _.pad('abc', 3);
14880 * // => 'abc'
14881 */
14882 function pad(string, length, chars) {
14883 string = toString(string);
14884 length = toInteger(length);
14885
14886 var strLength = length ? stringSize(string) : 0;
14887 if (!length || strLength >= length) {
14888 return string;
14889 }
14890 var mid = (length - strLength) / 2;
14891 return (
14892 createPadding(nativeFloor(mid), chars) +
14893 string +
14894 createPadding(nativeCeil(mid), chars)
14895 );
14896 }
14897
14898 /**
14899 * Pads `string` on the right side if it's shorter than `length`. Padding
14900 * characters are truncated if they exceed `length`.
14901 *
14902 * @static
14903 * @memberOf _
14904 * @since 4.0.0
14905 * @category String
14906 * @param {string} [string=''] The string to pad.
14907 * @param {number} [length=0] The padding length.
14908 * @param {string} [chars=' '] The string used as padding.
14909 * @returns {string} Returns the padded string.
14910 * @example
14911 *
14912 * _.padEnd('abc', 6);
14913 * // => 'abc '
14914 *
14915 * _.padEnd('abc', 6, '_-');
14916 * // => 'abc_-_'
14917 *
14918 * _.padEnd('abc', 3);
14919 * // => 'abc'
14920 */
14921 function padEnd(string, length, chars) {
14922 string = toString(string);
14923 length = toInteger(length);
14924
14925 var strLength = length ? stringSize(string) : 0;
14926 return (length && strLength < length)
14927 ? (string + createPadding(length - strLength, chars))
14928 : string;
14929 }
14930
14931 /**
14932 * Pads `string` on the left side if it's shorter than `length`. Padding
14933 * characters are truncated if they exceed `length`.
14934 *
14935 * @static
14936 * @memberOf _
14937 * @since 4.0.0
14938 * @category String
14939 * @param {string} [string=''] The string to pad.
14940 * @param {number} [length=0] The padding length.
14941 * @param {string} [chars=' '] The string used as padding.
14942 * @returns {string} Returns the padded string.
14943 * @example
14944 *
14945 * _.padStart('abc', 6);
14946 * // => ' abc'
14947 *
14948 * _.padStart('abc', 6, '_-');
14949 * // => '_-_abc'
14950 *
14951 * _.padStart('abc', 3);
14952 * // => 'abc'
14953 */
14954 function padStart(string, length, chars) {
14955 string = toString(string);
14956 length = toInteger(length);
14957
14958 var strLength = length ? stringSize(string) : 0;
14959 return (length && strLength < length)
14960 ? (createPadding(length - strLength, chars) + string)
14961 : string;
14962 }
14963
14964 /**
14965 * Converts `string` to an integer of the specified radix. If `radix` is
14966 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
14967 * hexadecimal, in which case a `radix` of `16` is used.
14968 *
14969 * **Note:** This method aligns with the
14970 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
14971 *
14972 * @static
14973 * @memberOf _
14974 * @since 1.1.0
14975 * @category String
14976 * @param {string} string The string to convert.
14977 * @param {number} [radix=10] The radix to interpret `value` by.
14978 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
14979 * @returns {number} Returns the converted integer.
14980 * @example
14981 *
14982 * _.parseInt('08');
14983 * // => 8
14984 *
14985 * _.map(['6', '08', '10'], _.parseInt);
14986 * // => [6, 8, 10]
14987 */
14988 function parseInt(string, radix, guard) {
14989 if (guard || radix == null) {
14990 radix = 0;
14991 } else if (radix) {
14992 radix = +radix;
14993 }
14994 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
14995 }
14996
14997 /**
14998 * Repeats the given string `n` times.
14999 *
15000 * @static
15001 * @memberOf _
15002 * @since 3.0.0
15003 * @category String
15004 * @param {string} [string=''] The string to repeat.
15005 * @param {number} [n=1] The number of times to repeat the string.
15006 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15007 * @returns {string} Returns the repeated string.
15008 * @example
15009 *
15010 * _.repeat('*', 3);
15011 * // => '***'
15012 *
15013 * _.repeat('abc', 2);
15014 * // => 'abcabc'
15015 *
15016 * _.repeat('abc', 0);
15017 * // => ''
15018 */
15019 function repeat(string, n, guard) {
15020 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
15021 n = 1;
15022 } else {
15023 n = toInteger(n);
15024 }
15025 return baseRepeat(toString(string), n);
15026 }
15027
15028 /**
15029 * Replaces matches for `pattern` in `string` with `replacement`.
15030 *
15031 * **Note:** This method is based on
15032 * [`String#replace`](https://mdn.io/String/replace).
15033 *
15034 * @static
15035 * @memberOf _
15036 * @since 4.0.0
15037 * @category String
15038 * @param {string} [string=''] The string to modify.
15039 * @param {RegExp|string} pattern The pattern to replace.
15040 * @param {Function|string} replacement The match replacement.
15041 * @returns {string} Returns the modified string.
15042 * @example
15043 *
15044 * _.replace('Hi Fred', 'Fred', 'Barney');
15045 * // => 'Hi Barney'
15046 */
15047 function replace() {
15048 var args = arguments,
15049 string = toString(args[0]);
15050
15051 return args.length < 3 ? string : string.replace(args[1], args[2]);
15052 }
15053
15054 /**
15055 * Converts `string` to
15056 * [snake case](https://en.wikipedia.org/wiki/Snake_case).
15057 *
15058 * @static
15059 * @memberOf _
15060 * @since 3.0.0
15061 * @category String
15062 * @param {string} [string=''] The string to convert.
15063 * @returns {string} Returns the snake cased string.
15064 * @example
15065 *
15066 * _.snakeCase('Foo Bar');
15067 * // => 'foo_bar'
15068 *
15069 * _.snakeCase('fooBar');
15070 * // => 'foo_bar'
15071 *
15072 * _.snakeCase('--FOO-BAR--');
15073 * // => 'foo_bar'
15074 */
15075 var snakeCase = createCompounder(function(result, word, index) {
15076 return result + (index ? '_' : '') + word.toLowerCase();
15077 });
15078
15079 /**
15080 * Splits `string` by `separator`.
15081 *
15082 * **Note:** This method is based on
15083 * [`String#split`](https://mdn.io/String/split).
15084 *
15085 * @static
15086 * @memberOf _
15087 * @since 4.0.0
15088 * @category String
15089 * @param {string} [string=''] The string to split.
15090 * @param {RegExp|string} separator The separator pattern to split by.
15091 * @param {number} [limit] The length to truncate results to.
15092 * @returns {Array} Returns the string segments.
15093 * @example
15094 *
15095 * _.split('a-b-c', '-', 2);
15096 * // => ['a', 'b']
15097 */
15098 function split(string, separator, limit) {
15099 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
15100 separator = limit = undefined;
15101 }
15102 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
15103 if (!limit) {
15104 return [];
15105 }
15106 string = toString(string);
15107 if (string && (
15108 typeof separator == 'string' ||
15109 (separator != null && !isRegExp(separator))
15110 )) {
15111 separator = baseToString(separator);
15112 if (!separator && hasUnicode(string)) {
15113 return castSlice(stringToArray(string), 0, limit);
15114 }
15115 }
15116 return string.split(separator, limit);
15117 }
15118
15119 /**
15120 * Converts `string` to
15121 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
15122 *
15123 * @static
15124 * @memberOf _
15125 * @since 3.1.0
15126 * @category String
15127 * @param {string} [string=''] The string to convert.
15128 * @returns {string} Returns the start cased string.
15129 * @example
15130 *
15131 * _.startCase('--foo-bar--');
15132 * // => 'Foo Bar'
15133 *
15134 * _.startCase('fooBar');
15135 * // => 'Foo Bar'
15136 *
15137 * _.startCase('__FOO_BAR__');
15138 * // => 'FOO BAR'
15139 */
15140 var startCase = createCompounder(function(result, word, index) {
15141 return result + (index ? ' ' : '') + upperFirst(word);
15142 });
15143
15144 /**
15145 * Checks if `string` starts with the given target string.
15146 *
15147 * @static
15148 * @memberOf _
15149 * @since 3.0.0
15150 * @category String
15151 * @param {string} [string=''] The string to inspect.
15152 * @param {string} [target] The string to search for.
15153 * @param {number} [position=0] The position to search from.
15154 * @returns {boolean} Returns `true` if `string` starts with `target`,
15155 * else `false`.
15156 * @example
15157 *
15158 * _.startsWith('abc', 'a');
15159 * // => true
15160 *
15161 * _.startsWith('abc', 'b');
15162 * // => false
15163 *
15164 * _.startsWith('abc', 'b', 1);
15165 * // => true
15166 */
15167 function startsWith(string, target, position) {
15168 string = toString(string);
15169 position = position == null
15170 ? 0
15171 : baseClamp(toInteger(position), 0, string.length);
15172
15173 target = baseToString(target);
15174 return string.slice(position, position + target.length) == target;
15175 }
15176
15177 /**
15178 * Creates a compiled template function that can interpolate data properties
15179 * in "interpolate" delimiters, HTML-escape interpolated data properties in
15180 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
15181 * properties may be accessed as free variables in the template. If a setting
15182 * object is given, it takes precedence over `_.templateSettings` values.
15183 *
15184 * **Note:** In the development build `_.template` utilizes
15185 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
15186 * for easier debugging.
15187 *
15188 * For more information on precompiling templates see
15189 * [lodash's custom builds documentation](https://lodash.com/custom-builds).
15190 *
15191 * For more information on Chrome extension sandboxes see
15192 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
15193 *
15194 * @static
15195 * @since 0.1.0
15196 * @memberOf _
15197 * @category String
15198 * @param {string} [string=''] The template string.
15199 * @param {Object} [options={}] The options object.
15200 * @param {RegExp} [options.escape=_.templateSettings.escape]
15201 * The HTML "escape" delimiter.
15202 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
15203 * The "evaluate" delimiter.
15204 * @param {Object} [options.imports=_.templateSettings.imports]
15205 * An object to import into the template as free variables.
15206 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
15207 * The "interpolate" delimiter.
15208 * @param {string} [options.sourceURL='lodash.templateSources[n]']
15209 * The sourceURL of the compiled template.
15210 * @param {string} [options.variable='obj']
15211 * The data object variable name.
15212 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15213 * @returns {Function} Returns the compiled template function.
15214 * @example
15215 *
15216 * // Use the "interpolate" delimiter to create a compiled template.
15217 * var compiled = _.template('hello <%= user %>!');
15218 * compiled({ 'user': 'fred' });
15219 * // => 'hello fred!'
15220 *
15221 * // Use the HTML "escape" delimiter to escape data property values.
15222 * var compiled = _.template('<b><%- value %></b>');
15223 * compiled({ 'value': '<script>' });
15224 * // => '<b>&lt;script&gt;</b>'
15225 *
15226 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
15227 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
15228 * compiled({ 'users': ['fred', 'barney'] });
15229 * // => '<li>fred</li><li>barney</li>'
15230 *
15231 * // Use the internal `print` function in "evaluate" delimiters.
15232 * var compiled = _.template('<% print("hello " + user); %>!');
15233 * compiled({ 'user': 'barney' });
15234 * // => 'hello barney!'
15235 *
15236 * // Use the ES template literal delimiter as an "interpolate" delimiter.
15237 * // Disable support by replacing the "interpolate" delimiter.
15238 * var compiled = _.template('hello ${ user }!');
15239 * compiled({ 'user': 'pebbles' });
15240 * // => 'hello pebbles!'
15241 *
15242 * // Use backslashes to treat delimiters as plain text.
15243 * var compiled = _.template('<%= "\\<%- value %\\>" %>');
15244 * compiled({ 'value': 'ignored' });
15245 * // => '<%- value %>'
15246 *
15247 * // Use the `imports` option to import `jQuery` as `jq`.
15248 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
15249 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
15250 * compiled({ 'users': ['fred', 'barney'] });
15251 * // => '<li>fred</li><li>barney</li>'
15252 *
15253 * // Use the `sourceURL` option to specify a custom sourceURL for the template.
15254 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
15255 * compiled(data);
15256 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
15257 *
15258 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
15259 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
15260 * compiled.source;
15261 * // => function(data) {
15262 * // var __t, __p = '';
15263 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
15264 * // return __p;
15265 * // }
15266 *
15267 * // Use custom template delimiters.
15268 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
15269 * var compiled = _.template('hello {{ user }}!');
15270 * compiled({ 'user': 'mustache' });
15271 * // => 'hello mustache!'
15272 *
15273 * // Use the `source` property to inline compiled templates for meaningful
15274 * // line numbers in error messages and stack traces.
15275 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
15276 * var JST = {\
15277 * "main": ' + _.template(mainText).source + '\
15278 * };\
15279 * ');
15280 */
15281 function template(string, options, guard) {
15282 // Based on John Resig's `tmpl` implementation
15283 // (http://ejohn.org/blog/javascript-micro-templating/)
15284 // and Laura Doktorova's doT.js (https://github.com/olado/doT).
15285 var settings = lodash.templateSettings;
15286
15287 if (guard && isIterateeCall(string, options, guard)) {
15288 options = undefined;
15289 }
15290 string = toString(string);
15291 options = assignInWith({}, options, settings, customDefaultsAssignIn);
15292
15293 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
15294 importsKeys = keys(imports),
15295 importsValues = baseValues(imports, importsKeys);
15296
15297 var isEscaping,
15298 isEvaluating,
15299 index = 0,
15300 interpolate = options.interpolate || reNoMatch,
15301 source = "__p += '";
15302
15303 // Compile the regexp to match each delimiter.
15304 var reDelimiters = RegExp(
15305 (options.escape || reNoMatch).source + '|' +
15306 interpolate.source + '|' +
15307 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
15308 (options.evaluate || reNoMatch).source + '|$'
15309 , 'g');
15310
15311 // Use a sourceURL for easier debugging.
15312 var sourceURL = '//# sourceURL=' +
15313 ('sourceURL' in options
15314 ? options.sourceURL
15315 : ('lodash.templateSources[' + (++templateCounter) + ']')
15316 ) + '\n';
15317
15318 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
15319 interpolateValue || (interpolateValue = esTemplateValue);
15320
15321 // Escape characters that can't be included in string literals.
15322 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
15323
15324 // Replace delimiters with snippets.
15325 if (escapeValue) {
15326 isEscaping = true;
15327 source += "' +\n__e(" + escapeValue + ") +\n'";
15328 }
15329 if (evaluateValue) {
15330 isEvaluating = true;
15331 source += "';\n" + evaluateValue + ";\n__p += '";
15332 }
15333 if (interpolateValue) {
15334 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
15335 }
15336 index = offset + match.length;
15337
15338 // The JS engine embedded in Adobe products needs `match` returned in
15339 // order to produce the correct `offset` value.
15340 return match;
15341 });
15342
15343 source += "';\n";
15344
15345 // If `variable` is not specified wrap a with-statement around the generated
15346 // code to add the data object to the top of the scope chain.
15347 var variable = options.variable;
15348 if (!variable) {
15349 source = 'with (obj) {\n' + source + '\n}\n';
15350 }
15351 // Cleanup code by stripping empty strings.
15352 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
15353 .replace(reEmptyStringMiddle, '$1')
15354 .replace(reEmptyStringTrailing, '$1;');
15355
15356 // Frame code as the function body.
15357 source = 'function(' + (variable || 'obj') + ') {\n' +
15358 (variable
15359 ? ''
15360 : 'obj || (obj = {});\n'
15361 ) +
15362 "var __t, __p = ''" +
15363 (isEscaping
15364 ? ', __e = _.escape'
15365 : ''
15366 ) +
15367 (isEvaluating
15368 ? ', __j = Array.prototype.join;\n' +
15369 "function print() { __p += __j.call(arguments, '') }\n"
15370 : ';\n'
15371 ) +
15372 source +
15373 'return __p\n}';
15374
15375 var result = attempt(function() {
15376 return Function(importsKeys, sourceURL + 'return ' + source)
15377 .apply(undefined, importsValues);
15378 });
15379
15380 // Provide the compiled function's source by its `toString` method or
15381 // the `source` property as a convenience for inlining compiled templates.
15382 result.source = source;
15383 if (isError(result)) {
15384 throw result;
15385 }
15386 return result;
15387 }
15388
15389 /**
15390 * Converts `string`, as a whole, to lower case just like
15391 * [String#toLowerCase](https://mdn.io/toLowerCase).
15392 *
15393 * @static
15394 * @memberOf _
15395 * @since 4.0.0
15396 * @category String
15397 * @param {string} [string=''] The string to convert.
15398 * @returns {string} Returns the lower cased string.
15399 * @example
15400 *
15401 * _.toLower('--Foo-Bar--');
15402 * // => '--foo-bar--'
15403 *
15404 * _.toLower('fooBar');
15405 * // => 'foobar'
15406 *
15407 * _.toLower('__FOO_BAR__');
15408 * // => '__foo_bar__'
15409 */
15410 function toLower(value) {
15411 return toString(value).toLowerCase();
15412 }
15413
15414 /**
15415 * Converts `string`, as a whole, to upper case just like
15416 * [String#toUpperCase](https://mdn.io/toUpperCase).
15417 *
15418 * @static
15419 * @memberOf _
15420 * @since 4.0.0
15421 * @category String
15422 * @param {string} [string=''] The string to convert.
15423 * @returns {string} Returns the upper cased string.
15424 * @example
15425 *
15426 * _.toUpper('--foo-bar--');
15427 * // => '--FOO-BAR--'
15428 *
15429 * _.toUpper('fooBar');
15430 * // => 'FOOBAR'
15431 *
15432 * _.toUpper('__foo_bar__');
15433 * // => '__FOO_BAR__'
15434 */
15435 function toUpper(value) {
15436 return toString(value).toUpperCase();
15437 }
15438
15439 /**
15440 * Removes leading and trailing whitespace or specified characters from `string`.
15441 *
15442 * @static
15443 * @memberOf _
15444 * @since 3.0.0
15445 * @category String
15446 * @param {string} [string=''] The string to trim.
15447 * @param {string} [chars=whitespace] The characters to trim.
15448 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15449 * @returns {string} Returns the trimmed string.
15450 * @example
15451 *
15452 * _.trim(' abc ');
15453 * // => 'abc'
15454 *
15455 * _.trim('-_-abc-_-', '_-');
15456 * // => 'abc'
15457 *
15458 * _.map([' foo ', ' bar '], _.trim);
15459 * // => ['foo', 'bar']
15460 */
15461 function trim(string, chars, guard) {
15462 string = toString(string);
15463 if (string && (guard || chars === undefined)) {
15464 return string.replace(reTrim, '');
15465 }
15466 if (!string || !(chars = baseToString(chars))) {
15467 return string;
15468 }
15469 var strSymbols = stringToArray(string),
15470 chrSymbols = stringToArray(chars),
15471 start = charsStartIndex(strSymbols, chrSymbols),
15472 end = charsEndIndex(strSymbols, chrSymbols) + 1;
15473
15474 return castSlice(strSymbols, start, end).join('');
15475 }
15476
15477 /**
15478 * Removes trailing whitespace or specified characters from `string`.
15479 *
15480 * @static
15481 * @memberOf _
15482 * @since 4.0.0
15483 * @category String
15484 * @param {string} [string=''] The string to trim.
15485 * @param {string} [chars=whitespace] The characters to trim.
15486 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15487 * @returns {string} Returns the trimmed string.
15488 * @example
15489 *
15490 * _.trimEnd(' abc ');
15491 * // => ' abc'
15492 *
15493 * _.trimEnd('-_-abc-_-', '_-');
15494 * // => '-_-abc'
15495 */
15496 function trimEnd(string, chars, guard) {
15497 string = toString(string);
15498 if (string && (guard || chars === undefined)) {
15499 return string.replace(reTrimEnd, '');
15500 }
15501 if (!string || !(chars = baseToString(chars))) {
15502 return string;
15503 }
15504 var strSymbols = stringToArray(string),
15505 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
15506
15507 return castSlice(strSymbols, 0, end).join('');
15508 }
15509
15510 /**
15511 * Removes leading whitespace or specified characters from `string`.
15512 *
15513 * @static
15514 * @memberOf _
15515 * @since 4.0.0
15516 * @category String
15517 * @param {string} [string=''] The string to trim.
15518 * @param {string} [chars=whitespace] The characters to trim.
15519 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15520 * @returns {string} Returns the trimmed string.
15521 * @example
15522 *
15523 * _.trimStart(' abc ');
15524 * // => 'abc '
15525 *
15526 * _.trimStart('-_-abc-_-', '_-');
15527 * // => 'abc-_-'
15528 */
15529 function trimStart(string, chars, guard) {
15530 string = toString(string);
15531 if (string && (guard || chars === undefined)) {
15532 return string.replace(reTrimStart, '');
15533 }
15534 if (!string || !(chars = baseToString(chars))) {
15535 return string;
15536 }
15537 var strSymbols = stringToArray(string),
15538 start = charsStartIndex(strSymbols, stringToArray(chars));
15539
15540 return castSlice(strSymbols, start).join('');
15541 }
15542
15543 /**
15544 * Truncates `string` if it's longer than the given maximum string length.
15545 * The last characters of the truncated string are replaced with the omission
15546 * string which defaults to "...".
15547 *
15548 * @static
15549 * @memberOf _
15550 * @since 4.0.0
15551 * @category String
15552 * @param {string} [string=''] The string to truncate.
15553 * @param {Object} [options={}] The options object.
15554 * @param {number} [options.length=30] The maximum string length.
15555 * @param {string} [options.omission='...'] The string to indicate text is omitted.
15556 * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
15557 * @returns {string} Returns the truncated string.
15558 * @example
15559 *
15560 * _.truncate('hi-diddly-ho there, neighborino');
15561 * // => 'hi-diddly-ho there, neighbo...'
15562 *
15563 * _.truncate('hi-diddly-ho there, neighborino', {
15564 * 'length': 24,
15565 * 'separator': ' '
15566 * });
15567 * // => 'hi-diddly-ho there,...'
15568 *
15569 * _.truncate('hi-diddly-ho there, neighborino', {
15570 * 'length': 24,
15571 * 'separator': /,? +/
15572 * });
15573 * // => 'hi-diddly-ho there...'
15574 *
15575 * _.truncate('hi-diddly-ho there, neighborino', {
15576 * 'omission': ' [...]'
15577 * });
15578 * // => 'hi-diddly-ho there, neig [...]'
15579 */
15580 function truncate(string, options) {
15581 var length = DEFAULT_TRUNC_LENGTH,
15582 omission = DEFAULT_TRUNC_OMISSION;
15583
15584 if (isObject(options)) {
15585 var separator = 'separator' in options ? options.separator : separator;
15586 length = 'length' in options ? toInteger(options.length) : length;
15587 omission = 'omission' in options ? baseToString(options.omission) : omission;
15588 }
15589 string = toString(string);
15590
15591 var strLength = string.length;
15592 if (hasUnicode(string)) {
15593 var strSymbols = stringToArray(string);
15594 strLength = strSymbols.length;
15595 }
15596 if (length >= strLength) {
15597 return string;
15598 }
15599 var end = length - stringSize(omission);
15600 if (end < 1) {
15601 return omission;
15602 }
15603 var result = strSymbols
15604 ? castSlice(strSymbols, 0, end).join('')
15605 : string.slice(0, end);
15606
15607 if (separator === undefined) {
15608 return result + omission;
15609 }
15610 if (strSymbols) {
15611 end += (result.length - end);
15612 }
15613 if (isRegExp(separator)) {
15614 if (string.slice(end).search(separator)) {
15615 var match,
15616 substring = result;
15617
15618 if (!separator.global) {
15619 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
15620 }
15621 separator.lastIndex = 0;
15622 while ((match = separator.exec(substring))) {
15623 var newEnd = match.index;
15624 }
15625 result = result.slice(0, newEnd === undefined ? end : newEnd);
15626 }
15627 } else if (string.indexOf(baseToString(separator), end) != end) {
15628 var index = result.lastIndexOf(separator);
15629 if (index > -1) {
15630 result = result.slice(0, index);
15631 }
15632 }
15633 return result + omission;
15634 }
15635
15636 /**
15637 * The inverse of `_.escape`; this method converts the HTML entities
15638 * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
15639 * their corresponding characters.
15640 *
15641 * **Note:** No other HTML entities are unescaped. To unescape additional
15642 * HTML entities use a third-party library like [_he_](https://mths.be/he).
15643 *
15644 * @static
15645 * @memberOf _
15646 * @since 0.6.0
15647 * @category String
15648 * @param {string} [string=''] The string to unescape.
15649 * @returns {string} Returns the unescaped string.
15650 * @example
15651 *
15652 * _.unescape('fred, barney, &amp; pebbles');
15653 * // => 'fred, barney, & pebbles'
15654 */
15655 function unescape(string) {
15656 string = toString(string);
15657 return (string && reHasEscapedHtml.test(string))
15658 ? string.replace(reEscapedHtml, unescapeHtmlChar)
15659 : string;
15660 }
15661
15662 /**
15663 * Converts `string`, as space separated words, to upper case.
15664 *
15665 * @static
15666 * @memberOf _
15667 * @since 4.0.0
15668 * @category String
15669 * @param {string} [string=''] The string to convert.
15670 * @returns {string} Returns the upper cased string.
15671 * @example
15672 *
15673 * _.upperCase('--foo-bar');
15674 * // => 'FOO BAR'
15675 *
15676 * _.upperCase('fooBar');
15677 * // => 'FOO BAR'
15678 *
15679 * _.upperCase('__foo_bar__');
15680 * // => 'FOO BAR'
15681 */
15682 var upperCase = createCompounder(function(result, word, index) {
15683 return result + (index ? ' ' : '') + word.toUpperCase();
15684 });
15685
15686 /**
15687 * Converts the first character of `string` to upper case.
15688 *
15689 * @static
15690 * @memberOf _
15691 * @since 4.0.0
15692 * @category String
15693 * @param {string} [string=''] The string to convert.
15694 * @returns {string} Returns the converted string.
15695 * @example
15696 *
15697 * _.upperFirst('fred');
15698 * // => 'Fred'
15699 *
15700 * _.upperFirst('FRED');
15701 * // => 'FRED'
15702 */
15703 var upperFirst = createCaseFirst('toUpperCase');
15704
15705 /**
15706 * Splits `string` into an array of its words.
15707 *
15708 * @static
15709 * @memberOf _
15710 * @since 3.0.0
15711 * @category String
15712 * @param {string} [string=''] The string to inspect.
15713 * @param {RegExp|string} [pattern] The pattern to match words.
15714 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15715 * @returns {Array} Returns the words of `string`.
15716 * @example
15717 *
15718 * _.words('fred, barney, & pebbles');
15719 * // => ['fred', 'barney', 'pebbles']
15720 *
15721 * _.words('fred, barney, & pebbles', /[^, ]+/g);
15722 * // => ['fred', 'barney', '&', 'pebbles']
15723 */
15724 function words(string, pattern, guard) {
15725 string = toString(string);
15726 pattern = guard ? undefined : pattern;
15727
15728 if (pattern === undefined) {
15729 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
15730 }
15731 return string.match(pattern) || [];
15732 }
15733
15734 /*------------------------------------------------------------------------*/
15735
15736 /**
15737 * Attempts to invoke `func`, returning either the result or the caught error
15738 * object. Any additional arguments are provided to `func` when it's invoked.
15739 *
15740 * @static
15741 * @memberOf _
15742 * @since 3.0.0
15743 * @category Util
15744 * @param {Function} func The function to attempt.
15745 * @param {...*} [args] The arguments to invoke `func` with.
15746 * @returns {*} Returns the `func` result or error object.
15747 * @example
15748 *
15749 * // Avoid throwing errors for invalid selectors.
15750 * var elements = _.attempt(function(selector) {
15751 * return document.querySelectorAll(selector);
15752 * }, '>_>');
15753 *
15754 * if (_.isError(elements)) {
15755 * elements = [];
15756 * }
15757 */
15758 var attempt = baseRest(function(func, args) {
15759 try {
15760 return apply(func, undefined, args);
15761 } catch (e) {
15762 return isError(e) ? e : new Error(e);
15763 }
15764 });
15765
15766 /**
15767 * Binds methods of an object to the object itself, overwriting the existing
15768 * method.
15769 *
15770 * **Note:** This method doesn't set the "length" property of bound functions.
15771 *
15772 * @static
15773 * @since 0.1.0
15774 * @memberOf _
15775 * @category Util
15776 * @param {Object} object The object to bind and assign the bound methods to.
15777 * @param {...(string|string[])} methodNames The object method names to bind.
15778 * @returns {Object} Returns `object`.
15779 * @example
15780 *
15781 * var view = {
15782 * 'label': 'docs',
15783 * 'click': function() {
15784 * console.log('clicked ' + this.label);
15785 * }
15786 * };
15787 *
15788 * _.bindAll(view, ['click']);
15789 * jQuery(element).on('click', view.click);
15790 * // => Logs 'clicked docs' when clicked.
15791 */
15792 var bindAll = flatRest(function(object, methodNames) {
15793 arrayEach(methodNames, function(key) {
15794 key = toKey(key);
15795 baseAssignValue(object, key, bind(object[key], object));
15796 });
15797 return object;
15798 });
15799
15800 /**
15801 * Creates a function that iterates over `pairs` and invokes the corresponding
15802 * function of the first predicate to return truthy. The predicate-function
15803 * pairs are invoked with the `this` binding and arguments of the created
15804 * function.
15805 *
15806 * @static
15807 * @memberOf _
15808 * @since 4.0.0
15809 * @category Util
15810 * @param {Array} pairs The predicate-function pairs.
15811 * @returns {Function} Returns the new composite function.
15812 * @example
15813 *
15814 * var func = _.cond([
15815 * [_.matches({ 'a': 1 }), _.constant('matches A')],
15816 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
15817 * [_.stubTrue, _.constant('no match')]
15818 * ]);
15819 *
15820 * func({ 'a': 1, 'b': 2 });
15821 * // => 'matches A'
15822 *
15823 * func({ 'a': 0, 'b': 1 });
15824 * // => 'matches B'
15825 *
15826 * func({ 'a': '1', 'b': '2' });
15827 * // => 'no match'
15828 */
15829 function cond(pairs) {
15830 var length = pairs == null ? 0 : pairs.length,
15831 toIteratee = getIteratee();
15832
15833 pairs = !length ? [] : arrayMap(pairs, function(pair) {
15834 if (typeof pair[1] != 'function') {
15835 throw new TypeError(FUNC_ERROR_TEXT);
15836 }
15837 return [toIteratee(pair[0]), pair[1]];
15838 });
15839
15840 return baseRest(function(args) {
15841 var index = -1;
15842 while (++index < length) {
15843 var pair = pairs[index];
15844 if (apply(pair[0], this, args)) {
15845 return apply(pair[1], this, args);
15846 }
15847 }
15848 });
15849 }
15850
15851 /**
15852 * Creates a function that invokes the predicate properties of `source` with
15853 * the corresponding property values of a given object, returning `true` if
15854 * all predicates return truthy, else `false`.
15855 *
15856 * **Note:** The created function is equivalent to `_.conformsTo` with
15857 * `source` partially applied.
15858 *
15859 * @static
15860 * @memberOf _
15861 * @since 4.0.0
15862 * @category Util
15863 * @param {Object} source The object of property predicates to conform to.
15864 * @returns {Function} Returns the new spec function.
15865 * @example
15866 *
15867 * var objects = [
15868 * { 'a': 2, 'b': 1 },
15869 * { 'a': 1, 'b': 2 }
15870 * ];
15871 *
15872 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
15873 * // => [{ 'a': 1, 'b': 2 }]
15874 */
15875 function conforms(source) {
15876 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
15877 }
15878
15879 /**
15880 * Creates a function that returns `value`.
15881 *
15882 * @static
15883 * @memberOf _
15884 * @since 2.4.0
15885 * @category Util
15886 * @param {*} value The value to return from the new function.
15887 * @returns {Function} Returns the new constant function.
15888 * @example
15889 *
15890 * var objects = _.times(2, _.constant({ 'a': 1 }));
15891 *
15892 * console.log(objects);
15893 * // => [{ 'a': 1 }, { 'a': 1 }]
15894 *
15895 * console.log(objects[0] === objects[1]);
15896 * // => true
15897 */
15898 function constant(value) {
15899 return function() {
15900 return value;
15901 };
15902 }
15903
15904 /**
15905 * Checks `value` to determine whether a default value should be returned in
15906 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
15907 * or `undefined`.
15908 *
15909 * @static
15910 * @memberOf _
15911 * @since 4.14.0
15912 * @category Util
15913 * @param {*} value The value to check.
15914 * @param {*} defaultValue The default value.
15915 * @returns {*} Returns the resolved value.
15916 * @example
15917 *
15918 * _.defaultTo(1, 10);
15919 * // => 1
15920 *
15921 * _.defaultTo(undefined, 10);
15922 * // => 10
15923 */
15924 function defaultTo(value, defaultValue) {
15925 return (value == null || value !== value) ? defaultValue : value;
15926 }
15927
15928 /**
15929 * Creates a function that returns the result of invoking the given functions
15930 * with the `this` binding of the created function, where each successive
15931 * invocation is supplied the return value of the previous.
15932 *
15933 * @static
15934 * @memberOf _
15935 * @since 3.0.0
15936 * @category Util
15937 * @param {...(Function|Function[])} [funcs] The functions to invoke.
15938 * @returns {Function} Returns the new composite function.
15939 * @see _.flowRight
15940 * @example
15941 *
15942 * function square(n) {
15943 * return n * n;
15944 * }
15945 *
15946 * var addSquare = _.flow([_.add, square]);
15947 * addSquare(1, 2);
15948 * // => 9
15949 */
15950 var flow = createFlow();
15951
15952 /**
15953 * This method is like `_.flow` except that it creates a function that
15954 * invokes the given functions from right to left.
15955 *
15956 * @static
15957 * @since 3.0.0
15958 * @memberOf _
15959 * @category Util
15960 * @param {...(Function|Function[])} [funcs] The functions to invoke.
15961 * @returns {Function} Returns the new composite function.
15962 * @see _.flow
15963 * @example
15964 *
15965 * function square(n) {
15966 * return n * n;
15967 * }
15968 *
15969 * var addSquare = _.flowRight([square, _.add]);
15970 * addSquare(1, 2);
15971 * // => 9
15972 */
15973 var flowRight = createFlow(true);
15974
15975 /**
15976 * This method returns the first argument it receives.
15977 *
15978 * @static
15979 * @since 0.1.0
15980 * @memberOf _
15981 * @category Util
15982 * @param {*} value Any value.
15983 * @returns {*} Returns `value`.
15984 * @example
15985 *
15986 * var object = { 'a': 1 };
15987 *
15988 * console.log(_.identity(object) === object);
15989 * // => true
15990 */
15991 function identity(value) {
15992 return value;
15993 }
15994
15995 /**
15996 * Creates a function that invokes `func` with the arguments of the created
15997 * function. If `func` is a property name, the created function returns the
15998 * property value for a given element. If `func` is an array or object, the
15999 * created function returns `true` for elements that contain the equivalent
16000 * source properties, otherwise it returns `false`.
16001 *
16002 * @static
16003 * @since 4.0.0
16004 * @memberOf _
16005 * @category Util
16006 * @param {*} [func=_.identity] The value to convert to a callback.
16007 * @returns {Function} Returns the callback.
16008 * @example
16009 *
16010 * var users = [
16011 * { 'user': 'barney', 'age': 36, 'active': true },
16012 * { 'user': 'fred', 'age': 40, 'active': false }
16013 * ];
16014 *
16015 * // The `_.matches` iteratee shorthand.
16016 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
16017 * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
16018 *
16019 * // The `_.matchesProperty` iteratee shorthand.
16020 * _.filter(users, _.iteratee(['user', 'fred']));
16021 * // => [{ 'user': 'fred', 'age': 40 }]
16022 *
16023 * // The `_.property` iteratee shorthand.
16024 * _.map(users, _.iteratee('user'));
16025 * // => ['barney', 'fred']
16026 *
16027 * // Create custom iteratee shorthands.
16028 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
16029 * return !_.isRegExp(func) ? iteratee(func) : function(string) {
16030 * return func.test(string);
16031 * };
16032 * });
16033 *
16034 * _.filter(['abc', 'def'], /ef/);
16035 * // => ['def']
16036 */
16037 function iteratee(func) {
16038 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
16039 }
16040
16041 /**
16042 * Creates a function that performs a partial deep comparison between a given
16043 * object and `source`, returning `true` if the given object has equivalent
16044 * property values, else `false`.
16045 *
16046 * **Note:** The created function is equivalent to `_.isMatch` with `source`
16047 * partially applied.
16048 *
16049 * Partial comparisons will match empty array and empty object `source`
16050 * values against any array or object value, respectively. See `_.isEqual`
16051 * for a list of supported value comparisons.
16052 *
16053 * @static
16054 * @memberOf _
16055 * @since 3.0.0
16056 * @category Util
16057 * @param {Object} source The object of property values to match.
16058 * @returns {Function} Returns the new spec function.
16059 * @example
16060 *
16061 * var objects = [
16062 * { 'a': 1, 'b': 2, 'c': 3 },
16063 * { 'a': 4, 'b': 5, 'c': 6 }
16064 * ];
16065 *
16066 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
16067 * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
16068 */
16069 function matches(source) {
16070 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
16071 }
16072
16073 /**
16074 * Creates a function that performs a partial deep comparison between the
16075 * value at `path` of a given object to `srcValue`, returning `true` if the
16076 * object value is equivalent, else `false`.
16077 *
16078 * **Note:** Partial comparisons will match empty array and empty object
16079 * `srcValue` values against any array or object value, respectively. See
16080 * `_.isEqual` for a list of supported value comparisons.
16081 *
16082 * @static
16083 * @memberOf _
16084 * @since 3.2.0
16085 * @category Util
16086 * @param {Array|string} path The path of the property to get.
16087 * @param {*} srcValue The value to match.
16088 * @returns {Function} Returns the new spec function.
16089 * @example
16090 *
16091 * var objects = [
16092 * { 'a': 1, 'b': 2, 'c': 3 },
16093 * { 'a': 4, 'b': 5, 'c': 6 }
16094 * ];
16095 *
16096 * _.find(objects, _.matchesProperty('a', 4));
16097 * // => { 'a': 4, 'b': 5, 'c': 6 }
16098 */
16099 function matchesProperty(path, srcValue) {
16100 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
16101 }
16102
16103 /**
16104 * Creates a function that invokes the method at `path` of a given object.
16105 * Any additional arguments are provided to the invoked method.
16106 *
16107 * @static
16108 * @memberOf _
16109 * @since 3.7.0
16110 * @category Util
16111 * @param {Array|string} path The path of the method to invoke.
16112 * @param {...*} [args] The arguments to invoke the method with.
16113 * @returns {Function} Returns the new invoker function.
16114 * @example
16115 *
16116 * var objects = [
16117 * { 'a': { 'b': _.constant(2) } },
16118 * { 'a': { 'b': _.constant(1) } }
16119 * ];
16120 *
16121 * _.map(objects, _.method('a.b'));
16122 * // => [2, 1]
16123 *
16124 * _.map(objects, _.method(['a', 'b']));
16125 * // => [2, 1]
16126 */
16127 var method = baseRest(function(path, args) {
16128 return function(object) {
16129 return baseInvoke(object, path, args);
16130 };
16131 });
16132
16133 /**
16134 * The opposite of `_.method`; this method creates a function that invokes
16135 * the method at a given path of `object`. Any additional arguments are
16136 * provided to the invoked method.
16137 *
16138 * @static
16139 * @memberOf _
16140 * @since 3.7.0
16141 * @category Util
16142 * @param {Object} object The object to query.
16143 * @param {...*} [args] The arguments to invoke the method with.
16144 * @returns {Function} Returns the new invoker function.
16145 * @example
16146 *
16147 * var array = _.times(3, _.constant),
16148 * object = { 'a': array, 'b': array, 'c': array };
16149 *
16150 * _.map(['a[2]', 'c[0]'], _.methodOf(object));
16151 * // => [2, 0]
16152 *
16153 * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
16154 * // => [2, 0]
16155 */
16156 var methodOf = baseRest(function(object, args) {
16157 return function(path) {
16158 return baseInvoke(object, path, args);
16159 };
16160 });
16161
16162 /**
16163 * Adds all own enumerable string keyed function properties of a source
16164 * object to the destination object. If `object` is a function, then methods
16165 * are added to its prototype as well.
16166 *
16167 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
16168 * avoid conflicts caused by modifying the original.
16169 *
16170 * @static
16171 * @since 0.1.0
16172 * @memberOf _
16173 * @category Util
16174 * @param {Function|Object} [object=lodash] The destination object.
16175 * @param {Object} source The object of functions to add.
16176 * @param {Object} [options={}] The options object.
16177 * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
16178 * @returns {Function|Object} Returns `object`.
16179 * @example
16180 *
16181 * function vowels(string) {
16182 * return _.filter(string, function(v) {
16183 * return /[aeiou]/i.test(v);
16184 * });
16185 * }
16186 *
16187 * _.mixin({ 'vowels': vowels });
16188 * _.vowels('fred');
16189 * // => ['e']
16190 *
16191 * _('fred').vowels().value();
16192 * // => ['e']
16193 *
16194 * _.mixin({ 'vowels': vowels }, { 'chain': false });
16195 * _('fred').vowels();
16196 * // => ['e']
16197 */
16198 function mixin(object, source, options) {
16199 var props = keys(source),
16200 methodNames = baseFunctions(source, props);
16201
16202 if (options == null &&
16203 !(isObject(source) && (methodNames.length || !props.length))) {
16204 options = source;
16205 source = object;
16206 object = this;
16207 methodNames = baseFunctions(source, keys(source));
16208 }
16209 var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
16210 isFunc = isFunction(object);
16211
16212 arrayEach(methodNames, function(methodName) {
16213 var func = source[methodName];
16214 object[methodName] = func;
16215 if (isFunc) {
16216 object.prototype[methodName] = function() {
16217 var chainAll = this.__chain__;
16218 if (chain || chainAll) {
16219 var result = object(this.__wrapped__),
16220 actions = result.__actions__ = copyArray(this.__actions__);
16221
16222 actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
16223 result.__chain__ = chainAll;
16224 return result;
16225 }
16226 return func.apply(object, arrayPush([this.value()], arguments));
16227 };
16228 }
16229 });
16230
16231 return object;
16232 }
16233
16234 /**
16235 * Reverts the `_` variable to its previous value and returns a reference to
16236 * the `lodash` function.
16237 *
16238 * @static
16239 * @since 0.1.0
16240 * @memberOf _
16241 * @category Util
16242 * @returns {Function} Returns the `lodash` function.
16243 * @example
16244 *
16245 * var lodash = _.noConflict();
16246 */
16247 function noConflict() {
16248 if (root._ === this) {
16249 root._ = oldDash;
16250 }
16251 return this;
16252 }
16253
16254 /**
16255 * This method returns `undefined`.
16256 *
16257 * @static
16258 * @memberOf _
16259 * @since 2.3.0
16260 * @category Util
16261 * @example
16262 *
16263 * _.times(2, _.noop);
16264 * // => [undefined, undefined]
16265 */
16266 function noop() {
16267 // No operation performed.
16268 }
16269
16270 /**
16271 * Creates a function that gets the argument at index `n`. If `n` is negative,
16272 * the nth argument from the end is returned.
16273 *
16274 * @static
16275 * @memberOf _
16276 * @since 4.0.0
16277 * @category Util
16278 * @param {number} [n=0] The index of the argument to return.
16279 * @returns {Function} Returns the new pass-thru function.
16280 * @example
16281 *
16282 * var func = _.nthArg(1);
16283 * func('a', 'b', 'c', 'd');
16284 * // => 'b'
16285 *
16286 * var func = _.nthArg(-2);
16287 * func('a', 'b', 'c', 'd');
16288 * // => 'c'
16289 */
16290 function nthArg(n) {
16291 n = toInteger(n);
16292 return baseRest(function(args) {
16293 return baseNth(args, n);
16294 });
16295 }
16296
16297 /**
16298 * Creates a function that invokes `iteratees` with the arguments it receives
16299 * and returns their results.
16300 *
16301 * @static
16302 * @memberOf _
16303 * @since 4.0.0
16304 * @category Util
16305 * @param {...(Function|Function[])} [iteratees=[_.identity]]
16306 * The iteratees to invoke.
16307 * @returns {Function} Returns the new function.
16308 * @example
16309 *
16310 * var func = _.over([Math.max, Math.min]);
16311 *
16312 * func(1, 2, 3, 4);
16313 * // => [4, 1]
16314 */
16315 var over = createOver(arrayMap);
16316
16317 /**
16318 * Creates a function that checks if **all** of the `predicates` return
16319 * truthy when invoked with the arguments it receives.
16320 *
16321 * @static
16322 * @memberOf _
16323 * @since 4.0.0
16324 * @category Util
16325 * @param {...(Function|Function[])} [predicates=[_.identity]]
16326 * The predicates to check.
16327 * @returns {Function} Returns the new function.
16328 * @example
16329 *
16330 * var func = _.overEvery([Boolean, isFinite]);
16331 *
16332 * func('1');
16333 * // => true
16334 *
16335 * func(null);
16336 * // => false
16337 *
16338 * func(NaN);
16339 * // => false
16340 */
16341 var overEvery = createOver(arrayEvery);
16342
16343 /**
16344 * Creates a function that checks if **any** of the `predicates` return
16345 * truthy when invoked with the arguments it receives.
16346 *
16347 * @static
16348 * @memberOf _
16349 * @since 4.0.0
16350 * @category Util
16351 * @param {...(Function|Function[])} [predicates=[_.identity]]
16352 * The predicates to check.
16353 * @returns {Function} Returns the new function.
16354 * @example
16355 *
16356 * var func = _.overSome([Boolean, isFinite]);
16357 *
16358 * func('1');
16359 * // => true
16360 *
16361 * func(null);
16362 * // => true
16363 *
16364 * func(NaN);
16365 * // => false
16366 */
16367 var overSome = createOver(arraySome);
16368
16369 /**
16370 * Creates a function that returns the value at `path` of a given object.
16371 *
16372 * @static
16373 * @memberOf _
16374 * @since 2.4.0
16375 * @category Util
16376 * @param {Array|string} path The path of the property to get.
16377 * @returns {Function} Returns the new accessor function.
16378 * @example
16379 *
16380 * var objects = [
16381 * { 'a': { 'b': 2 } },
16382 * { 'a': { 'b': 1 } }
16383 * ];
16384 *
16385 * _.map(objects, _.property('a.b'));
16386 * // => [2, 1]
16387 *
16388 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
16389 * // => [1, 2]
16390 */
16391 function property(path) {
16392 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
16393 }
16394
16395 /**
16396 * The opposite of `_.property`; this method creates a function that returns
16397 * the value at a given path of `object`.
16398 *
16399 * @static
16400 * @memberOf _
16401 * @since 3.0.0
16402 * @category Util
16403 * @param {Object} object The object to query.
16404 * @returns {Function} Returns the new accessor function.
16405 * @example
16406 *
16407 * var array = [0, 1, 2],
16408 * object = { 'a': array, 'b': array, 'c': array };
16409 *
16410 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
16411 * // => [2, 0]
16412 *
16413 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
16414 * // => [2, 0]
16415 */
16416 function propertyOf(object) {
16417 return function(path) {
16418 return object == null ? undefined : baseGet(object, path);
16419 };
16420 }
16421
16422 /**
16423 * Creates an array of numbers (positive and/or negative) progressing from
16424 * `start` up to, but not including, `end`. A step of `-1` is used if a negative
16425 * `start` is specified without an `end` or `step`. If `end` is not specified,
16426 * it's set to `start` with `start` then set to `0`.
16427 *
16428 * **Note:** JavaScript follows the IEEE-754 standard for resolving
16429 * floating-point values which can produce unexpected results.
16430 *
16431 * @static
16432 * @since 0.1.0
16433 * @memberOf _
16434 * @category Util
16435 * @param {number} [start=0] The start of the range.
16436 * @param {number} end The end of the range.
16437 * @param {number} [step=1] The value to increment or decrement by.
16438 * @returns {Array} Returns the range of numbers.
16439 * @see _.inRange, _.rangeRight
16440 * @example
16441 *
16442 * _.range(4);
16443 * // => [0, 1, 2, 3]
16444 *
16445 * _.range(-4);
16446 * // => [0, -1, -2, -3]
16447 *
16448 * _.range(1, 5);
16449 * // => [1, 2, 3, 4]
16450 *
16451 * _.range(0, 20, 5);
16452 * // => [0, 5, 10, 15]
16453 *
16454 * _.range(0, -4, -1);
16455 * // => [0, -1, -2, -3]
16456 *
16457 * _.range(1, 4, 0);
16458 * // => [1, 1, 1]
16459 *
16460 * _.range(0);
16461 * // => []
16462 */
16463 var range = createRange();
16464
16465 /**
16466 * This method is like `_.range` except that it populates values in
16467 * descending order.
16468 *
16469 * @static
16470 * @memberOf _
16471 * @since 4.0.0
16472 * @category Util
16473 * @param {number} [start=0] The start of the range.
16474 * @param {number} end The end of the range.
16475 * @param {number} [step=1] The value to increment or decrement by.
16476 * @returns {Array} Returns the range of numbers.
16477 * @see _.inRange, _.range
16478 * @example
16479 *
16480 * _.rangeRight(4);
16481 * // => [3, 2, 1, 0]
16482 *
16483 * _.rangeRight(-4);
16484 * // => [-3, -2, -1, 0]
16485 *
16486 * _.rangeRight(1, 5);
16487 * // => [4, 3, 2, 1]
16488 *
16489 * _.rangeRight(0, 20, 5);
16490 * // => [15, 10, 5, 0]
16491 *
16492 * _.rangeRight(0, -4, -1);
16493 * // => [-3, -2, -1, 0]
16494 *
16495 * _.rangeRight(1, 4, 0);
16496 * // => [1, 1, 1]
16497 *
16498 * _.rangeRight(0);
16499 * // => []
16500 */
16501 var rangeRight = createRange(true);
16502
16503 /**
16504 * This method returns a new empty array.
16505 *
16506 * @static
16507 * @memberOf _
16508 * @since 4.13.0
16509 * @category Util
16510 * @returns {Array} Returns the new empty array.
16511 * @example
16512 *
16513 * var arrays = _.times(2, _.stubArray);
16514 *
16515 * console.log(arrays);
16516 * // => [[], []]
16517 *
16518 * console.log(arrays[0] === arrays[1]);
16519 * // => false
16520 */
16521 function stubArray() {
16522 return [];
16523 }
16524
16525 /**
16526 * This method returns `false`.
16527 *
16528 * @static
16529 * @memberOf _
16530 * @since 4.13.0
16531 * @category Util
16532 * @returns {boolean} Returns `false`.
16533 * @example
16534 *
16535 * _.times(2, _.stubFalse);
16536 * // => [false, false]
16537 */
16538 function stubFalse() {
16539 return false;
16540 }
16541
16542 /**
16543 * This method returns a new empty object.
16544 *
16545 * @static
16546 * @memberOf _
16547 * @since 4.13.0
16548 * @category Util
16549 * @returns {Object} Returns the new empty object.
16550 * @example
16551 *
16552 * var objects = _.times(2, _.stubObject);
16553 *
16554 * console.log(objects);
16555 * // => [{}, {}]
16556 *
16557 * console.log(objects[0] === objects[1]);
16558 * // => false
16559 */
16560 function stubObject() {
16561 return {};
16562 }
16563
16564 /**
16565 * This method returns an empty string.
16566 *
16567 * @static
16568 * @memberOf _
16569 * @since 4.13.0
16570 * @category Util
16571 * @returns {string} Returns the empty string.
16572 * @example
16573 *
16574 * _.times(2, _.stubString);
16575 * // => ['', '']
16576 */
16577 function stubString() {
16578 return '';
16579 }
16580
16581 /**
16582 * This method returns `true`.
16583 *
16584 * @static
16585 * @memberOf _
16586 * @since 4.13.0
16587 * @category Util
16588 * @returns {boolean} Returns `true`.
16589 * @example
16590 *
16591 * _.times(2, _.stubTrue);
16592 * // => [true, true]
16593 */
16594 function stubTrue() {
16595 return true;
16596 }
16597
16598 /**
16599 * Invokes the iteratee `n` times, returning an array of the results of
16600 * each invocation. The iteratee is invoked with one argument; (index).
16601 *
16602 * @static
16603 * @since 0.1.0
16604 * @memberOf _
16605 * @category Util
16606 * @param {number} n The number of times to invoke `iteratee`.
16607 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
16608 * @returns {Array} Returns the array of results.
16609 * @example
16610 *
16611 * _.times(3, String);
16612 * // => ['0', '1', '2']
16613 *
16614 * _.times(4, _.constant(0));
16615 * // => [0, 0, 0, 0]
16616 */
16617 function times(n, iteratee) {
16618 n = toInteger(n);
16619 if (n < 1 || n > MAX_SAFE_INTEGER) {
16620 return [];
16621 }
16622 var index = MAX_ARRAY_LENGTH,
16623 length = nativeMin(n, MAX_ARRAY_LENGTH);
16624
16625 iteratee = getIteratee(iteratee);
16626 n -= MAX_ARRAY_LENGTH;
16627
16628 var result = baseTimes(length, iteratee);
16629 while (++index < n) {
16630 iteratee(index);
16631 }
16632 return result;
16633 }
16634
16635 /**
16636 * Converts `value` to a property path array.
16637 *
16638 * @static
16639 * @memberOf _
16640 * @since 4.0.0
16641 * @category Util
16642 * @param {*} value The value to convert.
16643 * @returns {Array} Returns the new property path array.
16644 * @example
16645 *
16646 * _.toPath('a.b.c');
16647 * // => ['a', 'b', 'c']
16648 *
16649 * _.toPath('a[0].b.c');
16650 * // => ['a', '0', 'b', 'c']
16651 */
16652 function toPath(value) {
16653 if (isArray(value)) {
16654 return arrayMap(value, toKey);
16655 }
16656 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
16657 }
16658
16659 /**
16660 * Generates a unique ID. If `prefix` is given, the ID is appended to it.
16661 *
16662 * @static
16663 * @since 0.1.0
16664 * @memberOf _
16665 * @category Util
16666 * @param {string} [prefix=''] The value to prefix the ID with.
16667 * @returns {string} Returns the unique ID.
16668 * @example
16669 *
16670 * _.uniqueId('contact_');
16671 * // => 'contact_104'
16672 *
16673 * _.uniqueId();
16674 * // => '105'
16675 */
16676 function uniqueId(prefix) {
16677 var id = ++idCounter;
16678 return toString(prefix) + id;
16679 }
16680
16681 /*------------------------------------------------------------------------*/
16682
16683 /**
16684 * Adds two numbers.
16685 *
16686 * @static
16687 * @memberOf _
16688 * @since 3.4.0
16689 * @category Math
16690 * @param {number} augend The first number in an addition.
16691 * @param {number} addend The second number in an addition.
16692 * @returns {number} Returns the total.
16693 * @example
16694 *
16695 * _.add(6, 4);
16696 * // => 10
16697 */
16698 var add = createMathOperation(function(augend, addend) {
16699 return augend + addend;
16700 }, 0);
16701
16702 /**
16703 * Computes `number` rounded up to `precision`.
16704 *
16705 * @static
16706 * @memberOf _
16707 * @since 3.10.0
16708 * @category Math
16709 * @param {number} number The number to round up.
16710 * @param {number} [precision=0] The precision to round up to.
16711 * @returns {number} Returns the rounded up number.
16712 * @example
16713 *
16714 * _.ceil(4.006);
16715 * // => 5
16716 *
16717 * _.ceil(6.004, 2);
16718 * // => 6.01
16719 *
16720 * _.ceil(6040, -2);
16721 * // => 6100
16722 */
16723 var ceil = createRound('ceil');
16724
16725 /**
16726 * Divide two numbers.
16727 *
16728 * @static
16729 * @memberOf _
16730 * @since 4.7.0
16731 * @category Math
16732 * @param {number} dividend The first number in a division.
16733 * @param {number} divisor The second number in a division.
16734 * @returns {number} Returns the quotient.
16735 * @example
16736 *
16737 * _.divide(6, 4);
16738 * // => 1.5
16739 */
16740 var divide = createMathOperation(function(dividend, divisor) {
16741 return dividend / divisor;
16742 }, 1);
16743
16744 /**
16745 * Computes `number` rounded down to `precision`.
16746 *
16747 * @static
16748 * @memberOf _
16749 * @since 3.10.0
16750 * @category Math
16751 * @param {number} number The number to round down.
16752 * @param {number} [precision=0] The precision to round down to.
16753 * @returns {number} Returns the rounded down number.
16754 * @example
16755 *
16756 * _.floor(4.006);
16757 * // => 4
16758 *
16759 * _.floor(0.046, 2);
16760 * // => 0.04
16761 *
16762 * _.floor(4060, -2);
16763 * // => 4000
16764 */
16765 var floor = createRound('floor');
16766
16767 /**
16768 * Computes the maximum value of `array`. If `array` is empty or falsey,
16769 * `undefined` is returned.
16770 *
16771 * @static
16772 * @since 0.1.0
16773 * @memberOf _
16774 * @category Math
16775 * @param {Array} array The array to iterate over.
16776 * @returns {*} Returns the maximum value.
16777 * @example
16778 *
16779 * _.max([4, 2, 8, 6]);
16780 * // => 8
16781 *
16782 * _.max([]);
16783 * // => undefined
16784 */
16785 function max(array) {
16786 return (array && array.length)
16787 ? baseExtremum(array, identity, baseGt)
16788 : undefined;
16789 }
16790
16791 /**
16792 * This method is like `_.max` except that it accepts `iteratee` which is
16793 * invoked for each element in `array` to generate the criterion by which
16794 * the value is ranked. The iteratee is invoked with one argument: (value).
16795 *
16796 * @static
16797 * @memberOf _
16798 * @since 4.0.0
16799 * @category Math
16800 * @param {Array} array The array to iterate over.
16801 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16802 * @returns {*} Returns the maximum value.
16803 * @example
16804 *
16805 * var objects = [{ 'n': 1 }, { 'n': 2 }];
16806 *
16807 * _.maxBy(objects, function(o) { return o.n; });
16808 * // => { 'n': 2 }
16809 *
16810 * // The `_.property` iteratee shorthand.
16811 * _.maxBy(objects, 'n');
16812 * // => { 'n': 2 }
16813 */
16814 function maxBy(array, iteratee) {
16815 return (array && array.length)
16816 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
16817 : undefined;
16818 }
16819
16820 /**
16821 * Computes the mean of the values in `array`.
16822 *
16823 * @static
16824 * @memberOf _
16825 * @since 4.0.0
16826 * @category Math
16827 * @param {Array} array The array to iterate over.
16828 * @returns {number} Returns the mean.
16829 * @example
16830 *
16831 * _.mean([4, 2, 8, 6]);
16832 * // => 5
16833 */
16834 function mean(array) {
16835 return baseMean(array, identity);
16836 }
16837
16838 /**
16839 * This method is like `_.mean` except that it accepts `iteratee` which is
16840 * invoked for each element in `array` to generate the value to be averaged.
16841 * The iteratee is invoked with one argument: (value).
16842 *
16843 * @static
16844 * @memberOf _
16845 * @since 4.7.0
16846 * @category Math
16847 * @param {Array} array The array to iterate over.
16848 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16849 * @returns {number} Returns the mean.
16850 * @example
16851 *
16852 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
16853 *
16854 * _.meanBy(objects, function(o) { return o.n; });
16855 * // => 5
16856 *
16857 * // The `_.property` iteratee shorthand.
16858 * _.meanBy(objects, 'n');
16859 * // => 5
16860 */
16861 function meanBy(array, iteratee) {
16862 return baseMean(array, getIteratee(iteratee, 2));
16863 }
16864
16865 /**
16866 * Computes the minimum value of `array`. If `array` is empty or falsey,
16867 * `undefined` is returned.
16868 *
16869 * @static
16870 * @since 0.1.0
16871 * @memberOf _
16872 * @category Math
16873 * @param {Array} array The array to iterate over.
16874 * @returns {*} Returns the minimum value.
16875 * @example
16876 *
16877 * _.min([4, 2, 8, 6]);
16878 * // => 2
16879 *
16880 * _.min([]);
16881 * // => undefined
16882 */
16883 function min(array) {
16884 return (array && array.length)
16885 ? baseExtremum(array, identity, baseLt)
16886 : undefined;
16887 }
16888
16889 /**
16890 * This method is like `_.min` except that it accepts `iteratee` which is
16891 * invoked for each element in `array` to generate the criterion by which
16892 * the value is ranked. The iteratee is invoked with one argument: (value).
16893 *
16894 * @static
16895 * @memberOf _
16896 * @since 4.0.0
16897 * @category Math
16898 * @param {Array} array The array to iterate over.
16899 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16900 * @returns {*} Returns the minimum value.
16901 * @example
16902 *
16903 * var objects = [{ 'n': 1 }, { 'n': 2 }];
16904 *
16905 * _.minBy(objects, function(o) { return o.n; });
16906 * // => { 'n': 1 }
16907 *
16908 * // The `_.property` iteratee shorthand.
16909 * _.minBy(objects, 'n');
16910 * // => { 'n': 1 }
16911 */
16912 function minBy(array, iteratee) {
16913 return (array && array.length)
16914 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
16915 : undefined;
16916 }
16917
16918 /**
16919 * Multiply two numbers.
16920 *
16921 * @static
16922 * @memberOf _
16923 * @since 4.7.0
16924 * @category Math
16925 * @param {number} multiplier The first number in a multiplication.
16926 * @param {number} multiplicand The second number in a multiplication.
16927 * @returns {number} Returns the product.
16928 * @example
16929 *
16930 * _.multiply(6, 4);
16931 * // => 24
16932 */
16933 var multiply = createMathOperation(function(multiplier, multiplicand) {
16934 return multiplier * multiplicand;
16935 }, 1);
16936
16937 /**
16938 * Computes `number` rounded to `precision`.
16939 *
16940 * @static
16941 * @memberOf _
16942 * @since 3.10.0
16943 * @category Math
16944 * @param {number} number The number to round.
16945 * @param {number} [precision=0] The precision to round to.
16946 * @returns {number} Returns the rounded number.
16947 * @example
16948 *
16949 * _.round(4.006);
16950 * // => 4
16951 *
16952 * _.round(4.006, 2);
16953 * // => 4.01
16954 *
16955 * _.round(4060, -2);
16956 * // => 4100
16957 */
16958 var round = createRound('round');
16959
16960 /**
16961 * Subtract two numbers.
16962 *
16963 * @static
16964 * @memberOf _
16965 * @since 4.0.0
16966 * @category Math
16967 * @param {number} minuend The first number in a subtraction.
16968 * @param {number} subtrahend The second number in a subtraction.
16969 * @returns {number} Returns the difference.
16970 * @example
16971 *
16972 * _.subtract(6, 4);
16973 * // => 2
16974 */
16975 var subtract = createMathOperation(function(minuend, subtrahend) {
16976 return minuend - subtrahend;
16977 }, 0);
16978
16979 /**
16980 * Computes the sum of the values in `array`.
16981 *
16982 * @static
16983 * @memberOf _
16984 * @since 3.4.0
16985 * @category Math
16986 * @param {Array} array The array to iterate over.
16987 * @returns {number} Returns the sum.
16988 * @example
16989 *
16990 * _.sum([4, 2, 8, 6]);
16991 * // => 20
16992 */
16993 function sum(array) {
16994 return (array && array.length)
16995 ? baseSum(array, identity)
16996 : 0;
16997 }
16998
16999 /**
17000 * This method is like `_.sum` except that it accepts `iteratee` which is
17001 * invoked for each element in `array` to generate the value to be summed.
17002 * The iteratee is invoked with one argument: (value).
17003 *
17004 * @static
17005 * @memberOf _
17006 * @since 4.0.0
17007 * @category Math
17008 * @param {Array} array The array to iterate over.
17009 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17010 * @returns {number} Returns the sum.
17011 * @example
17012 *
17013 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
17014 *
17015 * _.sumBy(objects, function(o) { return o.n; });
17016 * // => 20
17017 *
17018 * // The `_.property` iteratee shorthand.
17019 * _.sumBy(objects, 'n');
17020 * // => 20
17021 */
17022 function sumBy(array, iteratee) {
17023 return (array && array.length)
17024 ? baseSum(array, getIteratee(iteratee, 2))
17025 : 0;
17026 }
17027
17028 /*------------------------------------------------------------------------*/
17029
17030 // Add methods that return wrapped values in chain sequences.
17031 lodash.after = after;
17032 lodash.ary = ary;
17033 lodash.assign = assign;
17034 lodash.assignIn = assignIn;
17035 lodash.assignInWith = assignInWith;
17036 lodash.assignWith = assignWith;
17037 lodash.at = at;
17038 lodash.before = before;
17039 lodash.bind = bind;
17040 lodash.bindAll = bindAll;
17041 lodash.bindKey = bindKey;
17042 lodash.castArray = castArray;
17043 lodash.chain = chain;
17044 lodash.chunk = chunk;
17045 lodash.compact = compact;
17046 lodash.concat = concat;
17047 lodash.cond = cond;
17048 lodash.conforms = conforms;
17049 lodash.constant = constant;
17050 lodash.countBy = countBy;
17051 lodash.create = create;
17052 lodash.curry = curry;
17053 lodash.curryRight = curryRight;
17054 lodash.debounce = debounce;
17055 lodash.defaults = defaults;
17056 lodash.defaultsDeep = defaultsDeep;
17057 lodash.defer = defer;
17058 lodash.delay = delay;
17059 lodash.difference = difference;
17060 lodash.differenceBy = differenceBy;
17061 lodash.differenceWith = differenceWith;
17062 lodash.drop = drop;
17063 lodash.dropRight = dropRight;
17064 lodash.dropRightWhile = dropRightWhile;
17065 lodash.dropWhile = dropWhile;
17066 lodash.fill = fill;
17067 lodash.filter = filter;
17068 lodash.flatMap = flatMap;
17069 lodash.flatMapDeep = flatMapDeep;
17070 lodash.flatMapDepth = flatMapDepth;
17071 lodash.flatten = flatten;
17072 lodash.flattenDeep = flattenDeep;
17073 lodash.flattenDepth = flattenDepth;
17074 lodash.flip = flip;
17075 lodash.flow = flow;
17076 lodash.flowRight = flowRight;
17077 lodash.fromPairs = fromPairs;
17078 lodash.functions = functions;
17079 lodash.functionsIn = functionsIn;
17080 lodash.groupBy = groupBy;
17081 lodash.initial = initial;
17082 lodash.intersection = intersection;
17083 lodash.intersectionBy = intersectionBy;
17084 lodash.intersectionWith = intersectionWith;
17085 lodash.invert = invert;
17086 lodash.invertBy = invertBy;
17087 lodash.invokeMap = invokeMap;
17088 lodash.iteratee = iteratee;
17089 lodash.keyBy = keyBy;
17090 lodash.keys = keys;
17091 lodash.keysIn = keysIn;
17092 lodash.map = map;
17093 lodash.mapKeys = mapKeys;
17094 lodash.mapValues = mapValues;
17095 lodash.matches = matches;
17096 lodash.matchesProperty = matchesProperty;
17097 lodash.memoize = memoize;
17098 lodash.merge = merge;
17099 lodash.mergeWith = mergeWith;
17100 lodash.method = method;
17101 lodash.methodOf = methodOf;
17102 lodash.mixin = mixin;
17103 lodash.negate = negate;
17104 lodash.nthArg = nthArg;
17105 lodash.omit = omit;
17106 lodash.omitBy = omitBy;
17107 lodash.once = once;
17108 lodash.orderBy = orderBy;
17109 lodash.over = over;
17110 lodash.overArgs = overArgs;
17111 lodash.overEvery = overEvery;
17112 lodash.overSome = overSome;
17113 lodash.partial = partial;
17114 lodash.partialRight = partialRight;
17115 lodash.partition = partition;
17116 lodash.pick = pick;
17117 lodash.pickBy = pickBy;
17118 lodash.property = property;
17119 lodash.propertyOf = propertyOf;
17120 lodash.pull = pull;
17121 lodash.pullAll = pullAll;
17122 lodash.pullAllBy = pullAllBy;
17123 lodash.pullAllWith = pullAllWith;
17124 lodash.pullAt = pullAt;
17125 lodash.range = range;
17126 lodash.rangeRight = rangeRight;
17127 lodash.rearg = rearg;
17128 lodash.reject = reject;
17129 lodash.remove = remove;
17130 lodash.rest = rest;
17131 lodash.reverse = reverse;
17132 lodash.sampleSize = sampleSize;
17133 lodash.set = set;
17134 lodash.setWith = setWith;
17135 lodash.shuffle = shuffle;
17136 lodash.slice = slice;
17137 lodash.sortBy = sortBy;
17138 lodash.sortedUniq = sortedUniq;
17139 lodash.sortedUniqBy = sortedUniqBy;
17140 lodash.split = split;
17141 lodash.spread = spread;
17142 lodash.tail = tail;
17143 lodash.take = take;
17144 lodash.takeRight = takeRight;
17145 lodash.takeRightWhile = takeRightWhile;
17146 lodash.takeWhile = takeWhile;
17147 lodash.tap = tap;
17148 lodash.throttle = throttle;
17149 lodash.thru = thru;
17150 lodash.toArray = toArray;
17151 lodash.toPairs = toPairs;
17152 lodash.toPairsIn = toPairsIn;
17153 lodash.toPath = toPath;
17154 lodash.toPlainObject = toPlainObject;
17155 lodash.transform = transform;
17156 lodash.unary = unary;
17157 lodash.union = union;
17158 lodash.unionBy = unionBy;
17159 lodash.unionWith = unionWith;
17160 lodash.uniq = uniq;
17161 lodash.uniqBy = uniqBy;
17162 lodash.uniqWith = uniqWith;
17163 lodash.unset = unset;
17164 lodash.unzip = unzip;
17165 lodash.unzipWith = unzipWith;
17166 lodash.update = update;
17167 lodash.updateWith = updateWith;
17168 lodash.values = values;
17169 lodash.valuesIn = valuesIn;
17170 lodash.without = without;
17171 lodash.words = words;
17172 lodash.wrap = wrap;
17173 lodash.xor = xor;
17174 lodash.xorBy = xorBy;
17175 lodash.xorWith = xorWith;
17176 lodash.zip = zip;
17177 lodash.zipObject = zipObject;
17178 lodash.zipObjectDeep = zipObjectDeep;
17179 lodash.zipWith = zipWith;
17180
17181 // Add aliases.
17182 lodash.entries = toPairs;
17183 lodash.entriesIn = toPairsIn;
17184 lodash.extend = assignIn;
17185 lodash.extendWith = assignInWith;
17186
17187 // Add methods to `lodash.prototype`.
17188 mixin(lodash, lodash);
17189
17190 /*------------------------------------------------------------------------*/
17191
17192 // Add methods that return unwrapped values in chain sequences.
17193 lodash.add = add;
17194 lodash.attempt = attempt;
17195 lodash.camelCase = camelCase;
17196 lodash.capitalize = capitalize;
17197 lodash.ceil = ceil;
17198 lodash.clamp = clamp;
17199 lodash.clone = clone;
17200 lodash.cloneDeep = cloneDeep;
17201 lodash.cloneDeepWith = cloneDeepWith;
17202 lodash.cloneWith = cloneWith;
17203 lodash.conformsTo = conformsTo;
17204 lodash.deburr = deburr;
17205 lodash.defaultTo = defaultTo;
17206 lodash.divide = divide;
17207 lodash.endsWith = endsWith;
17208 lodash.eq = eq;
17209 lodash.escape = escape;
17210 lodash.escapeRegExp = escapeRegExp;
17211 lodash.every = every;
17212 lodash.find = find;
17213 lodash.findIndex = findIndex;
17214 lodash.findKey = findKey;
17215 lodash.findLast = findLast;
17216 lodash.findLastIndex = findLastIndex;
17217 lodash.findLastKey = findLastKey;
17218 lodash.floor = floor;
17219 lodash.forEach = forEach;
17220 lodash.forEachRight = forEachRight;
17221 lodash.forIn = forIn;
17222 lodash.forInRight = forInRight;
17223 lodash.forOwn = forOwn;
17224 lodash.forOwnRight = forOwnRight;
17225 lodash.get = get;
17226 lodash.gt = gt;
17227 lodash.gte = gte;
17228 lodash.has = has;
17229 lodash.hasIn = hasIn;
17230 lodash.head = head;
17231 lodash.identity = identity;
17232 lodash.includes = includes;
17233 lodash.indexOf = indexOf;
17234 lodash.inRange = inRange;
17235 lodash.invoke = invoke;
17236 lodash.isArguments = isArguments;
17237 lodash.isArray = isArray;
17238 lodash.isArrayBuffer = isArrayBuffer;
17239 lodash.isArrayLike = isArrayLike;
17240 lodash.isArrayLikeObject = isArrayLikeObject;
17241 lodash.isBoolean = isBoolean;
17242 lodash.isBuffer = isBuffer;
17243 lodash.isDate = isDate;
17244 lodash.isElement = isElement;
17245 lodash.isEmpty = isEmpty;
17246 lodash.isEqual = isEqual;
17247 lodash.isEqualWith = isEqualWith;
17248 lodash.isError = isError;
17249 lodash.isFinite = isFinite;
17250 lodash.isFunction = isFunction;
17251 lodash.isInteger = isInteger;
17252 lodash.isLength = isLength;
17253 lodash.isMap = isMap;
17254 lodash.isMatch = isMatch;
17255 lodash.isMatchWith = isMatchWith;
17256 lodash.isNaN = isNaN;
17257 lodash.isNative = isNative;
17258 lodash.isNil = isNil;
17259 lodash.isNull = isNull;
17260 lodash.isNumber = isNumber;
17261 lodash.isObject = isObject;
17262 lodash.isObjectLike = isObjectLike;
17263 lodash.isPlainObject = isPlainObject;
17264 lodash.isRegExp = isRegExp;
17265 lodash.isSafeInteger = isSafeInteger;
17266 lodash.isSet = isSet;
17267 lodash.isString = isString;
17268 lodash.isSymbol = isSymbol;
17269 lodash.isTypedArray = isTypedArray;
17270 lodash.isUndefined = isUndefined;
17271 lodash.isWeakMap = isWeakMap;
17272 lodash.isWeakSet = isWeakSet;
17273 lodash.join = join;
17274 lodash.kebabCase = kebabCase;
17275 lodash.last = last;
17276 lodash.lastIndexOf = lastIndexOf;
17277 lodash.lowerCase = lowerCase;
17278 lodash.lowerFirst = lowerFirst;
17279 lodash.lt = lt;
17280 lodash.lte = lte;
17281 lodash.max = max;
17282 lodash.maxBy = maxBy;
17283 lodash.mean = mean;
17284 lodash.meanBy = meanBy;
17285 lodash.min = min;
17286 lodash.minBy = minBy;
17287 lodash.stubArray = stubArray;
17288 lodash.stubFalse = stubFalse;
17289 lodash.stubObject = stubObject;
17290 lodash.stubString = stubString;
17291 lodash.stubTrue = stubTrue;
17292 lodash.multiply = multiply;
17293 lodash.nth = nth;
17294 lodash.noConflict = noConflict;
17295 lodash.noop = noop;
17296 lodash.now = now;
17297 lodash.pad = pad;
17298 lodash.padEnd = padEnd;
17299 lodash.padStart = padStart;
17300 lodash.parseInt = parseInt;
17301 lodash.random = random;
17302 lodash.reduce = reduce;
17303 lodash.reduceRight = reduceRight;
17304 lodash.repeat = repeat;
17305 lodash.replace = replace;
17306 lodash.result = result;
17307 lodash.round = round;
17308 lodash.runInContext = runInContext;
17309 lodash.sample = sample;
17310 lodash.size = size;
17311 lodash.snakeCase = snakeCase;
17312 lodash.some = some;
17313 lodash.sortedIndex = sortedIndex;
17314 lodash.sortedIndexBy = sortedIndexBy;
17315 lodash.sortedIndexOf = sortedIndexOf;
17316 lodash.sortedLastIndex = sortedLastIndex;
17317 lodash.sortedLastIndexBy = sortedLastIndexBy;
17318 lodash.sortedLastIndexOf = sortedLastIndexOf;
17319 lodash.startCase = startCase;
17320 lodash.startsWith = startsWith;
17321 lodash.subtract = subtract;
17322 lodash.sum = sum;
17323 lodash.sumBy = sumBy;
17324 lodash.template = template;
17325 lodash.times = times;
17326 lodash.toFinite = toFinite;
17327 lodash.toInteger = toInteger;
17328 lodash.toLength = toLength;
17329 lodash.toLower = toLower;
17330 lodash.toNumber = toNumber;
17331 lodash.toSafeInteger = toSafeInteger;
17332 lodash.toString = toString;
17333 lodash.toUpper = toUpper;
17334 lodash.trim = trim;
17335 lodash.trimEnd = trimEnd;
17336 lodash.trimStart = trimStart;
17337 lodash.truncate = truncate;
17338 lodash.unescape = unescape;
17339 lodash.uniqueId = uniqueId;
17340 lodash.upperCase = upperCase;
17341 lodash.upperFirst = upperFirst;
17342
17343 // Add aliases.
17344 lodash.each = forEach;
17345 lodash.eachRight = forEachRight;
17346 lodash.first = head;
17347
17348 mixin(lodash, (function() {
17349 var source = {};
17350 baseForOwn(lodash, function(func, methodName) {
17351 if (!hasOwnProperty.call(lodash.prototype, methodName)) {
17352 source[methodName] = func;
17353 }
17354 });
17355 return source;
17356 }()), { 'chain': false });
17357
17358 /*------------------------------------------------------------------------*/
17359
17360 /**
17361 * The semantic version number.
17362 *
17363 * @static
17364 * @memberOf _
17365 * @type {string}
17366 */
17367 lodash.VERSION = VERSION;
17368
17369 // Assign default placeholders.
17370 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
17371 lodash[methodName].placeholder = lodash;
17372 });
17373
17374 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
17375 arrayEach(['drop', 'take'], function(methodName, index) {
17376 LazyWrapper.prototype[methodName] = function(n) {
17377 n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
17378
17379 var result = (this.__filtered__ && !index)
17380 ? new LazyWrapper(this)
17381 : this.clone();
17382
17383 if (result.__filtered__) {
17384 result.__takeCount__ = nativeMin(n, result.__takeCount__);
17385 } else {
17386 result.__views__.push({
17387 'size': nativeMin(n, MAX_ARRAY_LENGTH),
17388 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
17389 });
17390 }
17391 return result;
17392 };
17393
17394 LazyWrapper.prototype[methodName + 'Right'] = function(n) {
17395 return this.reverse()[methodName](n).reverse();
17396 };
17397 });
17398
17399 // Add `LazyWrapper` methods that accept an `iteratee` value.
17400 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
17401 var type = index + 1,
17402 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
17403
17404 LazyWrapper.prototype[methodName] = function(iteratee) {
17405 var result = this.clone();
17406 result.__iteratees__.push({
17407 'iteratee': getIteratee(iteratee, 3),
17408 'type': type
17409 });
17410 result.__filtered__ = result.__filtered__ || isFilter;
17411 return result;
17412 };
17413 });
17414
17415 // Add `LazyWrapper` methods for `_.head` and `_.last`.
17416 arrayEach(['head', 'last'], function(methodName, index) {
17417 var takeName = 'take' + (index ? 'Right' : '');
17418
17419 LazyWrapper.prototype[methodName] = function() {
17420 return this[takeName](1).value()[0];
17421 };
17422 });
17423
17424 // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
17425 arrayEach(['initial', 'tail'], function(methodName, index) {
17426 var dropName = 'drop' + (index ? '' : 'Right');
17427
17428 LazyWrapper.prototype[methodName] = function() {
17429 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
17430 };
17431 });
17432
17433 LazyWrapper.prototype.compact = function() {
17434 return this.filter(identity);
17435 };
17436
17437 LazyWrapper.prototype.find = function(predicate) {
17438 return this.filter(predicate).head();
17439 };
17440
17441 LazyWrapper.prototype.findLast = function(predicate) {
17442 return this.reverse().find(predicate);
17443 };
17444
17445 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
17446 if (typeof path == 'function') {
17447 return new LazyWrapper(this);
17448 }
17449 return this.map(function(value) {
17450 return baseInvoke(value, path, args);
17451 });
17452 });
17453
17454 LazyWrapper.prototype.reject = function(predicate) {
17455 return this.filter(negate(getIteratee(predicate)));
17456 };
17457
17458 LazyWrapper.prototype.slice = function(start, end) {
17459 start = toInteger(start);
17460
17461 var result = this;
17462 if (result.__filtered__ && (start > 0 || end < 0)) {
17463 return new LazyWrapper(result);
17464 }
17465 if (start < 0) {
17466 result = result.takeRight(-start);
17467 } else if (start) {
17468 result = result.drop(start);
17469 }
17470 if (end !== undefined) {
17471 end = toInteger(end);
17472 result = end < 0 ? result.dropRight(-end) : result.take(end - start);
17473 }
17474 return result;
17475 };
17476
17477 LazyWrapper.prototype.takeRightWhile = function(predicate) {
17478 return this.reverse().takeWhile(predicate).reverse();
17479 };
17480
17481 LazyWrapper.prototype.toArray = function() {
17482 return this.take(MAX_ARRAY_LENGTH);
17483 };
17484
17485 // Add `LazyWrapper` methods to `lodash.prototype`.
17486 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
17487 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
17488 isTaker = /^(?:head|last)$/.test(methodName),
17489 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
17490 retUnwrapped = isTaker || /^find/.test(methodName);
17491
17492 if (!lodashFunc) {
17493 return;
17494 }
17495 lodash.prototype[methodName] = function() {
17496 var value = this.__wrapped__,
17497 args = isTaker ? [1] : arguments,
17498 isLazy = value instanceof LazyWrapper,
17499 iteratee = args[0],
17500 useLazy = isLazy || isArray(value);
17501
17502 var interceptor = function(value) {
17503 var result = lodashFunc.apply(lodash, arrayPush([value], args));
17504 return (isTaker && chainAll) ? result[0] : result;
17505 };
17506
17507 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
17508 // Avoid lazy use if the iteratee has a "length" value other than `1`.
17509 isLazy = useLazy = false;
17510 }
17511 var chainAll = this.__chain__,
17512 isHybrid = !!this.__actions__.length,
17513 isUnwrapped = retUnwrapped && !chainAll,
17514 onlyLazy = isLazy && !isHybrid;
17515
17516 if (!retUnwrapped && useLazy) {
17517 value = onlyLazy ? value : new LazyWrapper(this);
17518 var result = func.apply(value, args);
17519 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
17520 return new LodashWrapper(result, chainAll);
17521 }
17522 if (isUnwrapped && onlyLazy) {
17523 return func.apply(this, args);
17524 }
17525 result = this.thru(interceptor);
17526 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
17527 };
17528 });
17529
17530 // Add `Array` methods to `lodash.prototype`.
17531 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
17532 var func = arrayProto[methodName],
17533 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
17534 retUnwrapped = /^(?:pop|shift)$/.test(methodName);
17535
17536 lodash.prototype[methodName] = function() {
17537 var args = arguments;
17538 if (retUnwrapped && !this.__chain__) {
17539 var value = this.value();
17540 return func.apply(isArray(value) ? value : [], args);
17541 }
17542 return this[chainName](function(value) {
17543 return func.apply(isArray(value) ? value : [], args);
17544 });
17545 };
17546 });
17547
17548 // Map minified method names to their real names.
17549 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
17550 var lodashFunc = lodash[methodName];
17551 if (lodashFunc) {
17552 var key = (lodashFunc.name + ''),
17553 names = realNames[key] || (realNames[key] = []);
17554
17555 names.push({ 'name': methodName, 'func': lodashFunc });
17556 }
17557 });
17558
17559 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
17560 'name': 'wrapper',
17561 'func': undefined
17562 }];
17563
17564 // Add methods to `LazyWrapper`.
17565 LazyWrapper.prototype.clone = lazyClone;
17566 LazyWrapper.prototype.reverse = lazyReverse;
17567 LazyWrapper.prototype.value = lazyValue;
17568
17569 // Add chain sequence methods to the `lodash` wrapper.
17570 lodash.prototype.at = wrapperAt;
17571 lodash.prototype.chain = wrapperChain;
17572 lodash.prototype.commit = wrapperCommit;
17573 lodash.prototype.next = wrapperNext;
17574 lodash.prototype.plant = wrapperPlant;
17575 lodash.prototype.reverse = wrapperReverse;
17576 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
17577
17578 // Add lazy aliases.
17579 lodash.prototype.first = lodash.prototype.head;
17580
17581 if (symIterator) {
17582 lodash.prototype[symIterator] = wrapperToIterator;
17583 }
17584 return lodash;
17585 });
17586
17587 /*--------------------------------------------------------------------------*/
17588
17589 // Export lodash.
17590 var _ = runInContext();
17591
17592 // Some AMD build optimizers, like r.js, check for condition patterns like:
17593 if (true) {
17594 // Expose Lodash on the global object to prevent errors when Lodash is
17595 // loaded by a script tag in the presence of an AMD loader.
17596 // See http://requirejs.org/docs/errors.html#mismatch for more details.
17597 // Use `_.noConflict` to remove Lodash from the global object.
17598 root._ = _;
17599
17600 // Define as an anonymous module so, through path mapping, it can be
17601 // referenced as the "underscore" module.
17602 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
17603 return _;
17604 }).call(exports, __webpack_require__, exports, module),
17605 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
17606 }
17607 // Check for `exports` after `define` in case a build optimizer adds it.
17608 else {}
17609}.call(this));
17610
17611/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"), __webpack_require__("62e4")(module)))
17612
17613/***/ }),
17614
17615/***/ "3729":
17616/***/ (function(module, exports, __webpack_require__) {
17617
17618var Symbol = __webpack_require__("9e69"),
17619 getRawTag = __webpack_require__("00fd"),
17620 objectToString = __webpack_require__("29f3");
17621
17622/** `Object#toString` result references. */
17623var nullTag = '[object Null]',
17624 undefinedTag = '[object Undefined]';
17625
17626/** Built-in value references. */
17627var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
17628
17629/**
17630 * The base implementation of `getTag` without fallbacks for buggy environments.
17631 *
17632 * @private
17633 * @param {*} value The value to query.
17634 * @returns {string} Returns the `toStringTag`.
17635 */
17636function baseGetTag(value) {
17637 if (value == null) {
17638 return value === undefined ? undefinedTag : nullTag;
17639 }
17640 return (symToStringTag && symToStringTag in Object(value))
17641 ? getRawTag(value)
17642 : objectToString(value);
17643}
17644
17645module.exports = baseGetTag;
17646
17647
17648/***/ }),
17649
17650/***/ "4124":
17651/***/ (function(module, exports, __webpack_require__) {
17652
17653// extracted by mini-css-extract-plugin
17654
17655/***/ }),
17656
17657/***/ "436a":
17658/***/ (function(module, __webpack_exports__, __webpack_require__) {
17659
17660"use strict";
17661/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_select_vue_vue_type_style_index_0_id_2ff915ca_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2cfe");
17662/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_select_vue_vue_type_style_index_0_id_2ff915ca_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_select_vue_vue_type_style_index_0_id_2ff915ca_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
17663/* unused harmony reexport * */
17664 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_select_vue_vue_type_style_index_0_id_2ff915ca_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
17665
17666/***/ }),
17667
17668/***/ "457c":
17669/***/ (function(module, __webpack_exports__, __webpack_require__) {
17670
17671"use strict";
17672/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_grid_vue_vue_type_style_index_0_id_6063fe24_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4124");
17673/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_grid_vue_vue_type_style_index_0_id_6063fe24_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_grid_vue_vue_type_style_index_0_id_6063fe24_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
17674/* unused harmony reexport * */
17675 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_grid_vue_vue_type_style_index_0_id_6063fe24_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
17676
17677/***/ }),
17678
17679/***/ "4631":
17680/***/ (function(module, __webpack_exports__, __webpack_require__) {
17681
17682"use strict";
17683/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_link_vue_vue_type_style_index_0_id_b5033844_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a262");
17684/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_link_vue_vue_type_style_index_0_id_b5033844_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_link_vue_vue_type_style_index_0_id_b5033844_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
17685/* unused harmony reexport * */
17686 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_link_vue_vue_type_style_index_0_id_b5033844_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
17687
17688/***/ }),
17689
17690/***/ "46a6":
17691/***/ (function(module, exports, __webpack_require__) {
17692
17693// extracted by mini-css-extract-plugin
17694
17695/***/ }),
17696
17697/***/ "4caa":
17698/***/ (function(module, exports, __webpack_require__) {
17699
17700var deburrLetter = __webpack_require__("a919"),
17701 toString = __webpack_require__("76dd");
17702
17703/** Used to match Latin Unicode letters (excluding mathematical operators). */
17704var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
17705
17706/** Used to compose unicode character classes. */
17707var rsComboMarksRange = '\\u0300-\\u036f',
17708 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
17709 rsComboSymbolsRange = '\\u20d0-\\u20ff',
17710 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
17711
17712/** Used to compose unicode capture groups. */
17713var rsCombo = '[' + rsComboRange + ']';
17714
17715/**
17716 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
17717 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
17718 */
17719var reComboMark = RegExp(rsCombo, 'g');
17720
17721/**
17722 * Deburrs `string` by converting
17723 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
17724 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
17725 * letters to basic Latin letters and removing
17726 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
17727 *
17728 * @static
17729 * @memberOf _
17730 * @since 3.0.0
17731 * @category String
17732 * @param {string} [string=''] The string to deburr.
17733 * @returns {string} Returns the deburred string.
17734 * @example
17735 *
17736 * _.deburr('déjà vu');
17737 * // => 'deja vu'
17738 */
17739function deburr(string) {
17740 string = toString(string);
17741 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
17742}
17743
17744module.exports = deburr;
17745
17746
17747/***/ }),
17748
17749/***/ "585a":
17750/***/ (function(module, exports, __webpack_require__) {
17751
17752// extracted by mini-css-extract-plugin
17753
17754/***/ }),
17755
17756/***/ "585a9":
17757/***/ (function(module, exports, __webpack_require__) {
17758
17759/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
17760var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
17761
17762module.exports = freeGlobal;
17763
17764/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
17765
17766/***/ }),
17767
17768/***/ "6190":
17769/***/ (function(module, __webpack_exports__, __webpack_require__) {
17770
17771"use strict";
17772__webpack_require__.r(__webpack_exports__);
17773
17774// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-upload.vue?vue&type=template&id=6be8bede&scoped=true&
17775var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"uploader"},[_c('BaseInput',{attrs:{"value":_vm.value ? _vm.value.name : '',"readonly":""}}),_c('label',[_c('div',{class:['selectButton', _vm.disabled ? 'disabled' : '']},[_vm._v("Select File")]),_c('input',{staticClass:"fileButton",attrs:{"type":"file","disabled":_vm.disabled},on:{"change":_vm.handleFileChange}})])],1)}
17776var staticRenderFns = []
17777
17778
17779// CONCATENATED MODULE: ./src/components/_base-upload.vue?vue&type=template&id=6be8bede&scoped=true&
17780
17781// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-upload.vue?vue&type=script&lang=js&
17782/* harmony default export */ var _base_uploadvue_type_script_lang_js_ = ({
17783 props: {
17784 value: {
17785 type: File,
17786 default: null
17787 },
17788 disabled: {
17789 type: Boolean,
17790 default: false
17791 }
17792 },
17793 methods: {
17794 handleFileChange: function handleFileChange(e) {
17795 this.$emit('input', e.target.files[0]);
17796 }
17797 }
17798});
17799// CONCATENATED MODULE: ./src/components/_base-upload.vue?vue&type=script&lang=js&
17800 /* harmony default export */ var components_base_uploadvue_type_script_lang_js_ = (_base_uploadvue_type_script_lang_js_);
17801// EXTERNAL MODULE: ./src/components/_base-upload.vue?vue&type=style&index=0&id=6be8bede&lang=scss&scoped=true&
17802var _base_uploadvue_type_style_index_0_id_6be8bede_lang_scss_scoped_true_ = __webpack_require__("b423");
17803
17804// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
17805var componentNormalizer = __webpack_require__("2877");
17806
17807// CONCATENATED MODULE: ./src/components/_base-upload.vue
17808
17809
17810
17811
17812
17813
17814/* normalize component */
17815
17816var component = Object(componentNormalizer["a" /* default */])(
17817 components_base_uploadvue_type_script_lang_js_,
17818 render,
17819 staticRenderFns,
17820 false,
17821 null,
17822 "6be8bede",
17823 null
17824
17825)
17826
17827/* harmony default export */ var _base_upload = __webpack_exports__["default"] = (component.exports);
17828
17829/***/ }),
17830
17831/***/ "6263":
17832/***/ (function(module, exports, __webpack_require__) {
17833
17834// extracted by mini-css-extract-plugin
17835
17836/***/ }),
17837
17838/***/ "62e4":
17839/***/ (function(module, exports) {
17840
17841module.exports = function(module) {
17842 if (!module.webpackPolyfill) {
17843 module.deprecate = function() {};
17844 module.paths = [];
17845 // module.parent = undefined by default
17846 if (!module.children) module.children = [];
17847 Object.defineProperty(module, "loaded", {
17848 enumerable: true,
17849 get: function() {
17850 return module.l;
17851 }
17852 });
17853 Object.defineProperty(module, "id", {
17854 enumerable: true,
17855 get: function() {
17856 return module.i;
17857 }
17858 });
17859 module.webpackPolyfill = 1;
17860 }
17861 return module;
17862};
17863
17864
17865/***/ }),
17866
17867/***/ "6747":
17868/***/ (function(module, exports) {
17869
17870/**
17871 * Checks if `value` is classified as an `Array` object.
17872 *
17873 * @static
17874 * @memberOf _
17875 * @since 0.1.0
17876 * @category Lang
17877 * @param {*} value The value to check.
17878 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
17879 * @example
17880 *
17881 * _.isArray([1, 2, 3]);
17882 * // => true
17883 *
17884 * _.isArray(document.body.children);
17885 * // => false
17886 *
17887 * _.isArray('abc');
17888 * // => false
17889 *
17890 * _.isArray(_.noop);
17891 * // => false
17892 */
17893var isArray = Array.isArray;
17894
17895module.exports = isArray;
17896
17897
17898/***/ }),
17899
17900/***/ "6ac0":
17901/***/ (function(module, exports) {
17902
17903/**
17904 * A specialized version of `_.reduce` for arrays without support for
17905 * iteratee shorthands.
17906 *
17907 * @private
17908 * @param {Array} [array] The array to iterate over.
17909 * @param {Function} iteratee The function invoked per iteration.
17910 * @param {*} [accumulator] The initial value.
17911 * @param {boolean} [initAccum] Specify using the first element of `array` as
17912 * the initial value.
17913 * @returns {*} Returns the accumulated value.
17914 */
17915function arrayReduce(array, iteratee, accumulator, initAccum) {
17916 var index = -1,
17917 length = array == null ? 0 : array.length;
17918
17919 if (initAccum && length) {
17920 accumulator = array[++index];
17921 }
17922 while (++index < length) {
17923 accumulator = iteratee(accumulator, array[index], index, array);
17924 }
17925 return accumulator;
17926}
17927
17928module.exports = arrayReduce;
17929
17930
17931/***/ }),
17932
17933/***/ "6da8":
17934/***/ (function(module, exports) {
17935
17936/**
17937 * Converts an ASCII `string` to an array.
17938 *
17939 * @private
17940 * @param {string} string The string to convert.
17941 * @returns {Array} Returns the converted array.
17942 */
17943function asciiToArray(string) {
17944 return string.split('');
17945}
17946
17947module.exports = asciiToArray;
17948
17949
17950/***/ }),
17951
17952/***/ "7559":
17953/***/ (function(module, exports) {
17954
17955/** Used to match words composed of alphanumeric characters. */
17956var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
17957
17958/**
17959 * Splits an ASCII `string` into an array of its words.
17960 *
17961 * @private
17962 * @param {string} The string to inspect.
17963 * @returns {Array} Returns the words of `string`.
17964 */
17965function asciiWords(string) {
17966 return string.match(reAsciiWord) || [];
17967}
17968
17969module.exports = asciiWords;
17970
17971
17972/***/ }),
17973
17974/***/ "76dd":
17975/***/ (function(module, exports, __webpack_require__) {
17976
17977var baseToString = __webpack_require__("ce86");
17978
17979/**
17980 * Converts `value` to a string. An empty string is returned for `null`
17981 * and `undefined` values. The sign of `-0` is preserved.
17982 *
17983 * @static
17984 * @memberOf _
17985 * @since 4.0.0
17986 * @category Lang
17987 * @param {*} value The value to convert.
17988 * @returns {string} Returns the converted string.
17989 * @example
17990 *
17991 * _.toString(null);
17992 * // => ''
17993 *
17994 * _.toString(-0);
17995 * // => '-0'
17996 *
17997 * _.toString([1, 2, 3]);
17998 * // => '1,2,3'
17999 */
18000function toString(value) {
18001 return value == null ? '' : baseToString(value);
18002}
18003
18004module.exports = toString;
18005
18006
18007/***/ }),
18008
18009/***/ "7948":
18010/***/ (function(module, exports) {
18011
18012/**
18013 * A specialized version of `_.map` for arrays without support for iteratee
18014 * shorthands.
18015 *
18016 * @private
18017 * @param {Array} [array] The array to iterate over.
18018 * @param {Function} iteratee The function invoked per iteration.
18019 * @returns {Array} Returns the new mapped array.
18020 */
18021function arrayMap(array, iteratee) {
18022 var index = -1,
18023 length = array == null ? 0 : array.length,
18024 result = Array(length);
18025
18026 while (++index < length) {
18027 result[index] = iteratee(array[index], index, array);
18028 }
18029 return result;
18030}
18031
18032module.exports = arrayMap;
18033
18034
18035/***/ }),
18036
18037/***/ "79c6":
18038/***/ (function(module, exports, __webpack_require__) {
18039
18040// extracted by mini-css-extract-plugin
18041
18042/***/ }),
18043
18044/***/ "7e8e":
18045/***/ (function(module, exports) {
18046
18047/** Used to detect strings that need a more robust regexp to match words. */
18048var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
18049
18050/**
18051 * Checks if `string` contains a word composed of Unicode symbols.
18052 *
18053 * @private
18054 * @param {string} string The string to inspect.
18055 * @returns {boolean} Returns `true` if a word is found, else `false`.
18056 */
18057function hasUnicodeWord(string) {
18058 return reHasUnicodeWord.test(string);
18059}
18060
18061module.exports = hasUnicodeWord;
18062
18063
18064/***/ }),
18065
18066/***/ "80b6":
18067/***/ (function(module, __webpack_exports__, __webpack_require__) {
18068
18069"use strict";
18070__webpack_require__.r(__webpack_exports__);
18071
18072// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-modal.vue?vue&type=template&id=99c6bbc4&scoped=true&
18073var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isOpen),expression:"isOpen"}],class:[
18074 'baseModalOverlay',
18075 _vm.blocking ? 'blocking' : '',
18076 _vm.visible ? 'isBaseModalOverlayVisible' : '',
18077 'baseModalClickable' ],on:{"click":_vm.onOverlayClick}},[_c('div',{class:['baseModal', _vm.visible ? 'isBaseModalVisible' : ''],style:(_vm.modalStyle)},[(!_vm.isHideCloseButton)?_c('div',{staticClass:"baseActionClose",on:{"click":_vm.close}},[_c('BaseIcon',{attrs:{"color":"#333","name":"x-cirlce"}})],1):_vm._e(),(_vm.hasTitle)?_c('div',{staticClass:"baseTitle"},[(_vm.hasTitle)?[(_vm.title)?_c('h2',{domProps:{"innerHTML":_vm._s(_vm.title)}}):_vm._t("title")]:_vm._e()],2):_vm._e(),_c('div',{ref:"content",staticClass:"baseContent",style:(_vm.modalContentStyle)},[(_vm.$slots.default)?[_vm._t("default")]:_vm._e()],2),(_vm.$slots.button)?_c('div',{class:['baseButtons', _vm.buttonSpace]},[_vm._t("button")],2):_vm._e()])])])}
18078var staticRenderFns = []
18079
18080
18081// CONCATENATED MODULE: ./src/components/_base-modal.vue?vue&type=template&id=99c6bbc4&scoped=true&
18082
18083// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-modal.vue?vue&type=script&lang=js&
18084/* harmony default export */ var _base_modalvue_type_script_lang_js_ = ({
18085 name: 'BaseModal',
18086 props: {
18087 title: {
18088 type: [String, Array, Object],
18089 required: false,
18090 default: ''
18091 },
18092 overlayTheme: {
18093 type: String,
18094 required: false,
18095 default: 'normal'
18096 },
18097 modalTheme: {
18098 type: String,
18099 required: false,
18100 default: 'normal'
18101 },
18102 blocking: {
18103 type: Boolean,
18104 required: false,
18105 default: false
18106 },
18107 isHideCloseButton: {
18108 type: Boolean,
18109 required: false,
18110 default: false
18111 },
18112 width: {
18113 type: [Number, String],
18114 required: false,
18115 default: null
18116 },
18117 height: {
18118 type: [Number, String],
18119 required: false,
18120 default: null
18121 },
18122 buttonSpace: {
18123 type: String,
18124 default: 'flexEnd',
18125 validator: function validator(value) {
18126 return ['flexStart', 'flexEnd', 'spaceBetween'].indexOf(value) !== -1;
18127 }
18128 }
18129 },
18130 data: function data() {
18131 return {
18132 visible: false,
18133 isOpen: false,
18134 backups: {
18135 body: {
18136 height: null,
18137 overflow: null
18138 }
18139 }
18140 };
18141 },
18142 computed: {
18143 hasTitle: function hasTitle() {
18144 return this.title || this.$slots.title;
18145 },
18146 modalContentStyle: function modalContentStyle() {
18147 var height = this.height;
18148 var maxHeight = null;
18149
18150 if (height !== null) {
18151 if (Number.isInteger(Number(height))) {
18152 height = height + 'px';
18153 }
18154
18155 maxHeight = 'none';
18156 }
18157
18158 return {
18159 height: height,
18160 maxHeight: maxHeight
18161 };
18162 },
18163 modalStyle: function modalStyle() {
18164 var width = this.width;
18165 var maxWidth = null;
18166
18167 if (width !== null) {
18168 if (Number.isInteger(Number(width))) {
18169 width = width + 'px';
18170 }
18171
18172 maxWidth = 'none';
18173 }
18174
18175 return {
18176 width: width,
18177 maxWidth: maxWidth
18178 };
18179 }
18180 },
18181 mounted: function mounted() {
18182 document.addEventListener('keyup', this.onDocumentKeyup);
18183 },
18184 methods: {
18185 open: function open() {
18186 var _this = this;
18187
18188 this.isOpen = true;
18189 this.lockBody();
18190 setTimeout(function () {
18191 if (!_this.visible) {
18192 _this.visible = true;
18193 }
18194 }, 30);
18195 this.$emit('open');
18196 },
18197 close: function close() {
18198 var _this2 = this;
18199
18200 this.visible = false;
18201 this.unlockBody();
18202 setTimeout(function () {
18203 _this2.isOpen = false;
18204 }, 300);
18205 this.$emit('close');
18206 },
18207 lockBody: function lockBody() {
18208 this.backups.body.height = document.body.style.height;
18209 this.backups.body.overflow = document.body.style.overflow;
18210 document.body.style.height = '100%';
18211 document.body.style.overflow = 'hidden';
18212 },
18213 unlockBody: function unlockBody() {
18214 document.body.style.height = this.backups.body.height;
18215 document.body.style.overflow = this.backups.body.overflow;
18216 },
18217 onOverlayClick: function onOverlayClick(event) {
18218 if (!event.target.classList || event.target.classList.contains('baseModalClickable')) {
18219 if (!this.blocking) {
18220 this.close();
18221 }
18222 }
18223 }
18224 }
18225});
18226// CONCATENATED MODULE: ./src/components/_base-modal.vue?vue&type=script&lang=js&
18227 /* harmony default export */ var components_base_modalvue_type_script_lang_js_ = (_base_modalvue_type_script_lang_js_);
18228// EXTERNAL MODULE: ./src/components/_base-modal.vue?vue&type=style&index=0&id=99c6bbc4&lang=scss&scoped=true&
18229var _base_modalvue_type_style_index_0_id_99c6bbc4_lang_scss_scoped_true_ = __webpack_require__("de73");
18230
18231// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
18232var componentNormalizer = __webpack_require__("2877");
18233
18234// CONCATENATED MODULE: ./src/components/_base-modal.vue
18235
18236
18237
18238
18239
18240
18241/* normalize component */
18242
18243var component = Object(componentNormalizer["a" /* default */])(
18244 components_base_modalvue_type_script_lang_js_,
18245 render,
18246 staticRenderFns,
18247 false,
18248 null,
18249 "99c6bbc4",
18250 null
18251
18252)
18253
18254/* harmony default export */ var _base_modal = __webpack_exports__["default"] = (component.exports);
18255
18256/***/ }),
18257
18258/***/ "8103":
18259/***/ (function(module, exports, __webpack_require__) {
18260
18261var createCaseFirst = __webpack_require__("d194");
18262
18263/**
18264 * Converts the first character of `string` to upper case.
18265 *
18266 * @static
18267 * @memberOf _
18268 * @since 4.0.0
18269 * @category String
18270 * @param {string} [string=''] The string to convert.
18271 * @returns {string} Returns the converted string.
18272 * @example
18273 *
18274 * _.upperFirst('fred');
18275 * // => 'Fred'
18276 *
18277 * _.upperFirst('FRED');
18278 * // => 'FRED'
18279 */
18280var upperFirst = createCaseFirst('toUpperCase');
18281
18282module.exports = upperFirst;
18283
18284
18285/***/ }),
18286
18287/***/ "8339":
18288/***/ (function(module, __webpack_exports__, __webpack_require__) {
18289
18290"use strict";
18291__webpack_require__.r(__webpack_exports__);
18292
18293// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-button.vue?vue&type=template&id=5609df9c&scoped=true&
18294var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',_vm._g({class:[_vm.theme, _vm.size, 'button'],attrs:{"disabled":_vm.disabled},on:{"click":function($event){return _vm.click()}}},_vm.$listeners),[_vm._t("default")],2)}
18295var staticRenderFns = []
18296
18297
18298// CONCATENATED MODULE: ./src/components/_base-button.vue?vue&type=template&id=5609df9c&scoped=true&
18299
18300// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-button.vue?vue&type=script&lang=js&
18301/* harmony default export */ var _base_buttonvue_type_script_lang_js_ = ({
18302 props: {
18303 users: {
18304 type: Array,
18305 default: null
18306 },
18307 type: {
18308 type: String,
18309 default: 'submit'
18310 },
18311 size: {
18312 type: String,
18313 default: 'medium',
18314 validator: function validator(value) {
18315 return ['large', 'medium', 'small'].indexOf(value) !== -1;
18316 }
18317 },
18318 theme: {
18319 type: String,
18320 default: 'primary',
18321 validator: function validator(value) {
18322 return ['primary', 'secondary', 'teritary'].indexOf(value) !== -1;
18323 }
18324 },
18325 disabled: {
18326 type: Boolean,
18327 default: false
18328 },
18329 click: {
18330 type: Function,
18331 default: function _default() {}
18332 },
18333 ripple: {
18334 type: Boolean,
18335 default: false
18336 }
18337 }
18338});
18339// CONCATENATED MODULE: ./src/components/_base-button.vue?vue&type=script&lang=js&
18340 /* harmony default export */ var components_base_buttonvue_type_script_lang_js_ = (_base_buttonvue_type_script_lang_js_);
18341// EXTERNAL MODULE: ./src/components/_base-button.vue?vue&type=style&index=0&id=5609df9c&lang=scss&scoped=true&
18342var _base_buttonvue_type_style_index_0_id_5609df9c_lang_scss_scoped_true_ = __webpack_require__("188a");
18343
18344// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
18345var componentNormalizer = __webpack_require__("2877");
18346
18347// CONCATENATED MODULE: ./src/components/_base-button.vue
18348
18349
18350
18351
18352
18353
18354/* normalize component */
18355
18356var component = Object(componentNormalizer["a" /* default */])(
18357 components_base_buttonvue_type_script_lang_js_,
18358 render,
18359 staticRenderFns,
18360 false,
18361 null,
18362 "5609df9c",
18363 null
18364
18365)
18366
18367/* harmony default export */ var _base_button = __webpack_exports__["default"] = (component.exports);
18368
18369/***/ }),
18370
18371/***/ "83c6":
18372/***/ (function(module, __webpack_exports__, __webpack_require__) {
18373
18374"use strict";
18375__webpack_require__.r(__webpack_exports__);
18376
18377// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-tabs.vue?vue&type=template&id=3d1a2c4c&scoped=true&
18378var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:[_vm.size, 'tab']},[_c('ul',_vm._l((_vm.tabList),function(tab,index){return _c('li',_vm._b({key:index,class:[_vm.overlayItemClasses(tab, index), 'tabItem'],on:{"click":function($event){return _vm.select(index)}}},'li',tab.dataAttrs,false),[_vm._v(_vm._s(tab.title))])}),0),_c('div',{staticClass:"tabContent"},[_vm._t("default")],2)])}
18379var staticRenderFns = []
18380
18381
18382// CONCATENATED MODULE: ./src/components/_base-tabs.vue?vue&type=template&id=3d1a2c4c&scoped=true&
18383
18384// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-tabs.vue?vue&type=script&lang=js&
18385/* harmony default export */ var _base_tabsvue_type_script_lang_js_ = ({
18386 props: {
18387 size: {
18388 type: String,
18389 default: 'medium',
18390 validator: function validator(value) {
18391 return ['large', 'medium', 'small'].indexOf(value) !== -1;
18392 }
18393 }
18394 },
18395 data: function data() {
18396 return {
18397 tabList: [],
18398 activeTabIndex: 0
18399 };
18400 },
18401 computed: {
18402 overlaySizeClasses: function overlaySizeClasses() {
18403 return [this.size === 'large' ? this.$style.large : this.size === 'small' ? this.$style.small : this.$style.medium];
18404 }
18405 },
18406 mounted: function mounted() {
18407 // this.select(0)
18408 this.activeTabIndex = this.getInitialActiveTab(); // this.$root.$on('select-tab', (index) => this.select(index))
18409 },
18410 methods: {
18411 select: function select(index) {
18412 var tab = this.tabList[index];
18413
18414 if (!tab.isDisabled) {
18415 this.activeTabIndex = index;
18416 }
18417
18418 this.$emit('change', tab);
18419 },
18420 getInitialActiveTab: function getInitialActiveTab() {
18421 var index = this.tabList.findIndex(function (tab) {
18422 return tab.active;
18423 });
18424 return index === -1 ? 0 : index;
18425 },
18426 overlayItemClasses: function overlayItemClasses(tab, index) {
18427 return [this.activeTabIndex === index ? 'active' : '', tab.disabled ? 'disabled' : ''];
18428 }
18429 }
18430});
18431// CONCATENATED MODULE: ./src/components/_base-tabs.vue?vue&type=script&lang=js&
18432 /* harmony default export */ var components_base_tabsvue_type_script_lang_js_ = (_base_tabsvue_type_script_lang_js_);
18433// EXTERNAL MODULE: ./src/components/_base-tabs.vue?vue&type=style&index=0&id=3d1a2c4c&lang=scss&scoped=true&
18434var _base_tabsvue_type_style_index_0_id_3d1a2c4c_lang_scss_scoped_true_ = __webpack_require__("a895");
18435
18436// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
18437var componentNormalizer = __webpack_require__("2877");
18438
18439// CONCATENATED MODULE: ./src/components/_base-tabs.vue
18440
18441
18442
18443
18444
18445
18446/* normalize component */
18447
18448var component = Object(componentNormalizer["a" /* default */])(
18449 components_base_tabsvue_type_script_lang_js_,
18450 render,
18451 staticRenderFns,
18452 false,
18453 null,
18454 "3d1a2c4c",
18455 null
18456
18457)
18458
18459/* harmony default export */ var _base_tabs = __webpack_exports__["default"] = (component.exports);
18460
18461/***/ }),
18462
18463/***/ "86b3":
18464/***/ (function(module, exports, __webpack_require__) {
18465
18466// extracted by mini-css-extract-plugin
18467
18468/***/ }),
18469
18470/***/ "8b71":
18471/***/ (function(module, __webpack_exports__, __webpack_require__) {
18472
18473"use strict";
18474__webpack_require__.r(__webpack_exports__);
18475
18476// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-checkbox.vue?vue&type=template&id=328c5c04&scoped=true&
18477var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:[_vm.size, 'checkbox']},[_c('input',{attrs:{"id":_vm.id,"type":"checkbox","name":_vm.name,"disabled":_vm.disabled,"true-value":_vm.trueValue,"false-value":_vm.falseValue},on:{"change":function($event){return _vm.onChange($event)}}}),_c('label',{attrs:{"for":_vm.id}},[_c('span',[_vm._t("default")],2)])])}
18478var staticRenderFns = []
18479
18480
18481// CONCATENATED MODULE: ./src/components/_base-checkbox.vue?vue&type=template&id=328c5c04&scoped=true&
18482
18483// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-checkbox.vue?vue&type=script&lang=js&
18484/* harmony default export */ var _base_checkboxvue_type_script_lang_js_ = ({
18485 name: 'BaseCheckbox',
18486 props: {
18487 id: {
18488 type: String,
18489 default: function _default() {
18490 return 'checkbox-id-' + this._uid;
18491 }
18492 },
18493 name: {
18494 type: String,
18495 default: null
18496 },
18497 disabled: {
18498 type: Boolean,
18499 default: false
18500 },
18501 trueValue: {
18502 type: [Boolean, String, Number],
18503 default: null
18504 },
18505 falseValue: {
18506 type: [Boolean, String, Number],
18507 default: null
18508 },
18509 size: {
18510 type: String,
18511 default: 'medium',
18512 validator: function validator(value) {
18513 return ['large', 'medium', 'small'].indexOf(value) !== -1;
18514 }
18515 },
18516 change: {
18517 type: Function,
18518 default: null
18519 }
18520 },
18521 methods: {
18522 onChange: function onChange($event) {
18523 // Passing custom event from outside change.
18524 this.$emit('change');
18525 var isChecked = $event.target.checked;
18526
18527 if (this.trueValue !== null && isChecked) {
18528 this.$emit('input', this.trueValue);
18529 } else if (this.falseValue !== null && !isChecked) {
18530 this.$emit('input', this.falseValue);
18531 } else {
18532 this.$emit('input', $event.target.checked);
18533 }
18534 }
18535 }
18536});
18537// CONCATENATED MODULE: ./src/components/_base-checkbox.vue?vue&type=script&lang=js&
18538 /* harmony default export */ var components_base_checkboxvue_type_script_lang_js_ = (_base_checkboxvue_type_script_lang_js_);
18539// EXTERNAL MODULE: ./src/components/_base-checkbox.vue?vue&type=style&index=0&id=328c5c04&lang=scss&scoped=true&
18540var _base_checkboxvue_type_style_index_0_id_328c5c04_lang_scss_scoped_true_ = __webpack_require__("da4a");
18541
18542// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
18543var componentNormalizer = __webpack_require__("2877");
18544
18545// CONCATENATED MODULE: ./src/components/_base-checkbox.vue
18546
18547
18548
18549
18550
18551
18552/* normalize component */
18553
18554var component = Object(componentNormalizer["a" /* default */])(
18555 components_base_checkboxvue_type_script_lang_js_,
18556 render,
18557 staticRenderFns,
18558 false,
18559 null,
18560 "328c5c04",
18561 null
18562
18563)
18564
18565/* harmony default export */ var _base_checkbox = __webpack_exports__["default"] = (component.exports);
18566
18567/***/ }),
18568
18569/***/ "8bbf":
18570/***/ (function(module, exports) {
18571
18572module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;
18573
18574/***/ }),
18575
18576/***/ "8d62":
18577/***/ (function(module, exports, __webpack_require__) {
18578
18579// extracted by mini-css-extract-plugin
18580
18581/***/ }),
18582
18583/***/ "9325":
18584/***/ (function(module, __webpack_exports__, __webpack_require__) {
18585
18586"use strict";
18587/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_radio_vue_vue_type_style_index_0_id_61d77a12_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("86b3");
18588/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_radio_vue_vue_type_style_index_0_id_61d77a12_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_radio_vue_vue_type_style_index_0_id_61d77a12_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
18589/* unused harmony reexport * */
18590 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_radio_vue_vue_type_style_index_0_id_61d77a12_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
18591
18592/***/ }),
18593
18594/***/ "9e69":
18595/***/ (function(module, exports, __webpack_require__) {
18596
18597var root = __webpack_require__("2b3e");
18598
18599/** Built-in value references. */
18600var Symbol = root.Symbol;
18601
18602module.exports = Symbol;
18603
18604
18605/***/ }),
18606
18607/***/ "a262":
18608/***/ (function(module, exports, __webpack_require__) {
18609
18610// extracted by mini-css-extract-plugin
18611
18612/***/ }),
18613
18614/***/ "a61f":
18615/***/ (function(module, __webpack_exports__, __webpack_require__) {
18616
18617"use strict";
18618__webpack_require__.r(__webpack_exports__);
18619
18620// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-select.vue?vue&type=template&id=2ff915ca&scoped=true&
18621var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"selector formControl",on:{"click":function($event){_vm.showOptions = !_vm.showOptions}}},[_c('div',{staticClass:"spaceBetween"},[_c('div',{staticClass:"selectName"},[_vm._v(_vm._s(_vm.value ? _vm.value.value : 'Select'))]),_c('div',{staticClass:"selectSymbol"},[(!_vm.showOptions)?_c('BaseIcon',{attrs:{"width":"14","height":"14","color":"#0099d6","name":"down-arrow"}}):_c('BaseIcon',{attrs:{"width":"14","height":"14","color":"#0099d6","name":"up-arrow"}})],1)]),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.showOptions),expression:"showOptions"}],staticClass:"selectorOptions"},_vm._l((_vm.options),function(option,index){return _c('li',{key:index},[_c('label',{staticClass:"option",attrs:{"for":'selector_' + _vm._uid + '_' + index}},[_c('input',{attrs:{"id":'selector_' + _vm._uid + '_' + index,"type":"radio","name":'selector_' + _vm._uid},domProps:{"value":option.value},on:{"change":function($event){return _vm.onChange(option)}}}),_vm._v("\n "+_vm._s(option.value)+"\n ")])])}),0)])}
18622var staticRenderFns = []
18623
18624
18625// CONCATENATED MODULE: ./src/components/_base-select.vue?vue&type=template&id=2ff915ca&scoped=true&
18626
18627// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-select.vue?vue&type=script&lang=js&
18628/* harmony default export */ var _base_selectvue_type_script_lang_js_ = ({
18629 name: 'BaseSelect',
18630 props: {
18631 options: {
18632 type: Array,
18633 default: null
18634 },
18635 value: {
18636 type: [String, Object],
18637 default: null
18638 }
18639 },
18640 data: function data() {
18641 return {
18642 showOptions: false
18643 };
18644 },
18645 methods: {
18646 onChange: function onChange(option) {
18647 this.$emit('change');
18648 this.$emit('input', option);
18649 this.showOptions = !this.showOptions;
18650 }
18651 }
18652});
18653// CONCATENATED MODULE: ./src/components/_base-select.vue?vue&type=script&lang=js&
18654 /* harmony default export */ var components_base_selectvue_type_script_lang_js_ = (_base_selectvue_type_script_lang_js_);
18655// EXTERNAL MODULE: ./src/components/_base-select.vue?vue&type=style&index=0&id=2ff915ca&lang=scss&scoped=true&
18656var _base_selectvue_type_style_index_0_id_2ff915ca_lang_scss_scoped_true_ = __webpack_require__("436a");
18657
18658// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
18659var componentNormalizer = __webpack_require__("2877");
18660
18661// CONCATENATED MODULE: ./src/components/_base-select.vue
18662
18663
18664
18665
18666
18667
18668/* normalize component */
18669
18670var component = Object(componentNormalizer["a" /* default */])(
18671 components_base_selectvue_type_script_lang_js_,
18672 render,
18673 staticRenderFns,
18674 false,
18675 null,
18676 "2ff915ca",
18677 null
18678
18679)
18680
18681/* harmony default export */ var _base_select = __webpack_exports__["default"] = (component.exports);
18682
18683/***/ }),
18684
18685/***/ "a895":
18686/***/ (function(module, __webpack_exports__, __webpack_require__) {
18687
18688"use strict";
18689/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tabs_vue_vue_type_style_index_0_id_3d1a2c4c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8d62");
18690/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tabs_vue_vue_type_style_index_0_id_3d1a2c4c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tabs_vue_vue_type_style_index_0_id_3d1a2c4c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
18691/* unused harmony reexport * */
18692 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_tabs_vue_vue_type_style_index_0_id_3d1a2c4c_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
18693
18694/***/ }),
18695
18696/***/ "a919":
18697/***/ (function(module, exports, __webpack_require__) {
18698
18699var basePropertyOf = __webpack_require__("ddc6");
18700
18701/** Used to map Latin Unicode letters to basic Latin letters. */
18702var deburredLetters = {
18703 // Latin-1 Supplement block.
18704 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
18705 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
18706 '\xc7': 'C', '\xe7': 'c',
18707 '\xd0': 'D', '\xf0': 'd',
18708 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
18709 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
18710 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
18711 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
18712 '\xd1': 'N', '\xf1': 'n',
18713 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
18714 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
18715 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
18716 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
18717 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
18718 '\xc6': 'Ae', '\xe6': 'ae',
18719 '\xde': 'Th', '\xfe': 'th',
18720 '\xdf': 'ss',
18721 // Latin Extended-A block.
18722 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
18723 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
18724 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
18725 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
18726 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
18727 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
18728 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
18729 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
18730 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
18731 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
18732 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
18733 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
18734 '\u0134': 'J', '\u0135': 'j',
18735 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
18736 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
18737 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
18738 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
18739 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
18740 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
18741 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
18742 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
18743 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
18744 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
18745 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
18746 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
18747 '\u0163': 't', '\u0165': 't', '\u0167': 't',
18748 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
18749 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
18750 '\u0174': 'W', '\u0175': 'w',
18751 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
18752 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
18753 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
18754 '\u0132': 'IJ', '\u0133': 'ij',
18755 '\u0152': 'Oe', '\u0153': 'oe',
18756 '\u0149': "'n", '\u017f': 's'
18757};
18758
18759/**
18760 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
18761 * letters to basic Latin letters.
18762 *
18763 * @private
18764 * @param {string} letter The matched letter to deburr.
18765 * @returns {string} Returns the deburred letter.
18766 */
18767var deburrLetter = basePropertyOf(deburredLetters);
18768
18769module.exports = deburrLetter;
18770
18771
18772/***/ }),
18773
18774/***/ "aaec":
18775/***/ (function(module, exports) {
18776
18777/** Used to compose unicode character classes. */
18778var rsAstralRange = '\\ud800-\\udfff',
18779 rsComboMarksRange = '\\u0300-\\u036f',
18780 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
18781 rsComboSymbolsRange = '\\u20d0-\\u20ff',
18782 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
18783 rsVarRange = '\\ufe0e\\ufe0f';
18784
18785/** Used to compose unicode capture groups. */
18786var rsZWJ = '\\u200d';
18787
18788/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
18789var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
18790
18791/**
18792 * Checks if `string` contains Unicode symbols.
18793 *
18794 * @private
18795 * @param {string} string The string to inspect.
18796 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
18797 */
18798function hasUnicode(string) {
18799 return reHasUnicode.test(string);
18800}
18801
18802module.exports = hasUnicode;
18803
18804
18805/***/ }),
18806
18807/***/ "b20a":
18808/***/ (function(module, exports, __webpack_require__) {
18809
18810var arrayReduce = __webpack_require__("6ac0"),
18811 deburr = __webpack_require__("4caa"),
18812 words = __webpack_require__("ea72");
18813
18814/** Used to compose unicode capture groups. */
18815var rsApos = "['\u2019]";
18816
18817/** Used to match apostrophes. */
18818var reApos = RegExp(rsApos, 'g');
18819
18820/**
18821 * Creates a function like `_.camelCase`.
18822 *
18823 * @private
18824 * @param {Function} callback The function to combine each word.
18825 * @returns {Function} Returns the new compounder function.
18826 */
18827function createCompounder(callback) {
18828 return function(string) {
18829 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
18830 };
18831}
18832
18833module.exports = createCompounder;
18834
18835
18836/***/ }),
18837
18838/***/ "b423":
18839/***/ (function(module, __webpack_exports__, __webpack_require__) {
18840
18841"use strict";
18842/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_upload_vue_vue_type_style_index_0_id_6be8bede_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ff9e");
18843/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_upload_vue_vue_type_style_index_0_id_6be8bede_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_upload_vue_vue_type_style_index_0_id_6be8bede_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
18844/* unused harmony reexport * */
18845 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_upload_vue_vue_type_style_index_0_id_6be8bede_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
18846
18847/***/ }),
18848
18849/***/ "b526":
18850/***/ (function(module, exports, __webpack_require__) {
18851
18852var map = {
18853 "./_base-button.vue": "8339",
18854 "./_base-checkbox.vue": "8b71",
18855 "./_base-grid.vue": "d858",
18856 "./_base-input.vue": "08ce",
18857 "./_base-link.vue": "cbd4",
18858 "./_base-modal.vue": "80b6",
18859 "./_base-radio.vue": "cb87",
18860 "./_base-select.vue": "a61f",
18861 "./_base-tab.vue": "dd88",
18862 "./_base-tabs.vue": "83c6",
18863 "./_base-upload.vue": "6190"
18864};
18865
18866
18867function webpackContext(req) {
18868 var id = webpackContextResolve(req);
18869 return __webpack_require__(id);
18870}
18871function webpackContextResolve(req) {
18872 var id = map[req];
18873 if(!(id + 1)) { // check for number or string
18874 var e = new Error("Cannot find module '" + req + "'");
18875 e.code = 'MODULE_NOT_FOUND';
18876 throw e;
18877 }
18878 return id;
18879}
18880webpackContext.keys = function webpackContextKeys() {
18881 return Object.keys(map);
18882};
18883webpackContext.resolve = webpackContextResolve;
18884module.exports = webpackContext;
18885webpackContext.id = "b526";
18886
18887/***/ }),
18888
18889/***/ "bba4":
18890/***/ (function(module, exports, __webpack_require__) {
18891
18892var capitalize = __webpack_require__("e9a7"),
18893 createCompounder = __webpack_require__("b20a");
18894
18895/**
18896 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
18897 *
18898 * @static
18899 * @memberOf _
18900 * @since 3.0.0
18901 * @category String
18902 * @param {string} [string=''] The string to convert.
18903 * @returns {string} Returns the camel cased string.
18904 * @example
18905 *
18906 * _.camelCase('Foo Bar');
18907 * // => 'fooBar'
18908 *
18909 * _.camelCase('--foo-bar--');
18910 * // => 'fooBar'
18911 *
18912 * _.camelCase('__FOO_BAR__');
18913 * // => 'fooBar'
18914 */
18915var camelCase = createCompounder(function(result, word, index) {
18916 word = word.toLowerCase();
18917 return result + (index ? capitalize(word) : word);
18918});
18919
18920module.exports = camelCase;
18921
18922
18923/***/ }),
18924
18925/***/ "c32f":
18926/***/ (function(module, exports, __webpack_require__) {
18927
18928var baseSlice = __webpack_require__("2b10");
18929
18930/**
18931 * Casts `array` to a slice if it's needed.
18932 *
18933 * @private
18934 * @param {Array} array The array to inspect.
18935 * @param {number} start The start position.
18936 * @param {number} [end=array.length] The end position.
18937 * @returns {Array} Returns the cast slice.
18938 */
18939function castSlice(array, start, end) {
18940 var length = array.length;
18941 end = end === undefined ? length : end;
18942 return (!start && end >= length) ? array : baseSlice(array, start, end);
18943}
18944
18945module.exports = castSlice;
18946
18947
18948/***/ }),
18949
18950/***/ "c8ba":
18951/***/ (function(module, exports) {
18952
18953var g;
18954
18955// This works in non-strict mode
18956g = (function() {
18957 return this;
18958})();
18959
18960try {
18961 // This works if eval is allowed (see CSP)
18962 g = g || new Function("return this")();
18963} catch (e) {
18964 // This works if the window reference is available
18965 if (typeof window === "object") g = window;
18966}
18967
18968// g can still be undefined, but nothing to do about it...
18969// We return undefined, instead of nothing here, so it's
18970// easier to handle this case. if(!global) { ...}
18971
18972module.exports = g;
18973
18974
18975/***/ }),
18976
18977/***/ "cb87":
18978/***/ (function(module, __webpack_exports__, __webpack_require__) {
18979
18980"use strict";
18981__webpack_require__.r(__webpack_exports__);
18982
18983// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-radio.vue?vue&type=template&id=61d77a12&scoped=true&
18984var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['radio', _vm.size]},[_c('input',{attrs:{"id":_vm.id,"type":"radio","name":_vm.name,"disabled":_vm.disabled},domProps:{"value":_vm.value,"checked":_vm.state},on:{"change":_vm.onChange}}),_c('label',{attrs:{"for":_vm.id}},[_c('span',[_vm._t("default")],2)])])}
18985var staticRenderFns = []
18986
18987
18988// CONCATENATED MODULE: ./src/components/_base-radio.vue?vue&type=template&id=61d77a12&scoped=true&
18989
18990// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-radio.vue?vue&type=script&lang=js&
18991/* harmony default export */ var _base_radiovue_type_script_lang_js_ = ({
18992 name: 'BaseRadio',
18993 model: {
18994 prop: 'modelValue',
18995 event: 'input'
18996 },
18997 props: {
18998 id: {
18999 type: String,
19000 default: function _default() {
19001 return 'radio-id-' + this._uid;
19002 }
19003 },
19004 name: {
19005 type: String,
19006 default: null
19007 },
19008 value: {
19009 type: [String, Number, Boolean],
19010 default: null
19011 },
19012 modelValue: {
19013 type: [String, Number, Boolean],
19014 default: undefined
19015 },
19016 checked: {
19017 type: Boolean,
19018 default: false
19019 },
19020 disabled: {
19021 type: Boolean,
19022 default: false
19023 },
19024 size: {
19025 type: String,
19026 default: 'medium',
19027 validator: function validator(value) {
19028 return ['large', 'medium', 'small'].indexOf(value) !== -1;
19029 }
19030 }
19031 },
19032 computed: {
19033 state: function state() {
19034 if (this.modelValue === undefined) {
19035 return this.checked;
19036 }
19037
19038 return this.modelValue === this.value;
19039 }
19040 },
19041 mounted: function mounted() {
19042 if (this.checked && !this.state) {
19043 this.toggle();
19044 }
19045 },
19046 methods: {
19047 onChange: function onChange() {
19048 // Passing custom event from outside change.
19049 this.$emit('change');
19050 this.toggle();
19051 },
19052 toggle: function toggle() {
19053 this.$emit('input', this.state ? '' : this.value);
19054 }
19055 }
19056});
19057// CONCATENATED MODULE: ./src/components/_base-radio.vue?vue&type=script&lang=js&
19058 /* harmony default export */ var components_base_radiovue_type_script_lang_js_ = (_base_radiovue_type_script_lang_js_);
19059// EXTERNAL MODULE: ./src/components/_base-radio.vue?vue&type=style&index=0&id=61d77a12&lang=scss&scoped=true&
19060var _base_radiovue_type_style_index_0_id_61d77a12_lang_scss_scoped_true_ = __webpack_require__("9325");
19061
19062// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
19063var componentNormalizer = __webpack_require__("2877");
19064
19065// CONCATENATED MODULE: ./src/components/_base-radio.vue
19066
19067
19068
19069
19070
19071
19072/* normalize component */
19073
19074var component = Object(componentNormalizer["a" /* default */])(
19075 components_base_radiovue_type_script_lang_js_,
19076 render,
19077 staticRenderFns,
19078 false,
19079 null,
19080 "61d77a12",
19081 null
19082
19083)
19084
19085/* harmony default export */ var _base_radio = __webpack_exports__["default"] = (component.exports);
19086
19087/***/ }),
19088
19089/***/ "cbd4":
19090/***/ (function(module, __webpack_exports__, __webpack_require__) {
19091
19092"use strict";
19093__webpack_require__.r(__webpack_exports__);
19094
19095// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-link.vue?vue&type=template&id=b5033844&scoped=true&
19096var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.href)?_c('a',_vm._b({staticClass:"baseLink",attrs:{"href":_vm.href,"name":_vm.name,"target":_vm.target}},'a',_vm.$attrs,false),[_vm._t("default")],2):_c('RouterLink',_vm._b({staticClass:"baseLink",attrs:{"to":_vm.routerLinkTo}},'RouterLink',_vm.$attrs,false),[_vm._t("default")],2)}
19097var staticRenderFns = []
19098
19099
19100// CONCATENATED MODULE: ./src/components/_base-link.vue?vue&type=template&id=b5033844&scoped=true&
19101
19102// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-link.vue?vue&type=script&lang=js&
19103function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
19104
19105function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19106
19107/* harmony default export */ var _base_linkvue_type_script_lang_js_ = ({
19108 inheritAttrs: false,
19109 props: {
19110 href: {
19111 type: String,
19112 default: ''
19113 },
19114 target: {
19115 type: String,
19116 default: '_self'
19117 },
19118 allowInsecure: {
19119 type: Boolean,
19120 default: false
19121 },
19122 to: {
19123 type: Object,
19124 default: null
19125 },
19126 name: {
19127 type: String,
19128 default: ''
19129 },
19130 params: {
19131 type: Object,
19132 default: function _default() {
19133 return {};
19134 }
19135 }
19136 },
19137 computed: {
19138 routerLinkTo: function routerLinkTo(_ref) {
19139 var name = _ref.name,
19140 params = _ref.params;
19141 return _objectSpread({
19142 name: name,
19143 params: params
19144 }, this.to || {});
19145 }
19146 },
19147 created: function created() {
19148 this.validateProps();
19149 },
19150 methods: {
19151 // Perform more complex prop validations than is possible
19152 // inside individual validator functions for each prop.
19153 validateProps: function validateProps() {
19154 if (true) return;
19155
19156 if (this.href) {
19157 // Check for non-external URL in href.
19158 if (!/^\w+:/.test(this.href)) {
19159 return console.warn("Invalid <BaseLink> href: ".concat(this.href, ".\nIf you're trying to link to a local URL, provide at least a name or to"));
19160 } // Check for insecure URL in href.
19161
19162
19163 if (!this.allowInsecure && !/^(https|mailto|tel):/.test(this.href)) {
19164 return console.warn("Insecure <BaseLink> href: ".concat(this.href, ".\nWhen linking to external sites, always prefer https URLs. If this site does not offer SSL, explicitly add the allow-insecure attribute on <BaseLink>."));
19165 }
19166 } else {
19167 // Check for insufficient props.
19168 if (!this.name && !this.to) {
19169 return console.warn("Invalid <BaseLink> props:\n\n".concat(JSON.stringify(this.$props, null, 2), "\n\nEither a `name` or `to` is required for internal links, or an `href` for external links."));
19170 }
19171 }
19172 }
19173 }
19174});
19175// CONCATENATED MODULE: ./src/components/_base-link.vue?vue&type=script&lang=js&
19176 /* harmony default export */ var components_base_linkvue_type_script_lang_js_ = (_base_linkvue_type_script_lang_js_);
19177// EXTERNAL MODULE: ./src/components/_base-link.vue?vue&type=style&index=0&id=b5033844&lang=scss&scoped=true&
19178var _base_linkvue_type_style_index_0_id_b5033844_lang_scss_scoped_true_ = __webpack_require__("4631");
19179
19180// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
19181var componentNormalizer = __webpack_require__("2877");
19182
19183// CONCATENATED MODULE: ./src/components/_base-link.vue
19184
19185
19186
19187
19188
19189
19190/* normalize component */
19191
19192var component = Object(componentNormalizer["a" /* default */])(
19193 components_base_linkvue_type_script_lang_js_,
19194 render,
19195 staticRenderFns,
19196 false,
19197 null,
19198 "b5033844",
19199 null
19200
19201)
19202
19203/* harmony default export */ var _base_link = __webpack_exports__["default"] = (component.exports);
19204
19205/***/ }),
19206
19207/***/ "ce86":
19208/***/ (function(module, exports, __webpack_require__) {
19209
19210var Symbol = __webpack_require__("9e69"),
19211 arrayMap = __webpack_require__("7948"),
19212 isArray = __webpack_require__("6747"),
19213 isSymbol = __webpack_require__("ffd6");
19214
19215/** Used as references for various `Number` constants. */
19216var INFINITY = 1 / 0;
19217
19218/** Used to convert symbols to primitives and strings. */
19219var symbolProto = Symbol ? Symbol.prototype : undefined,
19220 symbolToString = symbolProto ? symbolProto.toString : undefined;
19221
19222/**
19223 * The base implementation of `_.toString` which doesn't convert nullish
19224 * values to empty strings.
19225 *
19226 * @private
19227 * @param {*} value The value to process.
19228 * @returns {string} Returns the string.
19229 */
19230function baseToString(value) {
19231 // Exit early for strings to avoid a performance hit in some environments.
19232 if (typeof value == 'string') {
19233 return value;
19234 }
19235 if (isArray(value)) {
19236 // Recursively convert values (susceptible to call stack limits).
19237 return arrayMap(value, baseToString) + '';
19238 }
19239 if (isSymbol(value)) {
19240 return symbolToString ? symbolToString.call(value) : '';
19241 }
19242 var result = (value + '');
19243 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
19244}
19245
19246module.exports = baseToString;
19247
19248
19249/***/ }),
19250
19251/***/ "d094":
19252/***/ (function(module, exports) {
19253
19254/** Used to compose unicode character classes. */
19255var rsAstralRange = '\\ud800-\\udfff',
19256 rsComboMarksRange = '\\u0300-\\u036f',
19257 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
19258 rsComboSymbolsRange = '\\u20d0-\\u20ff',
19259 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
19260 rsVarRange = '\\ufe0e\\ufe0f';
19261
19262/** Used to compose unicode capture groups. */
19263var rsAstral = '[' + rsAstralRange + ']',
19264 rsCombo = '[' + rsComboRange + ']',
19265 rsFitz = '\\ud83c[\\udffb-\\udfff]',
19266 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
19267 rsNonAstral = '[^' + rsAstralRange + ']',
19268 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
19269 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
19270 rsZWJ = '\\u200d';
19271
19272/** Used to compose unicode regexes. */
19273var reOptMod = rsModifier + '?',
19274 rsOptVar = '[' + rsVarRange + ']?',
19275 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
19276 rsSeq = rsOptVar + reOptMod + rsOptJoin,
19277 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
19278
19279/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
19280var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
19281
19282/**
19283 * Converts a Unicode `string` to an array.
19284 *
19285 * @private
19286 * @param {string} string The string to convert.
19287 * @returns {Array} Returns the converted array.
19288 */
19289function unicodeToArray(string) {
19290 return string.match(reUnicode) || [];
19291}
19292
19293module.exports = unicodeToArray;
19294
19295
19296/***/ }),
19297
19298/***/ "d194":
19299/***/ (function(module, exports, __webpack_require__) {
19300
19301var castSlice = __webpack_require__("c32f"),
19302 hasUnicode = __webpack_require__("aaec"),
19303 stringToArray = __webpack_require__("126d"),
19304 toString = __webpack_require__("76dd");
19305
19306/**
19307 * Creates a function like `_.lowerFirst`.
19308 *
19309 * @private
19310 * @param {string} methodName The name of the `String` case method to use.
19311 * @returns {Function} Returns the new case function.
19312 */
19313function createCaseFirst(methodName) {
19314 return function(string) {
19315 string = toString(string);
19316
19317 var strSymbols = hasUnicode(string)
19318 ? stringToArray(string)
19319 : undefined;
19320
19321 var chr = strSymbols
19322 ? strSymbols[0]
19323 : string.charAt(0);
19324
19325 var trailing = strSymbols
19326 ? castSlice(strSymbols, 1).join('')
19327 : string.slice(1);
19328
19329 return chr[methodName]() + trailing;
19330 };
19331}
19332
19333module.exports = createCaseFirst;
19334
19335
19336/***/ }),
19337
19338/***/ "d22d":
19339/***/ (function(module, __webpack_exports__, __webpack_require__) {
19340
19341"use strict";
19342/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_input_vue_vue_type_style_index_0_id_ef34fb18_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6263");
19343/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_input_vue_vue_type_style_index_0_id_ef34fb18_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_input_vue_vue_type_style_index_0_id_ef34fb18_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
19344/* unused harmony reexport * */
19345 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_input_vue_vue_type_style_index_0_id_ef34fb18_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
19346
19347/***/ }),
19348
19349/***/ "d858":
19350/***/ (function(module, __webpack_exports__, __webpack_require__) {
19351
19352"use strict";
19353__webpack_require__.r(__webpack_exports__);
19354
19355// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-grid.vue?vue&type=template&id=6063fe24&scoped=true&
19356var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tableContainer"},[_c('table',{staticClass:"table"},[_c('thead',[_c('tr',[(_vm.selector)?_c('th',{staticClass:"selectorColumn"},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.isSelectAll),expression:"isSelectAll"}],attrs:{"type":"checkbox"},domProps:{"checked":Array.isArray(_vm.isSelectAll)?_vm._i(_vm.isSelectAll,null)>-1:(_vm.isSelectAll)},on:{"change":[function($event){var $$a=_vm.isSelectAll,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.isSelectAll=$$a.concat([$$v]))}else{$$i>-1&&(_vm.isSelectAll=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.isSelectAll=$$c}},function($event){return _vm.selectAll()}]}})]):_vm._e(),_vm._l((_vm.columns),function(column,index){return _c('th',{key:index,class:_vm.sortKey === column.key ? 'active' : '',style:({ width: column.width }),on:{"click":function($event){return _vm.sortBy(column)}}},[_vm._v("\n "+_vm._s(column.label)+"\n "),(_vm.sortOrders[column.key] > 0)?_c('BaseIcon',{attrs:{"class-name":"sortIcon","name":"up-arrow","width":"12","height":"12"}}):_c('BaseIcon',{attrs:{"class-name":"sortIcon","name":"down-arrow","width":"12","height":"12"}})],1)})],2)]),_c('tbody',_vm._l((_vm.filteredData),function(item,index){return _c('tr',{key:index},[(_vm.selector)?_c('td',[_c('input',{directives:[{name:"model",rawName:"v-model",value:(item['isSelected']),expression:"item['isSelected']"}],attrs:{"type":"checkbox"},domProps:{"checked":Array.isArray(item['isSelected'])?_vm._i(item['isSelected'],null)>-1:(item['isSelected'])},on:{"change":[function($event){var $$a=item['isSelected'],$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(item, 'isSelected', $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(item, 'isSelected', $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(item, 'isSelected', $$c)}},function($event){return _vm.select(item)}]}})]):_vm._e(),_vm._l((_vm.columns),function(column,index2){return _c('td',{key:index2},[_vm._v(_vm._s(item[column.key]))])})],2)}),0)]),_c('div',{staticClass:"bottomSpace"},[_c('div',{staticClass:"total"},[_vm._v("\n Total:\n "),_c('strong',[_vm._v(_vm._s(_vm.total))])]),_c('ul',{staticClass:"pagination",attrs:{"name":"Pagination"}},[(!_vm.isFirstPage)?_c('li',{staticClass:"pageItem",on:{"click":function($event){return _vm.turnPage(-1)}}},[_c('a',{staticClass:"pageLink",attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();}}},[_c('BaseIcon',{attrs:{"name":"left-arrow","width":"12","height":"12"}})],1)]):_vm._e(),_vm._l((_vm.dspBtns),function(i,index){return _c('li',{key:index,class:['pageItem', i === _vm.curPage ? 'currentPage' : '']},[(i)?_c('a',{staticClass:"pageLink",attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.handleClick(i)}}},[_vm._v(_vm._s(i))]):_c('a',{staticClass:"pageLink"},[_vm._v("...")])])}),(!_vm.isLastPage)?_c('li',{staticClass:"pageItem",on:{"click":function($event){return _vm.turnPage(1)}}},[_c('a',{staticClass:"pageLink",attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();}}},[_c('BaseIcon',{attrs:{"name":"right-arrow","width":"12","height":"12"}})],1)]):_vm._e()],2)])])}
19357var staticRenderFns = []
19358
19359
19360// CONCATENATED MODULE: ./src/components/_base-grid.vue?vue&type=template&id=6063fe24&scoped=true&
19361
19362// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
19363var lodash = __webpack_require__("2ef0");
19364
19365// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-grid.vue?vue&type=script&lang=js&
19366
19367/* harmony default export */ var _base_gridvue_type_script_lang_js_ = ({
19368 props: {
19369 data: {
19370 type: Array,
19371 default: null
19372 },
19373 columns: {
19374 type: Array,
19375 default: null
19376 },
19377 query: {
19378 type: Object,
19379 required: true
19380 },
19381 selector: {
19382 type: Boolean,
19383 default: false
19384 }
19385 },
19386 data: function data() {
19387 var sortOrders = {};
19388 var sortKey = this.query.sort;
19389 this.columns.forEach(function (column) {
19390 sortOrders[column.key] = 1;
19391 });
19392
19393 if (sortKey) {
19394 if (this.query.order === 'desc') {
19395 sortOrders[sortKey] = sortOrders[sortKey] * -1;
19396 } else {
19397 sortOrders[sortKey] = sortOrders[sortKey] * 1;
19398 }
19399 }
19400
19401 return {
19402 sortKey: sortKey || '',
19403 sortOrders: sortOrders,
19404 total: this.data.length,
19405 selectedItems: [],
19406 isSelectAll: false
19407 };
19408 },
19409 computed: {
19410 filteredData: function filteredData() {
19411 var data = this.data;
19412 data = this.getFilterData(data);
19413 data = this.getSortData(data);
19414 this.setTotal(data.length);
19415 data = this.getPaginationData(data);
19416 return data;
19417 },
19418 isFirstPage: function isFirstPage() {
19419 return +this.query.offset === 0 || +this.query.limit >= this.total;
19420 },
19421 isLastPage: function isLastPage() {
19422 return +this.query.offset + +this.query.limit >= this.total;
19423 },
19424 totalPage: function totalPage() {
19425 return Math.ceil(this.total / +this.query.limit);
19426 },
19427 curPage: function curPage() {
19428 return Math.ceil(+this.query.offset / +this.query.limit) + 1;
19429 },
19430 dspBtns: function dspBtns() {
19431 var n = this.totalPage;
19432 var i = this.curPage;
19433
19434 if (n <= 9) {
19435 return function (n) {
19436 var array = Array(n);
19437
19438 while (n) {
19439 array[n - 1] = n--;
19440 }
19441
19442 return array;
19443 }(n);
19444 }
19445
19446 if (i <= 5) {
19447 return [1, 2, 3, 4, 5, 6, 7, 0, n]; // 0 represents `···`
19448 }
19449
19450 if (i >= n - 4) {
19451 return [1, 0, n - 6, n - 5, n - 4, n - 3, n - 2, n - 1, n];
19452 }
19453
19454 return [1, 0, i - 2, i - 1, i, i + 1, i + 2, 0, n];
19455 }
19456 },
19457 watch: {
19458 query: {
19459 handler: function handler(query) {
19460 if (this.filteredData.length === 0 && this.curPage !== 1) {
19461 this.handleClick(1);
19462 }
19463 },
19464 deep: true
19465 }
19466 },
19467 methods: {
19468 setTotal: function setTotal(total) {
19469 this.total = total;
19470 },
19471 sortBy: function sortBy(column) {
19472 this.sortKey = column.key;
19473 this.sortOrders[column.key] = this.sortOrders[column.key] * -1;
19474 },
19475 handleClick: function handleClick(n) {
19476 this.query.offset = (n - 1) * +this.query.limit;
19477 },
19478 turnPage: function turnPage(i) {
19479 if (i < 0 && this.isFirstPage || i > 0 && this.isLastPage) return;
19480 this.query.offset = +this.query.offset + i * +this.query.limit;
19481 },
19482 getFilterData: function getFilterData(data) {
19483 var filterKey = this.query.filterKey && this.query.filterKey.toLowerCase();
19484
19485 if (filterKey) {
19486 data = data.filter(function (row) {
19487 return Object.keys(row).some(function (key) {
19488 return String(row[key]).toLowerCase().indexOf(filterKey) > -1;
19489 });
19490 });
19491 }
19492
19493 return data;
19494 },
19495 getSortData: function getSortData(data) {
19496 var sortKey = this.sortKey;
19497 var order = this.sortOrders[sortKey] || 1;
19498
19499 if (sortKey) {
19500 data = data.slice().sort(function (a, b) {
19501 a = a[sortKey];
19502 b = b[sortKey];
19503 return (a === b ? 0 : a > b ? 1 : -1) * order;
19504 });
19505 }
19506
19507 return data;
19508 },
19509 getPaginationData: function getPaginationData(data) {
19510 if (this.query.offset >= 0) {
19511 data = Object(lodash["take"])(Object(lodash["drop"])(data, this.query.offset), this.query.limit);
19512 }
19513
19514 return data;
19515 },
19516 select: function select(item) {
19517 var selectedItems = this.selectedItems;
19518
19519 if (item['isSelected']) {
19520 selectedItems.push(item);
19521 return selectedItems;
19522 } else {
19523 selectedItems = Object(lodash["remove"])(this.selectedItems, function (removedItem) {
19524 return removedItem === item;
19525 });
19526 return selectedItems;
19527 }
19528 },
19529 selectAll: function selectAll() {
19530 var data = this.getFilterData(this.data);
19531 var _iteratorNormalCompletion = true;
19532 var _didIteratorError = false;
19533 var _iteratorError = undefined;
19534
19535 try {
19536 for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
19537 var item = _step.value;
19538
19539 if (this.isSelectAll) {
19540 if (!this.selectedItems.includes(item)) {
19541 item.isSelected = true;
19542 this.selectedItems.push(item);
19543 }
19544 } else {
19545 var _iteratorNormalCompletion2 = true;
19546 var _didIteratorError2 = false;
19547 var _iteratorError2 = undefined;
19548
19549 try {
19550 for (var _iterator2 = this.selectedItems[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
19551 var removeItem = _step2.value;
19552 removeItem.isSelected = false;
19553 }
19554 } catch (err) {
19555 _didIteratorError2 = true;
19556 _iteratorError2 = err;
19557 } finally {
19558 try {
19559 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
19560 _iterator2.return();
19561 }
19562 } finally {
19563 if (_didIteratorError2) {
19564 throw _iteratorError2;
19565 }
19566 }
19567 }
19568
19569 this.selectedItems = [];
19570 }
19571 }
19572 } catch (err) {
19573 _didIteratorError = true;
19574 _iteratorError = err;
19575 } finally {
19576 try {
19577 if (!_iteratorNormalCompletion && _iterator.return != null) {
19578 _iterator.return();
19579 }
19580 } finally {
19581 if (_didIteratorError) {
19582 throw _iteratorError;
19583 }
19584 }
19585 }
19586 }
19587 }
19588});
19589// CONCATENATED MODULE: ./src/components/_base-grid.vue?vue&type=script&lang=js&
19590 /* harmony default export */ var components_base_gridvue_type_script_lang_js_ = (_base_gridvue_type_script_lang_js_);
19591// EXTERNAL MODULE: ./src/components/_base-grid.vue?vue&type=style&index=0&id=6063fe24&lang=scss&scoped=true&
19592var _base_gridvue_type_style_index_0_id_6063fe24_lang_scss_scoped_true_ = __webpack_require__("457c");
19593
19594// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
19595var componentNormalizer = __webpack_require__("2877");
19596
19597// CONCATENATED MODULE: ./src/components/_base-grid.vue
19598
19599
19600
19601
19602
19603
19604/* normalize component */
19605
19606var component = Object(componentNormalizer["a" /* default */])(
19607 components_base_gridvue_type_script_lang_js_,
19608 render,
19609 staticRenderFns,
19610 false,
19611 null,
19612 "6063fe24",
19613 null
19614
19615)
19616
19617/* harmony default export */ var _base_grid = __webpack_exports__["default"] = (component.exports);
19618
19619/***/ }),
19620
19621/***/ "da4a":
19622/***/ (function(module, __webpack_exports__, __webpack_require__) {
19623
19624"use strict";
19625/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_checkbox_vue_vue_type_style_index_0_id_328c5c04_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("585a");
19626/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_checkbox_vue_vue_type_style_index_0_id_328c5c04_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_checkbox_vue_vue_type_style_index_0_id_328c5c04_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
19627/* unused harmony reexport * */
19628 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_checkbox_vue_vue_type_style_index_0_id_328c5c04_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
19629
19630/***/ }),
19631
19632/***/ "dd88":
19633/***/ (function(module, __webpack_exports__, __webpack_require__) {
19634
19635"use strict";
19636__webpack_require__.r(__webpack_exports__);
19637
19638// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"74c32341-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-tab.vue?vue&type=template&id=9d7e964a&scoped=true&
19639var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive),expression:"isActive"}],class:_vm.isDisabled ? 'disabled' : ''},[_vm._t("default")],2)}
19640var staticRenderFns = []
19641
19642
19643// CONCATENATED MODULE: ./src/components/_base-tab.vue?vue&type=template&id=9d7e964a&scoped=true&
19644
19645// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/_base-tab.vue?vue&type=script&lang=js&
19646/* harmony default export */ var _base_tabvue_type_script_lang_js_ = ({
19647 props: {
19648 title: {
19649 type: String,
19650 required: true
19651 },
19652 active: {
19653 type: Boolean,
19654 default: false
19655 },
19656 disabled: {
19657 type: [Boolean, String],
19658 default: false
19659 },
19660 dataAttrs: {
19661 type: Object,
19662 default: null
19663 }
19664 },
19665 data: function data() {
19666 return {
19667 isActive: this.active,
19668 isDisabled: this.disabled
19669 };
19670 },
19671 computed: {
19672 index: function index() {
19673 return this.$parent.tabList.indexOf(this);
19674 }
19675 },
19676 watch: {
19677 '$parent.activeTabIndex': function $parentActiveTabIndex(index) {
19678 this.isActive = this.index === index;
19679 },
19680 disabled: function disabled() {
19681 this.isDisabled = this.disabled;
19682 }
19683 },
19684 created: function created() {
19685 this.$parent.tabList.push(this);
19686 }
19687});
19688// CONCATENATED MODULE: ./src/components/_base-tab.vue?vue&type=script&lang=js&
19689 /* harmony default export */ var components_base_tabvue_type_script_lang_js_ = (_base_tabvue_type_script_lang_js_);
19690// EXTERNAL MODULE: ./src/components/_base-tab.vue?vue&type=style&index=0&id=9d7e964a&lang=scss&scoped=true&
19691var _base_tabvue_type_style_index_0_id_9d7e964a_lang_scss_scoped_true_ = __webpack_require__("1347");
19692
19693// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
19694var componentNormalizer = __webpack_require__("2877");
19695
19696// CONCATENATED MODULE: ./src/components/_base-tab.vue
19697
19698
19699
19700
19701
19702
19703/* normalize component */
19704
19705var component = Object(componentNormalizer["a" /* default */])(
19706 components_base_tabvue_type_script_lang_js_,
19707 render,
19708 staticRenderFns,
19709 false,
19710 null,
19711 "9d7e964a",
19712 null
19713
19714)
19715
19716/* harmony default export */ var _base_tab = __webpack_exports__["default"] = (component.exports);
19717
19718/***/ }),
19719
19720/***/ "ddc6":
19721/***/ (function(module, exports) {
19722
19723/**
19724 * The base implementation of `_.propertyOf` without support for deep paths.
19725 *
19726 * @private
19727 * @param {Object} object The object to query.
19728 * @returns {Function} Returns the new accessor function.
19729 */
19730function basePropertyOf(object) {
19731 return function(key) {
19732 return object == null ? undefined : object[key];
19733 };
19734}
19735
19736module.exports = basePropertyOf;
19737
19738
19739/***/ }),
19740
19741/***/ "de73":
19742/***/ (function(module, __webpack_exports__, __webpack_require__) {
19743
19744"use strict";
19745/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_modal_vue_vue_type_style_index_0_id_99c6bbc4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1102");
19746/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_modal_vue_vue_type_style_index_0_id_99c6bbc4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_modal_vue_vue_type_style_index_0_id_99c6bbc4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
19747/* unused harmony reexport * */
19748 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_lib_loader_js_ref_8_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_base_modal_vue_vue_type_style_index_0_id_99c6bbc4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
19749
19750/***/ }),
19751
19752/***/ "e9a7":
19753/***/ (function(module, exports, __webpack_require__) {
19754
19755var toString = __webpack_require__("76dd"),
19756 upperFirst = __webpack_require__("8103");
19757
19758/**
19759 * Converts the first character of `string` to upper case and the remaining
19760 * to lower case.
19761 *
19762 * @static
19763 * @memberOf _
19764 * @since 3.0.0
19765 * @category String
19766 * @param {string} [string=''] The string to capitalize.
19767 * @returns {string} Returns the capitalized string.
19768 * @example
19769 *
19770 * _.capitalize('FRED');
19771 * // => 'Fred'
19772 */
19773function capitalize(string) {
19774 return upperFirst(toString(string).toLowerCase());
19775}
19776
19777module.exports = capitalize;
19778
19779
19780/***/ }),
19781
19782/***/ "ea72":
19783/***/ (function(module, exports, __webpack_require__) {
19784
19785var asciiWords = __webpack_require__("7559"),
19786 hasUnicodeWord = __webpack_require__("7e8e"),
19787 toString = __webpack_require__("76dd"),
19788 unicodeWords = __webpack_require__("f4d9");
19789
19790/**
19791 * Splits `string` into an array of its words.
19792 *
19793 * @static
19794 * @memberOf _
19795 * @since 3.0.0
19796 * @category String
19797 * @param {string} [string=''] The string to inspect.
19798 * @param {RegExp|string} [pattern] The pattern to match words.
19799 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
19800 * @returns {Array} Returns the words of `string`.
19801 * @example
19802 *
19803 * _.words('fred, barney, & pebbles');
19804 * // => ['fred', 'barney', 'pebbles']
19805 *
19806 * _.words('fred, barney, & pebbles', /[^, ]+/g);
19807 * // => ['fred', 'barney', '&', 'pebbles']
19808 */
19809function words(string, pattern, guard) {
19810 string = toString(string);
19811 pattern = guard ? undefined : pattern;
19812
19813 if (pattern === undefined) {
19814 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
19815 }
19816 return string.match(pattern) || [];
19817}
19818
19819module.exports = words;
19820
19821
19822/***/ }),
19823
19824/***/ "f4d9":
19825/***/ (function(module, exports) {
19826
19827/** Used to compose unicode character classes. */
19828var rsAstralRange = '\\ud800-\\udfff',
19829 rsComboMarksRange = '\\u0300-\\u036f',
19830 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
19831 rsComboSymbolsRange = '\\u20d0-\\u20ff',
19832 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
19833 rsDingbatRange = '\\u2700-\\u27bf',
19834 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
19835 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
19836 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
19837 rsPunctuationRange = '\\u2000-\\u206f',
19838 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
19839 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
19840 rsVarRange = '\\ufe0e\\ufe0f',
19841 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
19842
19843/** Used to compose unicode capture groups. */
19844var rsApos = "['\u2019]",
19845 rsBreak = '[' + rsBreakRange + ']',
19846 rsCombo = '[' + rsComboRange + ']',
19847 rsDigits = '\\d+',
19848 rsDingbat = '[' + rsDingbatRange + ']',
19849 rsLower = '[' + rsLowerRange + ']',
19850 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
19851 rsFitz = '\\ud83c[\\udffb-\\udfff]',
19852 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
19853 rsNonAstral = '[^' + rsAstralRange + ']',
19854 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
19855 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
19856 rsUpper = '[' + rsUpperRange + ']',
19857 rsZWJ = '\\u200d';
19858
19859/** Used to compose unicode regexes. */
19860var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
19861 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
19862 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
19863 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
19864 reOptMod = rsModifier + '?',
19865 rsOptVar = '[' + rsVarRange + ']?',
19866 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
19867 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
19868 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
19869 rsSeq = rsOptVar + reOptMod + rsOptJoin,
19870 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
19871
19872/** Used to match complex or compound words. */
19873var reUnicodeWord = RegExp([
19874 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
19875 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
19876 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
19877 rsUpper + '+' + rsOptContrUpper,
19878 rsOrdUpper,
19879 rsOrdLower,
19880 rsDigits,
19881 rsEmoji
19882].join('|'), 'g');
19883
19884/**
19885 * Splits a Unicode `string` into an array of its words.
19886 *
19887 * @private
19888 * @param {string} The string to inspect.
19889 * @returns {Array} Returns the words of `string`.
19890 */
19891function unicodeWords(string) {
19892 return string.match(reUnicodeWord) || [];
19893}
19894
19895module.exports = unicodeWords;
19896
19897
19898/***/ }),
19899
19900/***/ "fae3":
19901/***/ (function(module, __webpack_exports__, __webpack_require__) {
19902
19903"use strict";
19904__webpack_require__.r(__webpack_exports__);
19905
19906// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
19907// This file is imported into lib/wc client bundles.
19908
19909if (typeof window !== 'undefined') {
19910 var i
19911 if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
19912 __webpack_require__.p = i[1] // eslint-disable-line
19913 }
19914}
19915
19916// Indicate to webpack that this file can be concatenated
19917/* harmony default export */ var setPublicPath = (null);
19918
19919// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
19920var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
19921var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
19922
19923// EXTERNAL MODULE: ./node_modules/lodash/upperFirst.js
19924var upperFirst = __webpack_require__("8103");
19925var upperFirst_default = /*#__PURE__*/__webpack_require__.n(upperFirst);
19926
19927// EXTERNAL MODULE: ./node_modules/lodash/camelCase.js
19928var camelCase = __webpack_require__("bba4");
19929var camelCase_default = /*#__PURE__*/__webpack_require__.n(camelCase);
19930
19931// CONCATENATED MODULE: ./src/components/_globals.js
19932
19933
19934 // https://webpack.js.org/guides/dependency-management/#require-context
19935
19936var requireComponent = __webpack_require__("b526"); // For each matching file name...
19937
19938
19939requireComponent.keys().forEach(function (fileName) {
19940 // Get the component config
19941 var componentConfig = requireComponent(fileName); // Get the PascalCase version of the component name
19942
19943 var componentName = upperFirst_default()(camelCase_default()(fileName // Remove the "./_" from the beginning
19944 .replace(/^\.\/_/, '') // Remove the file extension from the end
19945 .replace(/\.\w+$/, ''))); // Globally register the component
19946
19947 external_commonjs_vue_commonjs2_vue_root_Vue_default.a.component(componentName, componentConfig.default || componentConfig);
19948});
19949// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
19950
19951
19952
19953
19954/***/ }),
19955
19956/***/ "ff9e":
19957/***/ (function(module, exports, __webpack_require__) {
19958
19959// extracted by mini-css-extract-plugin
19960
19961/***/ }),
19962
19963/***/ "ffd6":
19964/***/ (function(module, exports, __webpack_require__) {
19965
19966var baseGetTag = __webpack_require__("3729"),
19967 isObjectLike = __webpack_require__("1310");
19968
19969/** `Object#toString` result references. */
19970var symbolTag = '[object Symbol]';
19971
19972/**
19973 * Checks if `value` is classified as a `Symbol` primitive or object.
19974 *
19975 * @static
19976 * @memberOf _
19977 * @since 4.0.0
19978 * @category Lang
19979 * @param {*} value The value to check.
19980 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
19981 * @example
19982 *
19983 * _.isSymbol(Symbol.iterator);
19984 * // => true
19985 *
19986 * _.isSymbol('abc');
19987 * // => false
19988 */
19989function isSymbol(value) {
19990 return typeof value == 'symbol' ||
19991 (isObjectLike(value) && baseGetTag(value) == symbolTag);
19992}
19993
19994module.exports = isSymbol;
19995
19996
19997/***/ })
19998
19999/******/ });
20000});
20001//# sourceMappingURL=index.umd.js.map
\No newline at end of file