@audius/sdk 1.0.33 → 1.0.35

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.
@@ -502,6 +502,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
502
502
  };
503
503
  }
504
504
 
505
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
506
+
505
507
  var Web3;
506
508
 
507
509
  if (typeof window !== 'undefined' && window && window.Web3) {
@@ -513,9 +515,9 @@ if (typeof window !== 'undefined' && window && window.Web3) {
513
515
  var LibsWeb3 = Web3;
514
516
 
515
517
  var name = "@audius/sdk";
516
- var version = "1.0.33";
518
+ var version = "1.0.35";
517
519
  var audius = {
518
- releaseSHA: "503765c37798a57b28320d6bb45253c27cb34741"
520
+ releaseSHA: "e40315da81c1fcf7d1d43d1b7a4bcefc5d1243d1"
519
521
  };
520
522
  var description = "";
521
523
  var main = "dist/index.cjs.js";
@@ -558,7 +560,7 @@ var scripts = {
558
560
  "gen:prod": "npm run gen:prod:default ; npm run gen:prod:full",
559
561
  "gen:prod:default": "node ./src/sdk/api/generator/gen.js",
560
562
  "gen:prod:full": "node ./src/sdk/api/generator/gen.js --api-flavor full",
561
- postinstall: "patch-package"
563
+ prepare: "patch-package"
562
564
  };
563
565
  var dependencies = {
564
566
  "@audius/anchor-audius-data": "0.0.2",
@@ -599,7 +601,6 @@ var dependencies = {
599
601
  lodash: "4.17.21",
600
602
  "micro-aes-gcm": "0.3.3",
601
603
  "node-localstorage": "^1.3.1",
602
- "patch-package": "6.5.0",
603
604
  "proper-url-join": "1.2.0",
604
605
  "rollup-plugin-shim": "^1.0.0",
605
606
  "safe-buffer": "5.2.1",
@@ -647,6 +648,7 @@ var devDependencies = {
647
648
  mocha: "9.2.2",
648
649
  nock: "13.1.2",
649
650
  nyc: "15.1.0",
651
+ "patch-package": "6.5.0",
650
652
  prettier: "^2.6.1",
651
653
  "prettier-config-standard": "^5.0.0",
652
654
  rollup: "2.70.1",
@@ -50649,247 +50651,3431 @@ var syncNodes = /*#__PURE__*/function () {
50649
50651
  };
50650
50652
  }();
50651
50653
 
50652
- var THREE_SECONDS = 3000;
50653
- var MAX_TRIES = 3;
50654
- /** Check if the user's primary creator node is healthy */
50654
+ var freeGlobal$1 = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
50655
+ var _freeGlobal = freeGlobal$1;
50655
50656
 
50656
- var checkPrimaryHealthy = /*#__PURE__*/function () {
50657
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
50658
- var healthy;
50659
- return regeneratorRuntime.wrap(function _callee$(_context) {
50660
- while (1) {
50661
- switch (_context.prev = _context.next) {
50662
- case 0:
50663
- _context.next = 2;
50664
- return Utils.isHealthy(primary);
50657
+ var freeGlobal = _freeGlobal;
50658
+ /** Detect free variable `self`. */
50665
50659
 
50666
- case 2:
50667
- healthy = _context.sent;
50660
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
50661
+ /** Used as a reference to the global object. */
50668
50662
 
50669
- if (!healthy) {
50670
- _context.next = 7;
50671
- break;
50672
- }
50663
+ var root$8 = freeGlobal || freeSelf || Function('return this')();
50664
+ var _root = root$8;
50673
50665
 
50674
- return _context.abrupt("return", healthy);
50666
+ var root$7 = _root;
50667
+ /** Built-in value references. */
50675
50668
 
50676
- case 7:
50677
- if (!(tries === 0)) {
50678
- _context.next = 9;
50679
- break;
50680
- }
50669
+ var _Symbol2 = root$7.Symbol;
50670
+ var _Symbol$4 = _Symbol2;
50681
50671
 
50682
- return _context.abrupt("return", false);
50672
+ var _Symbol$3 = _Symbol$4;
50673
+ /** Used for built-in method references. */
50683
50674
 
50684
- case 9:
50685
- _context.next = 11;
50686
- return Utils.wait(THREE_SECONDS);
50675
+ var objectProto$b = Object.prototype;
50676
+ /** Used to check objects for own properties. */
50687
50677
 
50688
- case 11:
50689
- _context.next = 13;
50690
- return checkPrimaryHealthy(libs, primary, tries - 1);
50678
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
50679
+ /**
50680
+ * Used to resolve the
50681
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
50682
+ * of values.
50683
+ */
50691
50684
 
50692
- case 13:
50693
- return _context.abrupt("return", _context.sent);
50685
+ var nativeObjectToString$1 = objectProto$b.toString;
50686
+ /** Built-in value references. */
50694
50687
 
50695
- case 14:
50696
- case "end":
50697
- return _context.stop();
50698
- }
50699
- }
50700
- }, _callee);
50701
- }));
50688
+ var symToStringTag$1 = _Symbol$3 ? _Symbol$3.toStringTag : undefined;
50689
+ /**
50690
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
50691
+ *
50692
+ * @private
50693
+ * @param {*} value The value to query.
50694
+ * @returns {string} Returns the raw `toStringTag`.
50695
+ */
50702
50696
 
50703
- return function checkPrimaryHealthy(_x, _x2, _x3) {
50704
- return _ref.apply(this, arguments);
50705
- };
50697
+ function getRawTag$1(value) {
50698
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
50699
+ tag = value[symToStringTag$1];
50700
+
50701
+ try {
50702
+ value[symToStringTag$1] = undefined;
50703
+ var unmasked = true;
50704
+ } catch (e) {}
50705
+
50706
+ var result = nativeObjectToString$1.call(value);
50707
+
50708
+ if (unmasked) {
50709
+ if (isOwn) {
50710
+ value[symToStringTag$1] = tag;
50711
+ } else {
50712
+ delete value[symToStringTag$1];
50713
+ }
50714
+ }
50715
+
50716
+ return result;
50717
+ }
50718
+
50719
+ var _getRawTag = getRawTag$1;
50720
+
50721
+ /** Used for built-in method references. */
50722
+ var objectProto$a = Object.prototype;
50723
+ /**
50724
+ * Used to resolve the
50725
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
50726
+ * of values.
50727
+ */
50728
+
50729
+ var nativeObjectToString = objectProto$a.toString;
50730
+ /**
50731
+ * Converts `value` to a string using `Object.prototype.toString`.
50732
+ *
50733
+ * @private
50734
+ * @param {*} value The value to convert.
50735
+ * @returns {string} Returns the converted string.
50736
+ */
50737
+
50738
+ function objectToString$1(value) {
50739
+ return nativeObjectToString.call(value);
50740
+ }
50741
+
50742
+ var _objectToString = objectToString$1;
50743
+
50744
+ var _Symbol$2 = _Symbol$4,
50745
+ getRawTag = _getRawTag,
50746
+ objectToString = _objectToString;
50747
+ /** `Object#toString` result references. */
50748
+
50749
+ var nullTag = '[object Null]',
50750
+ undefinedTag = '[object Undefined]';
50751
+ /** Built-in value references. */
50752
+
50753
+ var symToStringTag = _Symbol$2 ? _Symbol$2.toStringTag : undefined;
50754
+ /**
50755
+ * The base implementation of `getTag` without fallbacks for buggy environments.
50756
+ *
50757
+ * @private
50758
+ * @param {*} value The value to query.
50759
+ * @returns {string} Returns the `toStringTag`.
50760
+ */
50761
+
50762
+ function baseGetTag$5(value) {
50763
+ if (value == null) {
50764
+ return value === undefined ? undefinedTag : nullTag;
50765
+ }
50766
+
50767
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
50768
+ }
50769
+
50770
+ var _baseGetTag = baseGetTag$5;
50771
+
50772
+ function isObjectLike$5(value) {
50773
+ return value != null && _typeof(value) == 'object';
50774
+ }
50775
+
50776
+ var isObjectLike_1 = isObjectLike$5;
50777
+
50778
+ var baseGetTag$4 = _baseGetTag,
50779
+ isObjectLike$4 = isObjectLike_1;
50780
+ /** `Object#toString` result references. */
50781
+
50782
+ var symbolTag$1 = '[object Symbol]';
50783
+ /**
50784
+ * Checks if `value` is classified as a `Symbol` primitive or object.
50785
+ *
50786
+ * @static
50787
+ * @memberOf _
50788
+ * @since 4.0.0
50789
+ * @category Lang
50790
+ * @param {*} value The value to check.
50791
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
50792
+ * @example
50793
+ *
50794
+ * _.isSymbol(Symbol.iterator);
50795
+ * // => true
50796
+ *
50797
+ * _.isSymbol('abc');
50798
+ * // => false
50799
+ */
50800
+
50801
+ function isSymbol$4(value) {
50802
+ return _typeof(value) == 'symbol' || isObjectLike$4(value) && baseGetTag$4(value) == symbolTag$1;
50803
+ }
50804
+
50805
+ var isSymbol_1 = isSymbol$4;
50806
+
50807
+ var isSymbol$3 = isSymbol_1;
50808
+ /**
50809
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
50810
+ * `comparator` to determine the extremum value.
50811
+ *
50812
+ * @private
50813
+ * @param {Array} array The array to iterate over.
50814
+ * @param {Function} iteratee The iteratee invoked per iteration.
50815
+ * @param {Function} comparator The comparator used to compare values.
50816
+ * @returns {*} Returns the extremum value.
50817
+ */
50818
+
50819
+ function baseExtremum$1(array, iteratee, comparator) {
50820
+ var index = -1,
50821
+ length = array.length;
50822
+
50823
+ while (++index < length) {
50824
+ var value = array[index],
50825
+ current = iteratee(value);
50826
+
50827
+ if (current != null && (computed === undefined ? current === current && !isSymbol$3(current) : comparator(current, computed))) {
50828
+ var computed = current,
50829
+ result = value;
50830
+ }
50831
+ }
50832
+
50833
+ return result;
50834
+ }
50835
+
50836
+ var _baseExtremum = baseExtremum$1;
50837
+
50838
+ /**
50839
+ * The base implementation of `_.gt` which doesn't coerce arguments.
50840
+ *
50841
+ * @private
50842
+ * @param {*} value The value to compare.
50843
+ * @param {*} other The other value to compare.
50844
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
50845
+ * else `false`.
50846
+ */
50847
+
50848
+ function baseGt$1(value, other) {
50849
+ return value > other;
50850
+ }
50851
+
50852
+ var _baseGt = baseGt$1;
50853
+
50854
+ /**
50855
+ * Removes all key-value entries from the list cache.
50856
+ *
50857
+ * @private
50858
+ * @name clear
50859
+ * @memberOf ListCache
50860
+ */
50861
+
50862
+ function listCacheClear$1() {
50863
+ this.__data__ = [];
50864
+ this.size = 0;
50865
+ }
50866
+
50867
+ var _listCacheClear = listCacheClear$1;
50868
+
50869
+ /**
50870
+ * Performs a
50871
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
50872
+ * comparison between two values to determine if they are equivalent.
50873
+ *
50874
+ * @static
50875
+ * @memberOf _
50876
+ * @since 4.0.0
50877
+ * @category Lang
50878
+ * @param {*} value The value to compare.
50879
+ * @param {*} other The other value to compare.
50880
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
50881
+ * @example
50882
+ *
50883
+ * var object = { 'a': 1 };
50884
+ * var other = { 'a': 1 };
50885
+ *
50886
+ * _.eq(object, object);
50887
+ * // => true
50888
+ *
50889
+ * _.eq(object, other);
50890
+ * // => false
50891
+ *
50892
+ * _.eq('a', 'a');
50893
+ * // => true
50894
+ *
50895
+ * _.eq('a', Object('a'));
50896
+ * // => false
50897
+ *
50898
+ * _.eq(NaN, NaN);
50899
+ * // => true
50900
+ */
50901
+
50902
+ function eq$2(value, other) {
50903
+ return value === other || value !== value && other !== other;
50904
+ }
50905
+
50906
+ var eq_1 = eq$2;
50907
+
50908
+ var eq$1 = eq_1;
50909
+ /**
50910
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
50911
+ *
50912
+ * @private
50913
+ * @param {Array} array The array to inspect.
50914
+ * @param {*} key The key to search for.
50915
+ * @returns {number} Returns the index of the matched value, else `-1`.
50916
+ */
50917
+
50918
+ function assocIndexOf$4(array, key) {
50919
+ var length = array.length;
50920
+
50921
+ while (length--) {
50922
+ if (eq$1(array[length][0], key)) {
50923
+ return length;
50924
+ }
50925
+ }
50926
+
50927
+ return -1;
50928
+ }
50929
+
50930
+ var _assocIndexOf = assocIndexOf$4;
50931
+
50932
+ var assocIndexOf$3 = _assocIndexOf;
50933
+ /** Used for built-in method references. */
50934
+
50935
+ var arrayProto = Array.prototype;
50936
+ /** Built-in value references. */
50937
+
50938
+ var splice = arrayProto.splice;
50939
+ /**
50940
+ * Removes `key` and its value from the list cache.
50941
+ *
50942
+ * @private
50943
+ * @name delete
50944
+ * @memberOf ListCache
50945
+ * @param {string} key The key of the value to remove.
50946
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
50947
+ */
50948
+
50949
+ function listCacheDelete$1(key) {
50950
+ var data = this.__data__,
50951
+ index = assocIndexOf$3(data, key);
50952
+
50953
+ if (index < 0) {
50954
+ return false;
50955
+ }
50956
+
50957
+ var lastIndex = data.length - 1;
50958
+
50959
+ if (index == lastIndex) {
50960
+ data.pop();
50961
+ } else {
50962
+ splice.call(data, index, 1);
50963
+ }
50964
+
50965
+ --this.size;
50966
+ return true;
50967
+ }
50968
+
50969
+ var _listCacheDelete = listCacheDelete$1;
50970
+
50971
+ var assocIndexOf$2 = _assocIndexOf;
50972
+ /**
50973
+ * Gets the list cache value for `key`.
50974
+ *
50975
+ * @private
50976
+ * @name get
50977
+ * @memberOf ListCache
50978
+ * @param {string} key The key of the value to get.
50979
+ * @returns {*} Returns the entry value.
50980
+ */
50981
+
50982
+ function listCacheGet$1(key) {
50983
+ var data = this.__data__,
50984
+ index = assocIndexOf$2(data, key);
50985
+ return index < 0 ? undefined : data[index][1];
50986
+ }
50987
+
50988
+ var _listCacheGet = listCacheGet$1;
50989
+
50990
+ var assocIndexOf$1 = _assocIndexOf;
50991
+ /**
50992
+ * Checks if a list cache value for `key` exists.
50993
+ *
50994
+ * @private
50995
+ * @name has
50996
+ * @memberOf ListCache
50997
+ * @param {string} key The key of the entry to check.
50998
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
50999
+ */
51000
+
51001
+ function listCacheHas$1(key) {
51002
+ return assocIndexOf$1(this.__data__, key) > -1;
51003
+ }
51004
+
51005
+ var _listCacheHas = listCacheHas$1;
51006
+
51007
+ var assocIndexOf = _assocIndexOf;
51008
+ /**
51009
+ * Sets the list cache `key` to `value`.
51010
+ *
51011
+ * @private
51012
+ * @name set
51013
+ * @memberOf ListCache
51014
+ * @param {string} key The key of the value to set.
51015
+ * @param {*} value The value to set.
51016
+ * @returns {Object} Returns the list cache instance.
51017
+ */
51018
+
51019
+ function listCacheSet$1(key, value) {
51020
+ var data = this.__data__,
51021
+ index = assocIndexOf(data, key);
51022
+
51023
+ if (index < 0) {
51024
+ ++this.size;
51025
+ data.push([key, value]);
51026
+ } else {
51027
+ data[index][1] = value;
51028
+ }
51029
+
51030
+ return this;
51031
+ }
51032
+
51033
+ var _listCacheSet = listCacheSet$1;
51034
+
51035
+ var listCacheClear = _listCacheClear,
51036
+ listCacheDelete = _listCacheDelete,
51037
+ listCacheGet = _listCacheGet,
51038
+ listCacheHas = _listCacheHas,
51039
+ listCacheSet = _listCacheSet;
51040
+ /**
51041
+ * Creates an list cache object.
51042
+ *
51043
+ * @private
51044
+ * @constructor
51045
+ * @param {Array} [entries] The key-value pairs to cache.
51046
+ */
51047
+
51048
+ function ListCache$4(entries) {
51049
+ var index = -1,
51050
+ length = entries == null ? 0 : entries.length;
51051
+ this.clear();
51052
+
51053
+ while (++index < length) {
51054
+ var entry = entries[index];
51055
+ this.set(entry[0], entry[1]);
51056
+ }
51057
+ } // Add methods to `ListCache`.
51058
+
51059
+
51060
+ ListCache$4.prototype.clear = listCacheClear;
51061
+ ListCache$4.prototype['delete'] = listCacheDelete;
51062
+ ListCache$4.prototype.get = listCacheGet;
51063
+ ListCache$4.prototype.has = listCacheHas;
51064
+ ListCache$4.prototype.set = listCacheSet;
51065
+ var _ListCache = ListCache$4;
51066
+
51067
+ var ListCache$3 = _ListCache;
51068
+ /**
51069
+ * Removes all key-value entries from the stack.
51070
+ *
51071
+ * @private
51072
+ * @name clear
51073
+ * @memberOf Stack
51074
+ */
51075
+
51076
+ function stackClear$1() {
51077
+ this.__data__ = new ListCache$3();
51078
+ this.size = 0;
51079
+ }
51080
+
51081
+ var _stackClear = stackClear$1;
51082
+
51083
+ /**
51084
+ * Removes `key` and its value from the stack.
51085
+ *
51086
+ * @private
51087
+ * @name delete
51088
+ * @memberOf Stack
51089
+ * @param {string} key The key of the value to remove.
51090
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
51091
+ */
51092
+
51093
+ function stackDelete$1(key) {
51094
+ var data = this.__data__,
51095
+ result = data['delete'](key);
51096
+ this.size = data.size;
51097
+ return result;
51098
+ }
51099
+
51100
+ var _stackDelete = stackDelete$1;
51101
+
51102
+ /**
51103
+ * Gets the stack value for `key`.
51104
+ *
51105
+ * @private
51106
+ * @name get
51107
+ * @memberOf Stack
51108
+ * @param {string} key The key of the value to get.
51109
+ * @returns {*} Returns the entry value.
51110
+ */
51111
+
51112
+ function stackGet$1(key) {
51113
+ return this.__data__.get(key);
51114
+ }
51115
+
51116
+ var _stackGet = stackGet$1;
51117
+
51118
+ /**
51119
+ * Checks if a stack value for `key` exists.
51120
+ *
51121
+ * @private
51122
+ * @name has
51123
+ * @memberOf Stack
51124
+ * @param {string} key The key of the entry to check.
51125
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
51126
+ */
51127
+
51128
+ function stackHas$1(key) {
51129
+ return this.__data__.has(key);
51130
+ }
51131
+
51132
+ var _stackHas = stackHas$1;
51133
+
51134
+ function isObject$3(value) {
51135
+ var type = _typeof(value);
51136
+
51137
+ return value != null && (type == 'object' || type == 'function');
51138
+ }
51139
+
51140
+ var isObject_1 = isObject$3;
51141
+
51142
+ var baseGetTag$3 = _baseGetTag,
51143
+ isObject$2 = isObject_1;
51144
+ /** `Object#toString` result references. */
51145
+
51146
+ var asyncTag = '[object AsyncFunction]',
51147
+ funcTag$1 = '[object Function]',
51148
+ genTag = '[object GeneratorFunction]',
51149
+ proxyTag = '[object Proxy]';
51150
+ /**
51151
+ * Checks if `value` is classified as a `Function` object.
51152
+ *
51153
+ * @static
51154
+ * @memberOf _
51155
+ * @since 0.1.0
51156
+ * @category Lang
51157
+ * @param {*} value The value to check.
51158
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
51159
+ * @example
51160
+ *
51161
+ * _.isFunction(_);
51162
+ * // => true
51163
+ *
51164
+ * _.isFunction(/abc/);
51165
+ * // => false
51166
+ */
51167
+
51168
+ function isFunction$2(value) {
51169
+ if (!isObject$2(value)) {
51170
+ return false;
51171
+ } // The use of `Object#toString` avoids issues with the `typeof` operator
51172
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
51173
+
51174
+
51175
+ var tag = baseGetTag$3(value);
51176
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
51177
+ }
51178
+
51179
+ var isFunction_1 = isFunction$2;
51180
+
51181
+ var root$6 = _root;
51182
+ /** Used to detect overreaching core-js shims. */
51183
+
51184
+ var coreJsData$1 = root$6['__core-js_shared__'];
51185
+ var _coreJsData = coreJsData$1;
51186
+
51187
+ var coreJsData = _coreJsData;
51188
+ /** Used to detect methods masquerading as native. */
51189
+
51190
+ var maskSrcKey = function () {
51191
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
51192
+ return uid ? 'Symbol(src)_1.' + uid : '';
50706
51193
  }();
50707
- /** Gets new endpoints from a user's secondaries */
51194
+ /**
51195
+ * Checks if `func` has its source masked.
51196
+ *
51197
+ * @private
51198
+ * @param {Function} func The function to check.
51199
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
51200
+ */
50708
51201
 
50709
51202
 
50710
- var getNewPrimary = /*#__PURE__*/function () {
50711
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(libs, secondaries) {
50712
- var _iterator, _step, _libs$creatorNode, secondary, syncStatus;
51203
+ function isMasked$1(func) {
51204
+ return !!maskSrcKey && maskSrcKey in func;
51205
+ }
50713
51206
 
50714
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
50715
- while (1) {
50716
- switch (_context2.prev = _context2.next) {
50717
- case 0:
50718
- _iterator = _createForOfIteratorHelper(secondaries);
50719
- _context2.prev = 1;
51207
+ var _isMasked = isMasked$1;
50720
51208
 
50721
- _iterator.s();
51209
+ /** Used for built-in method references. */
51210
+ var funcProto$1 = Function.prototype;
51211
+ /** Used to resolve the decompiled source of functions. */
50722
51212
 
50723
- case 3:
50724
- if ((_step = _iterator.n()).done) {
50725
- _context2.next = 14;
50726
- break;
50727
- }
51213
+ var funcToString$1 = funcProto$1.toString;
51214
+ /**
51215
+ * Converts `func` to its source code.
51216
+ *
51217
+ * @private
51218
+ * @param {Function} func The function to convert.
51219
+ * @returns {string} Returns the source code.
51220
+ */
50728
51221
 
50729
- secondary = _step.value;
50730
- _context2.next = 7;
50731
- return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.getSyncStatus(secondary);
51222
+ function toSource$2(func) {
51223
+ if (func != null) {
51224
+ try {
51225
+ return funcToString$1.call(func);
51226
+ } catch (e) {}
50732
51227
 
50733
- case 7:
50734
- syncStatus = _context2.sent;
51228
+ try {
51229
+ return func + '';
51230
+ } catch (e) {}
51231
+ }
50735
51232
 
50736
- if (syncStatus) {
50737
- _context2.next = 10;
50738
- break;
50739
- }
51233
+ return '';
51234
+ }
50740
51235
 
50741
- return _context2.abrupt("continue", 12);
51236
+ var _toSource = toSource$2;
50742
51237
 
50743
- case 10:
50744
- if (syncStatus.isBehind) {
50745
- _context2.next = 12;
50746
- break;
50747
- }
51238
+ var isFunction$1 = isFunction_1,
51239
+ isMasked = _isMasked,
51240
+ isObject$1 = isObject_1,
51241
+ toSource$1 = _toSource;
51242
+ /**
51243
+ * Used to match `RegExp`
51244
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
51245
+ */
50748
51246
 
50749
- return _context2.abrupt("return", secondary);
51247
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
51248
+ /** Used to detect host constructors (Safari). */
50750
51249
 
50751
- case 12:
50752
- _context2.next = 3;
50753
- break;
51250
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
51251
+ /** Used for built-in method references. */
50754
51252
 
50755
- case 14:
50756
- _context2.next = 19;
50757
- break;
51253
+ var funcProto = Function.prototype,
51254
+ objectProto$9 = Object.prototype;
51255
+ /** Used to resolve the decompiled source of functions. */
50758
51256
 
50759
- case 16:
50760
- _context2.prev = 16;
50761
- _context2.t0 = _context2["catch"](1);
51257
+ var funcToString = funcProto.toString;
51258
+ /** Used to check objects for own properties. */
50762
51259
 
50763
- _iterator.e(_context2.t0);
51260
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
51261
+ /** Used to detect if a method is native. */
50764
51262
 
50765
- case 19:
50766
- _context2.prev = 19;
51263
+ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
51264
+ /**
51265
+ * The base implementation of `_.isNative` without bad shim checks.
51266
+ *
51267
+ * @private
51268
+ * @param {*} value The value to check.
51269
+ * @returns {boolean} Returns `true` if `value` is a native function,
51270
+ * else `false`.
51271
+ */
50767
51272
 
50768
- _iterator.f();
51273
+ function baseIsNative$1(value) {
51274
+ if (!isObject$1(value) || isMasked(value)) {
51275
+ return false;
51276
+ }
50769
51277
 
50770
- return _context2.finish(19);
51278
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
51279
+ return pattern.test(toSource$1(value));
51280
+ }
50771
51281
 
50772
- case 22:
50773
- throw new Error("Could not find valid secondaries for user ".concat(secondaries));
51282
+ var _baseIsNative = baseIsNative$1;
50774
51283
 
50775
- case 23:
50776
- case "end":
50777
- return _context2.stop();
50778
- }
50779
- }
50780
- }, _callee2, null, [[1, 16, 19, 22]]);
50781
- }));
51284
+ /**
51285
+ * Gets the value at `key` of `object`.
51286
+ *
51287
+ * @private
51288
+ * @param {Object} [object] The object to query.
51289
+ * @param {string} key The key of the property to get.
51290
+ * @returns {*} Returns the property value.
51291
+ */
50782
51292
 
50783
- return function getNewPrimary(_x4, _x5) {
50784
- return _ref2.apply(this, arguments);
51293
+ function getValue$1(object, key) {
51294
+ return object == null ? undefined : object[key];
51295
+ }
51296
+
51297
+ var _getValue = getValue$1;
51298
+
51299
+ var baseIsNative = _baseIsNative,
51300
+ getValue = _getValue;
51301
+ /**
51302
+ * Gets the native function at `key` of `object`.
51303
+ *
51304
+ * @private
51305
+ * @param {Object} object The object to query.
51306
+ * @param {string} key The key of the method to get.
51307
+ * @returns {*} Returns the function if it's native, else `undefined`.
51308
+ */
51309
+
51310
+ function getNative$6(object, key) {
51311
+ var value = getValue(object, key);
51312
+ return baseIsNative(value) ? value : undefined;
51313
+ }
51314
+
51315
+ var _getNative = getNative$6;
51316
+
51317
+ var getNative$5 = _getNative,
51318
+ root$5 = _root;
51319
+ /* Built-in method references that are verified to be native. */
51320
+
51321
+ var Map$4 = getNative$5(root$5, 'Map');
51322
+ var _Map = Map$4;
51323
+
51324
+ var getNative$4 = _getNative;
51325
+ /* Built-in method references that are verified to be native. */
51326
+
51327
+ var nativeCreate$4 = getNative$4(Object, 'create');
51328
+ var _nativeCreate = nativeCreate$4;
51329
+
51330
+ var nativeCreate$3 = _nativeCreate;
51331
+ /**
51332
+ * Removes all key-value entries from the hash.
51333
+ *
51334
+ * @private
51335
+ * @name clear
51336
+ * @memberOf Hash
51337
+ */
51338
+
51339
+ function hashClear$1() {
51340
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
51341
+ this.size = 0;
51342
+ }
51343
+
51344
+ var _hashClear = hashClear$1;
51345
+
51346
+ /**
51347
+ * Removes `key` and its value from the hash.
51348
+ *
51349
+ * @private
51350
+ * @name delete
51351
+ * @memberOf Hash
51352
+ * @param {Object} hash The hash to modify.
51353
+ * @param {string} key The key of the value to remove.
51354
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
51355
+ */
51356
+
51357
+ function hashDelete$1(key) {
51358
+ var result = this.has(key) && delete this.__data__[key];
51359
+ this.size -= result ? 1 : 0;
51360
+ return result;
51361
+ }
51362
+
51363
+ var _hashDelete = hashDelete$1;
51364
+
51365
+ var nativeCreate$2 = _nativeCreate;
51366
+ /** Used to stand-in for `undefined` hash values. */
51367
+
51368
+ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
51369
+ /** Used for built-in method references. */
51370
+
51371
+ var objectProto$8 = Object.prototype;
51372
+ /** Used to check objects for own properties. */
51373
+
51374
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
51375
+ /**
51376
+ * Gets the hash value for `key`.
51377
+ *
51378
+ * @private
51379
+ * @name get
51380
+ * @memberOf Hash
51381
+ * @param {string} key The key of the value to get.
51382
+ * @returns {*} Returns the entry value.
51383
+ */
51384
+
51385
+ function hashGet$1(key) {
51386
+ var data = this.__data__;
51387
+
51388
+ if (nativeCreate$2) {
51389
+ var result = data[key];
51390
+ return result === HASH_UNDEFINED$2 ? undefined : result;
51391
+ }
51392
+
51393
+ return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
51394
+ }
51395
+
51396
+ var _hashGet = hashGet$1;
51397
+
51398
+ var nativeCreate$1 = _nativeCreate;
51399
+ /** Used for built-in method references. */
51400
+
51401
+ var objectProto$7 = Object.prototype;
51402
+ /** Used to check objects for own properties. */
51403
+
51404
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
51405
+ /**
51406
+ * Checks if a hash value for `key` exists.
51407
+ *
51408
+ * @private
51409
+ * @name has
51410
+ * @memberOf Hash
51411
+ * @param {string} key The key of the entry to check.
51412
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
51413
+ */
51414
+
51415
+ function hashHas$1(key) {
51416
+ var data = this.__data__;
51417
+ return nativeCreate$1 ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
51418
+ }
51419
+
51420
+ var _hashHas = hashHas$1;
51421
+
51422
+ var nativeCreate = _nativeCreate;
51423
+ /** Used to stand-in for `undefined` hash values. */
51424
+
51425
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
51426
+ /**
51427
+ * Sets the hash `key` to `value`.
51428
+ *
51429
+ * @private
51430
+ * @name set
51431
+ * @memberOf Hash
51432
+ * @param {string} key The key of the value to set.
51433
+ * @param {*} value The value to set.
51434
+ * @returns {Object} Returns the hash instance.
51435
+ */
51436
+
51437
+ function hashSet$1(key, value) {
51438
+ var data = this.__data__;
51439
+ this.size += this.has(key) ? 0 : 1;
51440
+ data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
51441
+ return this;
51442
+ }
51443
+
51444
+ var _hashSet = hashSet$1;
51445
+
51446
+ var hashClear = _hashClear,
51447
+ hashDelete = _hashDelete,
51448
+ hashGet = _hashGet,
51449
+ hashHas = _hashHas,
51450
+ hashSet = _hashSet;
51451
+ /**
51452
+ * Creates a hash object.
51453
+ *
51454
+ * @private
51455
+ * @constructor
51456
+ * @param {Array} [entries] The key-value pairs to cache.
51457
+ */
51458
+
51459
+ function Hash$1(entries) {
51460
+ var index = -1,
51461
+ length = entries == null ? 0 : entries.length;
51462
+ this.clear();
51463
+
51464
+ while (++index < length) {
51465
+ var entry = entries[index];
51466
+ this.set(entry[0], entry[1]);
51467
+ }
51468
+ } // Add methods to `Hash`.
51469
+
51470
+
51471
+ Hash$1.prototype.clear = hashClear;
51472
+ Hash$1.prototype['delete'] = hashDelete;
51473
+ Hash$1.prototype.get = hashGet;
51474
+ Hash$1.prototype.has = hashHas;
51475
+ Hash$1.prototype.set = hashSet;
51476
+ var _Hash = Hash$1;
51477
+
51478
+ var Hash = _Hash,
51479
+ ListCache$2 = _ListCache,
51480
+ Map$3 = _Map;
51481
+ /**
51482
+ * Removes all key-value entries from the map.
51483
+ *
51484
+ * @private
51485
+ * @name clear
51486
+ * @memberOf MapCache
51487
+ */
51488
+
51489
+ function mapCacheClear$1() {
51490
+ this.size = 0;
51491
+ this.__data__ = {
51492
+ 'hash': new Hash(),
51493
+ 'map': new (Map$3 || ListCache$2)(),
51494
+ 'string': new Hash()
50785
51495
  };
50786
- }();
51496
+ }
50787
51497
 
50788
- var rolloverNodes = /*#__PURE__*/function () {
50789
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
50790
- var _libs$userStateManage;
51498
+ var _mapCacheClear = mapCacheClear$1;
50791
51499
 
50792
- var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode2, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
51500
+ function isKeyable$1(value) {
51501
+ var type = _typeof(value);
50793
51502
 
50794
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
50795
- while (1) {
50796
- switch (_context3.prev = _context3.next) {
50797
- case 0:
50798
- console.debug('Sanity Check - rolloverNodes');
50799
- user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
51503
+ return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
51504
+ }
50800
51505
 
50801
- if (user) {
50802
- _context3.next = 4;
50803
- break;
50804
- }
51506
+ var _isKeyable = isKeyable$1;
50805
51507
 
50806
- return _context3.abrupt("return");
51508
+ var isKeyable = _isKeyable;
51509
+ /**
51510
+ * Gets the data for `map`.
51511
+ *
51512
+ * @private
51513
+ * @param {Object} map The map to query.
51514
+ * @param {string} key The reference key.
51515
+ * @returns {*} Returns the map data.
51516
+ */
50807
51517
 
50808
- case 4:
50809
- primary = CreatorNode.getPrimary(user.creator_node_endpoint);
51518
+ function getMapData$4(map, key) {
51519
+ var data = map.__data__;
51520
+ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
51521
+ }
50810
51522
 
50811
- if (primary) {
50812
- _context3.next = 7;
50813
- break;
50814
- }
51523
+ var _getMapData = getMapData$4;
50815
51524
 
50816
- return _context3.abrupt("return");
51525
+ var getMapData$3 = _getMapData;
51526
+ /**
51527
+ * Removes `key` and its value from the map.
51528
+ *
51529
+ * @private
51530
+ * @name delete
51531
+ * @memberOf MapCache
51532
+ * @param {string} key The key of the value to remove.
51533
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
51534
+ */
50817
51535
 
50818
- case 7:
50819
- _context3.next = 9;
50820
- return checkPrimaryHealthy(libs, primary, MAX_TRIES);
51536
+ function mapCacheDelete$1(key) {
51537
+ var result = getMapData$3(this, key)['delete'](key);
51538
+ this.size -= result ? 1 : 0;
51539
+ return result;
51540
+ }
50821
51541
 
50822
- case 9:
50823
- healthy = _context3.sent;
51542
+ var _mapCacheDelete = mapCacheDelete$1;
50824
51543
 
50825
- if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
50826
- _context3.next = 12;
50827
- break;
50828
- }
51544
+ var getMapData$2 = _getMapData;
51545
+ /**
51546
+ * Gets the map value for `key`.
51547
+ *
51548
+ * @private
51549
+ * @name get
51550
+ * @memberOf MapCache
51551
+ * @param {string} key The key of the value to get.
51552
+ * @returns {*} Returns the entry value.
51553
+ */
50829
51554
 
50830
- return _context3.abrupt("return");
51555
+ function mapCacheGet$1(key) {
51556
+ return getMapData$2(this, key).get(key);
51557
+ }
50831
51558
 
50832
- case 12:
50833
- secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
50834
- _context3.prev = 13;
50835
- _context3.next = 16;
50836
- return getNewPrimary(libs, secondaries);
51559
+ var _mapCacheGet = mapCacheGet$1;
50837
51560
 
50838
- case 16:
50839
- newPrimary = _context3.sent;
50840
- index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
51561
+ var getMapData$1 = _getMapData;
51562
+ /**
51563
+ * Checks if a map value for `key` exists.
51564
+ *
51565
+ * @private
51566
+ * @name has
51567
+ * @memberOf MapCache
51568
+ * @param {string} key The key of the entry to check.
51569
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
51570
+ */
50841
51571
 
50842
- newSecondaries = _toConsumableArray(secondaries);
50843
- newSecondaries.splice(index, 1);
50844
- _context3.next = 22;
50845
- return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
50846
- numberOfNodes: 2 - newSecondaries.length,
50847
- whitelist: creatorNodeWhitelist,
50848
- // Exclude ones we currently have
50849
- blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
50850
- preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
50851
- preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
50852
- });
51572
+ function mapCacheHas$1(key) {
51573
+ return getMapData$1(this, key).has(key);
51574
+ }
50853
51575
 
50854
- case 22:
50855
- autoselect = _context3.sent;
51576
+ var _mapCacheHas = mapCacheHas$1;
50856
51577
 
50857
- if (autoselect) {
50858
- newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
50859
- } // Set the new endpoint and connect to it
51578
+ var getMapData = _getMapData;
51579
+ /**
51580
+ * Sets the map `key` to `value`.
51581
+ *
51582
+ * @private
51583
+ * @name set
51584
+ * @memberOf MapCache
51585
+ * @param {string} key The key of the value to set.
51586
+ * @param {*} value The value to set.
51587
+ * @returns {Object} Returns the map cache instance.
51588
+ */
50860
51589
 
51590
+ function mapCacheSet$1(key, value) {
51591
+ var data = getMapData(this, key),
51592
+ size = data.size;
51593
+ data.set(key, value);
51594
+ this.size += data.size == size ? 0 : 1;
51595
+ return this;
51596
+ }
50861
51597
 
50862
- newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
50863
- _context3.next = 27;
50864
- return (_libs$creatorNode2 = libs.creatorNode) === null || _libs$creatorNode2 === void 0 ? void 0 : _libs$creatorNode2.setEndpoint(newEndpoints[0]);
51598
+ var _mapCacheSet = mapCacheSet$1;
50865
51599
 
50866
- case 27:
50867
- // Update the user
50868
- newMetadata = _objectSpread2({}, user);
50869
- newMetadata.creator_node_endpoint = newEndpoints.join(',');
50870
- console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
50871
- _context3.next = 32;
50872
- return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata);
51600
+ var mapCacheClear = _mapCacheClear,
51601
+ mapCacheDelete = _mapCacheDelete,
51602
+ mapCacheGet = _mapCacheGet,
51603
+ mapCacheHas = _mapCacheHas,
51604
+ mapCacheSet = _mapCacheSet;
51605
+ /**
51606
+ * Creates a map cache object to store key-value pairs.
51607
+ *
51608
+ * @private
51609
+ * @constructor
51610
+ * @param {Array} [entries] The key-value pairs to cache.
51611
+ */
50873
51612
 
50874
- case 32:
50875
- _context3.next = 37;
50876
- break;
51613
+ function MapCache$3(entries) {
51614
+ var index = -1,
51615
+ length = entries == null ? 0 : entries.length;
51616
+ this.clear();
50877
51617
 
50878
- case 34:
50879
- _context3.prev = 34;
50880
- _context3.t0 = _context3["catch"](13);
50881
- console.error(_context3.t0);
51618
+ while (++index < length) {
51619
+ var entry = entries[index];
51620
+ this.set(entry[0], entry[1]);
51621
+ }
51622
+ } // Add methods to `MapCache`.
50882
51623
 
50883
- case 37:
50884
- case "end":
50885
- return _context3.stop();
50886
- }
50887
- }
50888
- }, _callee3, null, [[13, 34]]);
50889
- }));
50890
51624
 
50891
- return function rolloverNodes(_x6, _x7, _x8) {
50892
- return _ref3.apply(this, arguments);
51625
+ MapCache$3.prototype.clear = mapCacheClear;
51626
+ MapCache$3.prototype['delete'] = mapCacheDelete;
51627
+ MapCache$3.prototype.get = mapCacheGet;
51628
+ MapCache$3.prototype.has = mapCacheHas;
51629
+ MapCache$3.prototype.set = mapCacheSet;
51630
+ var _MapCache = MapCache$3;
51631
+
51632
+ var ListCache$1 = _ListCache,
51633
+ Map$2 = _Map,
51634
+ MapCache$2 = _MapCache;
51635
+ /** Used as the size to enable large array optimizations. */
51636
+
51637
+ var LARGE_ARRAY_SIZE = 200;
51638
+ /**
51639
+ * Sets the stack `key` to `value`.
51640
+ *
51641
+ * @private
51642
+ * @name set
51643
+ * @memberOf Stack
51644
+ * @param {string} key The key of the value to set.
51645
+ * @param {*} value The value to set.
51646
+ * @returns {Object} Returns the stack cache instance.
51647
+ */
51648
+
51649
+ function stackSet$1(key, value) {
51650
+ var data = this.__data__;
51651
+
51652
+ if (data instanceof ListCache$1) {
51653
+ var pairs = data.__data__;
51654
+
51655
+ if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
51656
+ pairs.push([key, value]);
51657
+ this.size = ++data.size;
51658
+ return this;
51659
+ }
51660
+
51661
+ data = this.__data__ = new MapCache$2(pairs);
51662
+ }
51663
+
51664
+ data.set(key, value);
51665
+ this.size = data.size;
51666
+ return this;
51667
+ }
51668
+
51669
+ var _stackSet = stackSet$1;
51670
+
51671
+ var ListCache = _ListCache,
51672
+ stackClear = _stackClear,
51673
+ stackDelete = _stackDelete,
51674
+ stackGet = _stackGet,
51675
+ stackHas = _stackHas,
51676
+ stackSet = _stackSet;
51677
+ /**
51678
+ * Creates a stack cache object to store key-value pairs.
51679
+ *
51680
+ * @private
51681
+ * @constructor
51682
+ * @param {Array} [entries] The key-value pairs to cache.
51683
+ */
51684
+
51685
+ function Stack$2(entries) {
51686
+ var data = this.__data__ = new ListCache(entries);
51687
+ this.size = data.size;
51688
+ } // Add methods to `Stack`.
51689
+
51690
+
51691
+ Stack$2.prototype.clear = stackClear;
51692
+ Stack$2.prototype['delete'] = stackDelete;
51693
+ Stack$2.prototype.get = stackGet;
51694
+ Stack$2.prototype.has = stackHas;
51695
+ Stack$2.prototype.set = stackSet;
51696
+ var _Stack = Stack$2;
51697
+
51698
+ /** Used to stand-in for `undefined` hash values. */
51699
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
51700
+ /**
51701
+ * Adds `value` to the array cache.
51702
+ *
51703
+ * @private
51704
+ * @name add
51705
+ * @memberOf SetCache
51706
+ * @alias push
51707
+ * @param {*} value The value to cache.
51708
+ * @returns {Object} Returns the cache instance.
51709
+ */
51710
+
51711
+ function setCacheAdd$1(value) {
51712
+ this.__data__.set(value, HASH_UNDEFINED);
51713
+
51714
+ return this;
51715
+ }
51716
+
51717
+ var _setCacheAdd = setCacheAdd$1;
51718
+
51719
+ /**
51720
+ * Checks if `value` is in the array cache.
51721
+ *
51722
+ * @private
51723
+ * @name has
51724
+ * @memberOf SetCache
51725
+ * @param {*} value The value to search for.
51726
+ * @returns {number} Returns `true` if `value` is found, else `false`.
51727
+ */
51728
+
51729
+ function setCacheHas$1(value) {
51730
+ return this.__data__.has(value);
51731
+ }
51732
+
51733
+ var _setCacheHas = setCacheHas$1;
51734
+
51735
+ var MapCache$1 = _MapCache,
51736
+ setCacheAdd = _setCacheAdd,
51737
+ setCacheHas = _setCacheHas;
51738
+ /**
51739
+ *
51740
+ * Creates an array cache object to store unique values.
51741
+ *
51742
+ * @private
51743
+ * @constructor
51744
+ * @param {Array} [values] The values to cache.
51745
+ */
51746
+
51747
+ function SetCache$1(values) {
51748
+ var index = -1,
51749
+ length = values == null ? 0 : values.length;
51750
+ this.__data__ = new MapCache$1();
51751
+
51752
+ while (++index < length) {
51753
+ this.add(values[index]);
51754
+ }
51755
+ } // Add methods to `SetCache`.
51756
+
51757
+
51758
+ SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
51759
+ SetCache$1.prototype.has = setCacheHas;
51760
+ var _SetCache = SetCache$1;
51761
+
51762
+ /**
51763
+ * A specialized version of `_.some` for arrays without support for iteratee
51764
+ * shorthands.
51765
+ *
51766
+ * @private
51767
+ * @param {Array} [array] The array to iterate over.
51768
+ * @param {Function} predicate The function invoked per iteration.
51769
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
51770
+ * else `false`.
51771
+ */
51772
+
51773
+ function arraySome$1(array, predicate) {
51774
+ var index = -1,
51775
+ length = array == null ? 0 : array.length;
51776
+
51777
+ while (++index < length) {
51778
+ if (predicate(array[index], index, array)) {
51779
+ return true;
51780
+ }
51781
+ }
51782
+
51783
+ return false;
51784
+ }
51785
+
51786
+ var _arraySome = arraySome$1;
51787
+
51788
+ /**
51789
+ * Checks if a `cache` value for `key` exists.
51790
+ *
51791
+ * @private
51792
+ * @param {Object} cache The cache to query.
51793
+ * @param {string} key The key of the entry to check.
51794
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
51795
+ */
51796
+
51797
+ function cacheHas$1(cache, key) {
51798
+ return cache.has(key);
51799
+ }
51800
+
51801
+ var _cacheHas = cacheHas$1;
51802
+
51803
+ var SetCache = _SetCache,
51804
+ arraySome = _arraySome,
51805
+ cacheHas = _cacheHas;
51806
+ /** Used to compose bitmasks for value comparisons. */
51807
+
51808
+ var COMPARE_PARTIAL_FLAG$5 = 1,
51809
+ COMPARE_UNORDERED_FLAG$3 = 2;
51810
+ /**
51811
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
51812
+ * partial deep comparisons.
51813
+ *
51814
+ * @private
51815
+ * @param {Array} array The array to compare.
51816
+ * @param {Array} other The other array to compare.
51817
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
51818
+ * @param {Function} customizer The function to customize comparisons.
51819
+ * @param {Function} equalFunc The function to determine equivalents of values.
51820
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
51821
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
51822
+ */
51823
+
51824
+ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
51825
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
51826
+ arrLength = array.length,
51827
+ othLength = other.length;
51828
+
51829
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
51830
+ return false;
51831
+ } // Check that cyclic values are equal.
51832
+
51833
+
51834
+ var arrStacked = stack.get(array);
51835
+ var othStacked = stack.get(other);
51836
+
51837
+ if (arrStacked && othStacked) {
51838
+ return arrStacked == other && othStacked == array;
51839
+ }
51840
+
51841
+ var index = -1,
51842
+ result = true,
51843
+ seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
51844
+ stack.set(array, other);
51845
+ stack.set(other, array); // Ignore non-index properties.
51846
+
51847
+ while (++index < arrLength) {
51848
+ var arrValue = array[index],
51849
+ othValue = other[index];
51850
+
51851
+ if (customizer) {
51852
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
51853
+ }
51854
+
51855
+ if (compared !== undefined) {
51856
+ if (compared) {
51857
+ continue;
51858
+ }
51859
+
51860
+ result = false;
51861
+ break;
51862
+ } // Recursively compare arrays (susceptible to call stack limits).
51863
+
51864
+
51865
+ if (seen) {
51866
+ if (!arraySome(other, function (othValue, othIndex) {
51867
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
51868
+ return seen.push(othIndex);
51869
+ }
51870
+ })) {
51871
+ result = false;
51872
+ break;
51873
+ }
51874
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
51875
+ result = false;
51876
+ break;
51877
+ }
51878
+ }
51879
+
51880
+ stack['delete'](array);
51881
+ stack['delete'](other);
51882
+ return result;
51883
+ }
51884
+
51885
+ var _equalArrays = equalArrays$2;
51886
+
51887
+ var root$4 = _root;
51888
+ /** Built-in value references. */
51889
+
51890
+ var Uint8Array$2 = root$4.Uint8Array;
51891
+ var _Uint8Array = Uint8Array$2;
51892
+
51893
+ /**
51894
+ * Converts `map` to its key-value pairs.
51895
+ *
51896
+ * @private
51897
+ * @param {Object} map The map to convert.
51898
+ * @returns {Array} Returns the key-value pairs.
51899
+ */
51900
+
51901
+ function mapToArray$1(map) {
51902
+ var index = -1,
51903
+ result = Array(map.size);
51904
+ map.forEach(function (value, key) {
51905
+ result[++index] = [key, value];
51906
+ });
51907
+ return result;
51908
+ }
51909
+
51910
+ var _mapToArray = mapToArray$1;
51911
+
51912
+ /**
51913
+ * Converts `set` to an array of its values.
51914
+ *
51915
+ * @private
51916
+ * @param {Object} set The set to convert.
51917
+ * @returns {Array} Returns the values.
51918
+ */
51919
+
51920
+ function setToArray$1(set) {
51921
+ var index = -1,
51922
+ result = Array(set.size);
51923
+ set.forEach(function (value) {
51924
+ result[++index] = value;
51925
+ });
51926
+ return result;
51927
+ }
51928
+
51929
+ var _setToArray = setToArray$1;
51930
+
51931
+ var _Symbol$1 = _Symbol$4,
51932
+ Uint8Array$1 = _Uint8Array,
51933
+ eq = eq_1,
51934
+ equalArrays$1 = _equalArrays,
51935
+ mapToArray = _mapToArray,
51936
+ setToArray = _setToArray;
51937
+ /** Used to compose bitmasks for value comparisons. */
51938
+
51939
+ var COMPARE_PARTIAL_FLAG$4 = 1,
51940
+ COMPARE_UNORDERED_FLAG$2 = 2;
51941
+ /** `Object#toString` result references. */
51942
+
51943
+ var boolTag$1 = '[object Boolean]',
51944
+ dateTag$1 = '[object Date]',
51945
+ errorTag$1 = '[object Error]',
51946
+ mapTag$2 = '[object Map]',
51947
+ numberTag$1 = '[object Number]',
51948
+ regexpTag$1 = '[object RegExp]',
51949
+ setTag$2 = '[object Set]',
51950
+ stringTag$1 = '[object String]',
51951
+ symbolTag = '[object Symbol]';
51952
+ var arrayBufferTag$1 = '[object ArrayBuffer]',
51953
+ dataViewTag$2 = '[object DataView]';
51954
+ /** Used to convert symbols to primitives and strings. */
51955
+
51956
+ var symbolProto$1 = _Symbol$1 ? _Symbol$1.prototype : undefined,
51957
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
51958
+ /**
51959
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
51960
+ * the same `toStringTag`.
51961
+ *
51962
+ * **Note:** This function only supports comparing values with tags of
51963
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
51964
+ *
51965
+ * @private
51966
+ * @param {Object} object The object to compare.
51967
+ * @param {Object} other The other object to compare.
51968
+ * @param {string} tag The `toStringTag` of the objects to compare.
51969
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
51970
+ * @param {Function} customizer The function to customize comparisons.
51971
+ * @param {Function} equalFunc The function to determine equivalents of values.
51972
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
51973
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
51974
+ */
51975
+
51976
+ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
51977
+ switch (tag) {
51978
+ case dataViewTag$2:
51979
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
51980
+ return false;
51981
+ }
51982
+
51983
+ object = object.buffer;
51984
+ other = other.buffer;
51985
+
51986
+ case arrayBufferTag$1:
51987
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
51988
+ return false;
51989
+ }
51990
+
51991
+ return true;
51992
+
51993
+ case boolTag$1:
51994
+ case dateTag$1:
51995
+ case numberTag$1:
51996
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
51997
+ // Invalid dates are coerced to `NaN`.
51998
+ return eq(+object, +other);
51999
+
52000
+ case errorTag$1:
52001
+ return object.name == other.name && object.message == other.message;
52002
+
52003
+ case regexpTag$1:
52004
+ case stringTag$1:
52005
+ // Coerce regexes to strings and treat strings, primitives and objects,
52006
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
52007
+ // for more details.
52008
+ return object == other + '';
52009
+
52010
+ case mapTag$2:
52011
+ var convert = mapToArray;
52012
+
52013
+ case setTag$2:
52014
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
52015
+ convert || (convert = setToArray);
52016
+
52017
+ if (object.size != other.size && !isPartial) {
52018
+ return false;
52019
+ } // Assume cyclic values are equal.
52020
+
52021
+
52022
+ var stacked = stack.get(object);
52023
+
52024
+ if (stacked) {
52025
+ return stacked == other;
52026
+ }
52027
+
52028
+ bitmask |= COMPARE_UNORDERED_FLAG$2; // Recursively compare objects (susceptible to call stack limits).
52029
+
52030
+ stack.set(object, other);
52031
+ var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
52032
+ stack['delete'](object);
52033
+ return result;
52034
+
52035
+ case symbolTag:
52036
+ if (symbolValueOf) {
52037
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
52038
+ }
52039
+
52040
+ }
52041
+
52042
+ return false;
52043
+ }
52044
+
52045
+ var _equalByTag = equalByTag$1;
52046
+
52047
+ /**
52048
+ * Appends the elements of `values` to `array`.
52049
+ *
52050
+ * @private
52051
+ * @param {Array} array The array to modify.
52052
+ * @param {Array} values The values to append.
52053
+ * @returns {Array} Returns `array`.
52054
+ */
52055
+
52056
+ function arrayPush$1(array, values) {
52057
+ var index = -1,
52058
+ length = values.length,
52059
+ offset = array.length;
52060
+
52061
+ while (++index < length) {
52062
+ array[offset + index] = values[index];
52063
+ }
52064
+
52065
+ return array;
52066
+ }
52067
+
52068
+ var _arrayPush = arrayPush$1;
52069
+
52070
+ /**
52071
+ * Checks if `value` is classified as an `Array` object.
52072
+ *
52073
+ * @static
52074
+ * @memberOf _
52075
+ * @since 0.1.0
52076
+ * @category Lang
52077
+ * @param {*} value The value to check.
52078
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
52079
+ * @example
52080
+ *
52081
+ * _.isArray([1, 2, 3]);
52082
+ * // => true
52083
+ *
52084
+ * _.isArray(document.body.children);
52085
+ * // => false
52086
+ *
52087
+ * _.isArray('abc');
52088
+ * // => false
52089
+ *
52090
+ * _.isArray(_.noop);
52091
+ * // => false
52092
+ */
52093
+ var isArray$8 = Array.isArray;
52094
+ var isArray_1 = isArray$8;
52095
+
52096
+ var arrayPush = _arrayPush,
52097
+ isArray$7 = isArray_1;
52098
+ /**
52099
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
52100
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
52101
+ * symbols of `object`.
52102
+ *
52103
+ * @private
52104
+ * @param {Object} object The object to query.
52105
+ * @param {Function} keysFunc The function to get the keys of `object`.
52106
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
52107
+ * @returns {Array} Returns the array of property names and symbols.
52108
+ */
52109
+
52110
+ function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
52111
+ var result = keysFunc(object);
52112
+ return isArray$7(object) ? result : arrayPush(result, symbolsFunc(object));
52113
+ }
52114
+
52115
+ var _baseGetAllKeys = baseGetAllKeys$1;
52116
+
52117
+ /**
52118
+ * A specialized version of `_.filter` for arrays without support for
52119
+ * iteratee shorthands.
52120
+ *
52121
+ * @private
52122
+ * @param {Array} [array] The array to iterate over.
52123
+ * @param {Function} predicate The function invoked per iteration.
52124
+ * @returns {Array} Returns the new filtered array.
52125
+ */
52126
+
52127
+ function arrayFilter$1(array, predicate) {
52128
+ var index = -1,
52129
+ length = array == null ? 0 : array.length,
52130
+ resIndex = 0,
52131
+ result = [];
52132
+
52133
+ while (++index < length) {
52134
+ var value = array[index];
52135
+
52136
+ if (predicate(value, index, array)) {
52137
+ result[resIndex++] = value;
52138
+ }
52139
+ }
52140
+
52141
+ return result;
52142
+ }
52143
+
52144
+ var _arrayFilter = arrayFilter$1;
52145
+
52146
+ /**
52147
+ * This method returns a new empty array.
52148
+ *
52149
+ * @static
52150
+ * @memberOf _
52151
+ * @since 4.13.0
52152
+ * @category Util
52153
+ * @returns {Array} Returns the new empty array.
52154
+ * @example
52155
+ *
52156
+ * var arrays = _.times(2, _.stubArray);
52157
+ *
52158
+ * console.log(arrays);
52159
+ * // => [[], []]
52160
+ *
52161
+ * console.log(arrays[0] === arrays[1]);
52162
+ * // => false
52163
+ */
52164
+
52165
+ function stubArray$1() {
52166
+ return [];
52167
+ }
52168
+
52169
+ var stubArray_1 = stubArray$1;
52170
+
52171
+ var arrayFilter = _arrayFilter,
52172
+ stubArray = stubArray_1;
52173
+ /** Used for built-in method references. */
52174
+
52175
+ var objectProto$6 = Object.prototype;
52176
+ /** Built-in value references. */
52177
+
52178
+ var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
52179
+ /* Built-in method references for those with the same name as other `lodash` methods. */
52180
+
52181
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
52182
+ /**
52183
+ * Creates an array of the own enumerable symbols of `object`.
52184
+ *
52185
+ * @private
52186
+ * @param {Object} object The object to query.
52187
+ * @returns {Array} Returns the array of symbols.
52188
+ */
52189
+
52190
+ var getSymbols$1 = !nativeGetSymbols ? stubArray : function (object) {
52191
+ if (object == null) {
52192
+ return [];
52193
+ }
52194
+
52195
+ object = Object(object);
52196
+ return arrayFilter(nativeGetSymbols(object), function (symbol) {
52197
+ return propertyIsEnumerable$1.call(object, symbol);
52198
+ });
52199
+ };
52200
+ var _getSymbols = getSymbols$1;
52201
+
52202
+ /**
52203
+ * The base implementation of `_.times` without support for iteratee shorthands
52204
+ * or max array length checks.
52205
+ *
52206
+ * @private
52207
+ * @param {number} n The number of times to invoke `iteratee`.
52208
+ * @param {Function} iteratee The function invoked per iteration.
52209
+ * @returns {Array} Returns the array of results.
52210
+ */
52211
+
52212
+ function baseTimes$1(n, iteratee) {
52213
+ var index = -1,
52214
+ result = Array(n);
52215
+
52216
+ while (++index < n) {
52217
+ result[index] = iteratee(index);
52218
+ }
52219
+
52220
+ return result;
52221
+ }
52222
+
52223
+ var _baseTimes = baseTimes$1;
52224
+
52225
+ var baseGetTag$2 = _baseGetTag,
52226
+ isObjectLike$3 = isObjectLike_1;
52227
+ /** `Object#toString` result references. */
52228
+
52229
+ var argsTag$2 = '[object Arguments]';
52230
+ /**
52231
+ * The base implementation of `_.isArguments`.
52232
+ *
52233
+ * @private
52234
+ * @param {*} value The value to check.
52235
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
52236
+ */
52237
+
52238
+ function baseIsArguments$1(value) {
52239
+ return isObjectLike$3(value) && baseGetTag$2(value) == argsTag$2;
52240
+ }
52241
+
52242
+ var _baseIsArguments = baseIsArguments$1;
52243
+
52244
+ var baseIsArguments = _baseIsArguments,
52245
+ isObjectLike$2 = isObjectLike_1;
52246
+ /** Used for built-in method references. */
52247
+
52248
+ var objectProto$5 = Object.prototype;
52249
+ /** Used to check objects for own properties. */
52250
+
52251
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
52252
+ /** Built-in value references. */
52253
+
52254
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
52255
+ /**
52256
+ * Checks if `value` is likely an `arguments` object.
52257
+ *
52258
+ * @static
52259
+ * @memberOf _
52260
+ * @since 0.1.0
52261
+ * @category Lang
52262
+ * @param {*} value The value to check.
52263
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
52264
+ * else `false`.
52265
+ * @example
52266
+ *
52267
+ * _.isArguments(function() { return arguments; }());
52268
+ * // => true
52269
+ *
52270
+ * _.isArguments([1, 2, 3]);
52271
+ * // => false
52272
+ */
52273
+
52274
+ var isArguments$2 = baseIsArguments(function () {
52275
+ return arguments;
52276
+ }()) ? baseIsArguments : function (value) {
52277
+ return isObjectLike$2(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
52278
+ };
52279
+ var isArguments_1 = isArguments$2;
52280
+
52281
+ var isBuffer$2 = {exports: {}};
52282
+
52283
+ /**
52284
+ * This method returns `false`.
52285
+ *
52286
+ * @static
52287
+ * @memberOf _
52288
+ * @since 4.13.0
52289
+ * @category Util
52290
+ * @returns {boolean} Returns `false`.
52291
+ * @example
52292
+ *
52293
+ * _.times(2, _.stubFalse);
52294
+ * // => [false, false]
52295
+ */
52296
+
52297
+ function stubFalse() {
52298
+ return false;
52299
+ }
52300
+
52301
+ var stubFalse_1 = stubFalse;
52302
+
52303
+ (function (module, exports) {
52304
+ var root = _root,
52305
+ stubFalse = stubFalse_1;
52306
+ /** Detect free variable `exports`. */
52307
+
52308
+ var freeExports = exports && !exports.nodeType && exports;
52309
+ /** Detect free variable `module`. */
52310
+
52311
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
52312
+ /** Detect the popular CommonJS extension `module.exports`. */
52313
+
52314
+ var moduleExports = freeModule && freeModule.exports === freeExports;
52315
+ /** Built-in value references. */
52316
+
52317
+ var Buffer = moduleExports ? root.Buffer : undefined;
52318
+ /* Built-in method references for those with the same name as other `lodash` methods. */
52319
+
52320
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
52321
+ /**
52322
+ * Checks if `value` is a buffer.
52323
+ *
52324
+ * @static
52325
+ * @memberOf _
52326
+ * @since 4.3.0
52327
+ * @category Lang
52328
+ * @param {*} value The value to check.
52329
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
52330
+ * @example
52331
+ *
52332
+ * _.isBuffer(new Buffer(2));
52333
+ * // => true
52334
+ *
52335
+ * _.isBuffer(new Uint8Array(2));
52336
+ * // => false
52337
+ */
52338
+
52339
+ var isBuffer = nativeIsBuffer || stubFalse;
52340
+ module.exports = isBuffer;
52341
+ })(isBuffer$2, isBuffer$2.exports);
52342
+
52343
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
52344
+ /** Used to detect unsigned integer values. */
52345
+
52346
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
52347
+ /**
52348
+ * Checks if `value` is a valid array-like index.
52349
+ *
52350
+ * @private
52351
+ * @param {*} value The value to check.
52352
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
52353
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
52354
+ */
52355
+
52356
+ function isIndex$2(value, length) {
52357
+ var type = _typeof(value);
52358
+
52359
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
52360
+ return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
52361
+ }
52362
+
52363
+ var _isIndex = isIndex$2;
52364
+
52365
+ /** Used as references for various `Number` constants. */
52366
+ var MAX_SAFE_INTEGER = 9007199254740991;
52367
+ /**
52368
+ * Checks if `value` is a valid array-like length.
52369
+ *
52370
+ * **Note:** This method is loosely based on
52371
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
52372
+ *
52373
+ * @static
52374
+ * @memberOf _
52375
+ * @since 4.0.0
52376
+ * @category Lang
52377
+ * @param {*} value The value to check.
52378
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
52379
+ * @example
52380
+ *
52381
+ * _.isLength(3);
52382
+ * // => true
52383
+ *
52384
+ * _.isLength(Number.MIN_VALUE);
52385
+ * // => false
52386
+ *
52387
+ * _.isLength(Infinity);
52388
+ * // => false
52389
+ *
52390
+ * _.isLength('3');
52391
+ * // => false
52392
+ */
52393
+
52394
+ function isLength$3(value) {
52395
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
52396
+ }
52397
+
52398
+ var isLength_1 = isLength$3;
52399
+
52400
+ var baseGetTag$1 = _baseGetTag,
52401
+ isLength$2 = isLength_1,
52402
+ isObjectLike$1 = isObjectLike_1;
52403
+ /** `Object#toString` result references. */
52404
+
52405
+ var argsTag$1 = '[object Arguments]',
52406
+ arrayTag$1 = '[object Array]',
52407
+ boolTag = '[object Boolean]',
52408
+ dateTag = '[object Date]',
52409
+ errorTag = '[object Error]',
52410
+ funcTag = '[object Function]',
52411
+ mapTag$1 = '[object Map]',
52412
+ numberTag = '[object Number]',
52413
+ objectTag$2 = '[object Object]',
52414
+ regexpTag = '[object RegExp]',
52415
+ setTag$1 = '[object Set]',
52416
+ stringTag = '[object String]',
52417
+ weakMapTag$1 = '[object WeakMap]';
52418
+ var arrayBufferTag = '[object ArrayBuffer]',
52419
+ dataViewTag$1 = '[object DataView]',
52420
+ float32Tag = '[object Float32Array]',
52421
+ float64Tag = '[object Float64Array]',
52422
+ int8Tag = '[object Int8Array]',
52423
+ int16Tag = '[object Int16Array]',
52424
+ int32Tag = '[object Int32Array]',
52425
+ uint8Tag = '[object Uint8Array]',
52426
+ uint8ClampedTag = '[object Uint8ClampedArray]',
52427
+ uint16Tag = '[object Uint16Array]',
52428
+ uint32Tag = '[object Uint32Array]';
52429
+ /** Used to identify `toStringTag` values of typed arrays. */
52430
+
52431
+ var typedArrayTags = {};
52432
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
52433
+ 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;
52434
+ /**
52435
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
52436
+ *
52437
+ * @private
52438
+ * @param {*} value The value to check.
52439
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
52440
+ */
52441
+
52442
+ function baseIsTypedArray$1(value) {
52443
+ return isObjectLike$1(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$1(value)];
52444
+ }
52445
+
52446
+ var _baseIsTypedArray = baseIsTypedArray$1;
52447
+
52448
+ /**
52449
+ * The base implementation of `_.unary` without support for storing metadata.
52450
+ *
52451
+ * @private
52452
+ * @param {Function} func The function to cap arguments for.
52453
+ * @returns {Function} Returns the new capped function.
52454
+ */
52455
+
52456
+ function baseUnary$1(func) {
52457
+ return function (value) {
52458
+ return func(value);
52459
+ };
52460
+ }
52461
+
52462
+ var _baseUnary = baseUnary$1;
52463
+
52464
+ var _nodeUtil = {exports: {}};
52465
+
52466
+ (function (module, exports) {
52467
+ var freeGlobal = _freeGlobal;
52468
+ /** Detect free variable `exports`. */
52469
+
52470
+ var freeExports = exports && !exports.nodeType && exports;
52471
+ /** Detect free variable `module`. */
52472
+
52473
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
52474
+ /** Detect the popular CommonJS extension `module.exports`. */
52475
+
52476
+ var moduleExports = freeModule && freeModule.exports === freeExports;
52477
+ /** Detect free variable `process` from Node.js. */
52478
+
52479
+ var freeProcess = moduleExports && freeGlobal.process;
52480
+ /** Used to access faster Node.js helpers. */
52481
+
52482
+ var nodeUtil = function () {
52483
+ try {
52484
+ // Use `util.types` for Node.js 10+.
52485
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
52486
+
52487
+ if (types) {
52488
+ return types;
52489
+ } // Legacy `process.binding('util')` for Node.js < 10.
52490
+
52491
+
52492
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
52493
+ } catch (e) {}
52494
+ }();
52495
+
52496
+ module.exports = nodeUtil;
52497
+ })(_nodeUtil, _nodeUtil.exports);
52498
+
52499
+ var baseIsTypedArray = _baseIsTypedArray,
52500
+ baseUnary = _baseUnary,
52501
+ nodeUtil = _nodeUtil.exports;
52502
+ /* Node.js helper references. */
52503
+
52504
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
52505
+ /**
52506
+ * Checks if `value` is classified as a typed array.
52507
+ *
52508
+ * @static
52509
+ * @memberOf _
52510
+ * @since 3.0.0
52511
+ * @category Lang
52512
+ * @param {*} value The value to check.
52513
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
52514
+ * @example
52515
+ *
52516
+ * _.isTypedArray(new Uint8Array);
52517
+ * // => true
52518
+ *
52519
+ * _.isTypedArray([]);
52520
+ * // => false
52521
+ */
52522
+
52523
+ var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
52524
+ var isTypedArray_1 = isTypedArray$2;
52525
+
52526
+ var baseTimes = _baseTimes,
52527
+ isArguments$1 = isArguments_1,
52528
+ isArray$6 = isArray_1,
52529
+ isBuffer$1 = isBuffer$2.exports,
52530
+ isIndex$1 = _isIndex,
52531
+ isTypedArray$1 = isTypedArray_1;
52532
+ /** Used for built-in method references. */
52533
+
52534
+ var objectProto$4 = Object.prototype;
52535
+ /** Used to check objects for own properties. */
52536
+
52537
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
52538
+ /**
52539
+ * Creates an array of the enumerable property names of the array-like `value`.
52540
+ *
52541
+ * @private
52542
+ * @param {*} value The value to query.
52543
+ * @param {boolean} inherited Specify returning inherited property names.
52544
+ * @returns {Array} Returns the array of property names.
52545
+ */
52546
+
52547
+ function arrayLikeKeys$1(value, inherited) {
52548
+ var isArr = isArray$6(value),
52549
+ isArg = !isArr && isArguments$1(value),
52550
+ isBuff = !isArr && !isArg && isBuffer$1(value),
52551
+ isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
52552
+ skipIndexes = isArr || isArg || isBuff || isType,
52553
+ result = skipIndexes ? baseTimes(value.length, String) : [],
52554
+ length = result.length;
52555
+
52556
+ for (var key in value) {
52557
+ if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
52558
+ key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
52559
+ isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
52560
+ isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
52561
+ isIndex$1(key, length)))) {
52562
+ result.push(key);
52563
+ }
52564
+ }
52565
+
52566
+ return result;
52567
+ }
52568
+
52569
+ var _arrayLikeKeys = arrayLikeKeys$1;
52570
+
52571
+ /** Used for built-in method references. */
52572
+ var objectProto$3 = Object.prototype;
52573
+ /**
52574
+ * Checks if `value` is likely a prototype object.
52575
+ *
52576
+ * @private
52577
+ * @param {*} value The value to check.
52578
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
52579
+ */
52580
+
52581
+ function isPrototype$1(value) {
52582
+ var Ctor = value && value.constructor,
52583
+ proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$3;
52584
+ return value === proto;
52585
+ }
52586
+
52587
+ var _isPrototype = isPrototype$1;
52588
+
52589
+ /**
52590
+ * Creates a unary function that invokes `func` with its argument transformed.
52591
+ *
52592
+ * @private
52593
+ * @param {Function} func The function to wrap.
52594
+ * @param {Function} transform The argument transform.
52595
+ * @returns {Function} Returns the new function.
52596
+ */
52597
+
52598
+ function overArg$1(func, transform) {
52599
+ return function (arg) {
52600
+ return func(transform(arg));
52601
+ };
52602
+ }
52603
+
52604
+ var _overArg = overArg$1;
52605
+
52606
+ var overArg = _overArg;
52607
+ /* Built-in method references for those with the same name as other `lodash` methods. */
52608
+
52609
+ var nativeKeys$1 = overArg(Object.keys, Object);
52610
+ var _nativeKeys = nativeKeys$1;
52611
+
52612
+ var isPrototype = _isPrototype,
52613
+ nativeKeys = _nativeKeys;
52614
+ /** Used for built-in method references. */
52615
+
52616
+ var objectProto$2 = Object.prototype;
52617
+ /** Used to check objects for own properties. */
52618
+
52619
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
52620
+ /**
52621
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
52622
+ *
52623
+ * @private
52624
+ * @param {Object} object The object to query.
52625
+ * @returns {Array} Returns the array of property names.
52626
+ */
52627
+
52628
+ function baseKeys$1(object) {
52629
+ if (!isPrototype(object)) {
52630
+ return nativeKeys(object);
52631
+ }
52632
+
52633
+ var result = [];
52634
+
52635
+ for (var key in Object(object)) {
52636
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
52637
+ result.push(key);
52638
+ }
52639
+ }
52640
+
52641
+ return result;
52642
+ }
52643
+
52644
+ var _baseKeys = baseKeys$1;
52645
+
52646
+ var isFunction = isFunction_1,
52647
+ isLength$1 = isLength_1;
52648
+ /**
52649
+ * Checks if `value` is array-like. A value is considered array-like if it's
52650
+ * not a function and has a `value.length` that's an integer greater than or
52651
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
52652
+ *
52653
+ * @static
52654
+ * @memberOf _
52655
+ * @since 4.0.0
52656
+ * @category Lang
52657
+ * @param {*} value The value to check.
52658
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
52659
+ * @example
52660
+ *
52661
+ * _.isArrayLike([1, 2, 3]);
52662
+ * // => true
52663
+ *
52664
+ * _.isArrayLike(document.body.children);
52665
+ * // => true
52666
+ *
52667
+ * _.isArrayLike('abc');
52668
+ * // => true
52669
+ *
52670
+ * _.isArrayLike(_.noop);
52671
+ * // => false
52672
+ */
52673
+
52674
+ function isArrayLike$1(value) {
52675
+ return value != null && isLength$1(value.length) && !isFunction(value);
52676
+ }
52677
+
52678
+ var isArrayLike_1 = isArrayLike$1;
52679
+
52680
+ var arrayLikeKeys = _arrayLikeKeys,
52681
+ baseKeys = _baseKeys,
52682
+ isArrayLike = isArrayLike_1;
52683
+ /**
52684
+ * Creates an array of the own enumerable property names of `object`.
52685
+ *
52686
+ * **Note:** Non-object values are coerced to objects. See the
52687
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
52688
+ * for more details.
52689
+ *
52690
+ * @static
52691
+ * @since 0.1.0
52692
+ * @memberOf _
52693
+ * @category Object
52694
+ * @param {Object} object The object to query.
52695
+ * @returns {Array} Returns the array of property names.
52696
+ * @example
52697
+ *
52698
+ * function Foo() {
52699
+ * this.a = 1;
52700
+ * this.b = 2;
52701
+ * }
52702
+ *
52703
+ * Foo.prototype.c = 3;
52704
+ *
52705
+ * _.keys(new Foo);
52706
+ * // => ['a', 'b'] (iteration order is not guaranteed)
52707
+ *
52708
+ * _.keys('hi');
52709
+ * // => ['0', '1']
52710
+ */
52711
+
52712
+ function keys$2(object) {
52713
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
52714
+ }
52715
+
52716
+ var keys_1 = keys$2;
52717
+
52718
+ var baseGetAllKeys = _baseGetAllKeys,
52719
+ getSymbols = _getSymbols,
52720
+ keys$1 = keys_1;
52721
+ /**
52722
+ * Creates an array of own enumerable property names and symbols of `object`.
52723
+ *
52724
+ * @private
52725
+ * @param {Object} object The object to query.
52726
+ * @returns {Array} Returns the array of property names and symbols.
52727
+ */
52728
+
52729
+ function getAllKeys$1(object) {
52730
+ return baseGetAllKeys(object, keys$1, getSymbols);
52731
+ }
52732
+
52733
+ var _getAllKeys = getAllKeys$1;
52734
+
52735
+ var getAllKeys = _getAllKeys;
52736
+ /** Used to compose bitmasks for value comparisons. */
52737
+
52738
+ var COMPARE_PARTIAL_FLAG$3 = 1;
52739
+ /** Used for built-in method references. */
52740
+
52741
+ var objectProto$1 = Object.prototype;
52742
+ /** Used to check objects for own properties. */
52743
+
52744
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
52745
+ /**
52746
+ * A specialized version of `baseIsEqualDeep` for objects with support for
52747
+ * partial deep comparisons.
52748
+ *
52749
+ * @private
52750
+ * @param {Object} object The object to compare.
52751
+ * @param {Object} other The other object to compare.
52752
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
52753
+ * @param {Function} customizer The function to customize comparisons.
52754
+ * @param {Function} equalFunc The function to determine equivalents of values.
52755
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
52756
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
52757
+ */
52758
+
52759
+ function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
52760
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
52761
+ objProps = getAllKeys(object),
52762
+ objLength = objProps.length,
52763
+ othProps = getAllKeys(other),
52764
+ othLength = othProps.length;
52765
+
52766
+ if (objLength != othLength && !isPartial) {
52767
+ return false;
52768
+ }
52769
+
52770
+ var index = objLength;
52771
+
52772
+ while (index--) {
52773
+ var key = objProps[index];
52774
+
52775
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
52776
+ return false;
52777
+ }
52778
+ } // Check that cyclic values are equal.
52779
+
52780
+
52781
+ var objStacked = stack.get(object);
52782
+ var othStacked = stack.get(other);
52783
+
52784
+ if (objStacked && othStacked) {
52785
+ return objStacked == other && othStacked == object;
52786
+ }
52787
+
52788
+ var result = true;
52789
+ stack.set(object, other);
52790
+ stack.set(other, object);
52791
+ var skipCtor = isPartial;
52792
+
52793
+ while (++index < objLength) {
52794
+ key = objProps[index];
52795
+ var objValue = object[key],
52796
+ othValue = other[key];
52797
+
52798
+ if (customizer) {
52799
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
52800
+ } // Recursively compare objects (susceptible to call stack limits).
52801
+
52802
+
52803
+ if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
52804
+ result = false;
52805
+ break;
52806
+ }
52807
+
52808
+ skipCtor || (skipCtor = key == 'constructor');
52809
+ }
52810
+
52811
+ if (result && !skipCtor) {
52812
+ var objCtor = object.constructor,
52813
+ othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
52814
+
52815
+ if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
52816
+ result = false;
52817
+ }
52818
+ }
52819
+
52820
+ stack['delete'](object);
52821
+ stack['delete'](other);
52822
+ return result;
52823
+ }
52824
+
52825
+ var _equalObjects = equalObjects$1;
52826
+
52827
+ var getNative$3 = _getNative,
52828
+ root$3 = _root;
52829
+ /* Built-in method references that are verified to be native. */
52830
+
52831
+ var DataView$1 = getNative$3(root$3, 'DataView');
52832
+ var _DataView = DataView$1;
52833
+
52834
+ var getNative$2 = _getNative,
52835
+ root$2 = _root;
52836
+ /* Built-in method references that are verified to be native. */
52837
+
52838
+ var Promise$2 = getNative$2(root$2, 'Promise');
52839
+ var _Promise = Promise$2;
52840
+
52841
+ var getNative$1 = _getNative,
52842
+ root$1 = _root;
52843
+ /* Built-in method references that are verified to be native. */
52844
+
52845
+ var Set$2 = getNative$1(root$1, 'Set');
52846
+ var _Set = Set$2;
52847
+
52848
+ var getNative = _getNative,
52849
+ root = _root;
52850
+ /* Built-in method references that are verified to be native. */
52851
+
52852
+ var WeakMap$2 = getNative(root, 'WeakMap');
52853
+ var _WeakMap = WeakMap$2;
52854
+
52855
+ var DataView = _DataView,
52856
+ Map$1 = _Map,
52857
+ Promise$1 = _Promise,
52858
+ Set$1 = _Set,
52859
+ WeakMap$1 = _WeakMap,
52860
+ baseGetTag = _baseGetTag,
52861
+ toSource = _toSource;
52862
+ /** `Object#toString` result references. */
52863
+
52864
+ var mapTag = '[object Map]',
52865
+ objectTag$1 = '[object Object]',
52866
+ promiseTag = '[object Promise]',
52867
+ setTag = '[object Set]',
52868
+ weakMapTag = '[object WeakMap]';
52869
+ var dataViewTag = '[object DataView]';
52870
+ /** Used to detect maps, sets, and weakmaps. */
52871
+
52872
+ var dataViewCtorString = toSource(DataView),
52873
+ mapCtorString = toSource(Map$1),
52874
+ promiseCtorString = toSource(Promise$1),
52875
+ setCtorString = toSource(Set$1),
52876
+ weakMapCtorString = toSource(WeakMap$1);
52877
+ /**
52878
+ * Gets the `toStringTag` of `value`.
52879
+ *
52880
+ * @private
52881
+ * @param {*} value The value to query.
52882
+ * @returns {string} Returns the `toStringTag`.
52883
+ */
52884
+
52885
+ var getTag$1 = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
52886
+
52887
+ 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) {
52888
+ getTag$1 = function getTag(value) {
52889
+ var result = baseGetTag(value),
52890
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
52891
+ ctorString = Ctor ? toSource(Ctor) : '';
52892
+
52893
+ if (ctorString) {
52894
+ switch (ctorString) {
52895
+ case dataViewCtorString:
52896
+ return dataViewTag;
52897
+
52898
+ case mapCtorString:
52899
+ return mapTag;
52900
+
52901
+ case promiseCtorString:
52902
+ return promiseTag;
52903
+
52904
+ case setCtorString:
52905
+ return setTag;
52906
+
52907
+ case weakMapCtorString:
52908
+ return weakMapTag;
52909
+ }
52910
+ }
52911
+
52912
+ return result;
52913
+ };
52914
+ }
52915
+
52916
+ var _getTag = getTag$1;
52917
+
52918
+ var Stack$1 = _Stack,
52919
+ equalArrays = _equalArrays,
52920
+ equalByTag = _equalByTag,
52921
+ equalObjects = _equalObjects,
52922
+ getTag = _getTag,
52923
+ isArray$5 = isArray_1,
52924
+ isBuffer = isBuffer$2.exports,
52925
+ isTypedArray = isTypedArray_1;
52926
+ /** Used to compose bitmasks for value comparisons. */
52927
+
52928
+ var COMPARE_PARTIAL_FLAG$2 = 1;
52929
+ /** `Object#toString` result references. */
52930
+
52931
+ var argsTag = '[object Arguments]',
52932
+ arrayTag = '[object Array]',
52933
+ objectTag = '[object Object]';
52934
+ /** Used for built-in method references. */
52935
+
52936
+ var objectProto = Object.prototype;
52937
+ /** Used to check objects for own properties. */
52938
+
52939
+ var hasOwnProperty = objectProto.hasOwnProperty;
52940
+ /**
52941
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
52942
+ * deep comparisons and tracks traversed objects enabling objects with circular
52943
+ * references to be compared.
52944
+ *
52945
+ * @private
52946
+ * @param {Object} object The object to compare.
52947
+ * @param {Object} other The other object to compare.
52948
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
52949
+ * @param {Function} customizer The function to customize comparisons.
52950
+ * @param {Function} equalFunc The function to determine equivalents of values.
52951
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
52952
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
52953
+ */
52954
+
52955
+ function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
52956
+ var objIsArr = isArray$5(object),
52957
+ othIsArr = isArray$5(other),
52958
+ objTag = objIsArr ? arrayTag : getTag(object),
52959
+ othTag = othIsArr ? arrayTag : getTag(other);
52960
+ objTag = objTag == argsTag ? objectTag : objTag;
52961
+ othTag = othTag == argsTag ? objectTag : othTag;
52962
+ var objIsObj = objTag == objectTag,
52963
+ othIsObj = othTag == objectTag,
52964
+ isSameTag = objTag == othTag;
52965
+
52966
+ if (isSameTag && isBuffer(object)) {
52967
+ if (!isBuffer(other)) {
52968
+ return false;
52969
+ }
52970
+
52971
+ objIsArr = true;
52972
+ objIsObj = false;
52973
+ }
52974
+
52975
+ if (isSameTag && !objIsObj) {
52976
+ stack || (stack = new Stack$1());
52977
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
52978
+ }
52979
+
52980
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
52981
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
52982
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
52983
+
52984
+ if (objIsWrapped || othIsWrapped) {
52985
+ var objUnwrapped = objIsWrapped ? object.value() : object,
52986
+ othUnwrapped = othIsWrapped ? other.value() : other;
52987
+ stack || (stack = new Stack$1());
52988
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
52989
+ }
52990
+ }
52991
+
52992
+ if (!isSameTag) {
52993
+ return false;
52994
+ }
52995
+
52996
+ stack || (stack = new Stack$1());
52997
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
52998
+ }
52999
+
53000
+ var _baseIsEqualDeep = baseIsEqualDeep$1;
53001
+
53002
+ var baseIsEqualDeep = _baseIsEqualDeep,
53003
+ isObjectLike = isObjectLike_1;
53004
+ /**
53005
+ * The base implementation of `_.isEqual` which supports partial comparisons
53006
+ * and tracks traversed objects.
53007
+ *
53008
+ * @private
53009
+ * @param {*} value The value to compare.
53010
+ * @param {*} other The other value to compare.
53011
+ * @param {boolean} bitmask The bitmask flags.
53012
+ * 1 - Unordered comparison
53013
+ * 2 - Partial comparison
53014
+ * @param {Function} [customizer] The function to customize comparisons.
53015
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
53016
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
53017
+ */
53018
+
53019
+ function baseIsEqual$2(value, other, bitmask, customizer, stack) {
53020
+ if (value === other) {
53021
+ return true;
53022
+ }
53023
+
53024
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
53025
+ return value !== value && other !== other;
53026
+ }
53027
+
53028
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$2, stack);
53029
+ }
53030
+
53031
+ var _baseIsEqual = baseIsEqual$2;
53032
+
53033
+ var Stack = _Stack,
53034
+ baseIsEqual$1 = _baseIsEqual;
53035
+ /** Used to compose bitmasks for value comparisons. */
53036
+
53037
+ var COMPARE_PARTIAL_FLAG$1 = 1,
53038
+ COMPARE_UNORDERED_FLAG$1 = 2;
53039
+ /**
53040
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
53041
+ *
53042
+ * @private
53043
+ * @param {Object} object The object to inspect.
53044
+ * @param {Object} source The object of property values to match.
53045
+ * @param {Array} matchData The property names, values, and compare flags to match.
53046
+ * @param {Function} [customizer] The function to customize comparisons.
53047
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53048
+ */
53049
+
53050
+ function baseIsMatch$1(object, source, matchData, customizer) {
53051
+ var index = matchData.length,
53052
+ length = index,
53053
+ noCustomizer = !customizer;
53054
+
53055
+ if (object == null) {
53056
+ return !length;
53057
+ }
53058
+
53059
+ object = Object(object);
53060
+
53061
+ while (index--) {
53062
+ var data = matchData[index];
53063
+
53064
+ if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
53065
+ return false;
53066
+ }
53067
+ }
53068
+
53069
+ while (++index < length) {
53070
+ data = matchData[index];
53071
+ var key = data[0],
53072
+ objValue = object[key],
53073
+ srcValue = data[1];
53074
+
53075
+ if (noCustomizer && data[2]) {
53076
+ if (objValue === undefined && !(key in object)) {
53077
+ return false;
53078
+ }
53079
+ } else {
53080
+ var stack = new Stack();
53081
+
53082
+ if (customizer) {
53083
+ var result = customizer(objValue, srcValue, key, object, source, stack);
53084
+ }
53085
+
53086
+ if (!(result === undefined ? baseIsEqual$1(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
53087
+ return false;
53088
+ }
53089
+ }
53090
+ }
53091
+
53092
+ return true;
53093
+ }
53094
+
53095
+ var _baseIsMatch = baseIsMatch$1;
53096
+
53097
+ var isObject = isObject_1;
53098
+ /**
53099
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
53100
+ *
53101
+ * @private
53102
+ * @param {*} value The value to check.
53103
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
53104
+ * equality comparisons, else `false`.
53105
+ */
53106
+
53107
+ function isStrictComparable$2(value) {
53108
+ return value === value && !isObject(value);
53109
+ }
53110
+
53111
+ var _isStrictComparable = isStrictComparable$2;
53112
+
53113
+ var isStrictComparable$1 = _isStrictComparable,
53114
+ keys = keys_1;
53115
+ /**
53116
+ * Gets the property names, values, and compare flags of `object`.
53117
+ *
53118
+ * @private
53119
+ * @param {Object} object The object to query.
53120
+ * @returns {Array} Returns the match data of `object`.
53121
+ */
53122
+
53123
+ function getMatchData$1(object) {
53124
+ var result = keys(object),
53125
+ length = result.length;
53126
+
53127
+ while (length--) {
53128
+ var key = result[length],
53129
+ value = object[key];
53130
+ result[length] = [key, value, isStrictComparable$1(value)];
53131
+ }
53132
+
53133
+ return result;
53134
+ }
53135
+
53136
+ var _getMatchData = getMatchData$1;
53137
+
53138
+ /**
53139
+ * A specialized version of `matchesProperty` for source values suitable
53140
+ * for strict equality comparisons, i.e. `===`.
53141
+ *
53142
+ * @private
53143
+ * @param {string} key The key of the property to get.
53144
+ * @param {*} srcValue The value to match.
53145
+ * @returns {Function} Returns the new spec function.
53146
+ */
53147
+
53148
+ function matchesStrictComparable$2(key, srcValue) {
53149
+ return function (object) {
53150
+ if (object == null) {
53151
+ return false;
53152
+ }
53153
+
53154
+ return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
53155
+ };
53156
+ }
53157
+
53158
+ var _matchesStrictComparable = matchesStrictComparable$2;
53159
+
53160
+ var baseIsMatch = _baseIsMatch,
53161
+ getMatchData = _getMatchData,
53162
+ matchesStrictComparable$1 = _matchesStrictComparable;
53163
+ /**
53164
+ * The base implementation of `_.matches` which doesn't clone `source`.
53165
+ *
53166
+ * @private
53167
+ * @param {Object} source The object of property values to match.
53168
+ * @returns {Function} Returns the new spec function.
53169
+ */
53170
+
53171
+ function baseMatches$1(source) {
53172
+ var matchData = getMatchData(source);
53173
+
53174
+ if (matchData.length == 1 && matchData[0][2]) {
53175
+ return matchesStrictComparable$1(matchData[0][0], matchData[0][1]);
53176
+ }
53177
+
53178
+ return function (object) {
53179
+ return object === source || baseIsMatch(object, source, matchData);
53180
+ };
53181
+ }
53182
+
53183
+ var _baseMatches = baseMatches$1;
53184
+
53185
+ var isArray$4 = isArray_1,
53186
+ isSymbol$2 = isSymbol_1;
53187
+ /** Used to match property names within property paths. */
53188
+
53189
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
53190
+ reIsPlainProp = /^\w*$/;
53191
+ /**
53192
+ * Checks if `value` is a property name and not a property path.
53193
+ *
53194
+ * @private
53195
+ * @param {*} value The value to check.
53196
+ * @param {Object} [object] The object to query keys on.
53197
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
53198
+ */
53199
+
53200
+ function isKey$3(value, object) {
53201
+ if (isArray$4(value)) {
53202
+ return false;
53203
+ }
53204
+
53205
+ var type = _typeof(value);
53206
+
53207
+ if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol$2(value)) {
53208
+ return true;
53209
+ }
53210
+
53211
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
53212
+ }
53213
+
53214
+ var _isKey = isKey$3;
53215
+
53216
+ var MapCache = _MapCache;
53217
+ /** Error message constants. */
53218
+
53219
+ var FUNC_ERROR_TEXT = 'Expected a function';
53220
+ /**
53221
+ * Creates a function that memoizes the result of `func`. If `resolver` is
53222
+ * provided, it determines the cache key for storing the result based on the
53223
+ * arguments provided to the memoized function. By default, the first argument
53224
+ * provided to the memoized function is used as the map cache key. The `func`
53225
+ * is invoked with the `this` binding of the memoized function.
53226
+ *
53227
+ * **Note:** The cache is exposed as the `cache` property on the memoized
53228
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
53229
+ * constructor with one whose instances implement the
53230
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
53231
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
53232
+ *
53233
+ * @static
53234
+ * @memberOf _
53235
+ * @since 0.1.0
53236
+ * @category Function
53237
+ * @param {Function} func The function to have its output memoized.
53238
+ * @param {Function} [resolver] The function to resolve the cache key.
53239
+ * @returns {Function} Returns the new memoized function.
53240
+ * @example
53241
+ *
53242
+ * var object = { 'a': 1, 'b': 2 };
53243
+ * var other = { 'c': 3, 'd': 4 };
53244
+ *
53245
+ * var values = _.memoize(_.values);
53246
+ * values(object);
53247
+ * // => [1, 2]
53248
+ *
53249
+ * values(other);
53250
+ * // => [3, 4]
53251
+ *
53252
+ * object.a = 2;
53253
+ * values(object);
53254
+ * // => [1, 2]
53255
+ *
53256
+ * // Modify the result cache.
53257
+ * values.cache.set(object, ['a', 'b']);
53258
+ * values(object);
53259
+ * // => ['a', 'b']
53260
+ *
53261
+ * // Replace `_.memoize.Cache`.
53262
+ * _.memoize.Cache = WeakMap;
53263
+ */
53264
+
53265
+ function memoize$1(func, resolver) {
53266
+ if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
53267
+ throw new TypeError(FUNC_ERROR_TEXT);
53268
+ }
53269
+
53270
+ var memoized = function memoized() {
53271
+ var args = arguments,
53272
+ key = resolver ? resolver.apply(this, args) : args[0],
53273
+ cache = memoized.cache;
53274
+
53275
+ if (cache.has(key)) {
53276
+ return cache.get(key);
53277
+ }
53278
+
53279
+ var result = func.apply(this, args);
53280
+ memoized.cache = cache.set(key, result) || cache;
53281
+ return result;
53282
+ };
53283
+
53284
+ memoized.cache = new (memoize$1.Cache || MapCache)();
53285
+ return memoized;
53286
+ } // Expose `MapCache`.
53287
+
53288
+
53289
+ memoize$1.Cache = MapCache;
53290
+ var memoize_1 = memoize$1;
53291
+
53292
+ var memoize = memoize_1;
53293
+ /** Used as the maximum memoize cache size. */
53294
+
53295
+ var MAX_MEMOIZE_SIZE = 500;
53296
+ /**
53297
+ * A specialized version of `_.memoize` which clears the memoized function's
53298
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
53299
+ *
53300
+ * @private
53301
+ * @param {Function} func The function to have its output memoized.
53302
+ * @returns {Function} Returns the new memoized function.
53303
+ */
53304
+
53305
+ function memoizeCapped$1(func) {
53306
+ var result = memoize(func, function (key) {
53307
+ if (cache.size === MAX_MEMOIZE_SIZE) {
53308
+ cache.clear();
53309
+ }
53310
+
53311
+ return key;
53312
+ });
53313
+ var cache = result.cache;
53314
+ return result;
53315
+ }
53316
+
53317
+ var _memoizeCapped = memoizeCapped$1;
53318
+
53319
+ var memoizeCapped = _memoizeCapped;
53320
+ /** Used to match property names within property paths. */
53321
+
53322
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
53323
+ /** Used to match backslashes in property paths. */
53324
+
53325
+ var reEscapeChar = /\\(\\)?/g;
53326
+ /**
53327
+ * Converts `string` to a property path array.
53328
+ *
53329
+ * @private
53330
+ * @param {string} string The string to convert.
53331
+ * @returns {Array} Returns the property path array.
53332
+ */
53333
+
53334
+ var stringToPath$1 = memoizeCapped(function (string) {
53335
+ var result = [];
53336
+
53337
+ if (string.charCodeAt(0) === 46
53338
+ /* . */
53339
+ ) {
53340
+ result.push('');
53341
+ }
53342
+
53343
+ string.replace(rePropName, function (match, number, quote, subString) {
53344
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
53345
+ });
53346
+ return result;
53347
+ });
53348
+ var _stringToPath = stringToPath$1;
53349
+
53350
+ /**
53351
+ * A specialized version of `_.map` for arrays without support for iteratee
53352
+ * shorthands.
53353
+ *
53354
+ * @private
53355
+ * @param {Array} [array] The array to iterate over.
53356
+ * @param {Function} iteratee The function invoked per iteration.
53357
+ * @returns {Array} Returns the new mapped array.
53358
+ */
53359
+
53360
+ function arrayMap$1(array, iteratee) {
53361
+ var index = -1,
53362
+ length = array == null ? 0 : array.length,
53363
+ result = Array(length);
53364
+
53365
+ while (++index < length) {
53366
+ result[index] = iteratee(array[index], index, array);
53367
+ }
53368
+
53369
+ return result;
53370
+ }
53371
+
53372
+ var _arrayMap = arrayMap$1;
53373
+
53374
+ var _Symbol = _Symbol$4,
53375
+ arrayMap = _arrayMap,
53376
+ isArray$3 = isArray_1,
53377
+ isSymbol$1 = isSymbol_1;
53378
+ /** Used as references for various `Number` constants. */
53379
+
53380
+ var INFINITY$1 = 1 / 0;
53381
+ /** Used to convert symbols to primitives and strings. */
53382
+
53383
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
53384
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
53385
+ /**
53386
+ * The base implementation of `_.toString` which doesn't convert nullish
53387
+ * values to empty strings.
53388
+ *
53389
+ * @private
53390
+ * @param {*} value The value to process.
53391
+ * @returns {string} Returns the string.
53392
+ */
53393
+
53394
+ function baseToString$1(value) {
53395
+ // Exit early for strings to avoid a performance hit in some environments.
53396
+ if (typeof value == 'string') {
53397
+ return value;
53398
+ }
53399
+
53400
+ if (isArray$3(value)) {
53401
+ // Recursively convert values (susceptible to call stack limits).
53402
+ return arrayMap(value, baseToString$1) + '';
53403
+ }
53404
+
53405
+ if (isSymbol$1(value)) {
53406
+ return symbolToString ? symbolToString.call(value) : '';
53407
+ }
53408
+
53409
+ var result = value + '';
53410
+ return result == '0' && 1 / value == -INFINITY$1 ? '-0' : result;
53411
+ }
53412
+
53413
+ var _baseToString = baseToString$1;
53414
+
53415
+ var baseToString = _baseToString;
53416
+ /**
53417
+ * Converts `value` to a string. An empty string is returned for `null`
53418
+ * and `undefined` values. The sign of `-0` is preserved.
53419
+ *
53420
+ * @static
53421
+ * @memberOf _
53422
+ * @since 4.0.0
53423
+ * @category Lang
53424
+ * @param {*} value The value to convert.
53425
+ * @returns {string} Returns the converted string.
53426
+ * @example
53427
+ *
53428
+ * _.toString(null);
53429
+ * // => ''
53430
+ *
53431
+ * _.toString(-0);
53432
+ * // => '-0'
53433
+ *
53434
+ * _.toString([1, 2, 3]);
53435
+ * // => '1,2,3'
53436
+ */
53437
+
53438
+ function toString$1(value) {
53439
+ return value == null ? '' : baseToString(value);
53440
+ }
53441
+
53442
+ var toString_1 = toString$1;
53443
+
53444
+ var isArray$2 = isArray_1,
53445
+ isKey$2 = _isKey,
53446
+ stringToPath = _stringToPath,
53447
+ toString = toString_1;
53448
+ /**
53449
+ * Casts `value` to a path array if it's not one.
53450
+ *
53451
+ * @private
53452
+ * @param {*} value The value to inspect.
53453
+ * @param {Object} [object] The object to query keys on.
53454
+ * @returns {Array} Returns the cast property path array.
53455
+ */
53456
+
53457
+ function castPath$2(value, object) {
53458
+ if (isArray$2(value)) {
53459
+ return value;
53460
+ }
53461
+
53462
+ return isKey$2(value, object) ? [value] : stringToPath(toString(value));
53463
+ }
53464
+
53465
+ var _castPath = castPath$2;
53466
+
53467
+ var isSymbol = isSymbol_1;
53468
+ /** Used as references for various `Number` constants. */
53469
+
53470
+ var INFINITY = 1 / 0;
53471
+ /**
53472
+ * Converts `value` to a string key if it's not a string or symbol.
53473
+ *
53474
+ * @private
53475
+ * @param {*} value The value to inspect.
53476
+ * @returns {string|symbol} Returns the key.
53477
+ */
53478
+
53479
+ function toKey$4(value) {
53480
+ if (typeof value == 'string' || isSymbol(value)) {
53481
+ return value;
53482
+ }
53483
+
53484
+ var result = value + '';
53485
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
53486
+ }
53487
+
53488
+ var _toKey = toKey$4;
53489
+
53490
+ var castPath$1 = _castPath,
53491
+ toKey$3 = _toKey;
53492
+ /**
53493
+ * The base implementation of `_.get` without support for default values.
53494
+ *
53495
+ * @private
53496
+ * @param {Object} object The object to query.
53497
+ * @param {Array|string} path The path of the property to get.
53498
+ * @returns {*} Returns the resolved value.
53499
+ */
53500
+
53501
+ function baseGet$2(object, path) {
53502
+ path = castPath$1(path, object);
53503
+ var index = 0,
53504
+ length = path.length;
53505
+
53506
+ while (object != null && index < length) {
53507
+ object = object[toKey$3(path[index++])];
53508
+ }
53509
+
53510
+ return index && index == length ? object : undefined;
53511
+ }
53512
+
53513
+ var _baseGet = baseGet$2;
53514
+
53515
+ var baseGet$1 = _baseGet;
53516
+ /**
53517
+ * Gets the value at `path` of `object`. If the resolved value is
53518
+ * `undefined`, the `defaultValue` is returned in its place.
53519
+ *
53520
+ * @static
53521
+ * @memberOf _
53522
+ * @since 3.7.0
53523
+ * @category Object
53524
+ * @param {Object} object The object to query.
53525
+ * @param {Array|string} path The path of the property to get.
53526
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
53527
+ * @returns {*} Returns the resolved value.
53528
+ * @example
53529
+ *
53530
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
53531
+ *
53532
+ * _.get(object, 'a[0].b.c');
53533
+ * // => 3
53534
+ *
53535
+ * _.get(object, ['a', '0', 'b', 'c']);
53536
+ * // => 3
53537
+ *
53538
+ * _.get(object, 'a.b.c', 'default');
53539
+ * // => 'default'
53540
+ */
53541
+
53542
+ function get$1(object, path, defaultValue) {
53543
+ var result = object == null ? undefined : baseGet$1(object, path);
53544
+ return result === undefined ? defaultValue : result;
53545
+ }
53546
+
53547
+ var get_1 = get$1;
53548
+
53549
+ /**
53550
+ * The base implementation of `_.hasIn` without support for deep paths.
53551
+ *
53552
+ * @private
53553
+ * @param {Object} [object] The object to query.
53554
+ * @param {Array|string} key The key to check.
53555
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
53556
+ */
53557
+
53558
+ function baseHasIn$1(object, key) {
53559
+ return object != null && key in Object(object);
53560
+ }
53561
+
53562
+ var _baseHasIn = baseHasIn$1;
53563
+
53564
+ var castPath = _castPath,
53565
+ isArguments = isArguments_1,
53566
+ isArray$1 = isArray_1,
53567
+ isIndex = _isIndex,
53568
+ isLength = isLength_1,
53569
+ toKey$2 = _toKey;
53570
+ /**
53571
+ * Checks if `path` exists on `object`.
53572
+ *
53573
+ * @private
53574
+ * @param {Object} object The object to query.
53575
+ * @param {Array|string} path The path to check.
53576
+ * @param {Function} hasFunc The function to check properties.
53577
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
53578
+ */
53579
+
53580
+ function hasPath$1(object, path, hasFunc) {
53581
+ path = castPath(path, object);
53582
+ var index = -1,
53583
+ length = path.length,
53584
+ result = false;
53585
+
53586
+ while (++index < length) {
53587
+ var key = toKey$2(path[index]);
53588
+
53589
+ if (!(result = object != null && hasFunc(object, key))) {
53590
+ break;
53591
+ }
53592
+
53593
+ object = object[key];
53594
+ }
53595
+
53596
+ if (result || ++index != length) {
53597
+ return result;
53598
+ }
53599
+
53600
+ length = object == null ? 0 : object.length;
53601
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
53602
+ }
53603
+
53604
+ var _hasPath = hasPath$1;
53605
+
53606
+ var baseHasIn = _baseHasIn,
53607
+ hasPath = _hasPath;
53608
+ /**
53609
+ * Checks if `path` is a direct or inherited property of `object`.
53610
+ *
53611
+ * @static
53612
+ * @memberOf _
53613
+ * @since 4.0.0
53614
+ * @category Object
53615
+ * @param {Object} object The object to query.
53616
+ * @param {Array|string} path The path to check.
53617
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
53618
+ * @example
53619
+ *
53620
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
53621
+ *
53622
+ * _.hasIn(object, 'a');
53623
+ * // => true
53624
+ *
53625
+ * _.hasIn(object, 'a.b');
53626
+ * // => true
53627
+ *
53628
+ * _.hasIn(object, ['a', 'b']);
53629
+ * // => true
53630
+ *
53631
+ * _.hasIn(object, 'b');
53632
+ * // => false
53633
+ */
53634
+
53635
+ function hasIn$1(object, path) {
53636
+ return object != null && hasPath(object, path, baseHasIn);
53637
+ }
53638
+
53639
+ var hasIn_1 = hasIn$1;
53640
+
53641
+ var baseIsEqual = _baseIsEqual,
53642
+ get = get_1,
53643
+ hasIn = hasIn_1,
53644
+ isKey$1 = _isKey,
53645
+ isStrictComparable = _isStrictComparable,
53646
+ matchesStrictComparable = _matchesStrictComparable,
53647
+ toKey$1 = _toKey;
53648
+ /** Used to compose bitmasks for value comparisons. */
53649
+
53650
+ var COMPARE_PARTIAL_FLAG = 1,
53651
+ COMPARE_UNORDERED_FLAG = 2;
53652
+ /**
53653
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
53654
+ *
53655
+ * @private
53656
+ * @param {string} path The path of the property to get.
53657
+ * @param {*} srcValue The value to match.
53658
+ * @returns {Function} Returns the new spec function.
53659
+ */
53660
+
53661
+ function baseMatchesProperty$1(path, srcValue) {
53662
+ if (isKey$1(path) && isStrictComparable(srcValue)) {
53663
+ return matchesStrictComparable(toKey$1(path), srcValue);
53664
+ }
53665
+
53666
+ return function (object) {
53667
+ var objValue = get(object, path);
53668
+ return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
53669
+ };
53670
+ }
53671
+
53672
+ var _baseMatchesProperty = baseMatchesProperty$1;
53673
+
53674
+ /**
53675
+ * This method returns the first argument it receives.
53676
+ *
53677
+ * @static
53678
+ * @since 0.1.0
53679
+ * @memberOf _
53680
+ * @category Util
53681
+ * @param {*} value Any value.
53682
+ * @returns {*} Returns `value`.
53683
+ * @example
53684
+ *
53685
+ * var object = { 'a': 1 };
53686
+ *
53687
+ * console.log(_.identity(object) === object);
53688
+ * // => true
53689
+ */
53690
+
53691
+ function identity$1(value) {
53692
+ return value;
53693
+ }
53694
+
53695
+ var identity_1 = identity$1;
53696
+
53697
+ /**
53698
+ * The base implementation of `_.property` without support for deep paths.
53699
+ *
53700
+ * @private
53701
+ * @param {string} key The key of the property to get.
53702
+ * @returns {Function} Returns the new accessor function.
53703
+ */
53704
+
53705
+ function baseProperty$1(key) {
53706
+ return function (object) {
53707
+ return object == null ? undefined : object[key];
53708
+ };
53709
+ }
53710
+
53711
+ var _baseProperty = baseProperty$1;
53712
+
53713
+ var baseGet = _baseGet;
53714
+ /**
53715
+ * A specialized version of `baseProperty` which supports deep paths.
53716
+ *
53717
+ * @private
53718
+ * @param {Array|string} path The path of the property to get.
53719
+ * @returns {Function} Returns the new accessor function.
53720
+ */
53721
+
53722
+ function basePropertyDeep$1(path) {
53723
+ return function (object) {
53724
+ return baseGet(object, path);
53725
+ };
53726
+ }
53727
+
53728
+ var _basePropertyDeep = basePropertyDeep$1;
53729
+
53730
+ var baseProperty = _baseProperty,
53731
+ basePropertyDeep = _basePropertyDeep,
53732
+ isKey = _isKey,
53733
+ toKey = _toKey;
53734
+ /**
53735
+ * Creates a function that returns the value at `path` of a given object.
53736
+ *
53737
+ * @static
53738
+ * @memberOf _
53739
+ * @since 2.4.0
53740
+ * @category Util
53741
+ * @param {Array|string} path The path of the property to get.
53742
+ * @returns {Function} Returns the new accessor function.
53743
+ * @example
53744
+ *
53745
+ * var objects = [
53746
+ * { 'a': { 'b': 2 } },
53747
+ * { 'a': { 'b': 1 } }
53748
+ * ];
53749
+ *
53750
+ * _.map(objects, _.property('a.b'));
53751
+ * // => [2, 1]
53752
+ *
53753
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
53754
+ * // => [1, 2]
53755
+ */
53756
+
53757
+ function property$1(path) {
53758
+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
53759
+ }
53760
+
53761
+ var property_1 = property$1;
53762
+
53763
+ var baseMatches = _baseMatches,
53764
+ baseMatchesProperty = _baseMatchesProperty,
53765
+ identity = identity_1,
53766
+ isArray = isArray_1,
53767
+ property = property_1;
53768
+ /**
53769
+ * The base implementation of `_.iteratee`.
53770
+ *
53771
+ * @private
53772
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
53773
+ * @returns {Function} Returns the iteratee.
53774
+ */
53775
+
53776
+ function baseIteratee$1(value) {
53777
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
53778
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
53779
+ if (typeof value == 'function') {
53780
+ return value;
53781
+ }
53782
+
53783
+ if (value == null) {
53784
+ return identity;
53785
+ }
53786
+
53787
+ if (_typeof(value) == 'object') {
53788
+ return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
53789
+ }
53790
+
53791
+ return property(value);
53792
+ }
53793
+
53794
+ var _baseIteratee = baseIteratee$1;
53795
+
53796
+ var baseExtremum = _baseExtremum,
53797
+ baseGt = _baseGt,
53798
+ baseIteratee = _baseIteratee;
53799
+ /**
53800
+ * This method is like `_.max` except that it accepts `iteratee` which is
53801
+ * invoked for each element in `array` to generate the criterion by which
53802
+ * the value is ranked. The iteratee is invoked with one argument: (value).
53803
+ *
53804
+ * @static
53805
+ * @memberOf _
53806
+ * @since 4.0.0
53807
+ * @category Math
53808
+ * @param {Array} array The array to iterate over.
53809
+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
53810
+ * @returns {*} Returns the maximum value.
53811
+ * @example
53812
+ *
53813
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
53814
+ *
53815
+ * _.maxBy(objects, function(o) { return o.n; });
53816
+ * // => { 'n': 2 }
53817
+ *
53818
+ * // The `_.property` iteratee shorthand.
53819
+ * _.maxBy(objects, 'n');
53820
+ * // => { 'n': 2 }
53821
+ */
53822
+
53823
+ function maxBy(array, iteratee) {
53824
+ return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : undefined;
53825
+ }
53826
+
53827
+ var maxBy_1 = maxBy;
53828
+
53829
+ var THREE_SECONDS = 3000;
53830
+ var MAX_TRIES = 3;
53831
+ /** Check if the user's primary creator node is healthy */
53832
+
53833
+ var checkPrimaryHealthy = /*#__PURE__*/function () {
53834
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(libs, primary, tries) {
53835
+ var healthy;
53836
+ return regeneratorRuntime.wrap(function _callee$(_context) {
53837
+ while (1) {
53838
+ switch (_context.prev = _context.next) {
53839
+ case 0:
53840
+ _context.next = 2;
53841
+ return Utils.isHealthy(primary);
53842
+
53843
+ case 2:
53844
+ healthy = _context.sent;
53845
+
53846
+ if (!healthy) {
53847
+ _context.next = 7;
53848
+ break;
53849
+ }
53850
+
53851
+ return _context.abrupt("return", healthy);
53852
+
53853
+ case 7:
53854
+ if (!(tries === 0)) {
53855
+ _context.next = 9;
53856
+ break;
53857
+ }
53858
+
53859
+ return _context.abrupt("return", false);
53860
+
53861
+ case 9:
53862
+ _context.next = 11;
53863
+ return Utils.wait(THREE_SECONDS);
53864
+
53865
+ case 11:
53866
+ _context.next = 13;
53867
+ return checkPrimaryHealthy(libs, primary, tries - 1);
53868
+
53869
+ case 13:
53870
+ return _context.abrupt("return", _context.sent);
53871
+
53872
+ case 14:
53873
+ case "end":
53874
+ return _context.stop();
53875
+ }
53876
+ }
53877
+ }, _callee);
53878
+ }));
53879
+
53880
+ return function checkPrimaryHealthy(_x, _x2, _x3) {
53881
+ return _ref.apply(this, arguments);
53882
+ };
53883
+ }();
53884
+ /** Gets new endpoints from a user's secondaries */
53885
+
53886
+
53887
+ var getNewPrimary = /*#__PURE__*/function () {
53888
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(secondaries, wallet) {
53889
+ var _maxBy;
53890
+
53891
+ var secondaryStatuses, max;
53892
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
53893
+ while (1) {
53894
+ switch (_context3.prev = _context3.next) {
53895
+ case 0:
53896
+ _context3.next = 2;
53897
+ return Promise.all(secondaries.map( /*#__PURE__*/function () {
53898
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(secondary) {
53899
+ var clockValue;
53900
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
53901
+ while (1) {
53902
+ switch (_context2.prev = _context2.next) {
53903
+ case 0:
53904
+ _context2.prev = 0;
53905
+ _context2.next = 3;
53906
+ return CreatorNode.getClockValue(secondary, wallet);
53907
+
53908
+ case 3:
53909
+ clockValue = _context2.sent;
53910
+
53911
+ if (!clockValue) {
53912
+ _context2.next = 6;
53913
+ break;
53914
+ }
53915
+
53916
+ return _context2.abrupt("return", {
53917
+ secondary: secondary,
53918
+ clockValue: clockValue
53919
+ });
53920
+
53921
+ case 6:
53922
+ return _context2.abrupt("return", undefined);
53923
+
53924
+ case 9:
53925
+ _context2.prev = 9;
53926
+ _context2.t0 = _context2["catch"](0);
53927
+ console.warn(_context2.t0);
53928
+ return _context2.abrupt("return", undefined);
53929
+
53930
+ case 13:
53931
+ case "end":
53932
+ return _context2.stop();
53933
+ }
53934
+ }
53935
+ }, _callee2, null, [[0, 9]]);
53936
+ }));
53937
+
53938
+ return function (_x6) {
53939
+ return _ref3.apply(this, arguments);
53940
+ };
53941
+ }()));
53942
+
53943
+ case 2:
53944
+ secondaryStatuses = _context3.sent.filter(Boolean);
53945
+ max = (_maxBy = maxBy_1(secondaryStatuses, function (s) {
53946
+ return s === null || s === void 0 ? void 0 : s.clockValue;
53947
+ })) === null || _maxBy === void 0 ? void 0 : _maxBy.secondary;
53948
+
53949
+ if (max) {
53950
+ _context3.next = 6;
53951
+ break;
53952
+ }
53953
+
53954
+ throw new Error("Could not find valid secondaries for user ".concat(secondaries));
53955
+
53956
+ case 6:
53957
+ return _context3.abrupt("return", max);
53958
+
53959
+ case 7:
53960
+ case "end":
53961
+ return _context3.stop();
53962
+ }
53963
+ }
53964
+ }, _callee3);
53965
+ }));
53966
+
53967
+ return function getNewPrimary(_x4, _x5) {
53968
+ return _ref2.apply(this, arguments);
53969
+ };
53970
+ }();
53971
+
53972
+ var rolloverNodes = /*#__PURE__*/function () {
53973
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(libs, creatorNodeWhitelist, creatorNodeBlacklist) {
53974
+ var _libs$userStateManage;
53975
+
53976
+ var user, primary, healthy, secondaries, _libs$ServiceProvider, _libs$User, _libs$User2, _libs$creatorNode, _libs$User3, newPrimary, index, newSecondaries, autoselect, newEndpoints, newMetadata;
53977
+
53978
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
53979
+ while (1) {
53980
+ switch (_context4.prev = _context4.next) {
53981
+ case 0:
53982
+ console.debug('Sanity Check - rolloverNodes');
53983
+ user = (_libs$userStateManage = libs.userStateManager) === null || _libs$userStateManage === void 0 ? void 0 : _libs$userStateManage.getCurrentUser();
53984
+
53985
+ if (user) {
53986
+ _context4.next = 4;
53987
+ break;
53988
+ }
53989
+
53990
+ return _context4.abrupt("return");
53991
+
53992
+ case 4:
53993
+ primary = CreatorNode.getPrimary(user.creator_node_endpoint);
53994
+
53995
+ if (primary) {
53996
+ _context4.next = 7;
53997
+ break;
53998
+ }
53999
+
54000
+ return _context4.abrupt("return");
54001
+
54002
+ case 7:
54003
+ _context4.next = 9;
54004
+ return checkPrimaryHealthy(libs, primary, MAX_TRIES);
54005
+
54006
+ case 9:
54007
+ healthy = _context4.sent;
54008
+
54009
+ if (!(healthy && !(creatorNodeBlacklist !== null && creatorNodeBlacklist !== void 0 && creatorNodeBlacklist.has(primary)))) {
54010
+ _context4.next = 12;
54011
+ break;
54012
+ }
54013
+
54014
+ return _context4.abrupt("return");
54015
+
54016
+ case 12:
54017
+ secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint);
54018
+ _context4.prev = 13;
54019
+ _context4.next = 16;
54020
+ return getNewPrimary(secondaries, user.wallet);
54021
+
54022
+ case 16:
54023
+ newPrimary = _context4.sent;
54024
+ index = secondaries.indexOf(newPrimary); // Get new secondaries and backfill up to 2
54025
+
54026
+ newSecondaries = _toConsumableArray(secondaries);
54027
+ newSecondaries.splice(index, 1);
54028
+ _context4.next = 22;
54029
+ return (_libs$ServiceProvider = libs.ServiceProvider) === null || _libs$ServiceProvider === void 0 ? void 0 : _libs$ServiceProvider.autoSelectCreatorNodes({
54030
+ numberOfNodes: 2 - newSecondaries.length,
54031
+ whitelist: creatorNodeWhitelist,
54032
+ // Exclude ones we currently have
54033
+ blacklist: new Set([newPrimary].concat(_toConsumableArray(newSecondaries))),
54034
+ preferHigherPatchForPrimary: (_libs$User = libs.User) === null || _libs$User === void 0 ? void 0 : _libs$User.preferHigherPatchForPrimary,
54035
+ preferHigherPatchForSecondaries: (_libs$User2 = libs.User) === null || _libs$User2 === void 0 ? void 0 : _libs$User2.preferHigherPatchForSecondaries
54036
+ });
54037
+
54038
+ case 22:
54039
+ autoselect = _context4.sent;
54040
+
54041
+ if (autoselect) {
54042
+ newSecondaries = newSecondaries.concat([autoselect.primary].concat(_toConsumableArray(autoselect.secondaries)));
54043
+ } // Set the new endpoint and connect to it
54044
+
54045
+
54046
+ newEndpoints = [newPrimary].concat(_toConsumableArray(newSecondaries));
54047
+ _context4.next = 27;
54048
+ return (_libs$creatorNode = libs.creatorNode) === null || _libs$creatorNode === void 0 ? void 0 : _libs$creatorNode.setEndpoint(newEndpoints[0]);
54049
+
54050
+ case 27:
54051
+ // Update the user
54052
+ newMetadata = _objectSpread2({}, user);
54053
+ newMetadata.creator_node_endpoint = newEndpoints.join(',');
54054
+ console.debug("Sanity Check - rolloverNodes - new nodes ".concat(newMetadata.creator_node_endpoint));
54055
+ _context4.next = 32;
54056
+ return (_libs$User3 = libs.User) === null || _libs$User3 === void 0 ? void 0 : _libs$User3.updateCreator(user.user_id, newMetadata, true
54057
+ /* useEntityManager */
54058
+ );
54059
+
54060
+ case 32:
54061
+ _context4.next = 37;
54062
+ break;
54063
+
54064
+ case 34:
54065
+ _context4.prev = 34;
54066
+ _context4.t0 = _context4["catch"](13);
54067
+ console.error(_context4.t0);
54068
+
54069
+ case 37:
54070
+ case "end":
54071
+ return _context4.stop();
54072
+ }
54073
+ }
54074
+ }, _callee4, null, [[13, 34]]);
54075
+ }));
54076
+
54077
+ return function rolloverNodes(_x7, _x8, _x9) {
54078
+ return _ref4.apply(this, arguments);
50893
54079
  };
50894
54080
  }();
50895
54081