@eva/plugin-evax 1.2.7-editor.9 → 1.2.7-fix.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,173 +1,216 @@
1
- window.EVA = window.EVA || {};
2
- window.EVA.plugin = window.EVA.plugin || {};
3
-
4
- var _EVA_IIFE_EVAX = function (exports, eva_js) {
5
- 'use strict';
6
-
7
- var _extendStatics = function extendStatics(d, b) {
8
- _extendStatics = Object.setPrototypeOf || {
9
- __proto__: []
10
- } instanceof Array && function (d, b) {
11
- d.__proto__ = b;
12
- } || function (d, b) {
13
- for (var p in b) {
14
- if (b.hasOwnProperty(p)) d[p] = b[p];
15
- }
16
- };
17
-
18
- return _extendStatics(d, b);
19
- };
20
-
21
- function __extends(d, b) {
22
- _extendStatics(d, b);
23
-
24
- function __() {
25
- this.constructor = d;
26
- }
27
-
28
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29
- }
30
-
31
- function __decorate(decorators, target, key, desc) {
32
- var c = arguments.length,
33
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
34
- d;
35
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
36
- if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
37
- }
38
- return c > 3 && r && Object.defineProperty(target, key, r), r;
39
- }
40
-
41
- function __values(o) {
42
- var s = typeof Symbol === "function" && Symbol.iterator,
43
- m = s && o[s],
44
- i = 0;
45
- if (m) return m.call(o);
46
- if (o && typeof o.length === "number") return {
47
- next: function next() {
48
- if (o && i >= o.length) o = void 0;
49
- return {
50
- value: o && o[i++],
51
- done: !o
52
- };
53
- }
54
- };
55
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
56
- }
57
-
58
- function __read(o, n) {
59
- var m = typeof Symbol === "function" && o[Symbol.iterator];
60
- if (!m) return o;
61
- var i = m.call(o),
62
- r,
63
- ar = [],
64
- e;
65
-
66
- try {
67
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
68
- ar.push(r.value);
69
- }
70
- } catch (error) {
71
- e = {
72
- error: error
73
- };
74
- } finally {
75
- try {
76
- if (r && !r.done && (m = i["return"])) m.call(i);
77
- } finally {
78
- if (e) throw e.error;
79
- }
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@eva/eva.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@eva/eva.js'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.EVA = global.EVA || {}, global.EVA.plugin = global.EVA.plugin || {}, global.EVA.plugin.EVAX = {}), global.EVA));
5
+ }(this, (function (exports, eva_js) { 'use strict';
6
+
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+
36
+ function __decorate(decorators, target, key, desc) {
37
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
38
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
39
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
40
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
41
+ }
42
+
43
+ function __values(o) {
44
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
45
+ if (m) return m.call(o);
46
+ if (o && typeof o.length === "number") return {
47
+ next: function () {
48
+ if (o && i >= o.length) o = void 0;
49
+ return { value: o && o[i++], done: !o };
50
+ }
51
+ };
52
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
53
+ }
54
+
55
+ function __read(o, n) {
56
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
57
+ if (!m) return o;
58
+ var i = m.call(o), r, ar = [], e;
59
+ try {
60
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
61
+ }
62
+ catch (error) { e = { error: error }; }
63
+ finally {
64
+ try {
65
+ if (r && !r.done && (m = i["return"])) m.call(i);
66
+ }
67
+ finally { if (e) throw e.error; }
68
+ }
69
+ return ar;
70
+ }
71
+
72
+ function __spread() {
73
+ for (var ar = [], i = 0; i < arguments.length; i++)
74
+ ar = ar.concat(__read(arguments[i]));
75
+ return ar;
80
76
  }
81
77
 
82
- return ar;
83
- }
84
-
85
- function __spread() {
86
- for (var ar = [], i = 0; i < arguments.length; i++) {
87
- ar = ar.concat(__read(arguments[i]));
78
+ var EvaXComponent = (function (_super) {
79
+ __extends(EvaXComponent, _super);
80
+ function EvaXComponent(gameObject) {
81
+ var _this = _super.call(this, gameObject) || this;
82
+ _this.events = {};
83
+ return _this;
84
+ }
85
+ EvaXComponent.prototype.init = function (option) {
86
+ if (option === void 0) { option = { events: {} }; }
87
+ var events = option.events;
88
+ this.events = events || {};
89
+ };
90
+ EvaXComponent.componentName = 'EvaX';
91
+ __decorate([
92
+ eva_js.decorators.IDEProp
93
+ ], EvaXComponent.prototype, "events", void 0);
94
+ return EvaXComponent;
95
+ }(eva_js.Component));
96
+ var EvaXComponent$1 = EvaXComponent;
97
+
98
+ function createCommonjsModule(fn) {
99
+ var module = { exports: {} };
100
+ return fn(module, module.exports), module.exports;
88
101
  }
89
102
 
90
- return ar;
91
- }
92
-
93
- var EvaXComponent = function (_super) {
94
- __extends(EvaXComponent, _super);
95
-
96
- function EvaXComponent(gameObject) {
97
- var _this = _super.call(this, gameObject) || this;
98
-
99
- _this.events = {};
100
- return _this;
101
- }
102
-
103
- EvaXComponent.prototype.init = function (option) {
104
- if (option === void 0) {
105
- option = {
106
- events: {}
107
- };
108
- }
109
-
110
- var events = option.events;
111
- this.events = events || {};
112
- };
113
-
114
- EvaXComponent.componentName = 'EvaX';
115
- return EvaXComponent;
116
- }(eva_js.Component);
103
+ var eventemitter3 = createCommonjsModule(function (module) {
117
104
 
118
- var EvaXComponent$1 = EvaXComponent;
119
-
120
- function createCommonjsModule(fn) {
121
- var module = {
122
- exports: {}
123
- };
124
- return fn(module, module.exports), module.exports;
125
- }
126
-
127
- var eventemitter3 = createCommonjsModule(function (module) {
128
- var has = Object.prototype.hasOwnProperty,
129
- prefix = '~';
105
+ var has = Object.prototype.hasOwnProperty
106
+ , prefix = '~';
130
107
 
108
+ /**
109
+ * Constructor to create a storage for our `EE` objects.
110
+ * An `Events` instance is a plain object whose properties are event names.
111
+ *
112
+ * @constructor
113
+ * @private
114
+ */
131
115
  function Events() {}
132
116
 
117
+ //
118
+ // We try to not inherit from `Object.prototype`. In some engines creating an
119
+ // instance in this way is faster than calling `Object.create(null)` directly.
120
+ // If `Object.create(null)` is not supported we prefix the event names with a
121
+ // character to make sure that the built-in object properties are not
122
+ // overridden or used as an attack vector.
123
+ //
133
124
  if (Object.create) {
134
125
  Events.prototype = Object.create(null);
126
+
127
+ //
128
+ // This hack is needed because the `__proto__` property is still inherited in
129
+ // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
130
+ //
135
131
  if (!new Events().__proto__) prefix = false;
136
132
  }
137
133
 
134
+ /**
135
+ * Representation of a single event listener.
136
+ *
137
+ * @param {Function} fn The listener function.
138
+ * @param {*} context The context to invoke the listener with.
139
+ * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
140
+ * @constructor
141
+ * @private
142
+ */
138
143
  function EE(fn, context, once) {
139
144
  this.fn = fn;
140
145
  this.context = context;
141
146
  this.once = once || false;
142
147
  }
143
148
 
149
+ /**
150
+ * Add a listener for a given event.
151
+ *
152
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
153
+ * @param {(String|Symbol)} event The event name.
154
+ * @param {Function} fn The listener function.
155
+ * @param {*} context The context to invoke the listener with.
156
+ * @param {Boolean} once Specify if the listener is a one-time listener.
157
+ * @returns {EventEmitter}
158
+ * @private
159
+ */
144
160
  function addListener(emitter, event, fn, context, once) {
145
161
  if (typeof fn !== 'function') {
146
162
  throw new TypeError('The listener must be a function');
147
163
  }
148
164
 
149
- var listener = new EE(fn, context || emitter, once),
150
- evt = prefix ? prefix + event : event;
151
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];
165
+ var listener = new EE(fn, context || emitter, once)
166
+ , evt = prefix ? prefix + event : event;
167
+
168
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
169
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
170
+ else emitter._events[evt] = [emitter._events[evt], listener];
171
+
152
172
  return emitter;
153
173
  }
154
174
 
175
+ /**
176
+ * Clear event by name.
177
+ *
178
+ * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
179
+ * @param {(String|Symbol)} evt The Event name.
180
+ * @private
181
+ */
155
182
  function clearEvent(emitter, evt) {
156
- if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];
183
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
184
+ else delete emitter._events[evt];
157
185
  }
158
186
 
187
+ /**
188
+ * Minimal `EventEmitter` interface that is molded against the Node.js
189
+ * `EventEmitter` interface.
190
+ *
191
+ * @constructor
192
+ * @public
193
+ */
159
194
  function EventEmitter() {
160
195
  this._events = new Events();
161
196
  this._eventsCount = 0;
162
197
  }
163
198
 
199
+ /**
200
+ * Return an array listing the events for which the emitter has registered
201
+ * listeners.
202
+ *
203
+ * @returns {Array}
204
+ * @public
205
+ */
164
206
  EventEmitter.prototype.eventNames = function eventNames() {
165
- var names = [],
166
- events,
167
- name;
207
+ var names = []
208
+ , events
209
+ , name;
210
+
168
211
  if (this._eventsCount === 0) return names;
169
212
 
170
- for (name in events = this._events) {
213
+ for (name in (events = this._events)) {
171
214
  if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
172
215
  }
173
216
 
@@ -178,9 +221,17 @@ var _EVA_IIFE_EVAX = function (exports, eva_js) {
178
221
  return names;
179
222
  };
180
223
 
224
+ /**
225
+ * Return the listeners registered for a given event.
226
+ *
227
+ * @param {(String|Symbol)} event The event name.
228
+ * @returns {Array} The registered listeners.
229
+ * @public
230
+ */
181
231
  EventEmitter.prototype.listeners = function listeners(event) {
182
- var evt = prefix ? prefix + event : event,
183
- handlers = this._events[evt];
232
+ var evt = prefix ? prefix + event : event
233
+ , handlers = this._events[evt];
234
+
184
235
  if (!handlers) return [];
185
236
  if (handlers.fn) return [handlers.fn];
186
237
 
@@ -191,78 +242,73 @@ var _EVA_IIFE_EVAX = function (exports, eva_js) {
191
242
  return ee;
192
243
  };
193
244
 
245
+ /**
246
+ * Return the number of listeners listening to a given event.
247
+ *
248
+ * @param {(String|Symbol)} event The event name.
249
+ * @returns {Number} The number of listeners.
250
+ * @public
251
+ */
194
252
  EventEmitter.prototype.listenerCount = function listenerCount(event) {
195
- var evt = prefix ? prefix + event : event,
196
- listeners = this._events[evt];
253
+ var evt = prefix ? prefix + event : event
254
+ , listeners = this._events[evt];
255
+
197
256
  if (!listeners) return 0;
198
257
  if (listeners.fn) return 1;
199
258
  return listeners.length;
200
259
  };
201
260
 
261
+ /**
262
+ * Calls each of the listeners registered for a given event.
263
+ *
264
+ * @param {(String|Symbol)} event The event name.
265
+ * @returns {Boolean} `true` if the event had listeners, else `false`.
266
+ * @public
267
+ */
202
268
  EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
203
269
  var evt = prefix ? prefix + event : event;
270
+
204
271
  if (!this._events[evt]) return false;
205
- var listeners = this._events[evt],
206
- len = arguments.length,
207
- args,
208
- i;
272
+
273
+ var listeners = this._events[evt]
274
+ , len = arguments.length
275
+ , args
276
+ , i;
209
277
 
210
278
  if (listeners.fn) {
211
279
  if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
212
280
 
213
281
  switch (len) {
214
- case 1:
215
- return listeners.fn.call(listeners.context), true;
216
-
217
- case 2:
218
- return listeners.fn.call(listeners.context, a1), true;
219
-
220
- case 3:
221
- return listeners.fn.call(listeners.context, a1, a2), true;
222
-
223
- case 4:
224
- return listeners.fn.call(listeners.context, a1, a2, a3), true;
225
-
226
- case 5:
227
- return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
228
-
229
- case 6:
230
- return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
282
+ case 1: return listeners.fn.call(listeners.context), true;
283
+ case 2: return listeners.fn.call(listeners.context, a1), true;
284
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
285
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
286
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
287
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
231
288
  }
232
289
 
233
- for (i = 1, args = new Array(len - 1); i < len; i++) {
290
+ for (i = 1, args = new Array(len -1); i < len; i++) {
234
291
  args[i - 1] = arguments[i];
235
292
  }
236
293
 
237
294
  listeners.fn.apply(listeners.context, args);
238
295
  } else {
239
- var length = listeners.length,
240
- j;
296
+ var length = listeners.length
297
+ , j;
241
298
 
242
299
  for (i = 0; i < length; i++) {
243
300
  if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
244
301
 
245
302
  switch (len) {
246
- case 1:
247
- listeners[i].fn.call(listeners[i].context);
248
- break;
249
-
250
- case 2:
251
- listeners[i].fn.call(listeners[i].context, a1);
252
- break;
253
-
254
- case 3:
255
- listeners[i].fn.call(listeners[i].context, a1, a2);
256
- break;
257
-
258
- case 4:
259
- listeners[i].fn.call(listeners[i].context, a1, a2, a3);
260
- break;
261
-
303
+ case 1: listeners[i].fn.call(listeners[i].context); break;
304
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
305
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
306
+ case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
262
307
  default:
263
- if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
308
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
264
309
  args[j - 1] = arguments[j];
265
310
  }
311
+
266
312
  listeners[i].fn.apply(listeners[i].context, args);
267
313
  }
268
314
  }
@@ -271,18 +317,46 @@ var _EVA_IIFE_EVAX = function (exports, eva_js) {
271
317
  return true;
272
318
  };
273
319
 
320
+ /**
321
+ * Add a listener for a given event.
322
+ *
323
+ * @param {(String|Symbol)} event The event name.
324
+ * @param {Function} fn The listener function.
325
+ * @param {*} [context=this] The context to invoke the listener with.
326
+ * @returns {EventEmitter} `this`.
327
+ * @public
328
+ */
274
329
  EventEmitter.prototype.on = function on(event, fn, context) {
275
330
  return addListener(this, event, fn, context, false);
276
331
  };
277
332
 
333
+ /**
334
+ * Add a one-time listener for a given event.
335
+ *
336
+ * @param {(String|Symbol)} event The event name.
337
+ * @param {Function} fn The listener function.
338
+ * @param {*} [context=this] The context to invoke the listener with.
339
+ * @returns {EventEmitter} `this`.
340
+ * @public
341
+ */
278
342
  EventEmitter.prototype.once = function once(event, fn, context) {
279
343
  return addListener(this, event, fn, context, true);
280
344
  };
281
345
 
346
+ /**
347
+ * Remove the listeners of a given event.
348
+ *
349
+ * @param {(String|Symbol)} event The event name.
350
+ * @param {Function} fn Only remove the listeners that match this function.
351
+ * @param {*} context Only remove the listeners that have this context.
352
+ * @param {Boolean} once Only remove one-time listeners.
353
+ * @returns {EventEmitter} `this`.
354
+ * @public
355
+ */
282
356
  EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
283
357
  var evt = prefix ? prefix + event : event;
284
- if (!this._events[evt]) return this;
285
358
 
359
+ if (!this._events[evt]) return this;
286
360
  if (!fn) {
287
361
  clearEvent(this, evt);
288
362
  return this;
@@ -291,22 +365,41 @@ var _EVA_IIFE_EVAX = function (exports, eva_js) {
291
365
  var listeners = this._events[evt];
292
366
 
293
367
  if (listeners.fn) {
294
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
368
+ if (
369
+ listeners.fn === fn &&
370
+ (!once || listeners.once) &&
371
+ (!context || listeners.context === context)
372
+ ) {
295
373
  clearEvent(this, evt);
296
374
  }
297
375
  } else {
298
376
  for (var i = 0, events = [], length = listeners.length; i < length; i++) {
299
- if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
377
+ if (
378
+ listeners[i].fn !== fn ||
379
+ (once && !listeners[i].once) ||
380
+ (context && listeners[i].context !== context)
381
+ ) {
300
382
  events.push(listeners[i]);
301
383
  }
302
384
  }
303
385
 
304
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);
386
+ //
387
+ // Reset the array, or remove it completely if we have no more listeners.
388
+ //
389
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
390
+ else clearEvent(this, evt);
305
391
  }
306
392
 
307
393
  return this;
308
394
  };
309
395
 
396
+ /**
397
+ * Remove all listeners, or those of the specified event.
398
+ *
399
+ * @param {(String|Symbol)} [event] The event name.
400
+ * @returns {EventEmitter} `this`.
401
+ * @public
402
+ */
310
403
  EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
311
404
  var evt;
312
405
 
@@ -321,1402 +414,2547 @@ var _EVA_IIFE_EVAX = function (exports, eva_js) {
321
414
  return this;
322
415
  };
323
416
 
417
+ //
418
+ // Alias methods names because people roll like that.
419
+ //
324
420
  EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
325
421
  EventEmitter.prototype.addListener = EventEmitter.prototype.on;
422
+
423
+ //
424
+ // Expose the prefix.
425
+ //
326
426
  EventEmitter.prefixed = prefix;
427
+
428
+ //
429
+ // Allow `EventEmitter` to be imported as module namespace.
430
+ //
327
431
  EventEmitter.EventEmitter = EventEmitter;
432
+
433
+ //
434
+ // Expose the module.
435
+ //
328
436
  {
329
437
  module.exports = EventEmitter;
330
438
  }
331
- });
332
- var EventEmitter = eventemitter3;
333
-
334
- function listCacheClear() {
335
- this.__data__ = [];
336
- this.size = 0;
337
- }
439
+ });
338
440
 
339
- function eq(value, other) {
340
- return value === other || value !== value && other !== other;
341
- }
441
+ var EventEmitter = eventemitter3;
442
+
443
+ /**
444
+ * Removes all key-value entries from the list cache.
445
+ *
446
+ * @private
447
+ * @name clear
448
+ * @memberOf ListCache
449
+ */
450
+ function listCacheClear() {
451
+ this.__data__ = [];
452
+ this.size = 0;
453
+ }
342
454
 
343
- function assocIndexOf(array, key) {
344
- var length = array.length;
455
+ /**
456
+ * Performs a
457
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
458
+ * comparison between two values to determine if they are equivalent.
459
+ *
460
+ * @static
461
+ * @memberOf _
462
+ * @since 4.0.0
463
+ * @category Lang
464
+ * @param {*} value The value to compare.
465
+ * @param {*} other The other value to compare.
466
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
467
+ * @example
468
+ *
469
+ * var object = { 'a': 1 };
470
+ * var other = { 'a': 1 };
471
+ *
472
+ * _.eq(object, object);
473
+ * // => true
474
+ *
475
+ * _.eq(object, other);
476
+ * // => false
477
+ *
478
+ * _.eq('a', 'a');
479
+ * // => true
480
+ *
481
+ * _.eq('a', Object('a'));
482
+ * // => false
483
+ *
484
+ * _.eq(NaN, NaN);
485
+ * // => true
486
+ */
487
+ function eq(value, other) {
488
+ return value === other || (value !== value && other !== other);
489
+ }
345
490
 
346
- while (length--) {
347
- if (eq(array[length][0], key)) {
348
- return length;
491
+ /**
492
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
493
+ *
494
+ * @private
495
+ * @param {Array} array The array to inspect.
496
+ * @param {*} key The key to search for.
497
+ * @returns {number} Returns the index of the matched value, else `-1`.
498
+ */
499
+ function assocIndexOf(array, key) {
500
+ var length = array.length;
501
+ while (length--) {
502
+ if (eq(array[length][0], key)) {
503
+ return length;
504
+ }
349
505
  }
506
+ return -1;
350
507
  }
351
508
 
352
- return -1;
353
- }
354
-
355
- var arrayProto = Array.prototype;
356
- var splice = arrayProto.splice;
509
+ /** Used for built-in method references. */
510
+ var arrayProto = Array.prototype;
511
+
512
+ /** Built-in value references. */
513
+ var splice = arrayProto.splice;
514
+
515
+ /**
516
+ * Removes `key` and its value from the list cache.
517
+ *
518
+ * @private
519
+ * @name delete
520
+ * @memberOf ListCache
521
+ * @param {string} key The key of the value to remove.
522
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
523
+ */
524
+ function listCacheDelete(key) {
525
+ var data = this.__data__,
526
+ index = assocIndexOf(data, key);
527
+
528
+ if (index < 0) {
529
+ return false;
530
+ }
531
+ var lastIndex = data.length - 1;
532
+ if (index == lastIndex) {
533
+ data.pop();
534
+ } else {
535
+ splice.call(data, index, 1);
536
+ }
537
+ --this.size;
538
+ return true;
539
+ }
357
540
 
358
- function listCacheDelete(key) {
359
- var data = this.__data__,
360
- index = assocIndexOf(data, key);
541
+ /**
542
+ * Gets the list cache value for `key`.
543
+ *
544
+ * @private
545
+ * @name get
546
+ * @memberOf ListCache
547
+ * @param {string} key The key of the value to get.
548
+ * @returns {*} Returns the entry value.
549
+ */
550
+ function listCacheGet(key) {
551
+ var data = this.__data__,
552
+ index = assocIndexOf(data, key);
553
+
554
+ return index < 0 ? undefined : data[index][1];
555
+ }
361
556
 
362
- if (index < 0) {
363
- return false;
557
+ /**
558
+ * Checks if a list cache value for `key` exists.
559
+ *
560
+ * @private
561
+ * @name has
562
+ * @memberOf ListCache
563
+ * @param {string} key The key of the entry to check.
564
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
565
+ */
566
+ function listCacheHas(key) {
567
+ return assocIndexOf(this.__data__, key) > -1;
364
568
  }
365
569
 
366
- var lastIndex = data.length - 1;
367
-
368
- if (index == lastIndex) {
369
- data.pop();
370
- } else {
371
- splice.call(data, index, 1);
372
- }
373
-
374
- --this.size;
375
- return true;
376
- }
377
-
378
- function listCacheGet(key) {
379
- var data = this.__data__,
380
- index = assocIndexOf(data, key);
381
- return index < 0 ? undefined : data[index][1];
382
- }
383
-
384
- function listCacheHas(key) {
385
- return assocIndexOf(this.__data__, key) > -1;
386
- }
387
-
388
- function listCacheSet(key, value) {
389
- var data = this.__data__,
390
- index = assocIndexOf(data, key);
391
-
392
- if (index < 0) {
393
- ++this.size;
394
- data.push([key, value]);
395
- } else {
396
- data[index][1] = value;
397
- }
398
-
399
- return this;
400
- }
401
-
402
- function ListCache(entries) {
403
- var index = -1,
404
- length = entries == null ? 0 : entries.length;
405
- this.clear();
406
-
407
- while (++index < length) {
408
- var entry = entries[index];
409
- this.set(entry[0], entry[1]);
410
- }
411
- }
412
-
413
- ListCache.prototype.clear = listCacheClear;
414
- ListCache.prototype['delete'] = listCacheDelete;
415
- ListCache.prototype.get = listCacheGet;
416
- ListCache.prototype.has = listCacheHas;
417
- ListCache.prototype.set = listCacheSet;
418
-
419
- function stackClear() {
420
- this.__data__ = new ListCache();
421
- this.size = 0;
422
- }
423
-
424
- function stackDelete(key) {
425
- var data = this.__data__,
426
- result = data['delete'](key);
427
- this.size = data.size;
428
- return result;
429
- }
430
-
431
- function stackGet(key) {
432
- return this.__data__.get(key);
433
- }
434
-
435
- function stackHas(key) {
436
- return this.__data__.has(key);
437
- }
438
-
439
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
440
- var freeGlobal$1 = freeGlobal;
441
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
442
- var root = freeGlobal$1 || freeSelf || Function('return this')();
443
- var root$1 = root;
444
- var Symbol$1 = root$1.Symbol;
445
- var Symbol$2 = Symbol$1;
446
- var objectProto$c = Object.prototype;
447
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
448
- var nativeObjectToString$1 = objectProto$c.toString;
449
- var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
450
-
451
- function getRawTag(value) {
452
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
453
- tag = value[symToStringTag$1];
454
-
455
- try {
456
- value[symToStringTag$1] = undefined;
457
- var unmasked = true;
458
- } catch (e) {}
459
-
460
- var result = nativeObjectToString$1.call(value);
461
-
462
- if (unmasked) {
463
- if (isOwn) {
464
- value[symToStringTag$1] = tag;
570
+ /**
571
+ * Sets the list cache `key` to `value`.
572
+ *
573
+ * @private
574
+ * @name set
575
+ * @memberOf ListCache
576
+ * @param {string} key The key of the value to set.
577
+ * @param {*} value The value to set.
578
+ * @returns {Object} Returns the list cache instance.
579
+ */
580
+ function listCacheSet(key, value) {
581
+ var data = this.__data__,
582
+ index = assocIndexOf(data, key);
583
+
584
+ if (index < 0) {
585
+ ++this.size;
586
+ data.push([key, value]);
465
587
  } else {
466
- delete value[symToStringTag$1];
588
+ data[index][1] = value;
467
589
  }
590
+ return this;
468
591
  }
469
592
 
470
- return result;
471
- }
593
+ /**
594
+ * Creates an list cache object.
595
+ *
596
+ * @private
597
+ * @constructor
598
+ * @param {Array} [entries] The key-value pairs to cache.
599
+ */
600
+ function ListCache(entries) {
601
+ var index = -1,
602
+ length = entries == null ? 0 : entries.length;
603
+
604
+ this.clear();
605
+ while (++index < length) {
606
+ var entry = entries[index];
607
+ this.set(entry[0], entry[1]);
608
+ }
609
+ }
472
610
 
473
- var objectProto$b = Object.prototype;
474
- var nativeObjectToString = objectProto$b.toString;
611
+ // Add methods to `ListCache`.
612
+ ListCache.prototype.clear = listCacheClear;
613
+ ListCache.prototype['delete'] = listCacheDelete;
614
+ ListCache.prototype.get = listCacheGet;
615
+ ListCache.prototype.has = listCacheHas;
616
+ ListCache.prototype.set = listCacheSet;
617
+
618
+ /**
619
+ * Removes all key-value entries from the stack.
620
+ *
621
+ * @private
622
+ * @name clear
623
+ * @memberOf Stack
624
+ */
625
+ function stackClear() {
626
+ this.__data__ = new ListCache;
627
+ this.size = 0;
628
+ }
475
629
 
476
- function objectToString(value) {
477
- return nativeObjectToString.call(value);
478
- }
630
+ /**
631
+ * Removes `key` and its value from the stack.
632
+ *
633
+ * @private
634
+ * @name delete
635
+ * @memberOf Stack
636
+ * @param {string} key The key of the value to remove.
637
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
638
+ */
639
+ function stackDelete(key) {
640
+ var data = this.__data__,
641
+ result = data['delete'](key);
642
+
643
+ this.size = data.size;
644
+ return result;
645
+ }
479
646
 
480
- var nullTag = '[object Null]',
481
- undefinedTag = '[object Undefined]';
482
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
647
+ /**
648
+ * Gets the stack value for `key`.
649
+ *
650
+ * @private
651
+ * @name get
652
+ * @memberOf Stack
653
+ * @param {string} key The key of the value to get.
654
+ * @returns {*} Returns the entry value.
655
+ */
656
+ function stackGet(key) {
657
+ return this.__data__.get(key);
658
+ }
483
659
 
484
- function baseGetTag(value) {
485
- if (value == null) {
486
- return value === undefined ? undefinedTag : nullTag;
660
+ /**
661
+ * Checks if a stack value for `key` exists.
662
+ *
663
+ * @private
664
+ * @name has
665
+ * @memberOf Stack
666
+ * @param {string} key The key of the entry to check.
667
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
668
+ */
669
+ function stackHas(key) {
670
+ return this.__data__.has(key);
487
671
  }
488
672
 
489
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
490
- }
673
+ /** Detect free variable `global` from Node.js. */
674
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
491
675
 
492
- function isObject(value) {
493
- var type = typeof value;
494
- return value != null && (type == 'object' || type == 'function');
495
- }
676
+ var freeGlobal$1 = freeGlobal;
496
677
 
497
- var asyncTag = '[object AsyncFunction]',
498
- funcTag$2 = '[object Function]',
499
- genTag$1 = '[object GeneratorFunction]',
500
- proxyTag = '[object Proxy]';
678
+ /** Detect free variable `self`. */
679
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
501
680
 
502
- function isFunction(value) {
503
- if (!isObject(value)) {
504
- return false;
505
- }
681
+ /** Used as a reference to the global object. */
682
+ var root = freeGlobal$1 || freeSelf || Function('return this')();
506
683
 
507
- var tag = baseGetTag(value);
508
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
509
- }
684
+ var root$1 = root;
510
685
 
511
- var coreJsData = root$1['__core-js_shared__'];
512
- var coreJsData$1 = coreJsData;
686
+ /** Built-in value references. */
687
+ var Symbol$1 = root$1.Symbol;
513
688
 
514
- var maskSrcKey = function () {
515
- var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
516
- return uid ? 'Symbol(src)_1.' + uid : '';
517
- }();
689
+ var Symbol$2 = Symbol$1;
518
690
 
519
- function isMasked(func) {
520
- return !!maskSrcKey && maskSrcKey in func;
521
- }
691
+ /** Used for built-in method references. */
692
+ var objectProto$c = Object.prototype;
522
693
 
523
- var funcProto$1 = Function.prototype;
524
- var funcToString$1 = funcProto$1.toString;
694
+ /** Used to check objects for own properties. */
695
+ var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
525
696
 
526
- function toSource(func) {
527
- if (func != null) {
528
- try {
529
- return funcToString$1.call(func);
530
- } catch (e) {}
697
+ /**
698
+ * Used to resolve the
699
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
700
+ * of values.
701
+ */
702
+ var nativeObjectToString$1 = objectProto$c.toString;
531
703
 
532
- try {
533
- return func + '';
534
- } catch (e) {}
535
- }
704
+ /** Built-in value references. */
705
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
536
706
 
537
- return '';
538
- }
707
+ /**
708
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
709
+ *
710
+ * @private
711
+ * @param {*} value The value to query.
712
+ * @returns {string} Returns the raw `toStringTag`.
713
+ */
714
+ function getRawTag(value) {
715
+ var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
716
+ tag = value[symToStringTag$1];
539
717
 
540
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
541
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
542
- var funcProto = Function.prototype,
543
- objectProto$a = Object.prototype;
544
- var funcToString = funcProto.toString;
545
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
546
- var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
718
+ try {
719
+ value[symToStringTag$1] = undefined;
720
+ var unmasked = true;
721
+ } catch (e) {}
547
722
 
548
- function baseIsNative(value) {
549
- if (!isObject(value) || isMasked(value)) {
550
- return false;
723
+ var result = nativeObjectToString$1.call(value);
724
+ if (unmasked) {
725
+ if (isOwn) {
726
+ value[symToStringTag$1] = tag;
727
+ } else {
728
+ delete value[symToStringTag$1];
729
+ }
730
+ }
731
+ return result;
551
732
  }
552
733
 
553
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
554
- return pattern.test(toSource(value));
555
- }
556
-
557
- function getValue(object, key) {
558
- return object == null ? undefined : object[key];
559
- }
560
-
561
- function getNative(object, key) {
562
- var value = getValue(object, key);
563
- return baseIsNative(value) ? value : undefined;
564
- }
734
+ /** Used for built-in method references. */
735
+ var objectProto$b = Object.prototype;
736
+
737
+ /**
738
+ * Used to resolve the
739
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
740
+ * of values.
741
+ */
742
+ var nativeObjectToString = objectProto$b.toString;
743
+
744
+ /**
745
+ * Converts `value` to a string using `Object.prototype.toString`.
746
+ *
747
+ * @private
748
+ * @param {*} value The value to convert.
749
+ * @returns {string} Returns the converted string.
750
+ */
751
+ function objectToString(value) {
752
+ return nativeObjectToString.call(value);
753
+ }
565
754
 
566
- var Map$1 = getNative(root$1, 'Map');
567
- var Map$2 = Map$1;
568
- var nativeCreate = getNative(Object, 'create');
569
- var nativeCreate$1 = nativeCreate;
755
+ /** `Object#toString` result references. */
756
+ var nullTag = '[object Null]',
757
+ undefinedTag = '[object Undefined]';
758
+
759
+ /** Built-in value references. */
760
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
761
+
762
+ /**
763
+ * The base implementation of `getTag` without fallbacks for buggy environments.
764
+ *
765
+ * @private
766
+ * @param {*} value The value to query.
767
+ * @returns {string} Returns the `toStringTag`.
768
+ */
769
+ function baseGetTag(value) {
770
+ if (value == null) {
771
+ return value === undefined ? undefinedTag : nullTag;
772
+ }
773
+ return (symToStringTag && symToStringTag in Object(value))
774
+ ? getRawTag(value)
775
+ : objectToString(value);
776
+ }
570
777
 
571
- function hashClear() {
572
- this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
573
- this.size = 0;
574
- }
778
+ /**
779
+ * Checks if `value` is the
780
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
781
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
782
+ *
783
+ * @static
784
+ * @memberOf _
785
+ * @since 0.1.0
786
+ * @category Lang
787
+ * @param {*} value The value to check.
788
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
789
+ * @example
790
+ *
791
+ * _.isObject({});
792
+ * // => true
793
+ *
794
+ * _.isObject([1, 2, 3]);
795
+ * // => true
796
+ *
797
+ * _.isObject(_.noop);
798
+ * // => true
799
+ *
800
+ * _.isObject(null);
801
+ * // => false
802
+ */
803
+ function isObject(value) {
804
+ var type = typeof value;
805
+ return value != null && (type == 'object' || type == 'function');
806
+ }
575
807
 
576
- function hashDelete(key) {
577
- var result = this.has(key) && delete this.__data__[key];
578
- this.size -= result ? 1 : 0;
579
- return result;
580
- }
808
+ /** `Object#toString` result references. */
809
+ var asyncTag = '[object AsyncFunction]',
810
+ funcTag$2 = '[object Function]',
811
+ genTag$1 = '[object GeneratorFunction]',
812
+ proxyTag = '[object Proxy]';
813
+
814
+ /**
815
+ * Checks if `value` is classified as a `Function` object.
816
+ *
817
+ * @static
818
+ * @memberOf _
819
+ * @since 0.1.0
820
+ * @category Lang
821
+ * @param {*} value The value to check.
822
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
823
+ * @example
824
+ *
825
+ * _.isFunction(_);
826
+ * // => true
827
+ *
828
+ * _.isFunction(/abc/);
829
+ * // => false
830
+ */
831
+ function isFunction(value) {
832
+ if (!isObject(value)) {
833
+ return false;
834
+ }
835
+ // The use of `Object#toString` avoids issues with the `typeof` operator
836
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
837
+ var tag = baseGetTag(value);
838
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
839
+ }
581
840
 
582
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
583
- var objectProto$9 = Object.prototype;
584
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
841
+ /** Used to detect overreaching core-js shims. */
842
+ var coreJsData = root$1['__core-js_shared__'];
843
+
844
+ var coreJsData$1 = coreJsData;
845
+
846
+ /** Used to detect methods masquerading as native. */
847
+ var maskSrcKey = (function() {
848
+ var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
849
+ return uid ? ('Symbol(src)_1.' + uid) : '';
850
+ }());
851
+
852
+ /**
853
+ * Checks if `func` has its source masked.
854
+ *
855
+ * @private
856
+ * @param {Function} func The function to check.
857
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
858
+ */
859
+ function isMasked(func) {
860
+ return !!maskSrcKey && (maskSrcKey in func);
861
+ }
585
862
 
586
- function hashGet(key) {
587
- var data = this.__data__;
863
+ /** Used for built-in method references. */
864
+ var funcProto$1 = Function.prototype;
865
+
866
+ /** Used to resolve the decompiled source of functions. */
867
+ var funcToString$1 = funcProto$1.toString;
868
+
869
+ /**
870
+ * Converts `func` to its source code.
871
+ *
872
+ * @private
873
+ * @param {Function} func The function to convert.
874
+ * @returns {string} Returns the source code.
875
+ */
876
+ function toSource(func) {
877
+ if (func != null) {
878
+ try {
879
+ return funcToString$1.call(func);
880
+ } catch (e) {}
881
+ try {
882
+ return (func + '');
883
+ } catch (e) {}
884
+ }
885
+ return '';
886
+ }
588
887
 
589
- if (nativeCreate$1) {
590
- var result = data[key];
591
- return result === HASH_UNDEFINED$1 ? undefined : result;
888
+ /**
889
+ * Used to match `RegExp`
890
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
891
+ */
892
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
893
+
894
+ /** Used to detect host constructors (Safari). */
895
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
896
+
897
+ /** Used for built-in method references. */
898
+ var funcProto = Function.prototype,
899
+ objectProto$a = Object.prototype;
900
+
901
+ /** Used to resolve the decompiled source of functions. */
902
+ var funcToString = funcProto.toString;
903
+
904
+ /** Used to check objects for own properties. */
905
+ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
906
+
907
+ /** Used to detect if a method is native. */
908
+ var reIsNative = RegExp('^' +
909
+ funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
910
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
911
+ );
912
+
913
+ /**
914
+ * The base implementation of `_.isNative` without bad shim checks.
915
+ *
916
+ * @private
917
+ * @param {*} value The value to check.
918
+ * @returns {boolean} Returns `true` if `value` is a native function,
919
+ * else `false`.
920
+ */
921
+ function baseIsNative(value) {
922
+ if (!isObject(value) || isMasked(value)) {
923
+ return false;
924
+ }
925
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
926
+ return pattern.test(toSource(value));
592
927
  }
593
928
 
594
- return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
595
- }
929
+ /**
930
+ * Gets the value at `key` of `object`.
931
+ *
932
+ * @private
933
+ * @param {Object} [object] The object to query.
934
+ * @param {string} key The key of the property to get.
935
+ * @returns {*} Returns the property value.
936
+ */
937
+ function getValue(object, key) {
938
+ return object == null ? undefined : object[key];
939
+ }
596
940
 
597
- var objectProto$8 = Object.prototype;
598
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
941
+ /**
942
+ * Gets the native function at `key` of `object`.
943
+ *
944
+ * @private
945
+ * @param {Object} object The object to query.
946
+ * @param {string} key The key of the method to get.
947
+ * @returns {*} Returns the function if it's native, else `undefined`.
948
+ */
949
+ function getNative(object, key) {
950
+ var value = getValue(object, key);
951
+ return baseIsNative(value) ? value : undefined;
952
+ }
599
953
 
600
- function hashHas(key) {
601
- var data = this.__data__;
602
- return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$6.call(data, key);
603
- }
954
+ /* Built-in method references that are verified to be native. */
955
+ var Map$1 = getNative(root$1, 'Map');
604
956
 
605
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
957
+ var Map$2 = Map$1;
606
958
 
607
- function hashSet(key, value) {
608
- var data = this.__data__;
609
- this.size += this.has(key) ? 0 : 1;
610
- data[key] = nativeCreate$1 && value === undefined ? HASH_UNDEFINED : value;
611
- return this;
612
- }
959
+ /* Built-in method references that are verified to be native. */
960
+ var nativeCreate = getNative(Object, 'create');
613
961
 
614
- function Hash(entries) {
615
- var index = -1,
616
- length = entries == null ? 0 : entries.length;
617
- this.clear();
962
+ var nativeCreate$1 = nativeCreate;
618
963
 
619
- while (++index < length) {
620
- var entry = entries[index];
621
- this.set(entry[0], entry[1]);
964
+ /**
965
+ * Removes all key-value entries from the hash.
966
+ *
967
+ * @private
968
+ * @name clear
969
+ * @memberOf Hash
970
+ */
971
+ function hashClear() {
972
+ this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
973
+ this.size = 0;
622
974
  }
623
- }
624
975
 
625
- Hash.prototype.clear = hashClear;
626
- Hash.prototype['delete'] = hashDelete;
627
- Hash.prototype.get = hashGet;
628
- Hash.prototype.has = hashHas;
629
- Hash.prototype.set = hashSet;
976
+ /**
977
+ * Removes `key` and its value from the hash.
978
+ *
979
+ * @private
980
+ * @name delete
981
+ * @memberOf Hash
982
+ * @param {Object} hash The hash to modify.
983
+ * @param {string} key The key of the value to remove.
984
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
985
+ */
986
+ function hashDelete(key) {
987
+ var result = this.has(key) && delete this.__data__[key];
988
+ this.size -= result ? 1 : 0;
989
+ return result;
990
+ }
630
991
 
631
- function mapCacheClear() {
632
- this.size = 0;
633
- this.__data__ = {
634
- 'hash': new Hash(),
635
- 'map': new (Map$2 || ListCache)(),
636
- 'string': new Hash()
637
- };
638
- }
639
-
640
- function isKeyable(value) {
641
- var type = typeof value;
642
- return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
643
- }
644
-
645
- function getMapData(map, key) {
646
- var data = map.__data__;
647
- return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
648
- }
649
-
650
- function mapCacheDelete(key) {
651
- var result = getMapData(this, key)['delete'](key);
652
- this.size -= result ? 1 : 0;
653
- return result;
654
- }
655
-
656
- function mapCacheGet(key) {
657
- return getMapData(this, key).get(key);
658
- }
659
-
660
- function mapCacheHas(key) {
661
- return getMapData(this, key).has(key);
662
- }
663
-
664
- function mapCacheSet(key, value) {
665
- var data = getMapData(this, key),
666
- size = data.size;
667
- data.set(key, value);
668
- this.size += data.size == size ? 0 : 1;
669
- return this;
670
- }
671
-
672
- function MapCache(entries) {
673
- var index = -1,
674
- length = entries == null ? 0 : entries.length;
675
- this.clear();
676
-
677
- while (++index < length) {
678
- var entry = entries[index];
679
- this.set(entry[0], entry[1]);
680
- }
681
- }
682
-
683
- MapCache.prototype.clear = mapCacheClear;
684
- MapCache.prototype['delete'] = mapCacheDelete;
685
- MapCache.prototype.get = mapCacheGet;
686
- MapCache.prototype.has = mapCacheHas;
687
- MapCache.prototype.set = mapCacheSet;
688
- var LARGE_ARRAY_SIZE = 200;
689
-
690
- function stackSet(key, value) {
691
- var data = this.__data__;
692
-
693
- if (data instanceof ListCache) {
694
- var pairs = data.__data__;
695
-
696
- if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
697
- pairs.push([key, value]);
698
- this.size = ++data.size;
699
- return this;
992
+ /** Used to stand-in for `undefined` hash values. */
993
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
994
+
995
+ /** Used for built-in method references. */
996
+ var objectProto$9 = Object.prototype;
997
+
998
+ /** Used to check objects for own properties. */
999
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
1000
+
1001
+ /**
1002
+ * Gets the hash value for `key`.
1003
+ *
1004
+ * @private
1005
+ * @name get
1006
+ * @memberOf Hash
1007
+ * @param {string} key The key of the value to get.
1008
+ * @returns {*} Returns the entry value.
1009
+ */
1010
+ function hashGet(key) {
1011
+ var data = this.__data__;
1012
+ if (nativeCreate$1) {
1013
+ var result = data[key];
1014
+ return result === HASH_UNDEFINED$1 ? undefined : result;
700
1015
  }
701
-
702
- data = this.__data__ = new MapCache(pairs);
1016
+ return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
703
1017
  }
704
1018
 
705
- data.set(key, value);
706
- this.size = data.size;
707
- return this;
708
- }
709
-
710
- function Stack(entries) {
711
- var data = this.__data__ = new ListCache(entries);
712
- this.size = data.size;
713
- }
714
-
715
- Stack.prototype.clear = stackClear;
716
- Stack.prototype['delete'] = stackDelete;
717
- Stack.prototype.get = stackGet;
718
- Stack.prototype.has = stackHas;
719
- Stack.prototype.set = stackSet;
1019
+ /** Used for built-in method references. */
1020
+ var objectProto$8 = Object.prototype;
1021
+
1022
+ /** Used to check objects for own properties. */
1023
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
1024
+
1025
+ /**
1026
+ * Checks if a hash value for `key` exists.
1027
+ *
1028
+ * @private
1029
+ * @name has
1030
+ * @memberOf Hash
1031
+ * @param {string} key The key of the entry to check.
1032
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1033
+ */
1034
+ function hashHas(key) {
1035
+ var data = this.__data__;
1036
+ return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
1037
+ }
720
1038
 
721
- function arrayEach(array, iteratee) {
722
- var index = -1,
723
- length = array == null ? 0 : array.length;
1039
+ /** Used to stand-in for `undefined` hash values. */
1040
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
1041
+
1042
+ /**
1043
+ * Sets the hash `key` to `value`.
1044
+ *
1045
+ * @private
1046
+ * @name set
1047
+ * @memberOf Hash
1048
+ * @param {string} key The key of the value to set.
1049
+ * @param {*} value The value to set.
1050
+ * @returns {Object} Returns the hash instance.
1051
+ */
1052
+ function hashSet(key, value) {
1053
+ var data = this.__data__;
1054
+ this.size += this.has(key) ? 0 : 1;
1055
+ data[key] = (nativeCreate$1 && value === undefined) ? HASH_UNDEFINED : value;
1056
+ return this;
1057
+ }
724
1058
 
725
- while (++index < length) {
726
- if (iteratee(array[index], index, array) === false) {
727
- break;
1059
+ /**
1060
+ * Creates a hash object.
1061
+ *
1062
+ * @private
1063
+ * @constructor
1064
+ * @param {Array} [entries] The key-value pairs to cache.
1065
+ */
1066
+ function Hash(entries) {
1067
+ var index = -1,
1068
+ length = entries == null ? 0 : entries.length;
1069
+
1070
+ this.clear();
1071
+ while (++index < length) {
1072
+ var entry = entries[index];
1073
+ this.set(entry[0], entry[1]);
728
1074
  }
729
1075
  }
730
1076
 
731
- return array;
732
- }
733
-
734
- var defineProperty$1 = function () {
735
- try {
736
- var func = getNative(Object, 'defineProperty');
737
- func({}, '', {});
738
- return func;
739
- } catch (e) {}
740
- }();
741
-
742
- var defineProperty$2 = defineProperty$1;
1077
+ // Add methods to `Hash`.
1078
+ Hash.prototype.clear = hashClear;
1079
+ Hash.prototype['delete'] = hashDelete;
1080
+ Hash.prototype.get = hashGet;
1081
+ Hash.prototype.has = hashHas;
1082
+ Hash.prototype.set = hashSet;
1083
+
1084
+ /**
1085
+ * Removes all key-value entries from the map.
1086
+ *
1087
+ * @private
1088
+ * @name clear
1089
+ * @memberOf MapCache
1090
+ */
1091
+ function mapCacheClear() {
1092
+ this.size = 0;
1093
+ this.__data__ = {
1094
+ 'hash': new Hash,
1095
+ 'map': new (Map$2 || ListCache),
1096
+ 'string': new Hash
1097
+ };
1098
+ }
743
1099
 
744
- function baseAssignValue(object, key, value) {
745
- if (key == '__proto__' && defineProperty$2) {
746
- defineProperty$2(object, key, {
747
- 'configurable': true,
748
- 'enumerable': true,
749
- 'value': value,
750
- 'writable': true
751
- });
752
- } else {
753
- object[key] = value;
1100
+ /**
1101
+ * Checks if `value` is suitable for use as unique object key.
1102
+ *
1103
+ * @private
1104
+ * @param {*} value The value to check.
1105
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1106
+ */
1107
+ function isKeyable(value) {
1108
+ var type = typeof value;
1109
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1110
+ ? (value !== '__proto__')
1111
+ : (value === null);
754
1112
  }
755
- }
756
1113
 
757
- var objectProto$7 = Object.prototype;
758
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
1114
+ /**
1115
+ * Gets the data for `map`.
1116
+ *
1117
+ * @private
1118
+ * @param {Object} map The map to query.
1119
+ * @param {string} key The reference key.
1120
+ * @returns {*} Returns the map data.
1121
+ */
1122
+ function getMapData(map, key) {
1123
+ var data = map.__data__;
1124
+ return isKeyable(key)
1125
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1126
+ : data.map;
1127
+ }
759
1128
 
760
- function assignValue(object, key, value) {
761
- var objValue = object[key];
1129
+ /**
1130
+ * Removes `key` and its value from the map.
1131
+ *
1132
+ * @private
1133
+ * @name delete
1134
+ * @memberOf MapCache
1135
+ * @param {string} key The key of the value to remove.
1136
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1137
+ */
1138
+ function mapCacheDelete(key) {
1139
+ var result = getMapData(this, key)['delete'](key);
1140
+ this.size -= result ? 1 : 0;
1141
+ return result;
1142
+ }
762
1143
 
763
- if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
764
- baseAssignValue(object, key, value);
1144
+ /**
1145
+ * Gets the map value for `key`.
1146
+ *
1147
+ * @private
1148
+ * @name get
1149
+ * @memberOf MapCache
1150
+ * @param {string} key The key of the value to get.
1151
+ * @returns {*} Returns the entry value.
1152
+ */
1153
+ function mapCacheGet(key) {
1154
+ return getMapData(this, key).get(key);
765
1155
  }
766
- }
767
1156
 
768
- function copyObject(source, props, object, customizer) {
769
- var isNew = !object;
770
- object || (object = {});
771
- var index = -1,
772
- length = props.length;
1157
+ /**
1158
+ * Checks if a map value for `key` exists.
1159
+ *
1160
+ * @private
1161
+ * @name has
1162
+ * @memberOf MapCache
1163
+ * @param {string} key The key of the entry to check.
1164
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1165
+ */
1166
+ function mapCacheHas(key) {
1167
+ return getMapData(this, key).has(key);
1168
+ }
773
1169
 
774
- while (++index < length) {
775
- var key = props[index];
776
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
1170
+ /**
1171
+ * Sets the map `key` to `value`.
1172
+ *
1173
+ * @private
1174
+ * @name set
1175
+ * @memberOf MapCache
1176
+ * @param {string} key The key of the value to set.
1177
+ * @param {*} value The value to set.
1178
+ * @returns {Object} Returns the map cache instance.
1179
+ */
1180
+ function mapCacheSet(key, value) {
1181
+ var data = getMapData(this, key),
1182
+ size = data.size;
1183
+
1184
+ data.set(key, value);
1185
+ this.size += data.size == size ? 0 : 1;
1186
+ return this;
1187
+ }
777
1188
 
778
- if (newValue === undefined) {
779
- newValue = source[key];
1189
+ /**
1190
+ * Creates a map cache object to store key-value pairs.
1191
+ *
1192
+ * @private
1193
+ * @constructor
1194
+ * @param {Array} [entries] The key-value pairs to cache.
1195
+ */
1196
+ function MapCache(entries) {
1197
+ var index = -1,
1198
+ length = entries == null ? 0 : entries.length;
1199
+
1200
+ this.clear();
1201
+ while (++index < length) {
1202
+ var entry = entries[index];
1203
+ this.set(entry[0], entry[1]);
780
1204
  }
1205
+ }
781
1206
 
782
- if (isNew) {
783
- baseAssignValue(object, key, newValue);
784
- } else {
785
- assignValue(object, key, newValue);
1207
+ // Add methods to `MapCache`.
1208
+ MapCache.prototype.clear = mapCacheClear;
1209
+ MapCache.prototype['delete'] = mapCacheDelete;
1210
+ MapCache.prototype.get = mapCacheGet;
1211
+ MapCache.prototype.has = mapCacheHas;
1212
+ MapCache.prototype.set = mapCacheSet;
1213
+
1214
+ /** Used as the size to enable large array optimizations. */
1215
+ var LARGE_ARRAY_SIZE = 200;
1216
+
1217
+ /**
1218
+ * Sets the stack `key` to `value`.
1219
+ *
1220
+ * @private
1221
+ * @name set
1222
+ * @memberOf Stack
1223
+ * @param {string} key The key of the value to set.
1224
+ * @param {*} value The value to set.
1225
+ * @returns {Object} Returns the stack cache instance.
1226
+ */
1227
+ function stackSet(key, value) {
1228
+ var data = this.__data__;
1229
+ if (data instanceof ListCache) {
1230
+ var pairs = data.__data__;
1231
+ if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1232
+ pairs.push([key, value]);
1233
+ this.size = ++data.size;
1234
+ return this;
1235
+ }
1236
+ data = this.__data__ = new MapCache(pairs);
786
1237
  }
1238
+ data.set(key, value);
1239
+ this.size = data.size;
1240
+ return this;
787
1241
  }
788
1242
 
789
- return object;
790
- }
791
-
792
- function baseTimes(n, iteratee) {
793
- var index = -1,
794
- result = Array(n);
795
-
796
- while (++index < n) {
797
- result[index] = iteratee(index);
798
- }
799
-
800
- return result;
801
- }
802
-
803
- function isObjectLike(value) {
804
- return value != null && typeof value == 'object';
805
- }
806
-
807
- var argsTag$2 = '[object Arguments]';
808
-
809
- function baseIsArguments(value) {
810
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
811
- }
812
-
813
- var objectProto$6 = Object.prototype;
814
- var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
815
- var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
816
- var isArguments = baseIsArguments(function () {
817
- return arguments;
818
- }()) ? baseIsArguments : function (value) {
819
- return isObjectLike(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee');
820
- };
821
- var isArguments$1 = isArguments;
822
- var isArray = Array.isArray;
823
- var isArray$1 = isArray;
824
-
825
- function stubFalse() {
826
- return false;
827
- }
828
-
829
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
830
- var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
831
- var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
832
- var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
833
- var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
834
- var isBuffer = nativeIsBuffer || stubFalse;
835
- var isBuffer$1 = isBuffer;
836
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
837
- var reIsUint = /^(?:0|[1-9]\d*)$/;
838
-
839
- function isIndex(value, length) {
840
- var type = typeof value;
841
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
842
- return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
843
- }
844
-
845
- var MAX_SAFE_INTEGER = 9007199254740991;
846
-
847
- function isLength(value) {
848
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
849
- }
850
-
851
- var argsTag$1 = '[object Arguments]',
852
- arrayTag$1 = '[object Array]',
853
- boolTag$2 = '[object Boolean]',
854
- dateTag$2 = '[object Date]',
855
- errorTag$1 = '[object Error]',
856
- funcTag$1 = '[object Function]',
857
- mapTag$4 = '[object Map]',
858
- numberTag$2 = '[object Number]',
859
- objectTag$2 = '[object Object]',
860
- regexpTag$2 = '[object RegExp]',
861
- setTag$4 = '[object Set]',
862
- stringTag$2 = '[object String]',
863
- weakMapTag$2 = '[object WeakMap]';
864
- var arrayBufferTag$2 = '[object ArrayBuffer]',
865
- dataViewTag$3 = '[object DataView]',
866
- float32Tag$2 = '[object Float32Array]',
867
- float64Tag$2 = '[object Float64Array]',
868
- int8Tag$2 = '[object Int8Array]',
869
- int16Tag$2 = '[object Int16Array]',
870
- int32Tag$2 = '[object Int32Array]',
871
- uint8Tag$2 = '[object Uint8Array]',
872
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
873
- uint16Tag$2 = '[object Uint16Array]',
874
- uint32Tag$2 = '[object Uint32Array]';
875
- var typedArrayTags = {};
876
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
877
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
878
-
879
- function baseIsTypedArray(value) {
880
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
881
- }
882
-
883
- function baseUnary(func) {
884
- return function (value) {
885
- return func(value);
886
- };
887
- }
888
-
889
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
890
- var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
891
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
892
- var freeProcess = moduleExports$1 && freeGlobal$1.process;
893
-
894
- var nodeUtil = function () {
895
- try {
896
- var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
1243
+ /**
1244
+ * Creates a stack cache object to store key-value pairs.
1245
+ *
1246
+ * @private
1247
+ * @constructor
1248
+ * @param {Array} [entries] The key-value pairs to cache.
1249
+ */
1250
+ function Stack(entries) {
1251
+ var data = this.__data__ = new ListCache(entries);
1252
+ this.size = data.size;
1253
+ }
897
1254
 
898
- if (types) {
899
- return types;
1255
+ // Add methods to `Stack`.
1256
+ Stack.prototype.clear = stackClear;
1257
+ Stack.prototype['delete'] = stackDelete;
1258
+ Stack.prototype.get = stackGet;
1259
+ Stack.prototype.has = stackHas;
1260
+ Stack.prototype.set = stackSet;
1261
+
1262
+ /**
1263
+ * A specialized version of `_.forEach` for arrays without support for
1264
+ * iteratee shorthands.
1265
+ *
1266
+ * @private
1267
+ * @param {Array} [array] The array to iterate over.
1268
+ * @param {Function} iteratee The function invoked per iteration.
1269
+ * @returns {Array} Returns `array`.
1270
+ */
1271
+ function arrayEach(array, iteratee) {
1272
+ var index = -1,
1273
+ length = array == null ? 0 : array.length;
1274
+
1275
+ while (++index < length) {
1276
+ if (iteratee(array[index], index, array) === false) {
1277
+ break;
1278
+ }
900
1279
  }
1280
+ return array;
1281
+ }
901
1282
 
902
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
903
- } catch (e) {}
904
- }();
905
-
906
- var nodeUtil$1 = nodeUtil;
907
- var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
908
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
909
- var isTypedArray$1 = isTypedArray;
910
- var objectProto$5 = Object.prototype;
911
- var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
912
-
913
- function arrayLikeKeys(value, inherited) {
914
- var isArr = isArray$1(value),
915
- isArg = !isArr && isArguments$1(value),
916
- isBuff = !isArr && !isArg && isBuffer$1(value),
917
- isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
918
- skipIndexes = isArr || isArg || isBuff || isType,
919
- result = skipIndexes ? baseTimes(value.length, String) : [],
920
- length = result.length;
921
-
922
- for (var key in value) {
923
- if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || isIndex(key, length)))) {
924
- result.push(key);
1283
+ var defineProperty$1 = (function() {
1284
+ try {
1285
+ var func = getNative(Object, 'defineProperty');
1286
+ func({}, '', {});
1287
+ return func;
1288
+ } catch (e) {}
1289
+ }());
1290
+
1291
+ var defineProperty$2 = defineProperty$1;
1292
+
1293
+ /**
1294
+ * The base implementation of `assignValue` and `assignMergeValue` without
1295
+ * value checks.
1296
+ *
1297
+ * @private
1298
+ * @param {Object} object The object to modify.
1299
+ * @param {string} key The key of the property to assign.
1300
+ * @param {*} value The value to assign.
1301
+ */
1302
+ function baseAssignValue(object, key, value) {
1303
+ if (key == '__proto__' && defineProperty$2) {
1304
+ defineProperty$2(object, key, {
1305
+ 'configurable': true,
1306
+ 'enumerable': true,
1307
+ 'value': value,
1308
+ 'writable': true
1309
+ });
1310
+ } else {
1311
+ object[key] = value;
925
1312
  }
926
1313
  }
927
1314
 
928
- return result;
929
- }
930
-
931
- var objectProto$4 = Object.prototype;
932
-
933
- function isPrototype(value) {
934
- var Ctor = value && value.constructor,
935
- proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$4;
936
- return value === proto;
937
- }
938
-
939
- function overArg(func, transform) {
940
- return function (arg) {
941
- return func(transform(arg));
942
- };
943
- }
944
-
945
- var nativeKeys = overArg(Object.keys, Object);
946
- var nativeKeys$1 = nativeKeys;
947
- var objectProto$3 = Object.prototype;
948
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
949
-
950
- function baseKeys(object) {
951
- if (!isPrototype(object)) {
952
- return nativeKeys$1(object);
1315
+ /** Used for built-in method references. */
1316
+ var objectProto$7 = Object.prototype;
1317
+
1318
+ /** Used to check objects for own properties. */
1319
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
1320
+
1321
+ /**
1322
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
1323
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1324
+ * for equality comparisons.
1325
+ *
1326
+ * @private
1327
+ * @param {Object} object The object to modify.
1328
+ * @param {string} key The key of the property to assign.
1329
+ * @param {*} value The value to assign.
1330
+ */
1331
+ function assignValue(object, key, value) {
1332
+ var objValue = object[key];
1333
+ if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) ||
1334
+ (value === undefined && !(key in object))) {
1335
+ baseAssignValue(object, key, value);
1336
+ }
953
1337
  }
954
1338
 
955
- var result = [];
956
-
957
- for (var key in Object(object)) {
958
- if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
959
- result.push(key);
1339
+ /**
1340
+ * Copies properties of `source` to `object`.
1341
+ *
1342
+ * @private
1343
+ * @param {Object} source The object to copy properties from.
1344
+ * @param {Array} props The property identifiers to copy.
1345
+ * @param {Object} [object={}] The object to copy properties to.
1346
+ * @param {Function} [customizer] The function to customize copied values.
1347
+ * @returns {Object} Returns `object`.
1348
+ */
1349
+ function copyObject(source, props, object, customizer) {
1350
+ var isNew = !object;
1351
+ object || (object = {});
1352
+
1353
+ var index = -1,
1354
+ length = props.length;
1355
+
1356
+ while (++index < length) {
1357
+ var key = props[index];
1358
+
1359
+ var newValue = customizer
1360
+ ? customizer(object[key], source[key], key, object, source)
1361
+ : undefined;
1362
+
1363
+ if (newValue === undefined) {
1364
+ newValue = source[key];
1365
+ }
1366
+ if (isNew) {
1367
+ baseAssignValue(object, key, newValue);
1368
+ } else {
1369
+ assignValue(object, key, newValue);
1370
+ }
960
1371
  }
1372
+ return object;
961
1373
  }
962
1374
 
963
- return result;
964
- }
965
-
966
- function isArrayLike(value) {
967
- return value != null && isLength(value.length) && !isFunction(value);
968
- }
969
-
970
- function keys(object) {
971
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
972
- }
973
-
974
- function baseAssign(object, source) {
975
- return object && copyObject(source, keys(source), object);
976
- }
977
-
978
- function nativeKeysIn(object) {
979
- var result = [];
980
-
981
- if (object != null) {
982
- for (var key in Object(object)) {
983
- result.push(key);
1375
+ /**
1376
+ * The base implementation of `_.times` without support for iteratee shorthands
1377
+ * or max array length checks.
1378
+ *
1379
+ * @private
1380
+ * @param {number} n The number of times to invoke `iteratee`.
1381
+ * @param {Function} iteratee The function invoked per iteration.
1382
+ * @returns {Array} Returns the array of results.
1383
+ */
1384
+ function baseTimes(n, iteratee) {
1385
+ var index = -1,
1386
+ result = Array(n);
1387
+
1388
+ while (++index < n) {
1389
+ result[index] = iteratee(index);
984
1390
  }
1391
+ return result;
985
1392
  }
986
1393
 
987
- return result;
988
- }
989
-
990
- var objectProto$2 = Object.prototype;
991
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
992
-
993
- function baseKeysIn(object) {
994
- if (!isObject(object)) {
995
- return nativeKeysIn(object);
1394
+ /**
1395
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1396
+ * and has a `typeof` result of "object".
1397
+ *
1398
+ * @static
1399
+ * @memberOf _
1400
+ * @since 4.0.0
1401
+ * @category Lang
1402
+ * @param {*} value The value to check.
1403
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1404
+ * @example
1405
+ *
1406
+ * _.isObjectLike({});
1407
+ * // => true
1408
+ *
1409
+ * _.isObjectLike([1, 2, 3]);
1410
+ * // => true
1411
+ *
1412
+ * _.isObjectLike(_.noop);
1413
+ * // => false
1414
+ *
1415
+ * _.isObjectLike(null);
1416
+ * // => false
1417
+ */
1418
+ function isObjectLike(value) {
1419
+ return value != null && typeof value == 'object';
996
1420
  }
997
1421
 
998
- var isProto = isPrototype(object),
999
- result = [];
1000
-
1001
- for (var key in object) {
1002
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
1003
- result.push(key);
1004
- }
1422
+ /** `Object#toString` result references. */
1423
+ var argsTag$2 = '[object Arguments]';
1424
+
1425
+ /**
1426
+ * The base implementation of `_.isArguments`.
1427
+ *
1428
+ * @private
1429
+ * @param {*} value The value to check.
1430
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1431
+ */
1432
+ function baseIsArguments(value) {
1433
+ return isObjectLike(value) && baseGetTag(value) == argsTag$2;
1005
1434
  }
1006
1435
 
1007
- return result;
1008
- }
1009
-
1010
- function keysIn(object) {
1011
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1012
- }
1013
-
1014
- function baseAssignIn(object, source) {
1015
- return object && copyObject(source, keysIn(source), object);
1016
- }
1017
-
1018
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1019
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1020
- var moduleExports = freeModule && freeModule.exports === freeExports;
1021
- var Buffer = moduleExports ? root$1.Buffer : undefined,
1022
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1436
+ /** Used for built-in method references. */
1437
+ var objectProto$6 = Object.prototype;
1438
+
1439
+ /** Used to check objects for own properties. */
1440
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
1441
+
1442
+ /** Built-in value references. */
1443
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
1444
+
1445
+ /**
1446
+ * Checks if `value` is likely an `arguments` object.
1447
+ *
1448
+ * @static
1449
+ * @memberOf _
1450
+ * @since 0.1.0
1451
+ * @category Lang
1452
+ * @param {*} value The value to check.
1453
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1454
+ * else `false`.
1455
+ * @example
1456
+ *
1457
+ * _.isArguments(function() { return arguments; }());
1458
+ * // => true
1459
+ *
1460
+ * _.isArguments([1, 2, 3]);
1461
+ * // => false
1462
+ */
1463
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1464
+ return isObjectLike(value) && hasOwnProperty$4.call(value, 'callee') &&
1465
+ !propertyIsEnumerable$1.call(value, 'callee');
1466
+ };
1023
1467
 
1024
- function cloneBuffer(buffer, isDeep) {
1025
- if (isDeep) {
1026
- return buffer.slice();
1468
+ var isArguments$1 = isArguments;
1469
+
1470
+ /**
1471
+ * Checks if `value` is classified as an `Array` object.
1472
+ *
1473
+ * @static
1474
+ * @memberOf _
1475
+ * @since 0.1.0
1476
+ * @category Lang
1477
+ * @param {*} value The value to check.
1478
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1479
+ * @example
1480
+ *
1481
+ * _.isArray([1, 2, 3]);
1482
+ * // => true
1483
+ *
1484
+ * _.isArray(document.body.children);
1485
+ * // => false
1486
+ *
1487
+ * _.isArray('abc');
1488
+ * // => false
1489
+ *
1490
+ * _.isArray(_.noop);
1491
+ * // => false
1492
+ */
1493
+ var isArray = Array.isArray;
1494
+
1495
+ var isArray$1 = isArray;
1496
+
1497
+ /**
1498
+ * This method returns `false`.
1499
+ *
1500
+ * @static
1501
+ * @memberOf _
1502
+ * @since 4.13.0
1503
+ * @category Util
1504
+ * @returns {boolean} Returns `false`.
1505
+ * @example
1506
+ *
1507
+ * _.times(2, _.stubFalse);
1508
+ * // => [false, false]
1509
+ */
1510
+ function stubFalse() {
1511
+ return false;
1027
1512
  }
1028
1513
 
1029
- var length = buffer.length,
1030
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1031
- buffer.copy(result);
1032
- return result;
1033
- }
1034
-
1035
- function copyArray(source, array) {
1036
- var index = -1,
1037
- length = source.length;
1038
- array || (array = Array(length));
1514
+ /** Detect free variable `exports`. */
1515
+ var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1516
+
1517
+ /** Detect free variable `module`. */
1518
+ var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
1519
+
1520
+ /** Detect the popular CommonJS extension `module.exports`. */
1521
+ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
1522
+
1523
+ /** Built-in value references. */
1524
+ var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
1525
+
1526
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1527
+ var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
1528
+
1529
+ /**
1530
+ * Checks if `value` is a buffer.
1531
+ *
1532
+ * @static
1533
+ * @memberOf _
1534
+ * @since 4.3.0
1535
+ * @category Lang
1536
+ * @param {*} value The value to check.
1537
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1538
+ * @example
1539
+ *
1540
+ * _.isBuffer(new Buffer(2));
1541
+ * // => true
1542
+ *
1543
+ * _.isBuffer(new Uint8Array(2));
1544
+ * // => false
1545
+ */
1546
+ var isBuffer = nativeIsBuffer || stubFalse;
1547
+
1548
+ var isBuffer$1 = isBuffer;
1549
+
1550
+ /** Used as references for various `Number` constants. */
1551
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
1552
+
1553
+ /** Used to detect unsigned integer values. */
1554
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1555
+
1556
+ /**
1557
+ * Checks if `value` is a valid array-like index.
1558
+ *
1559
+ * @private
1560
+ * @param {*} value The value to check.
1561
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1562
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1563
+ */
1564
+ function isIndex(value, length) {
1565
+ var type = typeof value;
1566
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
1567
+
1568
+ return !!length &&
1569
+ (type == 'number' ||
1570
+ (type != 'symbol' && reIsUint.test(value))) &&
1571
+ (value > -1 && value % 1 == 0 && value < length);
1572
+ }
1039
1573
 
1040
- while (++index < length) {
1041
- array[index] = source[index];
1574
+ /** Used as references for various `Number` constants. */
1575
+ var MAX_SAFE_INTEGER = 9007199254740991;
1576
+
1577
+ /**
1578
+ * Checks if `value` is a valid array-like length.
1579
+ *
1580
+ * **Note:** This method is loosely based on
1581
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1582
+ *
1583
+ * @static
1584
+ * @memberOf _
1585
+ * @since 4.0.0
1586
+ * @category Lang
1587
+ * @param {*} value The value to check.
1588
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1589
+ * @example
1590
+ *
1591
+ * _.isLength(3);
1592
+ * // => true
1593
+ *
1594
+ * _.isLength(Number.MIN_VALUE);
1595
+ * // => false
1596
+ *
1597
+ * _.isLength(Infinity);
1598
+ * // => false
1599
+ *
1600
+ * _.isLength('3');
1601
+ * // => false
1602
+ */
1603
+ function isLength(value) {
1604
+ return typeof value == 'number' &&
1605
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1042
1606
  }
1043
1607
 
1044
- return array;
1045
- }
1608
+ /** `Object#toString` result references. */
1609
+ var argsTag$1 = '[object Arguments]',
1610
+ arrayTag$1 = '[object Array]',
1611
+ boolTag$2 = '[object Boolean]',
1612
+ dateTag$2 = '[object Date]',
1613
+ errorTag$1 = '[object Error]',
1614
+ funcTag$1 = '[object Function]',
1615
+ mapTag$4 = '[object Map]',
1616
+ numberTag$2 = '[object Number]',
1617
+ objectTag$2 = '[object Object]',
1618
+ regexpTag$2 = '[object RegExp]',
1619
+ setTag$4 = '[object Set]',
1620
+ stringTag$2 = '[object String]',
1621
+ weakMapTag$2 = '[object WeakMap]';
1622
+
1623
+ var arrayBufferTag$2 = '[object ArrayBuffer]',
1624
+ dataViewTag$3 = '[object DataView]',
1625
+ float32Tag$2 = '[object Float32Array]',
1626
+ float64Tag$2 = '[object Float64Array]',
1627
+ int8Tag$2 = '[object Int8Array]',
1628
+ int16Tag$2 = '[object Int16Array]',
1629
+ int32Tag$2 = '[object Int32Array]',
1630
+ uint8Tag$2 = '[object Uint8Array]',
1631
+ uint8ClampedTag$2 = '[object Uint8ClampedArray]',
1632
+ uint16Tag$2 = '[object Uint16Array]',
1633
+ uint32Tag$2 = '[object Uint32Array]';
1634
+
1635
+ /** Used to identify `toStringTag` values of typed arrays. */
1636
+ var typedArrayTags = {};
1637
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
1638
+ typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
1639
+ typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
1640
+ typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
1641
+ typedArrayTags[uint32Tag$2] = true;
1642
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
1643
+ typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
1644
+ typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
1645
+ typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
1646
+ typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
1647
+ typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
1648
+ typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
1649
+ typedArrayTags[weakMapTag$2] = false;
1650
+
1651
+ /**
1652
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1653
+ *
1654
+ * @private
1655
+ * @param {*} value The value to check.
1656
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1657
+ */
1658
+ function baseIsTypedArray(value) {
1659
+ return isObjectLike(value) &&
1660
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1661
+ }
1046
1662
 
1047
- function arrayFilter(array, predicate) {
1048
- var index = -1,
1049
- length = array == null ? 0 : array.length,
1050
- resIndex = 0,
1051
- result = [];
1663
+ /**
1664
+ * The base implementation of `_.unary` without support for storing metadata.
1665
+ *
1666
+ * @private
1667
+ * @param {Function} func The function to cap arguments for.
1668
+ * @returns {Function} Returns the new capped function.
1669
+ */
1670
+ function baseUnary(func) {
1671
+ return function(value) {
1672
+ return func(value);
1673
+ };
1674
+ }
1052
1675
 
1053
- while (++index < length) {
1054
- var value = array[index];
1676
+ /** Detect free variable `exports`. */
1677
+ var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
1055
1678
 
1056
- if (predicate(value, index, array)) {
1057
- result[resIndex++] = value;
1058
- }
1059
- }
1679
+ /** Detect free variable `module`. */
1680
+ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
1060
1681
 
1061
- return result;
1062
- }
1682
+ /** Detect the popular CommonJS extension `module.exports`. */
1683
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
1063
1684
 
1064
- function stubArray() {
1065
- return [];
1066
- }
1685
+ /** Detect free variable `process` from Node.js. */
1686
+ var freeProcess = moduleExports$1 && freeGlobal$1.process;
1067
1687
 
1068
- var objectProto$1 = Object.prototype;
1069
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1070
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1071
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function (object) {
1072
- if (object == null) {
1073
- return [];
1074
- }
1688
+ /** Used to access faster Node.js helpers. */
1689
+ var nodeUtil = (function() {
1690
+ try {
1691
+ // Use `util.types` for Node.js 10+.
1692
+ var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
1075
1693
 
1076
- object = Object(object);
1077
- return arrayFilter(nativeGetSymbols$1(object), function (symbol) {
1078
- return propertyIsEnumerable.call(object, symbol);
1079
- });
1080
- };
1081
- var getSymbols$1 = getSymbols;
1082
-
1083
- function copySymbols(source, object) {
1084
- return copyObject(source, getSymbols$1(source), object);
1085
- }
1086
-
1087
- function arrayPush(array, values) {
1088
- var index = -1,
1089
- length = values.length,
1090
- offset = array.length;
1091
-
1092
- while (++index < length) {
1093
- array[offset + index] = values[index];
1094
- }
1095
-
1096
- return array;
1097
- }
1098
-
1099
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1100
- var getPrototype$1 = getPrototype;
1101
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1102
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
1103
- var result = [];
1104
-
1105
- while (object) {
1106
- arrayPush(result, getSymbols$1(object));
1107
- object = getPrototype$1(object);
1108
- }
1109
-
1110
- return result;
1111
- };
1112
- var getSymbolsIn$1 = getSymbolsIn;
1113
-
1114
- function copySymbolsIn(source, object) {
1115
- return copyObject(source, getSymbolsIn$1(source), object);
1116
- }
1117
-
1118
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1119
- var result = keysFunc(object);
1120
- return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1121
- }
1122
-
1123
- function getAllKeys(object) {
1124
- return baseGetAllKeys(object, keys, getSymbols$1);
1125
- }
1126
-
1127
- function getAllKeysIn(object) {
1128
- return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
1129
- }
1130
-
1131
- var DataView = getNative(root$1, 'DataView');
1132
- var DataView$1 = DataView;
1133
- var Promise$1 = getNative(root$1, 'Promise');
1134
- var Promise$2 = Promise$1;
1135
- var Set = getNative(root$1, 'Set');
1136
- var Set$1 = Set;
1137
- var WeakMap = getNative(root$1, 'WeakMap');
1138
- var WeakMap$1 = WeakMap;
1139
- var mapTag$3 = '[object Map]',
1140
- objectTag$1 = '[object Object]',
1141
- promiseTag = '[object Promise]',
1142
- setTag$3 = '[object Set]',
1143
- weakMapTag$1 = '[object WeakMap]';
1144
- var dataViewTag$2 = '[object DataView]';
1145
- var dataViewCtorString = toSource(DataView$1),
1146
- mapCtorString = toSource(Map$2),
1147
- promiseCtorString = toSource(Promise$2),
1148
- setCtorString = toSource(Set$1),
1149
- weakMapCtorString = toSource(WeakMap$1);
1150
- var getTag = baseGetTag;
1151
-
1152
- if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2 || Map$2 && getTag(new Map$2()) != mapTag$3 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$3 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) {
1153
- getTag = function getTag(value) {
1154
- var result = baseGetTag(value),
1155
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1156
- ctorString = Ctor ? toSource(Ctor) : '';
1157
-
1158
- if (ctorString) {
1159
- switch (ctorString) {
1160
- case dataViewCtorString:
1161
- return dataViewTag$2;
1162
-
1163
- case mapCtorString:
1164
- return mapTag$3;
1165
-
1166
- case promiseCtorString:
1167
- return promiseTag;
1168
-
1169
- case setCtorString:
1170
- return setTag$3;
1171
-
1172
- case weakMapCtorString:
1173
- return weakMapTag$1;
1694
+ if (types) {
1695
+ return types;
1174
1696
  }
1175
- }
1176
1697
 
1177
- return result;
1178
- };
1179
- }
1180
-
1181
- var getTag$1 = getTag;
1182
- var objectProto = Object.prototype;
1183
- var hasOwnProperty = objectProto.hasOwnProperty;
1184
-
1185
- function initCloneArray(array) {
1186
- var length = array.length,
1187
- result = new array.constructor(length);
1188
-
1189
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1190
- result.index = array.index;
1191
- result.input = array.input;
1192
- }
1193
-
1194
- return result;
1195
- }
1196
-
1197
- var Uint8Array = root$1.Uint8Array;
1198
- var Uint8Array$1 = Uint8Array;
1199
-
1200
- function cloneArrayBuffer(arrayBuffer) {
1201
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1202
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1203
- return result;
1204
- }
1205
-
1206
- function cloneDataView(dataView, isDeep) {
1207
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
1208
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1209
- }
1210
-
1211
- var reFlags = /\w*$/;
1212
-
1213
- function cloneRegExp(regexp) {
1214
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
1215
- result.lastIndex = regexp.lastIndex;
1216
- return result;
1217
- }
1218
-
1219
- var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
1220
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1221
-
1222
- function cloneSymbol(symbol) {
1223
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
1224
- }
1225
-
1226
- function cloneTypedArray(typedArray, isDeep) {
1227
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1228
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1229
- }
1230
-
1231
- var boolTag$1 = '[object Boolean]',
1232
- dateTag$1 = '[object Date]',
1233
- mapTag$2 = '[object Map]',
1234
- numberTag$1 = '[object Number]',
1235
- regexpTag$1 = '[object RegExp]',
1236
- setTag$2 = '[object Set]',
1237
- stringTag$1 = '[object String]',
1238
- symbolTag$1 = '[object Symbol]';
1239
- var arrayBufferTag$1 = '[object ArrayBuffer]',
1240
- dataViewTag$1 = '[object DataView]',
1241
- float32Tag$1 = '[object Float32Array]',
1242
- float64Tag$1 = '[object Float64Array]',
1243
- int8Tag$1 = '[object Int8Array]',
1244
- int16Tag$1 = '[object Int16Array]',
1245
- int32Tag$1 = '[object Int32Array]',
1246
- uint8Tag$1 = '[object Uint8Array]',
1247
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
1248
- uint16Tag$1 = '[object Uint16Array]',
1249
- uint32Tag$1 = '[object Uint32Array]';
1250
-
1251
- function initCloneByTag(object, tag, isDeep) {
1252
- var Ctor = object.constructor;
1253
-
1254
- switch (tag) {
1255
- case arrayBufferTag$1:
1256
- return cloneArrayBuffer(object);
1257
-
1258
- case boolTag$1:
1259
- case dateTag$1:
1260
- return new Ctor(+object);
1261
-
1262
- case dataViewTag$1:
1263
- return cloneDataView(object, isDeep);
1264
-
1265
- case float32Tag$1:
1266
- case float64Tag$1:
1267
- case int8Tag$1:
1268
- case int16Tag$1:
1269
- case int32Tag$1:
1270
- case uint8Tag$1:
1271
- case uint8ClampedTag$1:
1272
- case uint16Tag$1:
1273
- case uint32Tag$1:
1274
- return cloneTypedArray(object, isDeep);
1275
-
1276
- case mapTag$2:
1277
- return new Ctor();
1278
-
1279
- case numberTag$1:
1280
- case stringTag$1:
1281
- return new Ctor(object);
1282
-
1283
- case regexpTag$1:
1284
- return cloneRegExp(object);
1285
-
1286
- case setTag$2:
1287
- return new Ctor();
1288
-
1289
- case symbolTag$1:
1290
- return cloneSymbol(object);
1291
- }
1292
- }
1293
-
1294
- var objectCreate = Object.create;
1295
-
1296
- var baseCreate = function () {
1297
- function object() {}
1298
-
1299
- return function (proto) {
1300
- if (!isObject(proto)) {
1301
- return {};
1302
- }
1303
-
1304
- if (objectCreate) {
1305
- return objectCreate(proto);
1698
+ // Legacy `process.binding('util')` for Node.js < 10.
1699
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
1700
+ } catch (e) {}
1701
+ }());
1702
+
1703
+ var nodeUtil$1 = nodeUtil;
1704
+
1705
+ /* Node.js helper references. */
1706
+ var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
1707
+
1708
+ /**
1709
+ * Checks if `value` is classified as a typed array.
1710
+ *
1711
+ * @static
1712
+ * @memberOf _
1713
+ * @since 3.0.0
1714
+ * @category Lang
1715
+ * @param {*} value The value to check.
1716
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1717
+ * @example
1718
+ *
1719
+ * _.isTypedArray(new Uint8Array);
1720
+ * // => true
1721
+ *
1722
+ * _.isTypedArray([]);
1723
+ * // => false
1724
+ */
1725
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1726
+
1727
+ var isTypedArray$1 = isTypedArray;
1728
+
1729
+ /** Used for built-in method references. */
1730
+ var objectProto$5 = Object.prototype;
1731
+
1732
+ /** Used to check objects for own properties. */
1733
+ var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
1734
+
1735
+ /**
1736
+ * Creates an array of the enumerable property names of the array-like `value`.
1737
+ *
1738
+ * @private
1739
+ * @param {*} value The value to query.
1740
+ * @param {boolean} inherited Specify returning inherited property names.
1741
+ * @returns {Array} Returns the array of property names.
1742
+ */
1743
+ function arrayLikeKeys(value, inherited) {
1744
+ var isArr = isArray$1(value),
1745
+ isArg = !isArr && isArguments$1(value),
1746
+ isBuff = !isArr && !isArg && isBuffer$1(value),
1747
+ isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
1748
+ skipIndexes = isArr || isArg || isBuff || isType,
1749
+ result = skipIndexes ? baseTimes(value.length, String) : [],
1750
+ length = result.length;
1751
+
1752
+ for (var key in value) {
1753
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
1754
+ !(skipIndexes && (
1755
+ // Safari 9 has enumerable `arguments.length` in strict mode.
1756
+ key == 'length' ||
1757
+ // Node.js 0.10 has enumerable non-index properties on buffers.
1758
+ (isBuff && (key == 'offset' || key == 'parent')) ||
1759
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
1760
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1761
+ // Skip index properties.
1762
+ isIndex(key, length)
1763
+ ))) {
1764
+ result.push(key);
1765
+ }
1306
1766
  }
1307
-
1308
- object.prototype = proto;
1309
- var result = new object();
1310
- object.prototype = undefined;
1311
- return result;
1312
- };
1313
- }();
1314
-
1315
- var baseCreate$1 = baseCreate;
1316
-
1317
- function initCloneObject(object) {
1318
- return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
1319
- }
1320
-
1321
- var mapTag$1 = '[object Map]';
1322
-
1323
- function baseIsMap(value) {
1324
- return isObjectLike(value) && getTag$1(value) == mapTag$1;
1325
- }
1326
-
1327
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
1328
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
1329
- var isMap$1 = isMap;
1330
- var setTag$1 = '[object Set]';
1331
-
1332
- function baseIsSet(value) {
1333
- return isObjectLike(value) && getTag$1(value) == setTag$1;
1334
- }
1335
-
1336
- var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
1337
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
1338
- var isSet$1 = isSet;
1339
- var CLONE_DEEP_FLAG$1 = 1,
1340
- CLONE_FLAT_FLAG = 2,
1341
- CLONE_SYMBOLS_FLAG$1 = 4;
1342
- var argsTag = '[object Arguments]',
1343
- arrayTag = '[object Array]',
1344
- boolTag = '[object Boolean]',
1345
- dateTag = '[object Date]',
1346
- errorTag = '[object Error]',
1347
- funcTag = '[object Function]',
1348
- genTag = '[object GeneratorFunction]',
1349
- mapTag = '[object Map]',
1350
- numberTag = '[object Number]',
1351
- objectTag = '[object Object]',
1352
- regexpTag = '[object RegExp]',
1353
- setTag = '[object Set]',
1354
- stringTag = '[object String]',
1355
- symbolTag = '[object Symbol]',
1356
- weakMapTag = '[object WeakMap]';
1357
- var arrayBufferTag = '[object ArrayBuffer]',
1358
- dataViewTag = '[object DataView]',
1359
- float32Tag = '[object Float32Array]',
1360
- float64Tag = '[object Float64Array]',
1361
- int8Tag = '[object Int8Array]',
1362
- int16Tag = '[object Int16Array]',
1363
- int32Tag = '[object Int32Array]',
1364
- uint8Tag = '[object Uint8Array]',
1365
- uint8ClampedTag = '[object Uint8ClampedArray]',
1366
- uint16Tag = '[object Uint16Array]',
1367
- uint32Tag = '[object Uint32Array]';
1368
- var cloneableTags = {};
1369
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1370
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
1371
-
1372
- function baseClone(value, bitmask, customizer, key, object, stack) {
1373
- var result,
1374
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
1375
- isFlat = bitmask & CLONE_FLAT_FLAG,
1376
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
1377
-
1378
- if (customizer) {
1379
- result = object ? customizer(value, key, object, stack) : customizer(value);
1380
- }
1381
-
1382
- if (result !== undefined) {
1383
1767
  return result;
1384
1768
  }
1385
1769
 
1386
- if (!isObject(value)) {
1387
- return value;
1770
+ /** Used for built-in method references. */
1771
+ var objectProto$4 = Object.prototype;
1772
+
1773
+ /**
1774
+ * Checks if `value` is likely a prototype object.
1775
+ *
1776
+ * @private
1777
+ * @param {*} value The value to check.
1778
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1779
+ */
1780
+ function isPrototype(value) {
1781
+ var Ctor = value && value.constructor,
1782
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
1783
+
1784
+ return value === proto;
1388
1785
  }
1389
1786
 
1390
- var isArr = isArray$1(value);
1787
+ /**
1788
+ * Creates a unary function that invokes `func` with its argument transformed.
1789
+ *
1790
+ * @private
1791
+ * @param {Function} func The function to wrap.
1792
+ * @param {Function} transform The argument transform.
1793
+ * @returns {Function} Returns the new function.
1794
+ */
1795
+ function overArg(func, transform) {
1796
+ return function(arg) {
1797
+ return func(transform(arg));
1798
+ };
1799
+ }
1391
1800
 
1392
- if (isArr) {
1393
- result = initCloneArray(value);
1801
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1802
+ var nativeKeys = overArg(Object.keys, Object);
1394
1803
 
1395
- if (!isDeep) {
1396
- return copyArray(value, result);
1397
- }
1398
- } else {
1399
- var tag = getTag$1(value),
1400
- isFunc = tag == funcTag || tag == genTag;
1804
+ var nativeKeys$1 = nativeKeys;
1401
1805
 
1402
- if (isBuffer$1(value)) {
1403
- return cloneBuffer(value, isDeep);
1404
- }
1806
+ /** Used for built-in method references. */
1807
+ var objectProto$3 = Object.prototype;
1405
1808
 
1406
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
1407
- result = isFlat || isFunc ? {} : initCloneObject(value);
1809
+ /** Used to check objects for own properties. */
1810
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1408
1811
 
1409
- if (!isDeep) {
1410
- return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
1411
- }
1412
- } else {
1413
- if (!cloneableTags[tag]) {
1414
- return object ? value : {};
1812
+ /**
1813
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1814
+ *
1815
+ * @private
1816
+ * @param {Object} object The object to query.
1817
+ * @returns {Array} Returns the array of property names.
1818
+ */
1819
+ function baseKeys(object) {
1820
+ if (!isPrototype(object)) {
1821
+ return nativeKeys$1(object);
1822
+ }
1823
+ var result = [];
1824
+ for (var key in Object(object)) {
1825
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
1826
+ result.push(key);
1415
1827
  }
1416
-
1417
- result = initCloneByTag(value, tag, isDeep);
1418
1828
  }
1829
+ return result;
1419
1830
  }
1420
1831
 
1421
- stack || (stack = new Stack());
1422
- var stacked = stack.get(value);
1423
-
1424
- if (stacked) {
1425
- return stacked;
1832
+ /**
1833
+ * Checks if `value` is array-like. A value is considered array-like if it's
1834
+ * not a function and has a `value.length` that's an integer greater than or
1835
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1836
+ *
1837
+ * @static
1838
+ * @memberOf _
1839
+ * @since 4.0.0
1840
+ * @category Lang
1841
+ * @param {*} value The value to check.
1842
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1843
+ * @example
1844
+ *
1845
+ * _.isArrayLike([1, 2, 3]);
1846
+ * // => true
1847
+ *
1848
+ * _.isArrayLike(document.body.children);
1849
+ * // => true
1850
+ *
1851
+ * _.isArrayLike('abc');
1852
+ * // => true
1853
+ *
1854
+ * _.isArrayLike(_.noop);
1855
+ * // => false
1856
+ */
1857
+ function isArrayLike(value) {
1858
+ return value != null && isLength(value.length) && !isFunction(value);
1426
1859
  }
1427
1860
 
1428
- stack.set(value, result);
1861
+ /**
1862
+ * Creates an array of the own enumerable property names of `object`.
1863
+ *
1864
+ * **Note:** Non-object values are coerced to objects. See the
1865
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1866
+ * for more details.
1867
+ *
1868
+ * @static
1869
+ * @since 0.1.0
1870
+ * @memberOf _
1871
+ * @category Object
1872
+ * @param {Object} object The object to query.
1873
+ * @returns {Array} Returns the array of property names.
1874
+ * @example
1875
+ *
1876
+ * function Foo() {
1877
+ * this.a = 1;
1878
+ * this.b = 2;
1879
+ * }
1880
+ *
1881
+ * Foo.prototype.c = 3;
1882
+ *
1883
+ * _.keys(new Foo);
1884
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1885
+ *
1886
+ * _.keys('hi');
1887
+ * // => ['0', '1']
1888
+ */
1889
+ function keys(object) {
1890
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1891
+ }
1429
1892
 
1430
- if (isSet$1(value)) {
1431
- value.forEach(function (subValue) {
1432
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
1433
- });
1434
- } else if (isMap$1(value)) {
1435
- value.forEach(function (subValue, key) {
1436
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
1437
- });
1893
+ /**
1894
+ * The base implementation of `_.assign` without support for multiple sources
1895
+ * or `customizer` functions.
1896
+ *
1897
+ * @private
1898
+ * @param {Object} object The destination object.
1899
+ * @param {Object} source The source object.
1900
+ * @returns {Object} Returns `object`.
1901
+ */
1902
+ function baseAssign(object, source) {
1903
+ return object && copyObject(source, keys(source), object);
1438
1904
  }
1439
1905
 
1440
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
1441
- var props = isArr ? undefined : keysFunc(value);
1442
- arrayEach(props || value, function (subValue, key) {
1443
- if (props) {
1444
- key = subValue;
1445
- subValue = value[key];
1906
+ /**
1907
+ * This function is like
1908
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1909
+ * except that it includes inherited enumerable properties.
1910
+ *
1911
+ * @private
1912
+ * @param {Object} object The object to query.
1913
+ * @returns {Array} Returns the array of property names.
1914
+ */
1915
+ function nativeKeysIn(object) {
1916
+ var result = [];
1917
+ if (object != null) {
1918
+ for (var key in Object(object)) {
1919
+ result.push(key);
1920
+ }
1446
1921
  }
1922
+ return result;
1923
+ }
1447
1924
 
1448
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
1449
- });
1450
- return result;
1451
- }
1452
-
1453
- var CLONE_DEEP_FLAG = 1,
1454
- CLONE_SYMBOLS_FLAG = 4;
1455
-
1456
- function cloneDeep(value) {
1457
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
1458
- }
1459
-
1460
- var _defineCache = new Map();
1925
+ /** Used for built-in method references. */
1926
+ var objectProto$2 = Object.prototype;
1927
+
1928
+ /** Used to check objects for own properties. */
1929
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1930
+
1931
+ /**
1932
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1933
+ *
1934
+ * @private
1935
+ * @param {Object} object The object to query.
1936
+ * @returns {Array} Returns the array of property names.
1937
+ */
1938
+ function baseKeysIn(object) {
1939
+ if (!isObject(object)) {
1940
+ return nativeKeysIn(object);
1941
+ }
1942
+ var isProto = isPrototype(object),
1943
+ result = [];
1461
1944
 
1462
- function defineProperty(key, deep, store, originKey, originStore, callback) {
1463
- if (!_defineCache.has(store)) {
1464
- _defineCache.set(store, []);
1945
+ for (var key in object) {
1946
+ if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
1947
+ result.push(key);
1948
+ }
1949
+ }
1950
+ return result;
1465
1951
  }
1466
1952
 
1467
- if (_defineCache.get(store).indexOf(key) > -1) {
1468
- return;
1953
+ /**
1954
+ * Creates an array of the own and inherited enumerable property names of `object`.
1955
+ *
1956
+ * **Note:** Non-object values are coerced to objects.
1957
+ *
1958
+ * @static
1959
+ * @memberOf _
1960
+ * @since 3.0.0
1961
+ * @category Object
1962
+ * @param {Object} object The object to query.
1963
+ * @returns {Array} Returns the array of property names.
1964
+ * @example
1965
+ *
1966
+ * function Foo() {
1967
+ * this.a = 1;
1968
+ * this.b = 2;
1969
+ * }
1970
+ *
1971
+ * Foo.prototype.c = 3;
1972
+ *
1973
+ * _.keysIn(new Foo);
1974
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1975
+ */
1976
+ function keysIn(object) {
1977
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1469
1978
  }
1470
1979
 
1471
- _defineCache.get(store).push(key);
1472
-
1473
- var props = key.split('.');
1474
- var obj = store;
1475
- var length = props.length;
1980
+ /**
1981
+ * The base implementation of `_.assignIn` without support for multiple sources
1982
+ * or `customizer` functions.
1983
+ *
1984
+ * @private
1985
+ * @param {Object} object The destination object.
1986
+ * @param {Object} source The source object.
1987
+ * @returns {Object} Returns `object`.
1988
+ */
1989
+ function baseAssignIn(object, source) {
1990
+ return object && copyObject(source, keysIn(source), object);
1991
+ }
1476
1992
 
1477
- for (var i = 0; i < length - 1; i++) {
1478
- if (obj[props[i]] === undefined) {
1479
- return;
1993
+ /** Detect free variable `exports`. */
1994
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1995
+
1996
+ /** Detect free variable `module`. */
1997
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1998
+
1999
+ /** Detect the popular CommonJS extension `module.exports`. */
2000
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2001
+
2002
+ /** Built-in value references. */
2003
+ var Buffer = moduleExports ? root$1.Buffer : undefined,
2004
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
2005
+
2006
+ /**
2007
+ * Creates a clone of `buffer`.
2008
+ *
2009
+ * @private
2010
+ * @param {Buffer} buffer The buffer to clone.
2011
+ * @param {boolean} [isDeep] Specify a deep clone.
2012
+ * @returns {Buffer} Returns the cloned buffer.
2013
+ */
2014
+ function cloneBuffer(buffer, isDeep) {
2015
+ if (isDeep) {
2016
+ return buffer.slice();
1480
2017
  }
2018
+ var length = buffer.length,
2019
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1481
2020
 
1482
- obj = obj[props[i]];
2021
+ buffer.copy(result);
2022
+ return result;
1483
2023
  }
1484
2024
 
1485
- var value = obj[props[length - 1]];
1486
-
1487
- if (deep && isObject(value)) {
1488
- for (var key_1 in value) {
1489
- defineProperty(key_1, deep, value, originKey, originStore, callback);
2025
+ /**
2026
+ * Copies the values of `source` to `array`.
2027
+ *
2028
+ * @private
2029
+ * @param {Array} source The array to copy values from.
2030
+ * @param {Array} [array=[]] The array to copy values to.
2031
+ * @returns {Array} Returns `array`.
2032
+ */
2033
+ function copyArray(source, array) {
2034
+ var index = -1,
2035
+ length = source.length;
2036
+
2037
+ array || (array = Array(length));
2038
+ while (++index < length) {
2039
+ array[index] = source[index];
1490
2040
  }
2041
+ return array;
1491
2042
  }
1492
2043
 
1493
- var _key = "_" + props[length - 1];
1494
-
1495
- obj[_key] = value;
1496
- Object.defineProperty(obj, _key, {
1497
- enumerable: false
1498
- });
1499
- Object.defineProperty(obj, props[length - 1], {
1500
- set: function set(val) {
1501
- var oldStore = cloneDeep(originStore);
1502
- obj["_" + props[length - 1]] = val;
1503
- callback(originKey, oldStore);
1504
-
1505
- if (deep && isObject(val)) {
1506
- _defineCache.delete(obj);
1507
-
1508
- for (var key_2 in val) {
1509
- defineProperty(key_2, deep, val, originKey, originStore, callback);
1510
- }
2044
+ /**
2045
+ * A specialized version of `_.filter` for arrays without support for
2046
+ * iteratee shorthands.
2047
+ *
2048
+ * @private
2049
+ * @param {Array} [array] The array to iterate over.
2050
+ * @param {Function} predicate The function invoked per iteration.
2051
+ * @returns {Array} Returns the new filtered array.
2052
+ */
2053
+ function arrayFilter(array, predicate) {
2054
+ var index = -1,
2055
+ length = array == null ? 0 : array.length,
2056
+ resIndex = 0,
2057
+ result = [];
2058
+
2059
+ while (++index < length) {
2060
+ var value = array[index];
2061
+ if (predicate(value, index, array)) {
2062
+ result[resIndex++] = value;
1511
2063
  }
1512
- },
1513
- get: function get() {
1514
- return obj["_" + props[length - 1]];
1515
- }
1516
- });
1517
- }
1518
-
1519
- function updateStore(store, newStore, force) {
1520
- for (var key in store) {
1521
- if (!(key in newStore)) {
1522
- continue;
1523
2064
  }
2065
+ return result;
2066
+ }
1524
2067
 
1525
- if (typeof store[key] === 'object') {
1526
- updateStore(store[key], newStore[key], force);
1527
- } else {
1528
- if (force || store[key] !== newStore[key]) {
1529
- store[key] = newStore[key];
1530
- }
1531
- }
2068
+ /**
2069
+ * This method returns a new empty array.
2070
+ *
2071
+ * @static
2072
+ * @memberOf _
2073
+ * @since 4.13.0
2074
+ * @category Util
2075
+ * @returns {Array} Returns the new empty array.
2076
+ * @example
2077
+ *
2078
+ * var arrays = _.times(2, _.stubArray);
2079
+ *
2080
+ * console.log(arrays);
2081
+ * // => [[], []]
2082
+ *
2083
+ * console.log(arrays[0] === arrays[1]);
2084
+ * // => false
2085
+ */
2086
+ function stubArray() {
2087
+ return [];
1532
2088
  }
1533
- }
1534
2089
 
1535
- var EvaXSystem = function (_super) {
1536
- __extends(EvaXSystem, _super);
2090
+ /** Used for built-in method references. */
2091
+ var objectProto$1 = Object.prototype;
2092
+
2093
+ /** Built-in value references. */
2094
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
2095
+
2096
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2097
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
2098
+
2099
+ /**
2100
+ * Creates an array of the own enumerable symbols of `object`.
2101
+ *
2102
+ * @private
2103
+ * @param {Object} object The object to query.
2104
+ * @returns {Array} Returns the array of symbols.
2105
+ */
2106
+ var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
2107
+ if (object == null) {
2108
+ return [];
2109
+ }
2110
+ object = Object(object);
2111
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
2112
+ return propertyIsEnumerable.call(object, symbol);
2113
+ });
2114
+ };
1537
2115
 
1538
- function EvaXSystem() {
1539
- var _this = _super !== null && _super.apply(this, arguments) || this;
2116
+ var getSymbols$1 = getSymbols;
2117
+
2118
+ /**
2119
+ * Copies own symbols of `source` to `object`.
2120
+ *
2121
+ * @private
2122
+ * @param {Object} source The object to copy symbols from.
2123
+ * @param {Object} [object={}] The object to copy symbols to.
2124
+ * @returns {Object} Returns `object`.
2125
+ */
2126
+ function copySymbols(source, object) {
2127
+ return copyObject(source, getSymbols$1(source), object);
2128
+ }
1540
2129
 
1541
- _this.changeList = [];
1542
- return _this;
2130
+ /**
2131
+ * Appends the elements of `values` to `array`.
2132
+ *
2133
+ * @private
2134
+ * @param {Array} array The array to modify.
2135
+ * @param {Array} values The values to append.
2136
+ * @returns {Array} Returns `array`.
2137
+ */
2138
+ function arrayPush(array, values) {
2139
+ var index = -1,
2140
+ length = values.length,
2141
+ offset = array.length;
2142
+
2143
+ while (++index < length) {
2144
+ array[offset + index] = values[index];
2145
+ }
2146
+ return array;
1543
2147
  }
1544
2148
 
1545
- EvaXSystem.prototype.init = function (_a) {
1546
- var _b = (_a === void 0 ? {
1547
- store: {}
1548
- } : _a).store,
1549
- store = _b === void 0 ? {} : _b;
1550
- this.ee = new EventEmitter();
1551
- this.store = store;
1552
- this.bindDefaultListener();
2149
+ /** Built-in value references. */
2150
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
2151
+
2152
+ var getPrototype$1 = getPrototype;
2153
+
2154
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2155
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2156
+
2157
+ /**
2158
+ * Creates an array of the own and inherited enumerable symbols of `object`.
2159
+ *
2160
+ * @private
2161
+ * @param {Object} object The object to query.
2162
+ * @returns {Array} Returns the array of symbols.
2163
+ */
2164
+ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
2165
+ var result = [];
2166
+ while (object) {
2167
+ arrayPush(result, getSymbols$1(object));
2168
+ object = getPrototype$1(object);
2169
+ }
2170
+ return result;
1553
2171
  };
1554
2172
 
1555
- EvaXSystem.prototype.bindDefaultListener = function () {
1556
- var _this = this;
1557
-
1558
- this.ee.on('evax.updateStore', function (store) {
1559
- _this.updateStore(store);
1560
- });
1561
- this.ee.on('evax.forceUpdateStore', function (store) {
1562
- _this.forceUpdateStore(store);
1563
- });
1564
- };
2173
+ var getSymbolsIn$1 = getSymbolsIn;
2174
+
2175
+ /**
2176
+ * Copies own and inherited symbols of `source` to `object`.
2177
+ *
2178
+ * @private
2179
+ * @param {Object} source The object to copy symbols from.
2180
+ * @param {Object} [object={}] The object to copy symbols to.
2181
+ * @returns {Object} Returns `object`.
2182
+ */
2183
+ function copySymbolsIn(source, object) {
2184
+ return copyObject(source, getSymbolsIn$1(source), object);
2185
+ }
1565
2186
 
1566
- EvaXSystem.prototype.changeCallback = function (key, oldStore) {
1567
- this.changeList.push({
1568
- key: key,
1569
- oldStore: oldStore
1570
- });
1571
- };
2187
+ /**
2188
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
2189
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
2190
+ * symbols of `object`.
2191
+ *
2192
+ * @private
2193
+ * @param {Object} object The object to query.
2194
+ * @param {Function} keysFunc The function to get the keys of `object`.
2195
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
2196
+ * @returns {Array} Returns the array of property names and symbols.
2197
+ */
2198
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2199
+ var result = keysFunc(object);
2200
+ return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
2201
+ }
1572
2202
 
1573
- EvaXSystem.prototype.updateStore = function (store) {
1574
- updateStore(this.store, store, false);
1575
- };
2203
+ /**
2204
+ * Creates an array of own enumerable property names and symbols of `object`.
2205
+ *
2206
+ * @private
2207
+ * @param {Object} object The object to query.
2208
+ * @returns {Array} Returns the array of property names and symbols.
2209
+ */
2210
+ function getAllKeys(object) {
2211
+ return baseGetAllKeys(object, keys, getSymbols$1);
2212
+ }
1576
2213
 
1577
- EvaXSystem.prototype.forceUpdateStore = function (store) {
1578
- updateStore(this.store, store, true);
1579
- };
2214
+ /**
2215
+ * Creates an array of own and inherited enumerable property names and
2216
+ * symbols of `object`.
2217
+ *
2218
+ * @private
2219
+ * @param {Object} object The object to query.
2220
+ * @returns {Array} Returns the array of property names and symbols.
2221
+ */
2222
+ function getAllKeysIn(object) {
2223
+ return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
2224
+ }
1580
2225
 
1581
- EvaXSystem.prototype.bindListener = function (key, deep) {
1582
- var _this = this;
2226
+ /* Built-in method references that are verified to be native. */
2227
+ var DataView = getNative(root$1, 'DataView');
2228
+
2229
+ var DataView$1 = DataView;
2230
+
2231
+ /* Built-in method references that are verified to be native. */
2232
+ var Promise$1 = getNative(root$1, 'Promise');
2233
+
2234
+ var Promise$2 = Promise$1;
2235
+
2236
+ /* Built-in method references that are verified to be native. */
2237
+ var Set = getNative(root$1, 'Set');
2238
+
2239
+ var Set$1 = Set;
2240
+
2241
+ /* Built-in method references that are verified to be native. */
2242
+ var WeakMap = getNative(root$1, 'WeakMap');
2243
+
2244
+ var WeakMap$1 = WeakMap;
2245
+
2246
+ /** `Object#toString` result references. */
2247
+ var mapTag$3 = '[object Map]',
2248
+ objectTag$1 = '[object Object]',
2249
+ promiseTag = '[object Promise]',
2250
+ setTag$3 = '[object Set]',
2251
+ weakMapTag$1 = '[object WeakMap]';
2252
+
2253
+ var dataViewTag$2 = '[object DataView]';
2254
+
2255
+ /** Used to detect maps, sets, and weakmaps. */
2256
+ var dataViewCtorString = toSource(DataView$1),
2257
+ mapCtorString = toSource(Map$2),
2258
+ promiseCtorString = toSource(Promise$2),
2259
+ setCtorString = toSource(Set$1),
2260
+ weakMapCtorString = toSource(WeakMap$1);
2261
+
2262
+ /**
2263
+ * Gets the `toStringTag` of `value`.
2264
+ *
2265
+ * @private
2266
+ * @param {*} value The value to query.
2267
+ * @returns {string} Returns the `toStringTag`.
2268
+ */
2269
+ var getTag = baseGetTag;
2270
+
2271
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2272
+ if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2) ||
2273
+ (Map$2 && getTag(new Map$2) != mapTag$3) ||
2274
+ (Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
2275
+ (Set$1 && getTag(new Set$1) != setTag$3) ||
2276
+ (WeakMap$1 && getTag(new WeakMap$1) != weakMapTag$1)) {
2277
+ getTag = function(value) {
2278
+ var result = baseGetTag(value),
2279
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
2280
+ ctorString = Ctor ? toSource(Ctor) : '';
2281
+
2282
+ if (ctorString) {
2283
+ switch (ctorString) {
2284
+ case dataViewCtorString: return dataViewTag$2;
2285
+ case mapCtorString: return mapTag$3;
2286
+ case promiseCtorString: return promiseTag;
2287
+ case setCtorString: return setTag$3;
2288
+ case weakMapCtorString: return weakMapTag$1;
2289
+ }
2290
+ }
2291
+ return result;
2292
+ };
2293
+ }
1583
2294
 
1584
- if (key.indexOf('store.') === -1) {
1585
- return;
2295
+ var getTag$1 = getTag;
2296
+
2297
+ /** Used for built-in method references. */
2298
+ var objectProto = Object.prototype;
2299
+
2300
+ /** Used to check objects for own properties. */
2301
+ var hasOwnProperty = objectProto.hasOwnProperty;
2302
+
2303
+ /**
2304
+ * Initializes an array clone.
2305
+ *
2306
+ * @private
2307
+ * @param {Array} array The array to clone.
2308
+ * @returns {Array} Returns the initialized clone.
2309
+ */
2310
+ function initCloneArray(array) {
2311
+ var length = array.length,
2312
+ result = new array.constructor(length);
2313
+
2314
+ // Add properties assigned by `RegExp#exec`.
2315
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
2316
+ result.index = array.index;
2317
+ result.input = array.input;
1586
2318
  }
2319
+ return result;
2320
+ }
1587
2321
 
1588
- var realKey = key.split('.').slice(1).join('.');
1589
- defineProperty(realKey, deep, this.store, key, this.store, function (key, oldStore) {
1590
- return _this.changeCallback(key, oldStore);
1591
- });
1592
- };
2322
+ /** Built-in value references. */
2323
+ var Uint8Array = root$1.Uint8Array;
2324
+
2325
+ var Uint8Array$1 = Uint8Array;
2326
+
2327
+ /**
2328
+ * Creates a clone of `arrayBuffer`.
2329
+ *
2330
+ * @private
2331
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
2332
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
2333
+ */
2334
+ function cloneArrayBuffer(arrayBuffer) {
2335
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2336
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
2337
+ return result;
2338
+ }
1593
2339
 
1594
- EvaXSystem.prototype.update = function () {
1595
- var e_1, _a;
2340
+ /**
2341
+ * Creates a clone of `dataView`.
2342
+ *
2343
+ * @private
2344
+ * @param {Object} dataView The data view to clone.
2345
+ * @param {boolean} [isDeep] Specify a deep clone.
2346
+ * @returns {Object} Returns the cloned data view.
2347
+ */
2348
+ function cloneDataView(dataView, isDeep) {
2349
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2350
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2351
+ }
1596
2352
 
1597
- var changes = this.componentObserver.clear();
2353
+ /** Used to match `RegExp` flags from their coerced string values. */
2354
+ var reFlags = /\w*$/;
2355
+
2356
+ /**
2357
+ * Creates a clone of `regexp`.
2358
+ *
2359
+ * @private
2360
+ * @param {Object} regexp The regexp to clone.
2361
+ * @returns {Object} Returns the cloned regexp.
2362
+ */
2363
+ function cloneRegExp(regexp) {
2364
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2365
+ result.lastIndex = regexp.lastIndex;
2366
+ return result;
2367
+ }
1598
2368
 
1599
- try {
1600
- for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
1601
- var changed = changes_1_1.value;
2369
+ /** Used to convert symbols to primitives and strings. */
2370
+ var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
2371
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2372
+
2373
+ /**
2374
+ * Creates a clone of the `symbol` object.
2375
+ *
2376
+ * @private
2377
+ * @param {Object} symbol The symbol object to clone.
2378
+ * @returns {Object} Returns the cloned symbol object.
2379
+ */
2380
+ function cloneSymbol(symbol) {
2381
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2382
+ }
1602
2383
 
1603
- switch (changed.type) {
1604
- case eva_js.OBSERVER_TYPE.ADD:
1605
- this.add(changed);
1606
- break;
2384
+ /**
2385
+ * Creates a clone of `typedArray`.
2386
+ *
2387
+ * @private
2388
+ * @param {Object} typedArray The typed array to clone.
2389
+ * @param {boolean} [isDeep] Specify a deep clone.
2390
+ * @returns {Object} Returns the cloned typed array.
2391
+ */
2392
+ function cloneTypedArray(typedArray, isDeep) {
2393
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2394
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2395
+ }
1607
2396
 
1608
- case eva_js.OBSERVER_TYPE.REMOVE:
1609
- this.remove(changed);
1610
- break;
1611
- }
1612
- }
1613
- } catch (e_1_1) {
1614
- e_1 = {
1615
- error: e_1_1
1616
- };
1617
- } finally {
1618
- try {
1619
- if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
1620
- } finally {
1621
- if (e_1) throw e_1.error;
1622
- }
2397
+ /** `Object#toString` result references. */
2398
+ var boolTag$1 = '[object Boolean]',
2399
+ dateTag$1 = '[object Date]',
2400
+ mapTag$2 = '[object Map]',
2401
+ numberTag$1 = '[object Number]',
2402
+ regexpTag$1 = '[object RegExp]',
2403
+ setTag$2 = '[object Set]',
2404
+ stringTag$1 = '[object String]',
2405
+ symbolTag$1 = '[object Symbol]';
2406
+
2407
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
2408
+ dataViewTag$1 = '[object DataView]',
2409
+ float32Tag$1 = '[object Float32Array]',
2410
+ float64Tag$1 = '[object Float64Array]',
2411
+ int8Tag$1 = '[object Int8Array]',
2412
+ int16Tag$1 = '[object Int16Array]',
2413
+ int32Tag$1 = '[object Int32Array]',
2414
+ uint8Tag$1 = '[object Uint8Array]',
2415
+ uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2416
+ uint16Tag$1 = '[object Uint16Array]',
2417
+ uint32Tag$1 = '[object Uint32Array]';
2418
+
2419
+ /**
2420
+ * Initializes an object clone based on its `toStringTag`.
2421
+ *
2422
+ * **Note:** This function only supports cloning values with tags of
2423
+ * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2424
+ *
2425
+ * @private
2426
+ * @param {Object} object The object to clone.
2427
+ * @param {string} tag The `toStringTag` of the object to clone.
2428
+ * @param {boolean} [isDeep] Specify a deep clone.
2429
+ * @returns {Object} Returns the initialized clone.
2430
+ */
2431
+ function initCloneByTag(object, tag, isDeep) {
2432
+ var Ctor = object.constructor;
2433
+ switch (tag) {
2434
+ case arrayBufferTag$1:
2435
+ return cloneArrayBuffer(object);
2436
+
2437
+ case boolTag$1:
2438
+ case dateTag$1:
2439
+ return new Ctor(+object);
2440
+
2441
+ case dataViewTag$1:
2442
+ return cloneDataView(object, isDeep);
2443
+
2444
+ case float32Tag$1: case float64Tag$1:
2445
+ case int8Tag$1: case int16Tag$1: case int32Tag$1:
2446
+ case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2447
+ return cloneTypedArray(object, isDeep);
2448
+
2449
+ case mapTag$2:
2450
+ return new Ctor;
2451
+
2452
+ case numberTag$1:
2453
+ case stringTag$1:
2454
+ return new Ctor(object);
2455
+
2456
+ case regexpTag$1:
2457
+ return cloneRegExp(object);
2458
+
2459
+ case setTag$2:
2460
+ return new Ctor;
2461
+
2462
+ case symbolTag$1:
2463
+ return cloneSymbol(object);
1623
2464
  }
1624
- };
1625
-
1626
- EvaXSystem.prototype.lateUpdate = function () {
1627
- var e_2, _a;
2465
+ }
1628
2466
 
1629
- try {
1630
- for (var _b = __values(this.changeList), _c = _b.next(); !_c.done; _c = _b.next()) {
1631
- var item = _c.value;
1632
- this.ee.emit(item.key, this.store, item.oldStore);
2467
+ /** Built-in value references. */
2468
+ var objectCreate = Object.create;
2469
+
2470
+ /**
2471
+ * The base implementation of `_.create` without support for assigning
2472
+ * properties to the created object.
2473
+ *
2474
+ * @private
2475
+ * @param {Object} proto The object to inherit from.
2476
+ * @returns {Object} Returns the new object.
2477
+ */
2478
+ var baseCreate = (function() {
2479
+ function object() {}
2480
+ return function(proto) {
2481
+ if (!isObject(proto)) {
2482
+ return {};
1633
2483
  }
1634
- } catch (e_2_1) {
1635
- e_2 = {
1636
- error: e_2_1
1637
- };
1638
- } finally {
1639
- try {
1640
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1641
- } finally {
1642
- if (e_2) throw e_2.error;
2484
+ if (objectCreate) {
2485
+ return objectCreate(proto);
1643
2486
  }
1644
- }
2487
+ object.prototype = proto;
2488
+ var result = new object;
2489
+ object.prototype = undefined;
2490
+ return result;
2491
+ };
2492
+ }());
2493
+
2494
+ var baseCreate$1 = baseCreate;
2495
+
2496
+ /**
2497
+ * Initializes an object clone.
2498
+ *
2499
+ * @private
2500
+ * @param {Object} object The object to clone.
2501
+ * @returns {Object} Returns the initialized clone.
2502
+ */
2503
+ function initCloneObject(object) {
2504
+ return (typeof object.constructor == 'function' && !isPrototype(object))
2505
+ ? baseCreate$1(getPrototype$1(object))
2506
+ : {};
2507
+ }
1645
2508
 
1646
- this.changeList = [];
1647
- };
2509
+ /** `Object#toString` result references. */
2510
+ var mapTag$1 = '[object Map]';
2511
+
2512
+ /**
2513
+ * The base implementation of `_.isMap` without Node.js optimizations.
2514
+ *
2515
+ * @private
2516
+ * @param {*} value The value to check.
2517
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2518
+ */
2519
+ function baseIsMap(value) {
2520
+ return isObjectLike(value) && getTag$1(value) == mapTag$1;
2521
+ }
1648
2522
 
1649
- EvaXSystem.prototype.add = function (changed) {
1650
- var component = changed.component;
1651
- component.evax = this;
2523
+ /* Node.js helper references. */
2524
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
2525
+
2526
+ /**
2527
+ * Checks if `value` is classified as a `Map` object.
2528
+ *
2529
+ * @static
2530
+ * @memberOf _
2531
+ * @since 4.3.0
2532
+ * @category Lang
2533
+ * @param {*} value The value to check.
2534
+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2535
+ * @example
2536
+ *
2537
+ * _.isMap(new Map);
2538
+ * // => true
2539
+ *
2540
+ * _.isMap(new WeakMap);
2541
+ * // => false
2542
+ */
2543
+ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2544
+
2545
+ var isMap$1 = isMap;
2546
+
2547
+ /** `Object#toString` result references. */
2548
+ var setTag$1 = '[object Set]';
2549
+
2550
+ /**
2551
+ * The base implementation of `_.isSet` without Node.js optimizations.
2552
+ *
2553
+ * @private
2554
+ * @param {*} value The value to check.
2555
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2556
+ */
2557
+ function baseIsSet(value) {
2558
+ return isObjectLike(value) && getTag$1(value) == setTag$1;
2559
+ }
1652
2560
 
1653
- for (var key in component.events) {
1654
- if (component.events[key]) {
1655
- this.bindListener(key, !!component.events[key].deep);
1656
- var func = void 0;
2561
+ /* Node.js helper references. */
2562
+ var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
2563
+
2564
+ /**
2565
+ * Checks if `value` is classified as a `Set` object.
2566
+ *
2567
+ * @static
2568
+ * @memberOf _
2569
+ * @since 4.3.0
2570
+ * @category Lang
2571
+ * @param {*} value The value to check.
2572
+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2573
+ * @example
2574
+ *
2575
+ * _.isSet(new Set);
2576
+ * // => true
2577
+ *
2578
+ * _.isSet(new WeakSet);
2579
+ * // => false
2580
+ */
2581
+ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2582
+
2583
+ var isSet$1 = isSet;
2584
+
2585
+ /** Used to compose bitmasks for cloning. */
2586
+ var CLONE_DEEP_FLAG$1 = 1,
2587
+ CLONE_FLAT_FLAG = 2,
2588
+ CLONE_SYMBOLS_FLAG$1 = 4;
2589
+
2590
+ /** `Object#toString` result references. */
2591
+ var argsTag = '[object Arguments]',
2592
+ arrayTag = '[object Array]',
2593
+ boolTag = '[object Boolean]',
2594
+ dateTag = '[object Date]',
2595
+ errorTag = '[object Error]',
2596
+ funcTag = '[object Function]',
2597
+ genTag = '[object GeneratorFunction]',
2598
+ mapTag = '[object Map]',
2599
+ numberTag = '[object Number]',
2600
+ objectTag = '[object Object]',
2601
+ regexpTag = '[object RegExp]',
2602
+ setTag = '[object Set]',
2603
+ stringTag = '[object String]',
2604
+ symbolTag = '[object Symbol]',
2605
+ weakMapTag = '[object WeakMap]';
2606
+
2607
+ var arrayBufferTag = '[object ArrayBuffer]',
2608
+ dataViewTag = '[object DataView]',
2609
+ float32Tag = '[object Float32Array]',
2610
+ float64Tag = '[object Float64Array]',
2611
+ int8Tag = '[object Int8Array]',
2612
+ int16Tag = '[object Int16Array]',
2613
+ int32Tag = '[object Int32Array]',
2614
+ uint8Tag = '[object Uint8Array]',
2615
+ uint8ClampedTag = '[object Uint8ClampedArray]',
2616
+ uint16Tag = '[object Uint16Array]',
2617
+ uint32Tag = '[object Uint32Array]';
2618
+
2619
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
2620
+ var cloneableTags = {};
2621
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
2622
+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2623
+ cloneableTags[boolTag] = cloneableTags[dateTag] =
2624
+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2625
+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2626
+ cloneableTags[int32Tag] = cloneableTags[mapTag] =
2627
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
2628
+ cloneableTags[regexpTag] = cloneableTags[setTag] =
2629
+ cloneableTags[stringTag] = cloneableTags[symbolTag] =
2630
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2631
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2632
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
2633
+ cloneableTags[weakMapTag] = false;
2634
+
2635
+ /**
2636
+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2637
+ * traversed objects.
2638
+ *
2639
+ * @private
2640
+ * @param {*} value The value to clone.
2641
+ * @param {boolean} bitmask The bitmask flags.
2642
+ * 1 - Deep clone
2643
+ * 2 - Flatten inherited properties
2644
+ * 4 - Clone symbols
2645
+ * @param {Function} [customizer] The function to customize cloning.
2646
+ * @param {string} [key] The key of `value`.
2647
+ * @param {Object} [object] The parent object of `value`.
2648
+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2649
+ * @returns {*} Returns the cloned value.
2650
+ */
2651
+ function baseClone(value, bitmask, customizer, key, object, stack) {
2652
+ var result,
2653
+ isDeep = bitmask & CLONE_DEEP_FLAG$1,
2654
+ isFlat = bitmask & CLONE_FLAT_FLAG,
2655
+ isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2656
+
2657
+ if (customizer) {
2658
+ result = object ? customizer(value, key, object, stack) : customizer(value);
2659
+ }
2660
+ if (result !== undefined) {
2661
+ return result;
2662
+ }
2663
+ if (!isObject(value)) {
2664
+ return value;
2665
+ }
2666
+ var isArr = isArray$1(value);
2667
+ if (isArr) {
2668
+ result = initCloneArray(value);
2669
+ if (!isDeep) {
2670
+ return copyArray(value, result);
2671
+ }
2672
+ } else {
2673
+ var tag = getTag$1(value),
2674
+ isFunc = tag == funcTag || tag == genTag;
1657
2675
 
1658
- if (component.events[key] instanceof Function) {
1659
- func = component.events[key];
1660
- } else {
1661
- func = component.events[key].handler;
2676
+ if (isBuffer$1(value)) {
2677
+ return cloneBuffer(value, isDeep);
2678
+ }
2679
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2680
+ result = (isFlat || isFunc) ? {} : initCloneObject(value);
2681
+ if (!isDeep) {
2682
+ return isFlat
2683
+ ? copySymbolsIn(value, baseAssignIn(result, value))
2684
+ : copySymbols(value, baseAssign(result, value));
1662
2685
  }
1663
-
1664
- this.ee.on(key, func.bind(component));
2686
+ } else {
2687
+ if (!cloneableTags[tag]) {
2688
+ return object ? value : {};
2689
+ }
2690
+ result = initCloneByTag(value, tag, isDeep);
1665
2691
  }
1666
2692
  }
1667
- };
2693
+ // Check for circular references and return its corresponding clone.
2694
+ stack || (stack = new Stack);
2695
+ var stacked = stack.get(value);
2696
+ if (stacked) {
2697
+ return stacked;
2698
+ }
2699
+ stack.set(value, result);
2700
+
2701
+ if (isSet$1(value)) {
2702
+ value.forEach(function(subValue) {
2703
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2704
+ });
2705
+ } else if (isMap$1(value)) {
2706
+ value.forEach(function(subValue, key) {
2707
+ result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2708
+ });
2709
+ }
1668
2710
 
1669
- EvaXSystem.prototype.remove = function (changed) {
1670
- var component = changed.component;
2711
+ var keysFunc = isFull
2712
+ ? (isFlat ? getAllKeysIn : getAllKeys)
2713
+ : (isFlat ? keysIn : keys);
1671
2714
 
1672
- for (var key in component.events) {
1673
- if (component.events[key] instanceof Function) {
1674
- this.ee.off(key, component.events[key].bind(component));
2715
+ var props = isArr ? undefined : keysFunc(value);
2716
+ arrayEach(props || value, function(subValue, key) {
2717
+ if (props) {
2718
+ key = subValue;
2719
+ subValue = value[key];
1675
2720
  }
1676
- }
1677
- };
1678
-
1679
- EvaXSystem.prototype.on = function (eventName, func) {
1680
- return this.ee.on(eventName, func, this);
1681
- };
2721
+ // Recursively populate clone (susceptible to call stack limits).
2722
+ assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2723
+ });
2724
+ return result;
2725
+ }
1682
2726
 
1683
- EvaXSystem.prototype.off = function (eventName, func) {
1684
- return this.ee.off(eventName, func);
1685
- };
2727
+ /** Used to compose bitmasks for cloning. */
2728
+ var CLONE_DEEP_FLAG = 1,
2729
+ CLONE_SYMBOLS_FLAG = 4;
2730
+
2731
+ /**
2732
+ * This method is like `_.clone` except that it recursively clones `value`.
2733
+ *
2734
+ * @static
2735
+ * @memberOf _
2736
+ * @since 1.0.0
2737
+ * @category Lang
2738
+ * @param {*} value The value to recursively clone.
2739
+ * @returns {*} Returns the deep cloned value.
2740
+ * @see _.clone
2741
+ * @example
2742
+ *
2743
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
2744
+ *
2745
+ * var deep = _.cloneDeep(objects);
2746
+ * console.log(deep[0] === objects[0]);
2747
+ * // => false
2748
+ */
2749
+ function cloneDeep(value) {
2750
+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2751
+ }
1686
2752
 
1687
- EvaXSystem.prototype.emit = function (eventName) {
1688
- var _a;
2753
+ var _defineCache = new Map();
2754
+ function defineProperty(key, deep, store, originKey, originStore, callback) {
2755
+ if (!_defineCache.has(store)) {
2756
+ _defineCache.set(store, []);
2757
+ }
2758
+ if (_defineCache.get(store).indexOf(key) > -1) {
2759
+ return;
2760
+ }
2761
+ _defineCache.get(store).push(key);
2762
+ var props = key.split('.');
2763
+ var obj = store;
2764
+ var length = props.length;
2765
+ for (var i = 0; i < length - 1; i++) {
2766
+ if (obj[props[i]] === undefined) {
2767
+ return;
2768
+ }
2769
+ obj = obj[props[i]];
2770
+ }
2771
+ var value = obj[props[length - 1]];
2772
+ if (deep && isObject(value)) {
2773
+ for (var key_1 in value) {
2774
+ defineProperty(key_1, deep, value, originKey, originStore, callback);
2775
+ }
2776
+ }
2777
+ var _key = "_" + props[length - 1];
2778
+ obj[_key] = value;
2779
+ Object.defineProperty(obj, _key, {
2780
+ enumerable: false,
2781
+ });
2782
+ Object.defineProperty(obj, props[length - 1], {
2783
+ set: function (val) {
2784
+ var oldStore = cloneDeep(originStore);
2785
+ obj["_" + props[length - 1]] = val;
2786
+ callback(originKey, oldStore);
2787
+ if (deep && isObject(val)) {
2788
+ _defineCache.delete(obj);
2789
+ for (var key_2 in val) {
2790
+ defineProperty(key_2, deep, val, originKey, originStore, callback);
2791
+ }
2792
+ }
2793
+ },
2794
+ get: function () {
2795
+ return obj["_" + props[length - 1]];
2796
+ },
2797
+ });
2798
+ }
2799
+ function updateStore(store, newStore, force) {
2800
+ for (var key in store) {
2801
+ if (!(key in newStore)) {
2802
+ continue;
2803
+ }
2804
+ if (typeof store[key] === 'object') {
2805
+ updateStore(store[key], newStore[key], force);
2806
+ }
2807
+ else {
2808
+ if (force || store[key] !== newStore[key]) {
2809
+ store[key] = newStore[key];
2810
+ }
2811
+ }
2812
+ }
2813
+ }
1689
2814
 
1690
- var args = [];
2815
+ var EvaXSystem = (function (_super) {
2816
+ __extends(EvaXSystem, _super);
2817
+ function EvaXSystem() {
2818
+ var _this = _super !== null && _super.apply(this, arguments) || this;
2819
+ _this.changeList = [];
2820
+ return _this;
2821
+ }
2822
+ EvaXSystem.prototype.init = function (_a) {
2823
+ var _b = (_a === void 0 ? { store: {} } : _a).store, store = _b === void 0 ? {} : _b;
2824
+ this.ee = new EventEmitter();
2825
+ this.store = store;
2826
+ this.bindDefaultListener();
2827
+ };
2828
+ EvaXSystem.prototype.bindDefaultListener = function () {
2829
+ var _this = this;
2830
+ this.ee.on('evax.updateStore', function (store) {
2831
+ _this.updateStore(store);
2832
+ });
2833
+ this.ee.on('evax.forceUpdateStore', function (store) {
2834
+ _this.forceUpdateStore(store);
2835
+ });
2836
+ };
2837
+ EvaXSystem.prototype.changeCallback = function (key, oldStore) {
2838
+ this.changeList.push({
2839
+ key: key,
2840
+ oldStore: oldStore,
2841
+ });
2842
+ };
2843
+ EvaXSystem.prototype.updateStore = function (store) {
2844
+ updateStore(this.store, store, false);
2845
+ };
2846
+ EvaXSystem.prototype.forceUpdateStore = function (store) {
2847
+ updateStore(this.store, store, true);
2848
+ };
2849
+ EvaXSystem.prototype.bindListener = function (key, deep) {
2850
+ var _this = this;
2851
+ if (key.indexOf('store.') === -1) {
2852
+ return;
2853
+ }
2854
+ var realKey = key.split('.').slice(1).join('.');
2855
+ defineProperty(realKey, deep, this.store, key, this.store, function (key, oldStore) { return _this.changeCallback(key, oldStore); });
2856
+ };
2857
+ EvaXSystem.prototype.update = function () {
2858
+ var e_1, _a;
2859
+ var changes = this.componentObserver.clear();
2860
+ try {
2861
+ for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
2862
+ var changed = changes_1_1.value;
2863
+ switch (changed.type) {
2864
+ case eva_js.OBSERVER_TYPE.ADD:
2865
+ this.add(changed);
2866
+ break;
2867
+ case eva_js.OBSERVER_TYPE.REMOVE:
2868
+ this.remove(changed);
2869
+ break;
2870
+ }
2871
+ }
2872
+ }
2873
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2874
+ finally {
2875
+ try {
2876
+ if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
2877
+ }
2878
+ finally { if (e_1) throw e_1.error; }
2879
+ }
2880
+ };
2881
+ EvaXSystem.prototype.lateUpdate = function () {
2882
+ var e_2, _a;
2883
+ try {
2884
+ for (var _b = __values(this.changeList), _c = _b.next(); !_c.done; _c = _b.next()) {
2885
+ var item = _c.value;
2886
+ this.ee.emit(item.key, this.store, item.oldStore);
2887
+ }
2888
+ }
2889
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2890
+ finally {
2891
+ try {
2892
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2893
+ }
2894
+ finally { if (e_2) throw e_2.error; }
2895
+ }
2896
+ this.changeList = [];
2897
+ };
2898
+ EvaXSystem.prototype.add = function (changed) {
2899
+ var component = changed.component;
2900
+ component.evax = this;
2901
+ for (var key in component.events) {
2902
+ if (component.events[key]) {
2903
+ this.bindListener(key, !!component.events[key].deep);
2904
+ var func = void 0;
2905
+ if (component.events[key] instanceof Function) {
2906
+ func = component.events[key];
2907
+ }
2908
+ else {
2909
+ func = component.events[key].handler;
2910
+ }
2911
+ this.ee.on(key, func.bind(component));
2912
+ }
2913
+ }
2914
+ };
2915
+ EvaXSystem.prototype.remove = function (changed) {
2916
+ var component = changed.component;
2917
+ for (var key in component.events) {
2918
+ if (component.events[key] instanceof Function) {
2919
+ this.ee.off(key, component.events[key].bind(component));
2920
+ }
2921
+ }
2922
+ };
2923
+ EvaXSystem.prototype.on = function (eventName, func) {
2924
+ return this.ee.on(eventName, func, this);
2925
+ };
2926
+ EvaXSystem.prototype.off = function (eventName, func) {
2927
+ return this.ee.off(eventName, func);
2928
+ };
2929
+ EvaXSystem.prototype.emit = function (eventName) {
2930
+ var _a;
2931
+ var args = [];
2932
+ for (var _i = 1; _i < arguments.length; _i++) {
2933
+ args[_i - 1] = arguments[_i];
2934
+ }
2935
+ return (_a = this.ee).emit.apply(_a, __spread([eventName], args));
2936
+ };
2937
+ EvaXSystem.prototype.onDestroy = function () { };
2938
+ EvaXSystem.systemName = 'EvaX';
2939
+ EvaXSystem = __decorate([
2940
+ eva_js.decorators.componentObserver({
2941
+ EvaX: [],
2942
+ })
2943
+ ], EvaXSystem);
2944
+ return EvaXSystem;
2945
+ }(eva_js.System));
2946
+ var EvaXSystem$1 = EvaXSystem;
2947
+
2948
+ var index = {
2949
+ Components: [EvaXComponent$1],
2950
+ Systems: [EvaXSystem$1],
2951
+ };
1691
2952
 
1692
- for (var _i = 1; _i < arguments.length; _i++) {
1693
- args[_i - 1] = arguments[_i];
1694
- }
2953
+ exports.EvaX = EvaXComponent$1;
2954
+ exports.EvaXSystem = EvaXSystem$1;
2955
+ exports['default'] = index;
1695
2956
 
1696
- return (_a = this.ee).emit.apply(_a, __spread([eventName], args));
1697
- };
2957
+ Object.defineProperty(exports, '__esModule', { value: true });
1698
2958
 
1699
- EvaXSystem.prototype.onDestroy = function () {};
1700
-
1701
- EvaXSystem.systemName = 'EvaX';
1702
- EvaXSystem = __decorate([eva_js.decorators.componentObserver({
1703
- EvaX: []
1704
- })], EvaXSystem);
1705
- return EvaXSystem;
1706
- }(eva_js.System);
1707
-
1708
- var EvaXSystem$1 = EvaXSystem;
1709
- var index = {
1710
- Components: [EvaXComponent$1],
1711
- Systems: [EvaXSystem$1]
1712
- };
1713
- exports.EvaX = EvaXComponent$1;
1714
- exports.EvaXSystem = EvaXSystem$1;
1715
- exports["default"] = index;
1716
- Object.defineProperty(exports, '__esModule', {
1717
- value: true
1718
- });
1719
- return exports;
1720
- }({}, EVA);
1721
-
1722
- window.EVA.plugin.EVAX = window.EVA.plugin.EVAX || _EVA_IIFE_EVAX;
2959
+ })));
2960
+ //# sourceMappingURL=EVA.plugin.EVAX.js.map