@audius/sdk 1.0.34 → 1.0.36

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.
package/dist/index.cjs.js CHANGED
@@ -599,6 +599,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
599
599
  };
600
600
  }
601
601
 
602
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
603
+
602
604
  var Web3;
603
605
 
604
606
  if (typeof window !== 'undefined' && window && window.Web3) {
@@ -37172,9 +37174,9 @@ exports.ChatPermission = void 0;
37172
37174
  })(exports.ChatPermission || (exports.ChatPermission = {}));
37173
37175
 
37174
37176
  var name = "@audius/sdk";
37175
- var version = "1.0.34";
37177
+ var version = "1.0.36";
37176
37178
  var audius = {
37177
- releaseSHA: "8f0ae0d181bf1ee2dcf5ccc26987aaf1d0861903"
37179
+ releaseSHA: "f5d39ff9c22d1fe9b5ca9c14261a1690575af34d"
37178
37180
  };
37179
37181
  var description = "";
37180
37182
  var main = "dist/index.cjs.js";
@@ -50610,12 +50612,27 @@ var definitions$2 = {
50610
50612
  "ERC721",
50611
50613
  "ERC1155"
50612
50614
  ]
50615
+ },
50616
+ name: {
50617
+ type: "string"
50618
+ },
50619
+ slug: {
50620
+ type: "string"
50621
+ },
50622
+ externalLink: {
50623
+ type: [
50624
+ "string",
50625
+ "null"
50626
+ ],
50627
+ "default": null
50613
50628
  }
50614
50629
  },
50615
50630
  required: [
50616
50631
  "chain",
50617
50632
  "address",
50618
- "standard"
50633
+ "standard",
50634
+ "name",
50635
+ "slug"
50619
50636
  ],
50620
50637
  title: "PremiumConditionsEthNFTCollection"
50621
50638
  },
@@ -50629,11 +50646,22 @@ var definitions$2 = {
50629
50646
  },
50630
50647
  address: {
50631
50648
  type: "string"
50649
+ },
50650
+ name: {
50651
+ type: "string"
50652
+ },
50653
+ externalLink: {
50654
+ type: [
50655
+ "string",
50656
+ "null"
50657
+ ],
50658
+ "default": null
50632
50659
  }
50633
50660
  },
50634
50661
  required: [
50635
50662
  "chain",
50636
- "address"
50663
+ "address",
50664
+ "name"
50637
50665
  ],
50638
50666
  title: "PremiumConditionsSolNFTCollection"
50639
50667
  },
@@ -62884,247 +62912,3431 @@ var syncNodes = /*#__PURE__*/function () {
62884
62912
  };
62885
62913
  }();
62886
62914
 
62887
- var THREE_SECONDS = 3000;
62888
- var MAX_TRIES = 3;
62889
- /** Check if the user's primary creator node is healthy */
62915
+ var freeGlobal$1 = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
62916
+ var _freeGlobal = freeGlobal$1;
62890
62917
 
62891
- var checkPrimaryHealthy = /*#__PURE__*/function () {
62892
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
62893
- var healthy;
62894
- return regeneratorRuntime.wrap(function _callee$(_context) {
62895
- while (1) {
62896
- switch (_context.prev = _context.next) {
62897
- case 0:
62898
- _context.next = 2;
62899
- return Utils.isHealthy(primary);
62918
+ var freeGlobal = _freeGlobal;
62919
+ /** Detect free variable `self`. */
62900
62920
 
62901
- case 2:
62902
- healthy = _context.sent;
62921
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
62922
+ /** Used as a reference to the global object. */
62903
62923
 
62904
- if (!healthy) {
62905
- _context.next = 7;
62906
- break;
62907
- }
62924
+ var root$8 = freeGlobal || freeSelf || Function('return this')();
62925
+ var _root = root$8;
62908
62926
 
62909
- return _context.abrupt("return", healthy);
62927
+ var root$7 = _root;
62928
+ /** Built-in value references. */
62910
62929
 
62911
- case 7:
62912
- if (!(tries === 0)) {
62913
- _context.next = 9;
62914
- break;
62915
- }
62930
+ var _Symbol2 = root$7.Symbol;
62931
+ var _Symbol$4 = _Symbol2;
62916
62932
 
62917
- return _context.abrupt("return", false);
62933
+ var _Symbol$3 = _Symbol$4;
62934
+ /** Used for built-in method references. */
62918
62935
 
62919
- case 9:
62920
- _context.next = 11;
62921
- return Utils.wait(THREE_SECONDS);
62936
+ var objectProto$b = Object.prototype;
62937
+ /** Used to check objects for own properties. */
62922
62938
 
62923
- case 11:
62924
- _context.next = 13;
62925
- return checkPrimaryHealthy(libs, primary, tries - 1);
62939
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
62940
+ /**
62941
+ * Used to resolve the
62942
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62943
+ * of values.
62944
+ */
62926
62945
 
62927
- case 13:
62928
- return _context.abrupt("return", _context.sent);
62946
+ var nativeObjectToString$1 = objectProto$b.toString;
62947
+ /** Built-in value references. */
62929
62948
 
62930
- case 14:
62931
- case "end":
62932
- return _context.stop();
62933
- }
62934
- }
62935
- }, _callee);
62936
- }));
62949
+ var symToStringTag$1 = _Symbol$3 ? _Symbol$3.toStringTag : undefined;
62950
+ /**
62951
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
62952
+ *
62953
+ * @private
62954
+ * @param {*} value The value to query.
62955
+ * @returns {string} Returns the raw `toStringTag`.
62956
+ */
62937
62957
 
62938
- return function checkPrimaryHealthy(_x, _x2, _x3) {
62939
- return _ref.apply(this, arguments);
62940
- };
62958
+ function getRawTag$1(value) {
62959
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
62960
+ tag = value[symToStringTag$1];
62961
+
62962
+ try {
62963
+ value[symToStringTag$1] = undefined;
62964
+ var unmasked = true;
62965
+ } catch (e) {}
62966
+
62967
+ var result = nativeObjectToString$1.call(value);
62968
+
62969
+ if (unmasked) {
62970
+ if (isOwn) {
62971
+ value[symToStringTag$1] = tag;
62972
+ } else {
62973
+ delete value[symToStringTag$1];
62974
+ }
62975
+ }
62976
+
62977
+ return result;
62978
+ }
62979
+
62980
+ var _getRawTag = getRawTag$1;
62981
+
62982
+ /** Used for built-in method references. */
62983
+ var objectProto$a = Object.prototype;
62984
+ /**
62985
+ * Used to resolve the
62986
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
62987
+ * of values.
62988
+ */
62989
+
62990
+ var nativeObjectToString = objectProto$a.toString;
62991
+ /**
62992
+ * Converts `value` to a string using `Object.prototype.toString`.
62993
+ *
62994
+ * @private
62995
+ * @param {*} value The value to convert.
62996
+ * @returns {string} Returns the converted string.
62997
+ */
62998
+
62999
+ function objectToString$1(value) {
63000
+ return nativeObjectToString.call(value);
63001
+ }
63002
+
63003
+ var _objectToString = objectToString$1;
63004
+
63005
+ var _Symbol$2 = _Symbol$4,
63006
+ getRawTag = _getRawTag,
63007
+ objectToString = _objectToString;
63008
+ /** `Object#toString` result references. */
63009
+
63010
+ var nullTag = '[object Null]',
63011
+ undefinedTag = '[object Undefined]';
63012
+ /** Built-in value references. */
63013
+
63014
+ var symToStringTag = _Symbol$2 ? _Symbol$2.toStringTag : undefined;
63015
+ /**
63016
+ * The base implementation of `getTag` without fallbacks for buggy environments.
63017
+ *
63018
+ * @private
63019
+ * @param {*} value The value to query.
63020
+ * @returns {string} Returns the `toStringTag`.
63021
+ */
63022
+
63023
+ function baseGetTag$5(value) {
63024
+ if (value == null) {
63025
+ return value === undefined ? undefinedTag : nullTag;
63026
+ }
63027
+
63028
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
63029
+ }
63030
+
63031
+ var _baseGetTag = baseGetTag$5;
63032
+
63033
+ function isObjectLike$5(value) {
63034
+ return value != null && _typeof(value) == 'object';
63035
+ }
63036
+
63037
+ var isObjectLike_1 = isObjectLike$5;
63038
+
63039
+ var baseGetTag$4 = _baseGetTag,
63040
+ isObjectLike$4 = isObjectLike_1;
63041
+ /** `Object#toString` result references. */
63042
+
63043
+ var symbolTag$1 = '[object Symbol]';
63044
+ /**
63045
+ * Checks if `value` is classified as a `Symbol` primitive or object.
63046
+ *
63047
+ * @static
63048
+ * @memberOf _
63049
+ * @since 4.0.0
63050
+ * @category Lang
63051
+ * @param {*} value The value to check.
63052
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
63053
+ * @example
63054
+ *
63055
+ * _.isSymbol(Symbol.iterator);
63056
+ * // => true
63057
+ *
63058
+ * _.isSymbol('abc');
63059
+ * // => false
63060
+ */
63061
+
63062
+ function isSymbol$4(value) {
63063
+ return _typeof(value) == 'symbol' || isObjectLike$4(value) && baseGetTag$4(value) == symbolTag$1;
63064
+ }
63065
+
63066
+ var isSymbol_1 = isSymbol$4;
63067
+
63068
+ var isSymbol$3 = isSymbol_1;
63069
+ /**
63070
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
63071
+ * `comparator` to determine the extremum value.
63072
+ *
63073
+ * @private
63074
+ * @param {Array} array The array to iterate over.
63075
+ * @param {Function} iteratee The iteratee invoked per iteration.
63076
+ * @param {Function} comparator The comparator used to compare values.
63077
+ * @returns {*} Returns the extremum value.
63078
+ */
63079
+
63080
+ function baseExtremum$1(array, iteratee, comparator) {
63081
+ var index = -1,
63082
+ length = array.length;
63083
+
63084
+ while (++index < length) {
63085
+ var value = array[index],
63086
+ current = iteratee(value);
63087
+
63088
+ if (current != null && (computed === undefined ? current === current && !isSymbol$3(current) : comparator(current, computed))) {
63089
+ var computed = current,
63090
+ result = value;
63091
+ }
63092
+ }
63093
+
63094
+ return result;
63095
+ }
63096
+
63097
+ var _baseExtremum = baseExtremum$1;
63098
+
63099
+ /**
63100
+ * The base implementation of `_.gt` which doesn't coerce arguments.
63101
+ *
63102
+ * @private
63103
+ * @param {*} value The value to compare.
63104
+ * @param {*} other The other value to compare.
63105
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
63106
+ * else `false`.
63107
+ */
63108
+
63109
+ function baseGt$1(value, other) {
63110
+ return value > other;
63111
+ }
63112
+
63113
+ var _baseGt = baseGt$1;
63114
+
63115
+ /**
63116
+ * Removes all key-value entries from the list cache.
63117
+ *
63118
+ * @private
63119
+ * @name clear
63120
+ * @memberOf ListCache
63121
+ */
63122
+
63123
+ function listCacheClear$1() {
63124
+ this.__data__ = [];
63125
+ this.size = 0;
63126
+ }
63127
+
63128
+ var _listCacheClear = listCacheClear$1;
63129
+
63130
+ /**
63131
+ * Performs a
63132
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
63133
+ * comparison between two values to determine if they are equivalent.
63134
+ *
63135
+ * @static
63136
+ * @memberOf _
63137
+ * @since 4.0.0
63138
+ * @category Lang
63139
+ * @param {*} value The value to compare.
63140
+ * @param {*} other The other value to compare.
63141
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
63142
+ * @example
63143
+ *
63144
+ * var object = { 'a': 1 };
63145
+ * var other = { 'a': 1 };
63146
+ *
63147
+ * _.eq(object, object);
63148
+ * // => true
63149
+ *
63150
+ * _.eq(object, other);
63151
+ * // => false
63152
+ *
63153
+ * _.eq('a', 'a');
63154
+ * // => true
63155
+ *
63156
+ * _.eq('a', Object('a'));
63157
+ * // => false
63158
+ *
63159
+ * _.eq(NaN, NaN);
63160
+ * // => true
63161
+ */
63162
+
63163
+ function eq$2(value, other) {
63164
+ return value === other || value !== value && other !== other;
63165
+ }
63166
+
63167
+ var eq_1 = eq$2;
63168
+
63169
+ var eq$1 = eq_1;
63170
+ /**
63171
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
63172
+ *
63173
+ * @private
63174
+ * @param {Array} array The array to inspect.
63175
+ * @param {*} key The key to search for.
63176
+ * @returns {number} Returns the index of the matched value, else `-1`.
63177
+ */
63178
+
63179
+ function assocIndexOf$4(array, key) {
63180
+ var length = array.length;
63181
+
63182
+ while (length--) {
63183
+ if (eq$1(array[length][0], key)) {
63184
+ return length;
63185
+ }
63186
+ }
63187
+
63188
+ return -1;
63189
+ }
63190
+
63191
+ var _assocIndexOf = assocIndexOf$4;
63192
+
63193
+ var assocIndexOf$3 = _assocIndexOf;
63194
+ /** Used for built-in method references. */
63195
+
63196
+ var arrayProto = Array.prototype;
63197
+ /** Built-in value references. */
63198
+
63199
+ var splice = arrayProto.splice;
63200
+ /**
63201
+ * Removes `key` and its value from the list cache.
63202
+ *
63203
+ * @private
63204
+ * @name delete
63205
+ * @memberOf ListCache
63206
+ * @param {string} key The key of the value to remove.
63207
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63208
+ */
63209
+
63210
+ function listCacheDelete$1(key) {
63211
+ var data = this.__data__,
63212
+ index = assocIndexOf$3(data, key);
63213
+
63214
+ if (index < 0) {
63215
+ return false;
63216
+ }
63217
+
63218
+ var lastIndex = data.length - 1;
63219
+
63220
+ if (index == lastIndex) {
63221
+ data.pop();
63222
+ } else {
63223
+ splice.call(data, index, 1);
63224
+ }
63225
+
63226
+ --this.size;
63227
+ return true;
63228
+ }
63229
+
63230
+ var _listCacheDelete = listCacheDelete$1;
63231
+
63232
+ var assocIndexOf$2 = _assocIndexOf;
63233
+ /**
63234
+ * Gets the list cache value for `key`.
63235
+ *
63236
+ * @private
63237
+ * @name get
63238
+ * @memberOf ListCache
63239
+ * @param {string} key The key of the value to get.
63240
+ * @returns {*} Returns the entry value.
63241
+ */
63242
+
63243
+ function listCacheGet$1(key) {
63244
+ var data = this.__data__,
63245
+ index = assocIndexOf$2(data, key);
63246
+ return index < 0 ? undefined : data[index][1];
63247
+ }
63248
+
63249
+ var _listCacheGet = listCacheGet$1;
63250
+
63251
+ var assocIndexOf$1 = _assocIndexOf;
63252
+ /**
63253
+ * Checks if a list cache value for `key` exists.
63254
+ *
63255
+ * @private
63256
+ * @name has
63257
+ * @memberOf ListCache
63258
+ * @param {string} key The key of the entry to check.
63259
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63260
+ */
63261
+
63262
+ function listCacheHas$1(key) {
63263
+ return assocIndexOf$1(this.__data__, key) > -1;
63264
+ }
63265
+
63266
+ var _listCacheHas = listCacheHas$1;
63267
+
63268
+ var assocIndexOf = _assocIndexOf;
63269
+ /**
63270
+ * Sets the list cache `key` to `value`.
63271
+ *
63272
+ * @private
63273
+ * @name set
63274
+ * @memberOf ListCache
63275
+ * @param {string} key The key of the value to set.
63276
+ * @param {*} value The value to set.
63277
+ * @returns {Object} Returns the list cache instance.
63278
+ */
63279
+
63280
+ function listCacheSet$1(key, value) {
63281
+ var data = this.__data__,
63282
+ index = assocIndexOf(data, key);
63283
+
63284
+ if (index < 0) {
63285
+ ++this.size;
63286
+ data.push([key, value]);
63287
+ } else {
63288
+ data[index][1] = value;
63289
+ }
63290
+
63291
+ return this;
63292
+ }
63293
+
63294
+ var _listCacheSet = listCacheSet$1;
63295
+
63296
+ var listCacheClear = _listCacheClear,
63297
+ listCacheDelete = _listCacheDelete,
63298
+ listCacheGet = _listCacheGet,
63299
+ listCacheHas = _listCacheHas,
63300
+ listCacheSet = _listCacheSet;
63301
+ /**
63302
+ * Creates an list cache object.
63303
+ *
63304
+ * @private
63305
+ * @constructor
63306
+ * @param {Array} [entries] The key-value pairs to cache.
63307
+ */
63308
+
63309
+ function ListCache$4(entries) {
63310
+ var index = -1,
63311
+ length = entries == null ? 0 : entries.length;
63312
+ this.clear();
63313
+
63314
+ while (++index < length) {
63315
+ var entry = entries[index];
63316
+ this.set(entry[0], entry[1]);
63317
+ }
63318
+ } // Add methods to `ListCache`.
63319
+
63320
+
63321
+ ListCache$4.prototype.clear = listCacheClear;
63322
+ ListCache$4.prototype['delete'] = listCacheDelete;
63323
+ ListCache$4.prototype.get = listCacheGet;
63324
+ ListCache$4.prototype.has = listCacheHas;
63325
+ ListCache$4.prototype.set = listCacheSet;
63326
+ var _ListCache = ListCache$4;
63327
+
63328
+ var ListCache$3 = _ListCache;
63329
+ /**
63330
+ * Removes all key-value entries from the stack.
63331
+ *
63332
+ * @private
63333
+ * @name clear
63334
+ * @memberOf Stack
63335
+ */
63336
+
63337
+ function stackClear$1() {
63338
+ this.__data__ = new ListCache$3();
63339
+ this.size = 0;
63340
+ }
63341
+
63342
+ var _stackClear = stackClear$1;
63343
+
63344
+ /**
63345
+ * Removes `key` and its value from the stack.
63346
+ *
63347
+ * @private
63348
+ * @name delete
63349
+ * @memberOf Stack
63350
+ * @param {string} key The key of the value to remove.
63351
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63352
+ */
63353
+
63354
+ function stackDelete$1(key) {
63355
+ var data = this.__data__,
63356
+ result = data['delete'](key);
63357
+ this.size = data.size;
63358
+ return result;
63359
+ }
63360
+
63361
+ var _stackDelete = stackDelete$1;
63362
+
63363
+ /**
63364
+ * Gets the stack value for `key`.
63365
+ *
63366
+ * @private
63367
+ * @name get
63368
+ * @memberOf Stack
63369
+ * @param {string} key The key of the value to get.
63370
+ * @returns {*} Returns the entry value.
63371
+ */
63372
+
63373
+ function stackGet$1(key) {
63374
+ return this.__data__.get(key);
63375
+ }
63376
+
63377
+ var _stackGet = stackGet$1;
63378
+
63379
+ /**
63380
+ * Checks if a stack value for `key` exists.
63381
+ *
63382
+ * @private
63383
+ * @name has
63384
+ * @memberOf Stack
63385
+ * @param {string} key The key of the entry to check.
63386
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63387
+ */
63388
+
63389
+ function stackHas$1(key) {
63390
+ return this.__data__.has(key);
63391
+ }
63392
+
63393
+ var _stackHas = stackHas$1;
63394
+
63395
+ function isObject$3(value) {
63396
+ var type = _typeof(value);
63397
+
63398
+ return value != null && (type == 'object' || type == 'function');
63399
+ }
63400
+
63401
+ var isObject_1 = isObject$3;
63402
+
63403
+ var baseGetTag$3 = _baseGetTag,
63404
+ isObject$2 = isObject_1;
63405
+ /** `Object#toString` result references. */
63406
+
63407
+ var asyncTag = '[object AsyncFunction]',
63408
+ funcTag$1 = '[object Function]',
63409
+ genTag = '[object GeneratorFunction]',
63410
+ proxyTag = '[object Proxy]';
63411
+ /**
63412
+ * Checks if `value` is classified as a `Function` object.
63413
+ *
63414
+ * @static
63415
+ * @memberOf _
63416
+ * @since 0.1.0
63417
+ * @category Lang
63418
+ * @param {*} value The value to check.
63419
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
63420
+ * @example
63421
+ *
63422
+ * _.isFunction(_);
63423
+ * // => true
63424
+ *
63425
+ * _.isFunction(/abc/);
63426
+ * // => false
63427
+ */
63428
+
63429
+ function isFunction$2(value) {
63430
+ if (!isObject$2(value)) {
63431
+ return false;
63432
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
63433
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
63434
+
63435
+
63436
+ var tag = baseGetTag$3(value);
63437
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
63438
+ }
63439
+
63440
+ var isFunction_1 = isFunction$2;
63441
+
63442
+ var root$6 = _root;
63443
+ /** Used to detect overreaching core-js shims. */
63444
+
63445
+ var coreJsData$1 = root$6['__core-js_shared__'];
63446
+ var _coreJsData = coreJsData$1;
63447
+
63448
+ var coreJsData = _coreJsData;
63449
+ /** Used to detect methods masquerading as native. */
63450
+
63451
+ var maskSrcKey = function () {
63452
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
63453
+ return uid ? 'Symbol(src)_1.' + uid : '';
62941
63454
  }();
62942
- /** Gets new endpoints from a user's secondaries */
63455
+ /**
63456
+ * Checks if `func` has its source masked.
63457
+ *
63458
+ * @private
63459
+ * @param {Function} func The function to check.
63460
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
63461
+ */
62943
63462
 
62944
63463
 
62945
- var getNewPrimary = /*#__PURE__*/function () {
62946
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(libs, secondaries) {
62947
- var _iterator, _step, _libs$creatorNode, secondary, syncStatus;
63464
+ function isMasked$1(func) {
63465
+ return !!maskSrcKey && maskSrcKey in func;
63466
+ }
62948
63467
 
62949
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
62950
- while (1) {
62951
- switch (_context2.prev = _context2.next) {
62952
- case 0:
62953
- _iterator = _createForOfIteratorHelper(secondaries);
62954
- _context2.prev = 1;
63468
+ var _isMasked = isMasked$1;
62955
63469
 
62956
- _iterator.s();
63470
+ /** Used for built-in method references. */
63471
+ var funcProto$1 = Function.prototype;
63472
+ /** Used to resolve the decompiled source of functions. */
62957
63473
 
62958
- case 3:
62959
- if ((_step = _iterator.n()).done) {
62960
- _context2.next = 14;
62961
- break;
62962
- }
63474
+ var funcToString$1 = funcProto$1.toString;
63475
+ /**
63476
+ * Converts `func` to its source code.
63477
+ *
63478
+ * @private
63479
+ * @param {Function} func The function to convert.
63480
+ * @returns {string} Returns the source code.
63481
+ */
62963
63482
 
62964
- secondary = _step.value;
62965
- _context2.next = 7;
62966
- return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.getSyncStatus(secondary);
63483
+ function toSource$2(func) {
63484
+ if (func != null) {
63485
+ try {
63486
+ return funcToString$1.call(func);
63487
+ } catch (e) {}
62967
63488
 
62968
- case 7:
62969
- syncStatus = _context2.sent;
63489
+ try {
63490
+ return func + '';
63491
+ } catch (e) {}
63492
+ }
62970
63493
 
62971
- if (syncStatus) {
62972
- _context2.next = 10;
62973
- break;
62974
- }
63494
+ return '';
63495
+ }
62975
63496
 
62976
- return _context2.abrupt("continue", 12);
63497
+ var _toSource = toSource$2;
62977
63498
 
62978
- case 10:
62979
- if (syncStatus.isBehind) {
62980
- _context2.next = 12;
62981
- break;
62982
- }
63499
+ var isFunction$1 = isFunction_1,
63500
+ isMasked = _isMasked,
63501
+ isObject$1 = isObject_1,
63502
+ toSource$1 = _toSource;
63503
+ /**
63504
+ * Used to match `RegExp`
63505
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
63506
+ */
62983
63507
 
62984
- return _context2.abrupt("return", secondary);
63508
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
63509
+ /** Used to detect host constructors (Safari). */
62985
63510
 
62986
- case 12:
62987
- _context2.next = 3;
62988
- break;
63511
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
63512
+ /** Used for built-in method references. */
62989
63513
 
62990
- case 14:
62991
- _context2.next = 19;
62992
- break;
63514
+ var funcProto = Function.prototype,
63515
+ objectProto$9 = Object.prototype;
63516
+ /** Used to resolve the decompiled source of functions. */
62993
63517
 
62994
- case 16:
62995
- _context2.prev = 16;
62996
- _context2.t0 = _context2["catch"](1);
63518
+ var funcToString = funcProto.toString;
63519
+ /** Used to check objects for own properties. */
62997
63520
 
62998
- _iterator.e(_context2.t0);
63521
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
63522
+ /** Used to detect if a method is native. */
62999
63523
 
63000
- case 19:
63001
- _context2.prev = 19;
63524
+ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
63525
+ /**
63526
+ * The base implementation of `_.isNative` without bad shim checks.
63527
+ *
63528
+ * @private
63529
+ * @param {*} value The value to check.
63530
+ * @returns {boolean} Returns `true` if `value` is a native function,
63531
+ * else `false`.
63532
+ */
63002
63533
 
63003
- _iterator.f();
63534
+ function baseIsNative$1(value) {
63535
+ if (!isObject$1(value) || isMasked(value)) {
63536
+ return false;
63537
+ }
63004
63538
 
63005
- return _context2.finish(19);
63539
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
63540
+ return pattern.test(toSource$1(value));
63541
+ }
63006
63542
 
63007
- case 22:
63008
- throw new Error("Could not find valid secondaries for user ".concat(secondaries));
63543
+ var _baseIsNative = baseIsNative$1;
63009
63544
 
63010
- case 23:
63011
- case "end":
63012
- return _context2.stop();
63013
- }
63014
- }
63015
- }, _callee2, null, [[1, 16, 19, 22]]);
63016
- }));
63545
+ /**
63546
+ * Gets the value at `key` of `object`.
63547
+ *
63548
+ * @private
63549
+ * @param {Object} [object] The object to query.
63550
+ * @param {string} key The key of the property to get.
63551
+ * @returns {*} Returns the property value.
63552
+ */
63017
63553
 
63018
- return function getNewPrimary(_x4, _x5) {
63019
- return _ref2.apply(this, arguments);
63554
+ function getValue$1(object, key) {
63555
+ return object == null ? undefined : object[key];
63556
+ }
63557
+
63558
+ var _getValue = getValue$1;
63559
+
63560
+ var baseIsNative = _baseIsNative,
63561
+ getValue = _getValue;
63562
+ /**
63563
+ * Gets the native function at `key` of `object`.
63564
+ *
63565
+ * @private
63566
+ * @param {Object} object The object to query.
63567
+ * @param {string} key The key of the method to get.
63568
+ * @returns {*} Returns the function if it's native, else `undefined`.
63569
+ */
63570
+
63571
+ function getNative$6(object, key) {
63572
+ var value = getValue(object, key);
63573
+ return baseIsNative(value) ? value : undefined;
63574
+ }
63575
+
63576
+ var _getNative = getNative$6;
63577
+
63578
+ var getNative$5 = _getNative,
63579
+ root$5 = _root;
63580
+ /* Built-in method references that are verified to be native. */
63581
+
63582
+ var Map$4 = getNative$5(root$5, 'Map');
63583
+ var _Map = Map$4;
63584
+
63585
+ var getNative$4 = _getNative;
63586
+ /* Built-in method references that are verified to be native. */
63587
+
63588
+ var nativeCreate$4 = getNative$4(Object, 'create');
63589
+ var _nativeCreate = nativeCreate$4;
63590
+
63591
+ var nativeCreate$3 = _nativeCreate;
63592
+ /**
63593
+ * Removes all key-value entries from the hash.
63594
+ *
63595
+ * @private
63596
+ * @name clear
63597
+ * @memberOf Hash
63598
+ */
63599
+
63600
+ function hashClear$1() {
63601
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
63602
+ this.size = 0;
63603
+ }
63604
+
63605
+ var _hashClear = hashClear$1;
63606
+
63607
+ /**
63608
+ * Removes `key` and its value from the hash.
63609
+ *
63610
+ * @private
63611
+ * @name delete
63612
+ * @memberOf Hash
63613
+ * @param {Object} hash The hash to modify.
63614
+ * @param {string} key The key of the value to remove.
63615
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63616
+ */
63617
+
63618
+ function hashDelete$1(key) {
63619
+ var result = this.has(key) && delete this.__data__[key];
63620
+ this.size -= result ? 1 : 0;
63621
+ return result;
63622
+ }
63623
+
63624
+ var _hashDelete = hashDelete$1;
63625
+
63626
+ var nativeCreate$2 = _nativeCreate;
63627
+ /** Used to stand-in for `undefined` hash values. */
63628
+
63629
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
63630
+ /** Used for built-in method references. */
63631
+
63632
+ var objectProto$8 = Object.prototype;
63633
+ /** Used to check objects for own properties. */
63634
+
63635
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
63636
+ /**
63637
+ * Gets the hash value for `key`.
63638
+ *
63639
+ * @private
63640
+ * @name get
63641
+ * @memberOf Hash
63642
+ * @param {string} key The key of the value to get.
63643
+ * @returns {*} Returns the entry value.
63644
+ */
63645
+
63646
+ function hashGet$1(key) {
63647
+ var data = this.__data__;
63648
+
63649
+ if (nativeCreate$2) {
63650
+ var result = data[key];
63651
+ return result === HASH_UNDEFINED$2 ? undefined : result;
63652
+ }
63653
+
63654
+ return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
63655
+ }
63656
+
63657
+ var _hashGet = hashGet$1;
63658
+
63659
+ var nativeCreate$1 = _nativeCreate;
63660
+ /** Used for built-in method references. */
63661
+
63662
+ var objectProto$7 = Object.prototype;
63663
+ /** Used to check objects for own properties. */
63664
+
63665
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
63666
+ /**
63667
+ * Checks if a hash value for `key` exists.
63668
+ *
63669
+ * @private
63670
+ * @name has
63671
+ * @memberOf Hash
63672
+ * @param {string} key The key of the entry to check.
63673
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63674
+ */
63675
+
63676
+ function hashHas$1(key) {
63677
+ var data = this.__data__;
63678
+ return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
63679
+ }
63680
+
63681
+ var _hashHas = hashHas$1;
63682
+
63683
+ var nativeCreate = _nativeCreate;
63684
+ /** Used to stand-in for `undefined` hash values. */
63685
+
63686
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
63687
+ /**
63688
+ * Sets the hash `key` to `value`.
63689
+ *
63690
+ * @private
63691
+ * @name set
63692
+ * @memberOf Hash
63693
+ * @param {string} key The key of the value to set.
63694
+ * @param {*} value The value to set.
63695
+ * @returns {Object} Returns the hash instance.
63696
+ */
63697
+
63698
+ function hashSet$1(key, value) {
63699
+ var data = this.__data__;
63700
+ this.size += this.has(key) ? 0 : 1;
63701
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
63702
+ return this;
63703
+ }
63704
+
63705
+ var _hashSet = hashSet$1;
63706
+
63707
+ var hashClear = _hashClear,
63708
+ hashDelete = _hashDelete,
63709
+ hashGet = _hashGet,
63710
+ hashHas = _hashHas,
63711
+ hashSet = _hashSet;
63712
+ /**
63713
+ * Creates a hash object.
63714
+ *
63715
+ * @private
63716
+ * @constructor
63717
+ * @param {Array} [entries] The key-value pairs to cache.
63718
+ */
63719
+
63720
+ function Hash$1(entries) {
63721
+ var index = -1,
63722
+ length = entries == null ? 0 : entries.length;
63723
+ this.clear();
63724
+
63725
+ while (++index < length) {
63726
+ var entry = entries[index];
63727
+ this.set(entry[0], entry[1]);
63728
+ }
63729
+ } // Add methods to `Hash`.
63730
+
63731
+
63732
+ Hash$1.prototype.clear = hashClear;
63733
+ Hash$1.prototype['delete'] = hashDelete;
63734
+ Hash$1.prototype.get = hashGet;
63735
+ Hash$1.prototype.has = hashHas;
63736
+ Hash$1.prototype.set = hashSet;
63737
+ var _Hash = Hash$1;
63738
+
63739
+ var Hash = _Hash,
63740
+ ListCache$2 = _ListCache,
63741
+ Map$3 = _Map;
63742
+ /**
63743
+ * Removes all key-value entries from the map.
63744
+ *
63745
+ * @private
63746
+ * @name clear
63747
+ * @memberOf MapCache
63748
+ */
63749
+
63750
+ function mapCacheClear$1() {
63751
+ this.size = 0;
63752
+ this.__data__ = {
63753
+ 'hash': new Hash(),
63754
+ 'map': new (Map$3 || ListCache$2)(),
63755
+ 'string': new Hash()
63020
63756
  };
63021
- }();
63757
+ }
63022
63758
 
63023
- var rolloverNodes = /*#__PURE__*/function () {
63024
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
63025
- var _libs$userStateManage;
63759
+ var _mapCacheClear = mapCacheClear$1;
63026
63760
 
63027
- var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode2, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
63761
+ function isKeyable$1(value) {
63762
+ var type = _typeof(value);
63028
63763
 
63029
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
63030
- while (1) {
63031
- switch (_context3.prev = _context3.next) {
63032
- case 0:
63033
- console.debug('Sanity Check - rolloverNodes');
63034
- user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
63764
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
63765
+ }
63035
63766
 
63036
- if (user) {
63037
- _context3.next = 4;
63038
- break;
63039
- }
63767
+ var _isKeyable = isKeyable$1;
63040
63768
 
63041
- return _context3.abrupt("return");
63769
+ var isKeyable = _isKeyable;
63770
+ /**
63771
+ * Gets the data for `map`.
63772
+ *
63773
+ * @private
63774
+ * @param {Object} map The map to query.
63775
+ * @param {string} key The reference key.
63776
+ * @returns {*} Returns the map data.
63777
+ */
63042
63778
 
63043
- case 4:
63044
- primary = CreatorNode.getPrimary(user.creator_node_endpoint);
63779
+ function getMapData$4(map, key) {
63780
+ var data = map.__data__;
63781
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
63782
+ }
63045
63783
 
63046
- if (primary) {
63047
- _context3.next = 7;
63048
- break;
63049
- }
63784
+ var _getMapData = getMapData$4;
63050
63785
 
63051
- return _context3.abrupt("return");
63786
+ var getMapData$3 = _getMapData;
63787
+ /**
63788
+ * Removes `key` and its value from the map.
63789
+ *
63790
+ * @private
63791
+ * @name delete
63792
+ * @memberOf MapCache
63793
+ * @param {string} key The key of the value to remove.
63794
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
63795
+ */
63052
63796
 
63053
- case 7:
63054
- _context3.next = 9;
63055
- return checkPrimaryHealthy(libs, primary, MAX_TRIES);
63797
+ function mapCacheDelete$1(key) {
63798
+ var result = getMapData$3(this, key)['delete'](key);
63799
+ this.size -= result ? 1 : 0;
63800
+ return result;
63801
+ }
63056
63802
 
63057
- case 9:
63058
- healthy = _context3.sent;
63803
+ var _mapCacheDelete = mapCacheDelete$1;
63059
63804
 
63060
- if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
63061
- _context3.next = 12;
63062
- break;
63063
- }
63805
+ var getMapData$2 = _getMapData;
63806
+ /**
63807
+ * Gets the map value for `key`.
63808
+ *
63809
+ * @private
63810
+ * @name get
63811
+ * @memberOf MapCache
63812
+ * @param {string} key The key of the value to get.
63813
+ * @returns {*} Returns the entry value.
63814
+ */
63064
63815
 
63065
- return _context3.abrupt("return");
63816
+ function mapCacheGet$1(key) {
63817
+ return getMapData$2(this, key).get(key);
63818
+ }
63066
63819
 
63067
- case 12:
63068
- secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
63069
- _context3.prev = 13;
63070
- _context3.next = 16;
63071
- return getNewPrimary(libs, secondaries);
63820
+ var _mapCacheGet = mapCacheGet$1;
63072
63821
 
63073
- case 16:
63074
- newPrimary = _context3.sent;
63075
- index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
63822
+ var getMapData$1 = _getMapData;
63823
+ /**
63824
+ * Checks if a map value for `key` exists.
63825
+ *
63826
+ * @private
63827
+ * @name has
63828
+ * @memberOf MapCache
63829
+ * @param {string} key The key of the entry to check.
63830
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
63831
+ */
63076
63832
 
63077
- newSecondaries = _toConsumableArray(secondaries);
63078
- newSecondaries.splice(index, 1);
63079
- _context3.next = 22;
63080
- return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
63081
- numberOfNodes: 2 - newSecondaries.length,
63082
- whitelist: creatorNodeWhitelist,
63083
- // Exclude ones we currently have
63084
- blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
63085
- preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
63086
- preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
63087
- });
63833
+ function mapCacheHas$1(key) {
63834
+ return getMapData$1(this, key).has(key);
63835
+ }
63088
63836
 
63089
- case 22:
63090
- autoselect = _context3.sent;
63837
+ var _mapCacheHas = mapCacheHas$1;
63091
63838
 
63092
- if (autoselect) {
63093
- newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
63094
- } // Set the new endpoint and connect to it
63839
+ var getMapData = _getMapData;
63840
+ /**
63841
+ * Sets the map `key` to `value`.
63842
+ *
63843
+ * @private
63844
+ * @name set
63845
+ * @memberOf MapCache
63846
+ * @param {string} key The key of the value to set.
63847
+ * @param {*} value The value to set.
63848
+ * @returns {Object} Returns the map cache instance.
63849
+ */
63095
63850
 
63851
+ function mapCacheSet$1(key, value) {
63852
+ var data = getMapData(this, key),
63853
+ size = data.size;
63854
+ data.set(key, value);
63855
+ this.size += data.size == size ? 0 : 1;
63856
+ return this;
63857
+ }
63096
63858
 
63097
- newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
63098
- _context3.next = 27;
63099
- return (_libs$creatorNode2 = libs.creatorNode) === null || _libs$creatorNode2 === void 0 ? void 0 : _libs$creatorNode2.setEndpoint(newEndpoints[0]);
63859
+ var _mapCacheSet = mapCacheSet$1;
63100
63860
 
63101
- case 27:
63102
- // Update the user
63103
- newMetadata = _objectSpread2({}, user);
63104
- newMetadata.creator_node_endpoint = newEndpoints.join(',');
63105
- console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
63106
- _context3.next = 32;
63107
- return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata);
63861
+ var mapCacheClear = _mapCacheClear,
63862
+ mapCacheDelete = _mapCacheDelete,
63863
+ mapCacheGet = _mapCacheGet,
63864
+ mapCacheHas = _mapCacheHas,
63865
+ mapCacheSet = _mapCacheSet;
63866
+ /**
63867
+ * Creates a map cache object to store key-value pairs.
63868
+ *
63869
+ * @private
63870
+ * @constructor
63871
+ * @param {Array} [entries] The key-value pairs to cache.
63872
+ */
63108
63873
 
63109
- case 32:
63110
- _context3.next = 37;
63111
- break;
63874
+ function MapCache$3(entries) {
63875
+ var index = -1,
63876
+ length = entries == null ? 0 : entries.length;
63877
+ this.clear();
63112
63878
 
63113
- case 34:
63114
- _context3.prev = 34;
63115
- _context3.t0 = _context3["catch"](13);
63116
- console.error(_context3.t0);
63879
+ while (++index < length) {
63880
+ var entry = entries[index];
63881
+ this.set(entry[0], entry[1]);
63882
+ }
63883
+ } // Add methods to `MapCache`.
63117
63884
 
63118
- case 37:
63119
- case "end":
63120
- return _context3.stop();
63121
- }
63122
- }
63123
- }, _callee3, null, [[13, 34]]);
63124
- }));
63125
63885
 
63126
- return function rolloverNodes(_x6, _x7, _x8) {
63127
- return _ref3.apply(this, arguments);
63886
+ MapCache$3.prototype.clear = mapCacheClear;
63887
+ MapCache$3.prototype['delete'] = mapCacheDelete;
63888
+ MapCache$3.prototype.get = mapCacheGet;
63889
+ MapCache$3.prototype.has = mapCacheHas;
63890
+ MapCache$3.prototype.set = mapCacheSet;
63891
+ var _MapCache = MapCache$3;
63892
+
63893
+ var ListCache$1 = _ListCache,
63894
+ Map$2 = _Map,
63895
+ MapCache$2 = _MapCache;
63896
+ /** Used as the size to enable large array optimizations. */
63897
+
63898
+ var LARGE_ARRAY_SIZE = 200;
63899
+ /**
63900
+ * Sets the stack `key` to `value`.
63901
+ *
63902
+ * @private
63903
+ * @name set
63904
+ * @memberOf Stack
63905
+ * @param {string} key The key of the value to set.
63906
+ * @param {*} value The value to set.
63907
+ * @returns {Object} Returns the stack cache instance.
63908
+ */
63909
+
63910
+ function stackSet$1(key, value) {
63911
+ var data = this.__data__;
63912
+
63913
+ if (data instanceof ListCache$1) {
63914
+ var pairs = data.__data__;
63915
+
63916
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
63917
+ pairs.push([key, value]);
63918
+ this.size = ++data.size;
63919
+ return this;
63920
+ }
63921
+
63922
+ data = this.__data__ = new MapCache$2(pairs);
63923
+ }
63924
+
63925
+ data.set(key, value);
63926
+ this.size = data.size;
63927
+ return this;
63928
+ }
63929
+
63930
+ var _stackSet = stackSet$1;
63931
+
63932
+ var ListCache = _ListCache,
63933
+ stackClear = _stackClear,
63934
+ stackDelete = _stackDelete,
63935
+ stackGet = _stackGet,
63936
+ stackHas = _stackHas,
63937
+ stackSet = _stackSet;
63938
+ /**
63939
+ * Creates a stack cache object to store key-value pairs.
63940
+ *
63941
+ * @private
63942
+ * @constructor
63943
+ * @param {Array} [entries] The key-value pairs to cache.
63944
+ */
63945
+
63946
+ function Stack$2(entries) {
63947
+ var data = this.__data__ = new ListCache(entries);
63948
+ this.size = data.size;
63949
+ } // Add methods to `Stack`.
63950
+
63951
+
63952
+ Stack$2.prototype.clear = stackClear;
63953
+ Stack$2.prototype['delete'] = stackDelete;
63954
+ Stack$2.prototype.get = stackGet;
63955
+ Stack$2.prototype.has = stackHas;
63956
+ Stack$2.prototype.set = stackSet;
63957
+ var _Stack = Stack$2;
63958
+
63959
+ /** Used to stand-in for `undefined` hash values. */
63960
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
63961
+ /**
63962
+ * Adds `value` to the array cache.
63963
+ *
63964
+ * @private
63965
+ * @name add
63966
+ * @memberOf SetCache
63967
+ * @alias push
63968
+ * @param {*} value The value to cache.
63969
+ * @returns {Object} Returns the cache instance.
63970
+ */
63971
+
63972
+ function setCacheAdd$1(value) {
63973
+ this.__data__.set(value, HASH_UNDEFINED);
63974
+
63975
+ return this;
63976
+ }
63977
+
63978
+ var _setCacheAdd = setCacheAdd$1;
63979
+
63980
+ /**
63981
+ * Checks if `value` is in the array cache.
63982
+ *
63983
+ * @private
63984
+ * @name has
63985
+ * @memberOf SetCache
63986
+ * @param {*} value The value to search for.
63987
+ * @returns {number} Returns `true` if `value` is found, else `false`.
63988
+ */
63989
+
63990
+ function setCacheHas$1(value) {
63991
+ return this.__data__.has(value);
63992
+ }
63993
+
63994
+ var _setCacheHas = setCacheHas$1;
63995
+
63996
+ var MapCache$1 = _MapCache,
63997
+ setCacheAdd = _setCacheAdd,
63998
+ setCacheHas = _setCacheHas;
63999
+ /**
64000
+ *
64001
+ * Creates an array cache object to store unique values.
64002
+ *
64003
+ * @private
64004
+ * @constructor
64005
+ * @param {Array} [values] The values to cache.
64006
+ */
64007
+
64008
+ function SetCache$1(values) {
64009
+ var index = -1,
64010
+ length = values == null ? 0 : values.length;
64011
+ this.__data__ = new MapCache$1();
64012
+
64013
+ while (++index < length) {
64014
+ this.add(values[index]);
64015
+ }
64016
+ } // Add methods to `SetCache`.
64017
+
64018
+
64019
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
64020
+ SetCache$1.prototype.has = setCacheHas;
64021
+ var _SetCache = SetCache$1;
64022
+
64023
+ /**
64024
+ * A specialized version of `_.some` for arrays without support for iteratee
64025
+ * shorthands.
64026
+ *
64027
+ * @private
64028
+ * @param {Array} [array] The array to iterate over.
64029
+ * @param {Function} predicate The function invoked per iteration.
64030
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
64031
+ * else `false`.
64032
+ */
64033
+
64034
+ function arraySome$1(array, predicate) {
64035
+ var index = -1,
64036
+ length = array == null ? 0 : array.length;
64037
+
64038
+ while (++index < length) {
64039
+ if (predicate(array[index], index, array)) {
64040
+ return true;
64041
+ }
64042
+ }
64043
+
64044
+ return false;
64045
+ }
64046
+
64047
+ var _arraySome = arraySome$1;
64048
+
64049
+ /**
64050
+ * Checks if a `cache` value for `key` exists.
64051
+ *
64052
+ * @private
64053
+ * @param {Object} cache The cache to query.
64054
+ * @param {string} key The key of the entry to check.
64055
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
64056
+ */
64057
+
64058
+ function cacheHas$1(cache, key) {
64059
+ return cache.has(key);
64060
+ }
64061
+
64062
+ var _cacheHas = cacheHas$1;
64063
+
64064
+ var SetCache = _SetCache,
64065
+ arraySome = _arraySome,
64066
+ cacheHas = _cacheHas;
64067
+ /** Used to compose bitmasks for value comparisons. */
64068
+
64069
+ var COMPARE_PARTIAL_FLAG$5 = 1,
64070
+ COMPARE_UNORDERED_FLAG$3 = 2;
64071
+ /**
64072
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
64073
+ * partial deep comparisons.
64074
+ *
64075
+ * @private
64076
+ * @param {Array} array The array to compare.
64077
+ * @param {Array} other The other array to compare.
64078
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64079
+ * @param {Function} customizer The function to customize comparisons.
64080
+ * @param {Function} equalFunc The function to determine equivalents of values.
64081
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
64082
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
64083
+ */
64084
+
64085
+ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
64086
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
64087
+ arrLength = array.length,
64088
+ othLength = other.length;
64089
+
64090
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
64091
+ return false;
64092
+ } // Check that cyclic values are equal.
64093
+
64094
+
64095
+ var arrStacked = stack.get(array);
64096
+ var othStacked = stack.get(other);
64097
+
64098
+ if (arrStacked && othStacked) {
64099
+ return arrStacked == other && othStacked == array;
64100
+ }
64101
+
64102
+ var index = -1,
64103
+ result = true,
64104
+ seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
64105
+ stack.set(array, other);
64106
+ stack.set(other, array); // Ignore non-index properties.
64107
+
64108
+ while (++index < arrLength) {
64109
+ var arrValue = array[index],
64110
+ othValue = other[index];
64111
+
64112
+ if (customizer) {
64113
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
64114
+ }
64115
+
64116
+ if (compared !== undefined) {
64117
+ if (compared) {
64118
+ continue;
64119
+ }
64120
+
64121
+ result = false;
64122
+ break;
64123
+ } // Recursively compare arrays (susceptible to call stack limits).
64124
+
64125
+
64126
+ if (seen) {
64127
+ if (!arraySome(other, function (othValue, othIndex) {
64128
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
64129
+ return seen.push(othIndex);
64130
+ }
64131
+ })) {
64132
+ result = false;
64133
+ break;
64134
+ }
64135
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
64136
+ result = false;
64137
+ break;
64138
+ }
64139
+ }
64140
+
64141
+ stack['delete'](array);
64142
+ stack['delete'](other);
64143
+ return result;
64144
+ }
64145
+
64146
+ var _equalArrays = equalArrays$2;
64147
+
64148
+ var root$4 = _root;
64149
+ /** Built-in value references. */
64150
+
64151
+ var Uint8Array$2 = root$4.Uint8Array;
64152
+ var _Uint8Array = Uint8Array$2;
64153
+
64154
+ /**
64155
+ * Converts `map` to its key-value pairs.
64156
+ *
64157
+ * @private
64158
+ * @param {Object} map The map to convert.
64159
+ * @returns {Array} Returns the key-value pairs.
64160
+ */
64161
+
64162
+ function mapToArray$1(map) {
64163
+ var index = -1,
64164
+ result = Array(map.size);
64165
+ map.forEach(function (value, key) {
64166
+ result[++index] = [key, value];
64167
+ });
64168
+ return result;
64169
+ }
64170
+
64171
+ var _mapToArray = mapToArray$1;
64172
+
64173
+ /**
64174
+ * Converts `set` to an array of its values.
64175
+ *
64176
+ * @private
64177
+ * @param {Object} set The set to convert.
64178
+ * @returns {Array} Returns the values.
64179
+ */
64180
+
64181
+ function setToArray$1(set) {
64182
+ var index = -1,
64183
+ result = Array(set.size);
64184
+ set.forEach(function (value) {
64185
+ result[++index] = value;
64186
+ });
64187
+ return result;
64188
+ }
64189
+
64190
+ var _setToArray = setToArray$1;
64191
+
64192
+ var _Symbol$1 = _Symbol$4,
64193
+ Uint8Array$1 = _Uint8Array,
64194
+ eq = eq_1,
64195
+ equalArrays$1 = _equalArrays,
64196
+ mapToArray = _mapToArray,
64197
+ setToArray = _setToArray;
64198
+ /** Used to compose bitmasks for value comparisons. */
64199
+
64200
+ var COMPARE_PARTIAL_FLAG$4 = 1,
64201
+ COMPARE_UNORDERED_FLAG$2 = 2;
64202
+ /** `Object#toString` result references. */
64203
+
64204
+ var boolTag$1 = '[object Boolean]',
64205
+ dateTag$1 = '[object Date]',
64206
+ errorTag$1 = '[object Error]',
64207
+ mapTag$2 = '[object Map]',
64208
+ numberTag$1 = '[object Number]',
64209
+ regexpTag$1 = '[object RegExp]',
64210
+ setTag$2 = '[object Set]',
64211
+ stringTag$1 = '[object String]',
64212
+ symbolTag = '[object Symbol]';
64213
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
64214
+ dataViewTag$2 = '[object DataView]';
64215
+ /** Used to convert symbols to primitives and strings. */
64216
+
64217
+ var symbolProto$1 = _Symbol$1 ? _Symbol$1.prototype : undefined,
64218
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
64219
+ /**
64220
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
64221
+ * the same `toStringTag`.
64222
+ *
64223
+ * **Note:** This function only supports comparing values with tags of
64224
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
64225
+ *
64226
+ * @private
64227
+ * @param {Object} object The object to compare.
64228
+ * @param {Object} other The other object to compare.
64229
+ * @param {string} tag The `toStringTag` of the objects to compare.
64230
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
64231
+ * @param {Function} customizer The function to customize comparisons.
64232
+ * @param {Function} equalFunc The function to determine equivalents of values.
64233
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
64234
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
64235
+ */
64236
+
64237
+ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
64238
+ switch (tag) {
64239
+ case dataViewTag$2:
64240
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
64241
+ return false;
64242
+ }
64243
+
64244
+ object = object.buffer;
64245
+ other = other.buffer;
64246
+
64247
+ case arrayBufferTag$1:
64248
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
64249
+ return false;
64250
+ }
64251
+
64252
+ return true;
64253
+
64254
+ case boolTag$1:
64255
+ case dateTag$1:
64256
+ case numberTag$1:
64257
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
64258
+ // Invalid dates are coerced to `NaN`.
64259
+ return eq(+object, +other);
64260
+
64261
+ case errorTag$1:
64262
+ return object.name == other.name && object.message == other.message;
64263
+
64264
+ case regexpTag$1:
64265
+ case stringTag$1:
64266
+ // Coerce regexes to strings and treat strings, primitives and objects,
64267
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
64268
+ // for more details.
64269
+ return object == other + '';
64270
+
64271
+ case mapTag$2:
64272
+ var convert = mapToArray;
64273
+
64274
+ case setTag$2:
64275
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
64276
+ convert || (convert = setToArray);
64277
+
64278
+ if (object.size != other.size && !isPartial) {
64279
+ return false;
64280
+ } // Assume cyclic values are equal.
64281
+
64282
+
64283
+ var stacked = stack.get(object);
64284
+
64285
+ if (stacked) {
64286
+ return stacked == other;
64287
+ }
64288
+
64289
+ bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).
64290
+
64291
+ stack.set(object, other);
64292
+ var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
64293
+ stack['delete'](object);
64294
+ return result;
64295
+
64296
+ case symbolTag:
64297
+ if (symbolValueOf) {
64298
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
64299
+ }
64300
+
64301
+ }
64302
+
64303
+ return false;
64304
+ }
64305
+
64306
+ var _equalByTag = equalByTag$1;
64307
+
64308
+ /**
64309
+ * Appends the elements of `values` to `array`.
64310
+ *
64311
+ * @private
64312
+ * @param {Array} array The array to modify.
64313
+ * @param {Array} values The values to append.
64314
+ * @returns {Array} Returns `array`.
64315
+ */
64316
+
64317
+ function arrayPush$1(array, values) {
64318
+ var index = -1,
64319
+ length = values.length,
64320
+ offset = array.length;
64321
+
64322
+ while (++index < length) {
64323
+ array[offset + index] = values[index];
64324
+ }
64325
+
64326
+ return array;
64327
+ }
64328
+
64329
+ var _arrayPush = arrayPush$1;
64330
+
64331
+ /**
64332
+ * Checks if `value` is classified as an `Array` object.
64333
+ *
64334
+ * @static
64335
+ * @memberOf _
64336
+ * @since 0.1.0
64337
+ * @category Lang
64338
+ * @param {*} value The value to check.
64339
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
64340
+ * @example
64341
+ *
64342
+ * _.isArray([1, 2, 3]);
64343
+ * // => true
64344
+ *
64345
+ * _.isArray(document.body.children);
64346
+ * // => false
64347
+ *
64348
+ * _.isArray('abc');
64349
+ * // => false
64350
+ *
64351
+ * _.isArray(_.noop);
64352
+ * // => false
64353
+ */
64354
+ var isArray$8 = Array.isArray;
64355
+ var isArray_1 = isArray$8;
64356
+
64357
+ var arrayPush = _arrayPush,
64358
+ isArray$7 = isArray_1;
64359
+ /**
64360
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
64361
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
64362
+ * symbols of `object`.
64363
+ *
64364
+ * @private
64365
+ * @param {Object} object The object to query.
64366
+ * @param {Function} keysFunc The function to get the keys of `object`.
64367
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
64368
+ * @returns {Array} Returns the array of property names and symbols.
64369
+ */
64370
+
64371
+ function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
64372
+ var result = keysFunc(object);
64373
+ return isArray$7(object) ? result : arrayPush(result, symbolsFunc(object));
64374
+ }
64375
+
64376
+ var _baseGetAllKeys = baseGetAllKeys$1;
64377
+
64378
+ /**
64379
+ * A specialized version of `_.filter` for arrays without support for
64380
+ * iteratee shorthands.
64381
+ *
64382
+ * @private
64383
+ * @param {Array} [array] The array to iterate over.
64384
+ * @param {Function} predicate The function invoked per iteration.
64385
+ * @returns {Array} Returns the new filtered array.
64386
+ */
64387
+
64388
+ function arrayFilter$1(array, predicate) {
64389
+ var index = -1,
64390
+ length = array == null ? 0 : array.length,
64391
+ resIndex = 0,
64392
+ result = [];
64393
+
64394
+ while (++index < length) {
64395
+ var value = array[index];
64396
+
64397
+ if (predicate(value, index, array)) {
64398
+ result[resIndex++] = value;
64399
+ }
64400
+ }
64401
+
64402
+ return result;
64403
+ }
64404
+
64405
+ var _arrayFilter = arrayFilter$1;
64406
+
64407
+ /**
64408
+ * This method returns a new empty array.
64409
+ *
64410
+ * @static
64411
+ * @memberOf _
64412
+ * @since 4.13.0
64413
+ * @category Util
64414
+ * @returns {Array} Returns the new empty array.
64415
+ * @example
64416
+ *
64417
+ * var arrays = _.times(2, _.stubArray);
64418
+ *
64419
+ * console.log(arrays);
64420
+ * // => [[], []]
64421
+ *
64422
+ * console.log(arrays[0] === arrays[1]);
64423
+ * // => false
64424
+ */
64425
+
64426
+ function stubArray$1() {
64427
+ return [];
64428
+ }
64429
+
64430
+ var stubArray_1 = stubArray$1;
64431
+
64432
+ var arrayFilter = _arrayFilter,
64433
+ stubArray = stubArray_1;
64434
+ /** Used for built-in method references. */
64435
+
64436
+ var objectProto$6 = Object.prototype;
64437
+ /** Built-in value references. */
64438
+
64439
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
64440
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64441
+
64442
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
64443
+ /**
64444
+ * Creates an array of the own enumerable symbols of `object`.
64445
+ *
64446
+ * @private
64447
+ * @param {Object} object The object to query.
64448
+ * @returns {Array} Returns the array of symbols.
64449
+ */
64450
+
64451
+ var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
64452
+ if (object == null) {
64453
+ return [];
64454
+ }
64455
+
64456
+ object = Object(object);
64457
+ return arrayFilter(nativeGetSymbols(object), function (symbol) {
64458
+ return propertyIsEnumerable$1.call(object, symbol);
64459
+ });
64460
+ };
64461
+ var _getSymbols = getSymbols$1;
64462
+
64463
+ /**
64464
+ * The base implementation of `_.times` without support for iteratee shorthands
64465
+ * or max array length checks.
64466
+ *
64467
+ * @private
64468
+ * @param {number} n The number of times to invoke `iteratee`.
64469
+ * @param {Function} iteratee The function invoked per iteration.
64470
+ * @returns {Array} Returns the array of results.
64471
+ */
64472
+
64473
+ function baseTimes$1(n, iteratee) {
64474
+ var index = -1,
64475
+ result = Array(n);
64476
+
64477
+ while (++index < n) {
64478
+ result[index] = iteratee(index);
64479
+ }
64480
+
64481
+ return result;
64482
+ }
64483
+
64484
+ var _baseTimes = baseTimes$1;
64485
+
64486
+ var baseGetTag$2 = _baseGetTag,
64487
+ isObjectLike$3 = isObjectLike_1;
64488
+ /** `Object#toString` result references. */
64489
+
64490
+ var argsTag$2 = '[object Arguments]';
64491
+ /**
64492
+ * The base implementation of `_.isArguments`.
64493
+ *
64494
+ * @private
64495
+ * @param {*} value The value to check.
64496
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64497
+ */
64498
+
64499
+ function baseIsArguments$1(value) {
64500
+ return isObjectLike$3(value) && baseGetTag$2(value) == argsTag$2;
64501
+ }
64502
+
64503
+ var _baseIsArguments = baseIsArguments$1;
64504
+
64505
+ var baseIsArguments = _baseIsArguments,
64506
+ isObjectLike$2 = isObjectLike_1;
64507
+ /** Used for built-in method references. */
64508
+
64509
+ var objectProto$5 = Object.prototype;
64510
+ /** Used to check objects for own properties. */
64511
+
64512
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
64513
+ /** Built-in value references. */
64514
+
64515
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
64516
+ /**
64517
+ * Checks if `value` is likely an `arguments` object.
64518
+ *
64519
+ * @static
64520
+ * @memberOf _
64521
+ * @since 0.1.0
64522
+ * @category Lang
64523
+ * @param {*} value The value to check.
64524
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
64525
+ * else `false`.
64526
+ * @example
64527
+ *
64528
+ * _.isArguments(function() { return arguments; }());
64529
+ * // => true
64530
+ *
64531
+ * _.isArguments([1, 2, 3]);
64532
+ * // => false
64533
+ */
64534
+
64535
+ var isArguments$2 = baseIsArguments(function () {
64536
+ return arguments;
64537
+ }()) ? baseIsArguments : function (value) {
64538
+ return isObjectLike$2(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
64539
+ };
64540
+ var isArguments_1 = isArguments$2;
64541
+
64542
+ var isBuffer$2 = {exports: {}};
64543
+
64544
+ /**
64545
+ * This method returns `false`.
64546
+ *
64547
+ * @static
64548
+ * @memberOf _
64549
+ * @since 4.13.0
64550
+ * @category Util
64551
+ * @returns {boolean} Returns `false`.
64552
+ * @example
64553
+ *
64554
+ * _.times(2, _.stubFalse);
64555
+ * // => [false, false]
64556
+ */
64557
+
64558
+ function stubFalse() {
64559
+ return false;
64560
+ }
64561
+
64562
+ var stubFalse_1 = stubFalse;
64563
+
64564
+ (function (module, exports) {
64565
+ var root = _root,
64566
+ stubFalse = stubFalse_1;
64567
+ /** Detect free variable `exports`. */
64568
+
64569
+ var freeExports = exports && !exports.nodeType && exports;
64570
+ /** Detect free variable `module`. */
64571
+
64572
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64573
+ /** Detect the popular CommonJS extension `module.exports`. */
64574
+
64575
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64576
+ /** Built-in value references. */
64577
+
64578
+ var Buffer = moduleExports ? root.Buffer : undefined;
64579
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64580
+
64581
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
64582
+ /**
64583
+ * Checks if `value` is a buffer.
64584
+ *
64585
+ * @static
64586
+ * @memberOf _
64587
+ * @since 4.3.0
64588
+ * @category Lang
64589
+ * @param {*} value The value to check.
64590
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
64591
+ * @example
64592
+ *
64593
+ * _.isBuffer(new Buffer(2));
64594
+ * // => true
64595
+ *
64596
+ * _.isBuffer(new Uint8Array(2));
64597
+ * // => false
64598
+ */
64599
+
64600
+ var isBuffer = nativeIsBuffer || stubFalse;
64601
+ module.exports = isBuffer;
64602
+ })(isBuffer$2, isBuffer$2.exports);
64603
+
64604
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
64605
+ /** Used to detect unsigned integer values. */
64606
+
64607
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
64608
+ /**
64609
+ * Checks if `value` is a valid array-like index.
64610
+ *
64611
+ * @private
64612
+ * @param {*} value The value to check.
64613
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
64614
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
64615
+ */
64616
+
64617
+ function isIndex$2(value, length) {
64618
+ var type = _typeof(value);
64619
+
64620
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
64621
+ return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
64622
+ }
64623
+
64624
+ var _isIndex = isIndex$2;
64625
+
64626
+ /** Used as references for various `Number` constants. */
64627
+ var MAX_SAFE_INTEGER = 9007199254740991;
64628
+ /**
64629
+ * Checks if `value` is a valid array-like length.
64630
+ *
64631
+ * **Note:** This method is loosely based on
64632
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
64633
+ *
64634
+ * @static
64635
+ * @memberOf _
64636
+ * @since 4.0.0
64637
+ * @category Lang
64638
+ * @param {*} value The value to check.
64639
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
64640
+ * @example
64641
+ *
64642
+ * _.isLength(3);
64643
+ * // => true
64644
+ *
64645
+ * _.isLength(Number.MIN_VALUE);
64646
+ * // => false
64647
+ *
64648
+ * _.isLength(Infinity);
64649
+ * // => false
64650
+ *
64651
+ * _.isLength('3');
64652
+ * // => false
64653
+ */
64654
+
64655
+ function isLength$3(value) {
64656
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
64657
+ }
64658
+
64659
+ var isLength_1 = isLength$3;
64660
+
64661
+ var baseGetTag$1 = _baseGetTag,
64662
+ isLength$2 = isLength_1,
64663
+ isObjectLike$1 = isObjectLike_1;
64664
+ /** `Object#toString` result references. */
64665
+
64666
+ var argsTag$1 = '[object Arguments]',
64667
+ arrayTag$1 = '[object Array]',
64668
+ boolTag = '[object Boolean]',
64669
+ dateTag = '[object Date]',
64670
+ errorTag = '[object Error]',
64671
+ funcTag = '[object Function]',
64672
+ mapTag$1 = '[object Map]',
64673
+ numberTag = '[object Number]',
64674
+ objectTag$2 = '[object Object]',
64675
+ regexpTag = '[object RegExp]',
64676
+ setTag$1 = '[object Set]',
64677
+ stringTag = '[object String]',
64678
+ weakMapTag$1 = '[object WeakMap]';
64679
+ var arrayBufferTag = '[object ArrayBuffer]',
64680
+ dataViewTag$1 = '[object DataView]',
64681
+ float32Tag = '[object Float32Array]',
64682
+ float64Tag = '[object Float64Array]',
64683
+ int8Tag = '[object Int8Array]',
64684
+ int16Tag = '[object Int16Array]',
64685
+ int32Tag = '[object Int32Array]',
64686
+ uint8Tag = '[object Uint8Array]',
64687
+ uint8ClampedTag = '[object Uint8ClampedArray]',
64688
+ uint16Tag = '[object Uint16Array]',
64689
+ uint32Tag = '[object Uint32Array]';
64690
+ /** Used to identify `toStringTag` values of typed arrays. */
64691
+
64692
+ var typedArrayTags = {};
64693
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
64694
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
64695
+ /**
64696
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
64697
+ *
64698
+ * @private
64699
+ * @param {*} value The value to check.
64700
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64701
+ */
64702
+
64703
+ function baseIsTypedArray$1(value) {
64704
+ return isObjectLike$1(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$1(value)];
64705
+ }
64706
+
64707
+ var _baseIsTypedArray = baseIsTypedArray$1;
64708
+
64709
+ /**
64710
+ * The base implementation of `_.unary` without support for storing metadata.
64711
+ *
64712
+ * @private
64713
+ * @param {Function} func The function to cap arguments for.
64714
+ * @returns {Function} Returns the new capped function.
64715
+ */
64716
+
64717
+ function baseUnary$1(func) {
64718
+ return function (value) {
64719
+ return func(value);
64720
+ };
64721
+ }
64722
+
64723
+ var _baseUnary = baseUnary$1;
64724
+
64725
+ var _nodeUtil = {exports: {}};
64726
+
64727
+ (function (module, exports) {
64728
+ var freeGlobal = _freeGlobal;
64729
+ /** Detect free variable `exports`. */
64730
+
64731
+ var freeExports = exports && !exports.nodeType && exports;
64732
+ /** Detect free variable `module`. */
64733
+
64734
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
64735
+ /** Detect the popular CommonJS extension `module.exports`. */
64736
+
64737
+ var moduleExports = freeModule && freeModule.exports === freeExports;
64738
+ /** Detect free variable `process` from Node.js. */
64739
+
64740
+ var freeProcess = moduleExports && freeGlobal.process;
64741
+ /** Used to access faster Node.js helpers. */
64742
+
64743
+ var nodeUtil = function () {
64744
+ try {
64745
+ // Use `util.types` for Node.js 10+.
64746
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
64747
+
64748
+ if (types) {
64749
+ return types;
64750
+ } // Legacy `process.binding('util')` for Node.js < 10.
64751
+
64752
+
64753
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
64754
+ } catch (e) {}
64755
+ }();
64756
+
64757
+ module.exports = nodeUtil;
64758
+ })(_nodeUtil, _nodeUtil.exports);
64759
+
64760
+ var baseIsTypedArray = _baseIsTypedArray,
64761
+ baseUnary = _baseUnary,
64762
+ nodeUtil = _nodeUtil.exports;
64763
+ /* Node.js helper references. */
64764
+
64765
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
64766
+ /**
64767
+ * Checks if `value` is classified as a typed array.
64768
+ *
64769
+ * @static
64770
+ * @memberOf _
64771
+ * @since 3.0.0
64772
+ * @category Lang
64773
+ * @param {*} value The value to check.
64774
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
64775
+ * @example
64776
+ *
64777
+ * _.isTypedArray(new Uint8Array);
64778
+ * // => true
64779
+ *
64780
+ * _.isTypedArray([]);
64781
+ * // => false
64782
+ */
64783
+
64784
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
64785
+ var isTypedArray_1 = isTypedArray$2;
64786
+
64787
+ var baseTimes = _baseTimes,
64788
+ isArguments$1 = isArguments_1,
64789
+ isArray$6 = isArray_1,
64790
+ isBuffer$1 = isBuffer$2.exports,
64791
+ isIndex$1 = _isIndex,
64792
+ isTypedArray$1 = isTypedArray_1;
64793
+ /** Used for built-in method references. */
64794
+
64795
+ var objectProto$4 = Object.prototype;
64796
+ /** Used to check objects for own properties. */
64797
+
64798
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
64799
+ /**
64800
+ * Creates an array of the enumerable property names of the array-like `value`.
64801
+ *
64802
+ * @private
64803
+ * @param {*} value The value to query.
64804
+ * @param {boolean} inherited Specify returning inherited property names.
64805
+ * @returns {Array} Returns the array of property names.
64806
+ */
64807
+
64808
+ function arrayLikeKeys$1(value, inherited) {
64809
+ var isArr = isArray$6(value),
64810
+ isArg = !isArr && isArguments$1(value),
64811
+ isBuff = !isArr && !isArg && isBuffer$1(value),
64812
+ isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
64813
+ skipIndexes = isArr || isArg || isBuff || isType,
64814
+ result = skipIndexes ? baseTimes(value.length, String) : [],
64815
+ length = result.length;
64816
+
64817
+ for (var key in value) {
64818
+ if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
64819
+ key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
64820
+ isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
64821
+ isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
64822
+ isIndex$1(key, length)))) {
64823
+ result.push(key);
64824
+ }
64825
+ }
64826
+
64827
+ return result;
64828
+ }
64829
+
64830
+ var _arrayLikeKeys = arrayLikeKeys$1;
64831
+
64832
+ /** Used for built-in method references. */
64833
+ var objectProto$3 = Object.prototype;
64834
+ /**
64835
+ * Checks if `value` is likely a prototype object.
64836
+ *
64837
+ * @private
64838
+ * @param {*} value The value to check.
64839
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
64840
+ */
64841
+
64842
+ function isPrototype$1(value) {
64843
+ var Ctor = value && value.constructor,
64844
+ proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$3;
64845
+ return value === proto;
64846
+ }
64847
+
64848
+ var _isPrototype = isPrototype$1;
64849
+
64850
+ /**
64851
+ * Creates a unary function that invokes `func` with its argument transformed.
64852
+ *
64853
+ * @private
64854
+ * @param {Function} func The function to wrap.
64855
+ * @param {Function} transform The argument transform.
64856
+ * @returns {Function} Returns the new function.
64857
+ */
64858
+
64859
+ function overArg$1(func, transform) {
64860
+ return function (arg) {
64861
+ return func(transform(arg));
64862
+ };
64863
+ }
64864
+
64865
+ var _overArg = overArg$1;
64866
+
64867
+ var overArg = _overArg;
64868
+ /* Built-in method references for those with the same name as other `lodash` methods. */
64869
+
64870
+ var nativeKeys$1 = overArg(Object.keys, Object);
64871
+ var _nativeKeys = nativeKeys$1;
64872
+
64873
+ var isPrototype = _isPrototype,
64874
+ nativeKeys = _nativeKeys;
64875
+ /** Used for built-in method references. */
64876
+
64877
+ var objectProto$2 = Object.prototype;
64878
+ /** Used to check objects for own properties. */
64879
+
64880
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
64881
+ /**
64882
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
64883
+ *
64884
+ * @private
64885
+ * @param {Object} object The object to query.
64886
+ * @returns {Array} Returns the array of property names.
64887
+ */
64888
+
64889
+ function baseKeys$1(object) {
64890
+ if (!isPrototype(object)) {
64891
+ return nativeKeys(object);
64892
+ }
64893
+
64894
+ var result = [];
64895
+
64896
+ for (var key in Object(object)) {
64897
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
64898
+ result.push(key);
64899
+ }
64900
+ }
64901
+
64902
+ return result;
64903
+ }
64904
+
64905
+ var _baseKeys = baseKeys$1;
64906
+
64907
+ var isFunction = isFunction_1,
64908
+ isLength$1 = isLength_1;
64909
+ /**
64910
+ * Checks if `value` is array-like. A value is considered array-like if it's
64911
+ * not a function and has a `value.length` that's an integer greater than or
64912
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
64913
+ *
64914
+ * @static
64915
+ * @memberOf _
64916
+ * @since 4.0.0
64917
+ * @category Lang
64918
+ * @param {*} value The value to check.
64919
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
64920
+ * @example
64921
+ *
64922
+ * _.isArrayLike([1, 2, 3]);
64923
+ * // => true
64924
+ *
64925
+ * _.isArrayLike(document.body.children);
64926
+ * // => true
64927
+ *
64928
+ * _.isArrayLike('abc');
64929
+ * // => true
64930
+ *
64931
+ * _.isArrayLike(_.noop);
64932
+ * // => false
64933
+ */
64934
+
64935
+ function isArrayLike$1(value) {
64936
+ return value != null && isLength$1(value.length) && !isFunction(value);
64937
+ }
64938
+
64939
+ var isArrayLike_1 = isArrayLike$1;
64940
+
64941
+ var arrayLikeKeys = _arrayLikeKeys,
64942
+ baseKeys = _baseKeys,
64943
+ isArrayLike = isArrayLike_1;
64944
+ /**
64945
+ * Creates an array of the own enumerable property names of `object`.
64946
+ *
64947
+ * **Note:** Non-object values are coerced to objects. See the
64948
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
64949
+ * for more details.
64950
+ *
64951
+ * @static
64952
+ * @since 0.1.0
64953
+ * @memberOf _
64954
+ * @category Object
64955
+ * @param {Object} object The object to query.
64956
+ * @returns {Array} Returns the array of property names.
64957
+ * @example
64958
+ *
64959
+ * function Foo() {
64960
+ * this.a = 1;
64961
+ * this.b = 2;
64962
+ * }
64963
+ *
64964
+ * Foo.prototype.c = 3;
64965
+ *
64966
+ * _.keys(new Foo);
64967
+ * // => ['a', 'b'] (iteration order is not guaranteed)
64968
+ *
64969
+ * _.keys('hi');
64970
+ * // => ['0', '1']
64971
+ */
64972
+
64973
+ function keys$2(object) {
64974
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
64975
+ }
64976
+
64977
+ var keys_1 = keys$2;
64978
+
64979
+ var baseGetAllKeys = _baseGetAllKeys,
64980
+ getSymbols = _getSymbols,
64981
+ keys$1 = keys_1;
64982
+ /**
64983
+ * Creates an array of own enumerable property names and symbols of `object`.
64984
+ *
64985
+ * @private
64986
+ * @param {Object} object The object to query.
64987
+ * @returns {Array} Returns the array of property names and symbols.
64988
+ */
64989
+
64990
+ function getAllKeys$1(object) {
64991
+ return baseGetAllKeys(object, keys$1, getSymbols);
64992
+ }
64993
+
64994
+ var _getAllKeys = getAllKeys$1;
64995
+
64996
+ var getAllKeys = _getAllKeys;
64997
+ /** Used to compose bitmasks for value comparisons. */
64998
+
64999
+ var COMPARE_PARTIAL_FLAG$3 = 1;
65000
+ /** Used for built-in method references. */
65001
+
65002
+ var objectProto$1 = Object.prototype;
65003
+ /** Used to check objects for own properties. */
65004
+
65005
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
65006
+ /**
65007
+ * A specialized version of `baseIsEqualDeep` for objects with support for
65008
+ * partial deep comparisons.
65009
+ *
65010
+ * @private
65011
+ * @param {Object} object The object to compare.
65012
+ * @param {Object} other The other object to compare.
65013
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
65014
+ * @param {Function} customizer The function to customize comparisons.
65015
+ * @param {Function} equalFunc The function to determine equivalents of values.
65016
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
65017
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
65018
+ */
65019
+
65020
+ function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
65021
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
65022
+ objProps = getAllKeys(object),
65023
+ objLength = objProps.length,
65024
+ othProps = getAllKeys(other),
65025
+ othLength = othProps.length;
65026
+
65027
+ if (objLength != othLength && !isPartial) {
65028
+ return false;
65029
+ }
65030
+
65031
+ var index = objLength;
65032
+
65033
+ while (index--) {
65034
+ var key = objProps[index];
65035
+
65036
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
65037
+ return false;
65038
+ }
65039
+ } // Check that cyclic values are equal.
65040
+
65041
+
65042
+ var objStacked = stack.get(object);
65043
+ var othStacked = stack.get(other);
65044
+
65045
+ if (objStacked && othStacked) {
65046
+ return objStacked == other && othStacked == object;
65047
+ }
65048
+
65049
+ var result = true;
65050
+ stack.set(object, other);
65051
+ stack.set(other, object);
65052
+ var skipCtor = isPartial;
65053
+
65054
+ while (++index < objLength) {
65055
+ key = objProps[index];
65056
+ var objValue = object[key],
65057
+ othValue = other[key];
65058
+
65059
+ if (customizer) {
65060
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
65061
+ } // Recursively compare objects (susceptible to call stack limits).
65062
+
65063
+
65064
+ if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
65065
+ result = false;
65066
+ break;
65067
+ }
65068
+
65069
+ skipCtor || (skipCtor = key == 'constructor');
65070
+ }
65071
+
65072
+ if (result && !skipCtor) {
65073
+ var objCtor = object.constructor,
65074
+ othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
65075
+
65076
+ if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
65077
+ result = false;
65078
+ }
65079
+ }
65080
+
65081
+ stack['delete'](object);
65082
+ stack['delete'](other);
65083
+ return result;
65084
+ }
65085
+
65086
+ var _equalObjects = equalObjects$1;
65087
+
65088
+ var getNative$3 = _getNative,
65089
+ root$3 = _root;
65090
+ /* Built-in method references that are verified to be native. */
65091
+
65092
+ var DataView$1 = getNative$3(root$3, 'DataView');
65093
+ var _DataView = DataView$1;
65094
+
65095
+ var getNative$2 = _getNative,
65096
+ root$2 = _root;
65097
+ /* Built-in method references that are verified to be native. */
65098
+
65099
+ var Promise$2 = getNative$2(root$2, 'Promise');
65100
+ var _Promise = Promise$2;
65101
+
65102
+ var getNative$1 = _getNative,
65103
+ root$1 = _root;
65104
+ /* Built-in method references that are verified to be native. */
65105
+
65106
+ var Set$2 = getNative$1(root$1, 'Set');
65107
+ var _Set = Set$2;
65108
+
65109
+ var getNative = _getNative,
65110
+ root = _root;
65111
+ /* Built-in method references that are verified to be native. */
65112
+
65113
+ var WeakMap$2 = getNative(root, 'WeakMap');
65114
+ var _WeakMap = WeakMap$2;
65115
+
65116
+ var DataView = _DataView,
65117
+ Map$1 = _Map,
65118
+ Promise$1 = _Promise,
65119
+ Set$1 = _Set,
65120
+ WeakMap$1 = _WeakMap,
65121
+ baseGetTag = _baseGetTag,
65122
+ toSource = _toSource;
65123
+ /** `Object#toString` result references. */
65124
+
65125
+ var mapTag = '[object Map]',
65126
+ objectTag$1 = '[object Object]',
65127
+ promiseTag = '[object Promise]',
65128
+ setTag = '[object Set]',
65129
+ weakMapTag = '[object WeakMap]';
65130
+ var dataViewTag = '[object DataView]';
65131
+ /** Used to detect maps, sets, and weakmaps. */
65132
+
65133
+ var dataViewCtorString = toSource(DataView),
65134
+ mapCtorString = toSource(Map$1),
65135
+ promiseCtorString = toSource(Promise$1),
65136
+ setCtorString = toSource(Set$1),
65137
+ weakMapCtorString = toSource(WeakMap$1);
65138
+ /**
65139
+ * Gets the `toStringTag` of `value`.
65140
+ *
65141
+ * @private
65142
+ * @param {*} value The value to query.
65143
+ * @returns {string} Returns the `toStringTag`.
65144
+ */
65145
+
65146
+ var getTag$1 = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
65147
+
65148
+ if (DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag$1(new Map$1()) != mapTag || Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag || Set$1 && getTag$1(new Set$1()) != setTag || WeakMap$1 && getTag$1(new WeakMap$1()) != weakMapTag) {
65149
+ getTag$1 = function getTag(value) {
65150
+ var result = baseGetTag(value),
65151
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
65152
+ ctorString = Ctor ? toSource(Ctor) : '';
65153
+
65154
+ if (ctorString) {
65155
+ switch (ctorString) {
65156
+ case dataViewCtorString:
65157
+ return dataViewTag;
65158
+
65159
+ case mapCtorString:
65160
+ return mapTag;
65161
+
65162
+ case promiseCtorString:
65163
+ return promiseTag;
65164
+
65165
+ case setCtorString:
65166
+ return setTag;
65167
+
65168
+ case weakMapCtorString:
65169
+ return weakMapTag;
65170
+ }
65171
+ }
65172
+
65173
+ return result;
65174
+ };
65175
+ }
65176
+
65177
+ var _getTag = getTag$1;
65178
+
65179
+ var Stack$1 = _Stack,
65180
+ equalArrays = _equalArrays,
65181
+ equalByTag = _equalByTag,
65182
+ equalObjects = _equalObjects,
65183
+ getTag = _getTag,
65184
+ isArray$5 = isArray_1,
65185
+ isBuffer = isBuffer$2.exports,
65186
+ isTypedArray = isTypedArray_1;
65187
+ /** Used to compose bitmasks for value comparisons. */
65188
+
65189
+ var COMPARE_PARTIAL_FLAG$2 = 1;
65190
+ /** `Object#toString` result references. */
65191
+
65192
+ var argsTag = '[object Arguments]',
65193
+ arrayTag = '[object Array]',
65194
+ objectTag = '[object Object]';
65195
+ /** Used for built-in method references. */
65196
+
65197
+ var objectProto = Object.prototype;
65198
+ /** Used to check objects for own properties. */
65199
+
65200
+ var hasOwnProperty = objectProto.hasOwnProperty;
65201
+ /**
65202
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
65203
+ * deep comparisons and tracks traversed objects enabling objects with circular
65204
+ * references to be compared.
65205
+ *
65206
+ * @private
65207
+ * @param {Object} object The object to compare.
65208
+ * @param {Object} other The other object to compare.
65209
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
65210
+ * @param {Function} customizer The function to customize comparisons.
65211
+ * @param {Function} equalFunc The function to determine equivalents of values.
65212
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
65213
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
65214
+ */
65215
+
65216
+ function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
65217
+ var objIsArr = isArray$5(object),
65218
+ othIsArr = isArray$5(other),
65219
+ objTag = objIsArr ? arrayTag : getTag(object),
65220
+ othTag = othIsArr ? arrayTag : getTag(other);
65221
+ objTag = objTag == argsTag ? objectTag : objTag;
65222
+ othTag = othTag == argsTag ? objectTag : othTag;
65223
+ var objIsObj = objTag == objectTag,
65224
+ othIsObj = othTag == objectTag,
65225
+ isSameTag = objTag == othTag;
65226
+
65227
+ if (isSameTag && isBuffer(object)) {
65228
+ if (!isBuffer(other)) {
65229
+ return false;
65230
+ }
65231
+
65232
+ objIsArr = true;
65233
+ objIsObj = false;
65234
+ }
65235
+
65236
+ if (isSameTag && !objIsObj) {
65237
+ stack || (stack = new Stack$1());
65238
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
65239
+ }
65240
+
65241
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
65242
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
65243
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
65244
+
65245
+ if (objIsWrapped || othIsWrapped) {
65246
+ var objUnwrapped = objIsWrapped ? object.value() : object,
65247
+ othUnwrapped = othIsWrapped ? other.value() : other;
65248
+ stack || (stack = new Stack$1());
65249
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
65250
+ }
65251
+ }
65252
+
65253
+ if (!isSameTag) {
65254
+ return false;
65255
+ }
65256
+
65257
+ stack || (stack = new Stack$1());
65258
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
65259
+ }
65260
+
65261
+ var _baseIsEqualDeep = baseIsEqualDeep$1;
65262
+
65263
+ var baseIsEqualDeep = _baseIsEqualDeep,
65264
+ isObjectLike = isObjectLike_1;
65265
+ /**
65266
+ * The base implementation of `_.isEqual` which supports partial comparisons
65267
+ * and tracks traversed objects.
65268
+ *
65269
+ * @private
65270
+ * @param {*} value The value to compare.
65271
+ * @param {*} other The other value to compare.
65272
+ * @param {boolean} bitmask The bitmask flags.
65273
+ * 1 - Unordered comparison
65274
+ * 2 - Partial comparison
65275
+ * @param {Function} [customizer] The function to customize comparisons.
65276
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
65277
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
65278
+ */
65279
+
65280
+ function baseIsEqual$2(value, other, bitmask, customizer, stack) {
65281
+ if (value === other) {
65282
+ return true;
65283
+ }
65284
+
65285
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
65286
+ return value !== value && other !== other;
65287
+ }
65288
+
65289
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
65290
+ }
65291
+
65292
+ var _baseIsEqual = baseIsEqual$2;
65293
+
65294
+ var Stack = _Stack,
65295
+ baseIsEqual$1 = _baseIsEqual;
65296
+ /** Used to compose bitmasks for value comparisons. */
65297
+
65298
+ var COMPARE_PARTIAL_FLAG$1 = 1,
65299
+ COMPARE_UNORDERED_FLAG$1 = 2;
65300
+ /**
65301
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
65302
+ *
65303
+ * @private
65304
+ * @param {Object} object The object to inspect.
65305
+ * @param {Object} source The object of property values to match.
65306
+ * @param {Array} matchData The property names, values, and compare flags to match.
65307
+ * @param {Function} [customizer] The function to customize comparisons.
65308
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
65309
+ */
65310
+
65311
+ function baseIsMatch$1(object, source, matchData, customizer) {
65312
+ var index = matchData.length,
65313
+ length = index,
65314
+ noCustomizer = !customizer;
65315
+
65316
+ if (object == null) {
65317
+ return !length;
65318
+ }
65319
+
65320
+ object = Object(object);
65321
+
65322
+ while (index--) {
65323
+ var data = matchData[index];
65324
+
65325
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
65326
+ return false;
65327
+ }
65328
+ }
65329
+
65330
+ while (++index < length) {
65331
+ data = matchData[index];
65332
+ var key = data[0],
65333
+ objValue = object[key],
65334
+ srcValue = data[1];
65335
+
65336
+ if (noCustomizer && data[2]) {
65337
+ if (objValue === undefined && !(key in object)) {
65338
+ return false;
65339
+ }
65340
+ } else {
65341
+ var stack = new Stack();
65342
+
65343
+ if (customizer) {
65344
+ var result = customizer(objValue, srcValue, key, object, source, stack);
65345
+ }
65346
+
65347
+ if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
65348
+ return false;
65349
+ }
65350
+ }
65351
+ }
65352
+
65353
+ return true;
65354
+ }
65355
+
65356
+ var _baseIsMatch = baseIsMatch$1;
65357
+
65358
+ var isObject = isObject_1;
65359
+ /**
65360
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
65361
+ *
65362
+ * @private
65363
+ * @param {*} value The value to check.
65364
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
65365
+ * equality comparisons, else `false`.
65366
+ */
65367
+
65368
+ function isStrictComparable$2(value) {
65369
+ return value === value && !isObject(value);
65370
+ }
65371
+
65372
+ var _isStrictComparable = isStrictComparable$2;
65373
+
65374
+ var isStrictComparable$1 = _isStrictComparable,
65375
+ keys = keys_1;
65376
+ /**
65377
+ * Gets the property names, values, and compare flags of `object`.
65378
+ *
65379
+ * @private
65380
+ * @param {Object} object The object to query.
65381
+ * @returns {Array} Returns the match data of `object`.
65382
+ */
65383
+
65384
+ function getMatchData$1(object) {
65385
+ var result = keys(object),
65386
+ length = result.length;
65387
+
65388
+ while (length--) {
65389
+ var key = result[length],
65390
+ value = object[key];
65391
+ result[length] = [key, value, isStrictComparable$1(value)];
65392
+ }
65393
+
65394
+ return result;
65395
+ }
65396
+
65397
+ var _getMatchData = getMatchData$1;
65398
+
65399
+ /**
65400
+ * A specialized version of `matchesProperty` for source values suitable
65401
+ * for strict equality comparisons, i.e. `===`.
65402
+ *
65403
+ * @private
65404
+ * @param {string} key The key of the property to get.
65405
+ * @param {*} srcValue The value to match.
65406
+ * @returns {Function} Returns the new spec function.
65407
+ */
65408
+
65409
+ function matchesStrictComparable$2(key, srcValue) {
65410
+ return function (object) {
65411
+ if (object == null) {
65412
+ return false;
65413
+ }
65414
+
65415
+ return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
65416
+ };
65417
+ }
65418
+
65419
+ var _matchesStrictComparable = matchesStrictComparable$2;
65420
+
65421
+ var baseIsMatch = _baseIsMatch,
65422
+ getMatchData = _getMatchData,
65423
+ matchesStrictComparable$1 = _matchesStrictComparable;
65424
+ /**
65425
+ * The base implementation of `_.matches` which doesn't clone `source`.
65426
+ *
65427
+ * @private
65428
+ * @param {Object} source The object of property values to match.
65429
+ * @returns {Function} Returns the new spec function.
65430
+ */
65431
+
65432
+ function baseMatches$1(source) {
65433
+ var matchData = getMatchData(source);
65434
+
65435
+ if (matchData.length == 1 && matchData[0][2]) {
65436
+ return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
65437
+ }
65438
+
65439
+ return function (object) {
65440
+ return object === source || baseIsMatch(object, source, matchData);
65441
+ };
65442
+ }
65443
+
65444
+ var _baseMatches = baseMatches$1;
65445
+
65446
+ var isArray$4 = isArray_1,
65447
+ isSymbol$2 = isSymbol_1;
65448
+ /** Used to match property names within property paths. */
65449
+
65450
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
65451
+ reIsPlainProp = /^\w*$/;
65452
+ /**
65453
+ * Checks if `value` is a property name and not a property path.
65454
+ *
65455
+ * @private
65456
+ * @param {*} value The value to check.
65457
+ * @param {Object} [object] The object to query keys on.
65458
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
65459
+ */
65460
+
65461
+ function isKey$3(value, object) {
65462
+ if (isArray$4(value)) {
65463
+ return false;
65464
+ }
65465
+
65466
+ var type = _typeof(value);
65467
+
65468
+ if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
65469
+ return true;
65470
+ }
65471
+
65472
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
65473
+ }
65474
+
65475
+ var _isKey = isKey$3;
65476
+
65477
+ var MapCache = _MapCache;
65478
+ /** Error message constants. */
65479
+
65480
+ var FUNC_ERROR_TEXT = 'Expected a function';
65481
+ /**
65482
+ * Creates a function that memoizes the result of `func`. If `resolver` is
65483
+ * provided, it determines the cache key for storing the result based on the
65484
+ * arguments provided to the memoized function. By default, the first argument
65485
+ * provided to the memoized function is used as the map cache key. The `func`
65486
+ * is invoked with the `this` binding of the memoized function.
65487
+ *
65488
+ * **Note:** The cache is exposed as the `cache` property on the memoized
65489
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
65490
+ * constructor with one whose instances implement the
65491
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
65492
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
65493
+ *
65494
+ * @static
65495
+ * @memberOf _
65496
+ * @since 0.1.0
65497
+ * @category Function
65498
+ * @param {Function} func The function to have its output memoized.
65499
+ * @param {Function} [resolver] The function to resolve the cache key.
65500
+ * @returns {Function} Returns the new memoized function.
65501
+ * @example
65502
+ *
65503
+ * var object = { 'a': 1, 'b': 2 };
65504
+ * var other = { 'c': 3, 'd': 4 };
65505
+ *
65506
+ * var values = _.memoize(_.values);
65507
+ * values(object);
65508
+ * // => [1, 2]
65509
+ *
65510
+ * values(other);
65511
+ * // => [3, 4]
65512
+ *
65513
+ * object.a = 2;
65514
+ * values(object);
65515
+ * // => [1, 2]
65516
+ *
65517
+ * // Modify the result cache.
65518
+ * values.cache.set(object, ['a', 'b']);
65519
+ * values(object);
65520
+ * // => ['a', 'b']
65521
+ *
65522
+ * // Replace `_.memoize.Cache`.
65523
+ * _.memoize.Cache = WeakMap;
65524
+ */
65525
+
65526
+ function memoize$1(func, resolver) {
65527
+ if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
65528
+ throw new TypeError(FUNC_ERROR_TEXT);
65529
+ }
65530
+
65531
+ var memoized = function memoized() {
65532
+ var args = arguments,
65533
+ key = resolver ? resolver.apply(this, args) : args[0],
65534
+ cache = memoized.cache;
65535
+
65536
+ if (cache.has(key)) {
65537
+ return cache.get(key);
65538
+ }
65539
+
65540
+ var result = func.apply(this, args);
65541
+ memoized.cache = cache.set(key, result) || cache;
65542
+ return result;
65543
+ };
65544
+
65545
+ memoized.cache = new (memoize$1.Cache || MapCache)();
65546
+ return memoized;
65547
+ } // Expose `MapCache`.
65548
+
65549
+
65550
+ memoize$1.Cache = MapCache;
65551
+ var memoize_1 = memoize$1;
65552
+
65553
+ var memoize = memoize_1;
65554
+ /** Used as the maximum memoize cache size. */
65555
+
65556
+ var MAX_MEMOIZE_SIZE = 500;
65557
+ /**
65558
+ * A specialized version of `_.memoize` which clears the memoized function's
65559
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
65560
+ *
65561
+ * @private
65562
+ * @param {Function} func The function to have its output memoized.
65563
+ * @returns {Function} Returns the new memoized function.
65564
+ */
65565
+
65566
+ function memoizeCapped$1(func) {
65567
+ var result = memoize(func, function (key) {
65568
+ if (cache.size === MAX_MEMOIZE_SIZE) {
65569
+ cache.clear();
65570
+ }
65571
+
65572
+ return key;
65573
+ });
65574
+ var cache = result.cache;
65575
+ return result;
65576
+ }
65577
+
65578
+ var _memoizeCapped = memoizeCapped$1;
65579
+
65580
+ var memoizeCapped = _memoizeCapped;
65581
+ /** Used to match property names within property paths. */
65582
+
65583
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
65584
+ /** Used to match backslashes in property paths. */
65585
+
65586
+ var reEscapeChar = /\\(\\)?/g;
65587
+ /**
65588
+ * Converts `string` to a property path array.
65589
+ *
65590
+ * @private
65591
+ * @param {string} string The string to convert.
65592
+ * @returns {Array} Returns the property path array.
65593
+ */
65594
+
65595
+ var stringToPath$1 = memoizeCapped(function (string) {
65596
+ var result = [];
65597
+
65598
+ if (string.charCodeAt(0) === 46
65599
+ /* . */
65600
+ ) {
65601
+ result.push('');
65602
+ }
65603
+
65604
+ string.replace(rePropName, function (match, number, quote, subString) {
65605
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
65606
+ });
65607
+ return result;
65608
+ });
65609
+ var _stringToPath = stringToPath$1;
65610
+
65611
+ /**
65612
+ * A specialized version of `_.map` for arrays without support for iteratee
65613
+ * shorthands.
65614
+ *
65615
+ * @private
65616
+ * @param {Array} [array] The array to iterate over.
65617
+ * @param {Function} iteratee The function invoked per iteration.
65618
+ * @returns {Array} Returns the new mapped array.
65619
+ */
65620
+
65621
+ function arrayMap$1(array, iteratee) {
65622
+ var index = -1,
65623
+ length = array == null ? 0 : array.length,
65624
+ result = Array(length);
65625
+
65626
+ while (++index < length) {
65627
+ result[index] = iteratee(array[index], index, array);
65628
+ }
65629
+
65630
+ return result;
65631
+ }
65632
+
65633
+ var _arrayMap = arrayMap$1;
65634
+
65635
+ var _Symbol = _Symbol$4,
65636
+ arrayMap = _arrayMap,
65637
+ isArray$3 = isArray_1,
65638
+ isSymbol$1 = isSymbol_1;
65639
+ /** Used as references for various `Number` constants. */
65640
+
65641
+ var INFINITY$1 = 1 / 0;
65642
+ /** Used to convert symbols to primitives and strings. */
65643
+
65644
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
65645
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
65646
+ /**
65647
+ * The base implementation of `_.toString` which doesn't convert nullish
65648
+ * values to empty strings.
65649
+ *
65650
+ * @private
65651
+ * @param {*} value The value to process.
65652
+ * @returns {string} Returns the string.
65653
+ */
65654
+
65655
+ function baseToString$1(value) {
65656
+ // Exit early for strings to avoid a performance hit in some environments.
65657
+ if (typeof value == 'string') {
65658
+ return value;
65659
+ }
65660
+
65661
+ if (isArray$3(value)) {
65662
+ // Recursively convert values (susceptible to call stack limits).
65663
+ return arrayMap(value, baseToString$1) + '';
65664
+ }
65665
+
65666
+ if (isSymbol$1(value)) {
65667
+ return symbolToString ? symbolToString.call(value) : '';
65668
+ }
65669
+
65670
+ var result = value + '';
65671
+ return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
65672
+ }
65673
+
65674
+ var _baseToString = baseToString$1;
65675
+
65676
+ var baseToString = _baseToString;
65677
+ /**
65678
+ * Converts `value` to a string. An empty string is returned for `null`
65679
+ * and `undefined` values. The sign of `-0` is preserved.
65680
+ *
65681
+ * @static
65682
+ * @memberOf _
65683
+ * @since 4.0.0
65684
+ * @category Lang
65685
+ * @param {*} value The value to convert.
65686
+ * @returns {string} Returns the converted string.
65687
+ * @example
65688
+ *
65689
+ * _.toString(null);
65690
+ * // => ''
65691
+ *
65692
+ * _.toString(-0);
65693
+ * // => '-0'
65694
+ *
65695
+ * _.toString([1, 2, 3]);
65696
+ * // => '1,2,3'
65697
+ */
65698
+
65699
+ function toString$1(value) {
65700
+ return value == null ? '' : baseToString(value);
65701
+ }
65702
+
65703
+ var toString_1 = toString$1;
65704
+
65705
+ var isArray$2 = isArray_1,
65706
+ isKey$2 = _isKey,
65707
+ stringToPath = _stringToPath,
65708
+ toString = toString_1;
65709
+ /**
65710
+ * Casts `value` to a path array if it's not one.
65711
+ *
65712
+ * @private
65713
+ * @param {*} value The value to inspect.
65714
+ * @param {Object} [object] The object to query keys on.
65715
+ * @returns {Array} Returns the cast property path array.
65716
+ */
65717
+
65718
+ function castPath$2(value, object) {
65719
+ if (isArray$2(value)) {
65720
+ return value;
65721
+ }
65722
+
65723
+ return isKey$2(value, object) ? [value] : stringToPath(toString(value));
65724
+ }
65725
+
65726
+ var _castPath = castPath$2;
65727
+
65728
+ var isSymbol = isSymbol_1;
65729
+ /** Used as references for various `Number` constants. */
65730
+
65731
+ var INFINITY = 1 / 0;
65732
+ /**
65733
+ * Converts `value` to a string key if it's not a string or symbol.
65734
+ *
65735
+ * @private
65736
+ * @param {*} value The value to inspect.
65737
+ * @returns {string|symbol} Returns the key.
65738
+ */
65739
+
65740
+ function toKey$4(value) {
65741
+ if (typeof value == 'string' || isSymbol(value)) {
65742
+ return value;
65743
+ }
65744
+
65745
+ var result = value + '';
65746
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
65747
+ }
65748
+
65749
+ var _toKey = toKey$4;
65750
+
65751
+ var castPath$1 = _castPath,
65752
+ toKey$3 = _toKey;
65753
+ /**
65754
+ * The base implementation of `_.get` without support for default values.
65755
+ *
65756
+ * @private
65757
+ * @param {Object} object The object to query.
65758
+ * @param {Array|string} path The path of the property to get.
65759
+ * @returns {*} Returns the resolved value.
65760
+ */
65761
+
65762
+ function baseGet$2(object, path) {
65763
+ path = castPath$1(path, object);
65764
+ var index = 0,
65765
+ length = path.length;
65766
+
65767
+ while (object != null && index < length) {
65768
+ object = object[toKey$3(path[index++])];
65769
+ }
65770
+
65771
+ return index && index == length ? object : undefined;
65772
+ }
65773
+
65774
+ var _baseGet = baseGet$2;
65775
+
65776
+ var baseGet$1 = _baseGet;
65777
+ /**
65778
+ * Gets the value at `path` of `object`. If the resolved value is
65779
+ * `undefined`, the `defaultValue` is returned in its place.
65780
+ *
65781
+ * @static
65782
+ * @memberOf _
65783
+ * @since 3.7.0
65784
+ * @category Object
65785
+ * @param {Object} object The object to query.
65786
+ * @param {Array|string} path The path of the property to get.
65787
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
65788
+ * @returns {*} Returns the resolved value.
65789
+ * @example
65790
+ *
65791
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
65792
+ *
65793
+ * _.get(object, 'a[0].b.c');
65794
+ * // => 3
65795
+ *
65796
+ * _.get(object, ['a', '0', 'b', 'c']);
65797
+ * // => 3
65798
+ *
65799
+ * _.get(object, 'a.b.c', 'default');
65800
+ * // => 'default'
65801
+ */
65802
+
65803
+ function get$1(object, path, defaultValue) {
65804
+ var result = object == null ? undefined : baseGet$1(object, path);
65805
+ return result === undefined ? defaultValue : result;
65806
+ }
65807
+
65808
+ var get_1 = get$1;
65809
+
65810
+ /**
65811
+ * The base implementation of `_.hasIn` without support for deep paths.
65812
+ *
65813
+ * @private
65814
+ * @param {Object} [object] The object to query.
65815
+ * @param {Array|string} key The key to check.
65816
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
65817
+ */
65818
+
65819
+ function baseHasIn$1(object, key) {
65820
+ return object != null && key in Object(object);
65821
+ }
65822
+
65823
+ var _baseHasIn = baseHasIn$1;
65824
+
65825
+ var castPath = _castPath,
65826
+ isArguments = isArguments_1,
65827
+ isArray$1 = isArray_1,
65828
+ isIndex = _isIndex,
65829
+ isLength = isLength_1,
65830
+ toKey$2 = _toKey;
65831
+ /**
65832
+ * Checks if `path` exists on `object`.
65833
+ *
65834
+ * @private
65835
+ * @param {Object} object The object to query.
65836
+ * @param {Array|string} path The path to check.
65837
+ * @param {Function} hasFunc The function to check properties.
65838
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65839
+ */
65840
+
65841
+ function hasPath$1(object, path, hasFunc) {
65842
+ path = castPath(path, object);
65843
+ var index = -1,
65844
+ length = path.length,
65845
+ result = false;
65846
+
65847
+ while (++index < length) {
65848
+ var key = toKey$2(path[index]);
65849
+
65850
+ if (!(result = object != null && hasFunc(object, key))) {
65851
+ break;
65852
+ }
65853
+
65854
+ object = object[key];
65855
+ }
65856
+
65857
+ if (result || ++index != length) {
65858
+ return result;
65859
+ }
65860
+
65861
+ length = object == null ? 0 : object.length;
65862
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
65863
+ }
65864
+
65865
+ var _hasPath = hasPath$1;
65866
+
65867
+ var baseHasIn = _baseHasIn,
65868
+ hasPath = _hasPath;
65869
+ /**
65870
+ * Checks if `path` is a direct or inherited property of `object`.
65871
+ *
65872
+ * @static
65873
+ * @memberOf _
65874
+ * @since 4.0.0
65875
+ * @category Object
65876
+ * @param {Object} object The object to query.
65877
+ * @param {Array|string} path The path to check.
65878
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
65879
+ * @example
65880
+ *
65881
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
65882
+ *
65883
+ * _.hasIn(object, 'a');
65884
+ * // => true
65885
+ *
65886
+ * _.hasIn(object, 'a.b');
65887
+ * // => true
65888
+ *
65889
+ * _.hasIn(object, ['a', 'b']);
65890
+ * // => true
65891
+ *
65892
+ * _.hasIn(object, 'b');
65893
+ * // => false
65894
+ */
65895
+
65896
+ function hasIn$1(object, path) {
65897
+ return object != null && hasPath(object, path, baseHasIn);
65898
+ }
65899
+
65900
+ var hasIn_1 = hasIn$1;
65901
+
65902
+ var baseIsEqual = _baseIsEqual,
65903
+ get = get_1,
65904
+ hasIn = hasIn_1,
65905
+ isKey$1 = _isKey,
65906
+ isStrictComparable = _isStrictComparable,
65907
+ matchesStrictComparable = _matchesStrictComparable,
65908
+ toKey$1 = _toKey;
65909
+ /** Used to compose bitmasks for value comparisons. */
65910
+
65911
+ var COMPARE_PARTIAL_FLAG = 1,
65912
+ COMPARE_UNORDERED_FLAG = 2;
65913
+ /**
65914
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
65915
+ *
65916
+ * @private
65917
+ * @param {string} path The path of the property to get.
65918
+ * @param {*} srcValue The value to match.
65919
+ * @returns {Function} Returns the new spec function.
65920
+ */
65921
+
65922
+ function baseMatchesProperty$1(path, srcValue) {
65923
+ if (isKey$1(path) && isStrictComparable(srcValue)) {
65924
+ return matchesStrictComparable(toKey$1(path), srcValue);
65925
+ }
65926
+
65927
+ return function (object) {
65928
+ var objValue = get(object, path);
65929
+ return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
65930
+ };
65931
+ }
65932
+
65933
+ var _baseMatchesProperty = baseMatchesProperty$1;
65934
+
65935
+ /**
65936
+ * This method returns the first argument it receives.
65937
+ *
65938
+ * @static
65939
+ * @since 0.1.0
65940
+ * @memberOf _
65941
+ * @category Util
65942
+ * @param {*} value Any value.
65943
+ * @returns {*} Returns `value`.
65944
+ * @example
65945
+ *
65946
+ * var object = { 'a': 1 };
65947
+ *
65948
+ * console.log(_.identity(object) === object);
65949
+ * // => true
65950
+ */
65951
+
65952
+ function identity$1(value) {
65953
+ return value;
65954
+ }
65955
+
65956
+ var identity_1 = identity$1;
65957
+
65958
+ /**
65959
+ * The base implementation of `_.property` without support for deep paths.
65960
+ *
65961
+ * @private
65962
+ * @param {string} key The key of the property to get.
65963
+ * @returns {Function} Returns the new accessor function.
65964
+ */
65965
+
65966
+ function baseProperty$1(key) {
65967
+ return function (object) {
65968
+ return object == null ? undefined : object[key];
65969
+ };
65970
+ }
65971
+
65972
+ var _baseProperty = baseProperty$1;
65973
+
65974
+ var baseGet = _baseGet;
65975
+ /**
65976
+ * A specialized version of `baseProperty` which supports deep paths.
65977
+ *
65978
+ * @private
65979
+ * @param {Array|string} path The path of the property to get.
65980
+ * @returns {Function} Returns the new accessor function.
65981
+ */
65982
+
65983
+ function basePropertyDeep$1(path) {
65984
+ return function (object) {
65985
+ return baseGet(object, path);
65986
+ };
65987
+ }
65988
+
65989
+ var _basePropertyDeep = basePropertyDeep$1;
65990
+
65991
+ var baseProperty = _baseProperty,
65992
+ basePropertyDeep = _basePropertyDeep,
65993
+ isKey = _isKey,
65994
+ toKey = _toKey;
65995
+ /**
65996
+ * Creates a function that returns the value at `path` of a given object.
65997
+ *
65998
+ * @static
65999
+ * @memberOf _
66000
+ * @since 2.4.0
66001
+ * @category Util
66002
+ * @param {Array|string} path The path of the property to get.
66003
+ * @returns {Function} Returns the new accessor function.
66004
+ * @example
66005
+ *
66006
+ * var objects = [
66007
+ * { 'a': { 'b': 2 } },
66008
+ * { 'a': { 'b': 1 } }
66009
+ * ];
66010
+ *
66011
+ * _.map(objects, _.property('a.b'));
66012
+ * // => [2, 1]
66013
+ *
66014
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
66015
+ * // => [1, 2]
66016
+ */
66017
+
66018
+ function property$1(path) {
66019
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
66020
+ }
66021
+
66022
+ var property_1 = property$1;
66023
+
66024
+ var baseMatches = _baseMatches,
66025
+ baseMatchesProperty = _baseMatchesProperty,
66026
+ identity = identity_1,
66027
+ isArray = isArray_1,
66028
+ property = property_1;
66029
+ /**
66030
+ * The base implementation of `_.iteratee`.
66031
+ *
66032
+ * @private
66033
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
66034
+ * @returns {Function} Returns the iteratee.
66035
+ */
66036
+
66037
+ function baseIteratee$1(value) {
66038
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
66039
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
66040
+ if (typeof value == 'function') {
66041
+ return value;
66042
+ }
66043
+
66044
+ if (value == null) {
66045
+ return identity;
66046
+ }
66047
+
66048
+ if (_typeof(value) == 'object') {
66049
+ return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
66050
+ }
66051
+
66052
+ return property(value);
66053
+ }
66054
+
66055
+ var _baseIteratee = baseIteratee$1;
66056
+
66057
+ var baseExtremum = _baseExtremum,
66058
+ baseGt = _baseGt,
66059
+ baseIteratee = _baseIteratee;
66060
+ /**
66061
+ * This method is like `_.max` except that it accepts `iteratee` which is
66062
+ * invoked for each element in `array` to generate the criterion by which
66063
+ * the value is ranked. The iteratee is invoked with one argument: (value).
66064
+ *
66065
+ * @static
66066
+ * @memberOf _
66067
+ * @since 4.0.0
66068
+ * @category Math
66069
+ * @param {Array} array The array to iterate over.
66070
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
66071
+ * @returns {*} Returns the maximum value.
66072
+ * @example
66073
+ *
66074
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
66075
+ *
66076
+ * _.maxBy(objects, function(o) { return o.n; });
66077
+ * // => { 'n': 2 }
66078
+ *
66079
+ * // The `_.property` iteratee shorthand.
66080
+ * _.maxBy(objects, 'n');
66081
+ * // => { 'n': 2 }
66082
+ */
66083
+
66084
+ function maxBy(array, iteratee) {
66085
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : undefined;
66086
+ }
66087
+
66088
+ var maxBy_1 = maxBy;
66089
+
66090
+ var THREE_SECONDS = 3000;
66091
+ var MAX_TRIES = 3;
66092
+ /** Check if the user's primary creator node is healthy */
66093
+
66094
+ var checkPrimaryHealthy = /*#__PURE__*/function () {
66095
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
66096
+ var healthy;
66097
+ return regeneratorRuntime.wrap(function _callee$(_context) {
66098
+ while (1) {
66099
+ switch (_context.prev = _context.next) {
66100
+ case 0:
66101
+ _context.next = 2;
66102
+ return Utils.isHealthy(primary);
66103
+
66104
+ case 2:
66105
+ healthy = _context.sent;
66106
+
66107
+ if (!healthy) {
66108
+ _context.next = 7;
66109
+ break;
66110
+ }
66111
+
66112
+ return _context.abrupt("return", healthy);
66113
+
66114
+ case 7:
66115
+ if (!(tries === 0)) {
66116
+ _context.next = 9;
66117
+ break;
66118
+ }
66119
+
66120
+ return _context.abrupt("return", false);
66121
+
66122
+ case 9:
66123
+ _context.next = 11;
66124
+ return Utils.wait(THREE_SECONDS);
66125
+
66126
+ case 11:
66127
+ _context.next = 13;
66128
+ return checkPrimaryHealthy(libs, primary, tries - 1);
66129
+
66130
+ case 13:
66131
+ return _context.abrupt("return", _context.sent);
66132
+
66133
+ case 14:
66134
+ case "end":
66135
+ return _context.stop();
66136
+ }
66137
+ }
66138
+ }, _callee);
66139
+ }));
66140
+
66141
+ return function checkPrimaryHealthy(_x, _x2, _x3) {
66142
+ return _ref.apply(this, arguments);
66143
+ };
66144
+ }();
66145
+ /** Gets new endpoints from a user's secondaries */
66146
+
66147
+
66148
+ var getNewPrimary = /*#__PURE__*/function () {
66149
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(secondaries, wallet) {
66150
+ var _maxBy;
66151
+
66152
+ var secondaryStatuses, max;
66153
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
66154
+ while (1) {
66155
+ switch (_context3.prev = _context3.next) {
66156
+ case 0:
66157
+ _context3.next = 2;
66158
+ return Promise.all(secondaries.map( /*#__PURE__*/function () {
66159
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(secondary) {
66160
+ var clockValue;
66161
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
66162
+ while (1) {
66163
+ switch (_context2.prev = _context2.next) {
66164
+ case 0:
66165
+ _context2.prev = 0;
66166
+ _context2.next = 3;
66167
+ return CreatorNode.getClockValue(secondary, wallet);
66168
+
66169
+ case 3:
66170
+ clockValue = _context2.sent;
66171
+
66172
+ if (!clockValue) {
66173
+ _context2.next = 6;
66174
+ break;
66175
+ }
66176
+
66177
+ return _context2.abrupt("return", {
66178
+ secondary: secondary,
66179
+ clockValue: clockValue
66180
+ });
66181
+
66182
+ case 6:
66183
+ return _context2.abrupt("return", undefined);
66184
+
66185
+ case 9:
66186
+ _context2.prev = 9;
66187
+ _context2.t0 = _context2["catch"](0);
66188
+ console.warn(_context2.t0);
66189
+ return _context2.abrupt("return", undefined);
66190
+
66191
+ case 13:
66192
+ case "end":
66193
+ return _context2.stop();
66194
+ }
66195
+ }
66196
+ }, _callee2, null, [[0, 9]]);
66197
+ }));
66198
+
66199
+ return function (_x6) {
66200
+ return _ref3.apply(this, arguments);
66201
+ };
66202
+ }()));
66203
+
66204
+ case 2:
66205
+ secondaryStatuses = _context3.sent.filter(Boolean);
66206
+ max = (_maxBy = maxBy_1(secondaryStatuses, function (s) {
66207
+ return s === null || s === void 0 ? void 0 : s.clockValue;
66208
+ })) === null || _maxBy === void 0 ? void 0 : _maxBy.secondary;
66209
+
66210
+ if (max) {
66211
+ _context3.next = 6;
66212
+ break;
66213
+ }
66214
+
66215
+ throw new Error("Could not find valid secondaries for user ".concat(secondaries));
66216
+
66217
+ case 6:
66218
+ return _context3.abrupt("return", max);
66219
+
66220
+ case 7:
66221
+ case "end":
66222
+ return _context3.stop();
66223
+ }
66224
+ }
66225
+ }, _callee3);
66226
+ }));
66227
+
66228
+ return function getNewPrimary(_x4, _x5) {
66229
+ return _ref2.apply(this, arguments);
66230
+ };
66231
+ }();
66232
+
66233
+ var rolloverNodes = /*#__PURE__*/function () {
66234
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
66235
+ var _libs$userStateManage;
66236
+
66237
+ var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
66238
+
66239
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
66240
+ while (1) {
66241
+ switch (_context4.prev = _context4.next) {
66242
+ case 0:
66243
+ console.debug('Sanity Check - rolloverNodes');
66244
+ user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
66245
+
66246
+ if (user) {
66247
+ _context4.next = 4;
66248
+ break;
66249
+ }
66250
+
66251
+ return _context4.abrupt("return");
66252
+
66253
+ case 4:
66254
+ primary = CreatorNode.getPrimary(user.creator_node_endpoint);
66255
+
66256
+ if (primary) {
66257
+ _context4.next = 7;
66258
+ break;
66259
+ }
66260
+
66261
+ return _context4.abrupt("return");
66262
+
66263
+ case 7:
66264
+ _context4.next = 9;
66265
+ return checkPrimaryHealthy(libs, primary, MAX_TRIES);
66266
+
66267
+ case 9:
66268
+ healthy = _context4.sent;
66269
+
66270
+ if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
66271
+ _context4.next = 12;
66272
+ break;
66273
+ }
66274
+
66275
+ return _context4.abrupt("return");
66276
+
66277
+ case 12:
66278
+ secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
66279
+ _context4.prev = 13;
66280
+ _context4.next = 16;
66281
+ return getNewPrimary(secondaries, user.wallet);
66282
+
66283
+ case 16:
66284
+ newPrimary = _context4.sent;
66285
+ index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
66286
+
66287
+ newSecondaries = _toConsumableArray(secondaries);
66288
+ newSecondaries.splice(index, 1);
66289
+ _context4.next = 22;
66290
+ return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
66291
+ numberOfNodes: 2 - newSecondaries.length,
66292
+ whitelist: creatorNodeWhitelist,
66293
+ // Exclude ones we currently have
66294
+ blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
66295
+ preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
66296
+ preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
66297
+ });
66298
+
66299
+ case 22:
66300
+ autoselect = _context4.sent;
66301
+
66302
+ if (autoselect) {
66303
+ newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
66304
+ } // Set the new endpoint and connect to it
66305
+
66306
+
66307
+ newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
66308
+ _context4.next = 27;
66309
+ return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.setEndpoint(newEndpoints[0]);
66310
+
66311
+ case 27:
66312
+ // Update the user
66313
+ newMetadata = _objectSpread2({}, user);
66314
+ newMetadata.creator_node_endpoint = newEndpoints.join(',');
66315
+ console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
66316
+ _context4.next = 32;
66317
+ return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata, true
66318
+ /* useEntityManager */
66319
+ );
66320
+
66321
+ case 32:
66322
+ _context4.next = 37;
66323
+ break;
66324
+
66325
+ case 34:
66326
+ _context4.prev = 34;
66327
+ _context4.t0 = _context4["catch"](13);
66328
+ console.error(_context4.t0);
66329
+
66330
+ case 37:
66331
+ case "end":
66332
+ return _context4.stop();
66333
+ }
66334
+ }
66335
+ }, _callee4, null, [[13, 34]]);
66336
+ }));
66337
+
66338
+ return function rolloverNodes(_x7, _x8, _x9) {
66339
+ return _ref4.apply(this, arguments);
63128
66340
  };
63129
66341
  }();
63130
66342