immutable 4.1.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -637,6 +637,46 @@ Range(1, Infinity)
637
637
  // 1006008
638
638
  ```
639
639
 
640
+ ## Comparison of filter(), groupBy(), and partition()
641
+
642
+ The `filter()`, `groupBy()`, and `partition()` methods are similar in that they
643
+ all divide a collection into parts based on applying a function to each element.
644
+ All three call the predicate or grouping function once for each item in the
645
+ input collection. All three return zero or more collections of the same type as
646
+ their input. The returned collections are always distinct from the input
647
+ (according to `===`), even if the contents are identical.
648
+
649
+ Of these methods, `filter()` is the only one that is lazy and the only one which
650
+ discards items from the input collection. It is the simplest to use, and the
651
+ fact that it returns exactly one collection makes it easy to combine with other
652
+ methods to form a pipeline of operations.
653
+
654
+ The `partition()` method is similar to an eager version of `filter()`, but it
655
+ returns two collections; the first contains the items that would have been
656
+ discarded by `filter()`, and the second contains the items that would have been
657
+ kept. It always returns an array of exactly two collections, which can make it
658
+ easier to use than `groupBy()`. Compared to making two separate calls to
659
+ `filter()`, `partition()` makes half as many calls it the predicate passed to
660
+ it.
661
+
662
+ The `groupBy()` method is a more generalized version of `partition()` that can
663
+ group by an arbitrary function rather than just a predicate. It returns a map
664
+ with zero or more entries, where the keys are the values returned by the
665
+ grouping function, and the values are nonempty collections of the corresponding
666
+ arguments. Although `groupBy()` is more powerful than `partition()`, it can be
667
+ harder to use because it is not always possible predict in advance how many
668
+ entries the returned map will have and what their keys will be.
669
+
670
+ | Summary | `filter` | `partition` | `groupBy` |
671
+ |:------------------------------|:---------|:------------|:---------------|
672
+ | ease of use | easiest | moderate | hardest |
673
+ | generality | least | moderate | most |
674
+ | laziness | lazy | eager | eager |
675
+ | # of returned sub-collections | 1 | 2 | 0 or more |
676
+ | sub-collections may be empty | yes | yes | no |
677
+ | can discard items | yes | no | no |
678
+ | wrapping container | none | array | Map/OrderedMap |
679
+
640
680
  ## Additional Tools and Resources
641
681
 
642
682
  - [Atom-store](https://github.com/jameshopkins/atom-store/)
@@ -91,6 +91,40 @@
91
91
  */
92
92
 
93
93
  declare namespace Immutable {
94
+ /**
95
+ * @ignore
96
+ *
97
+ * Used to convert deeply all immutable types to a plain TS type.
98
+ * Using `unknown` on object instead of recursive call as we have a circular reference issue
99
+ */
100
+ export type DeepCopy<T> = T extends Record<infer R>
101
+ ? // convert Record to DeepCopy plain JS object
102
+ {
103
+ [key in keyof R]: R[key] extends object ? unknown : R[key];
104
+ }
105
+ : T extends Collection.Keyed<infer KeyedKey, infer V>
106
+ ? // convert KeyedCollection to DeepCopy plain JS object
107
+ {
108
+ [key in KeyedKey extends string | number | symbol
109
+ ? KeyedKey
110
+ : string]: V extends object ? unknown : V;
111
+ }
112
+ : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array
113
+ T extends Collection<infer _, infer V>
114
+ ? Array<V extends object ? unknown : V>
115
+ : T extends string | number // Iterable scalar types : should be kept as is
116
+ ? T
117
+ : T extends Iterable<infer V> // Iterable are converted to plain JS array
118
+ ? Array<V extends object ? unknown : V>
119
+ : T extends object // plain JS object are converted deeply
120
+ ? {
121
+ [ObjectKey in keyof T]: T[ObjectKey] extends object
122
+ ? unknown
123
+ : T[ObjectKey];
124
+ }
125
+ : // other case : should be kept as is
126
+ T;
127
+
94
128
  /**
95
129
  * Lists are ordered indexed dense collections, much like a JavaScript
96
130
  * Array.
@@ -588,6 +622,19 @@ declare namespace Immutable {
588
622
  context?: unknown
589
623
  ): this;
590
624
 
625
+ /**
626
+ * Returns a new List with the values for which the `predicate`
627
+ * function returns false and another for which is returns true.
628
+ */
629
+ partition<F extends T, C>(
630
+ predicate: (this: C, value: T, index: number, iter: this) => value is F,
631
+ context?: C
632
+ ): [List<T>, List<F>];
633
+ partition<C>(
634
+ predicate: (this: C, value: T, index: number, iter: this) => unknown,
635
+ context?: C
636
+ ): [this, this];
637
+
591
638
  /**
592
639
  * Returns a List "zipped" with the provided collection.
593
640
  *
@@ -1406,6 +1453,19 @@ declare namespace Immutable {
1406
1453
  context?: unknown
1407
1454
  ): this;
1408
1455
 
1456
+ /**
1457
+ * Returns a new Map with the values for which the `predicate`
1458
+ * function returns false and another for which is returns true.
1459
+ */
1460
+ partition<F extends V, C>(
1461
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
1462
+ context?: C
1463
+ ): [Map<K, V>, Map<K, F>];
1464
+ partition<C>(
1465
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
1466
+ context?: C
1467
+ ): [this, this];
1468
+
1409
1469
  /**
1410
1470
  * @see Collection.Keyed.flip
1411
1471
  */
@@ -1574,6 +1634,19 @@ declare namespace Immutable {
1574
1634
  context?: unknown
1575
1635
  ): this;
1576
1636
 
1637
+ /**
1638
+ * Returns a new OrderedMap with the values for which the `predicate`
1639
+ * function returns false and another for which is returns true.
1640
+ */
1641
+ partition<F extends V, C>(
1642
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
1643
+ context?: C
1644
+ ): [OrderedMap<K, V>, OrderedMap<K, F>];
1645
+ partition<C>(
1646
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
1647
+ context?: C
1648
+ ): [this, this];
1649
+
1577
1650
  /**
1578
1651
  * @see Collection.Keyed.flip
1579
1652
  */
@@ -1787,6 +1860,19 @@ declare namespace Immutable {
1787
1860
  predicate: (value: T, key: T, iter: this) => unknown,
1788
1861
  context?: unknown
1789
1862
  ): this;
1863
+
1864
+ /**
1865
+ * Returns a new Set with the values for which the `predicate` function
1866
+ * returns false and another for which is returns true.
1867
+ */
1868
+ partition<F extends T, C>(
1869
+ predicate: (this: C, value: T, key: T, iter: this) => value is F,
1870
+ context?: C
1871
+ ): [Set<T>, Set<F>];
1872
+ partition<C>(
1873
+ predicate: (this: C, value: T, key: T, iter: this) => unknown,
1874
+ context?: C
1875
+ ): [this, this];
1790
1876
  }
1791
1877
 
1792
1878
  /**
@@ -1887,6 +1973,19 @@ declare namespace Immutable {
1887
1973
  context?: unknown
1888
1974
  ): this;
1889
1975
 
1976
+ /**
1977
+ * Returns a new OrderedSet with the values for which the `predicate`
1978
+ * function returns false and another for which is returns true.
1979
+ */
1980
+ partition<F extends T, C>(
1981
+ predicate: (this: C, value: T, key: T, iter: this) => value is F,
1982
+ context?: C
1983
+ ): [OrderedSet<T>, OrderedSet<F>];
1984
+ partition<C>(
1985
+ predicate: (this: C, value: T, key: T, iter: this) => unknown,
1986
+ context?: C
1987
+ ): [this, this];
1988
+
1890
1989
  /**
1891
1990
  * Returns an OrderedSet of the same type "zipped" with the provided
1892
1991
  * collections.
@@ -2601,7 +2700,7 @@ declare namespace Immutable {
2601
2700
  * Note: This method may not be overridden. Objects with custom
2602
2701
  * serialization to plain JS may override toJSON() instead.
2603
2702
  */
2604
- toJS(): { [K in keyof TProps]: unknown };
2703
+ toJS(): DeepCopy<TProps>;
2605
2704
 
2606
2705
  /**
2607
2706
  * Shallowly converts this Record to equivalent native JavaScript Object.
@@ -2761,14 +2860,14 @@ declare namespace Immutable {
2761
2860
  *
2762
2861
  * Converts keys to Strings.
2763
2862
  */
2764
- toJS(): { [key: string]: unknown };
2863
+ toJS(): { [key in string | number | symbol]: DeepCopy<V> };
2765
2864
 
2766
2865
  /**
2767
2866
  * Shallowly converts this Keyed Seq to equivalent native JavaScript Object.
2768
2867
  *
2769
2868
  * Converts keys to Strings.
2770
2869
  */
2771
- toJSON(): { [key: string]: V };
2870
+ toJSON(): { [key in string | number | symbol]: V };
2772
2871
 
2773
2872
  /**
2774
2873
  * Shallowly converts this collection to an Array.
@@ -2857,6 +2956,19 @@ declare namespace Immutable {
2857
2956
  context?: unknown
2858
2957
  ): this;
2859
2958
 
2959
+ /**
2960
+ * Returns a new keyed Seq with the values for which the `predicate`
2961
+ * function returns false and another for which is returns true.
2962
+ */
2963
+ partition<F extends V, C>(
2964
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
2965
+ context?: C
2966
+ ): [Seq.Keyed<K, V>, Seq.Keyed<K, F>];
2967
+ partition<C>(
2968
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
2969
+ context?: C
2970
+ ): [this, this];
2971
+
2860
2972
  /**
2861
2973
  * @see Collection.Keyed.flip
2862
2974
  */
@@ -2890,7 +3002,7 @@ declare namespace Immutable {
2890
3002
  /**
2891
3003
  * Deeply converts this Indexed Seq to equivalent native JavaScript Array.
2892
3004
  */
2893
- toJS(): Array<unknown>;
3005
+ toJS(): Array<DeepCopy<T>>;
2894
3006
 
2895
3007
  /**
2896
3008
  * Shallowly converts this Indexed Seq to equivalent native JavaScript Array.
@@ -2958,6 +3070,19 @@ declare namespace Immutable {
2958
3070
  context?: unknown
2959
3071
  ): this;
2960
3072
 
3073
+ /**
3074
+ * Returns a new indexed Seq with the values for which the `predicate`
3075
+ * function returns false and another for which is returns true.
3076
+ */
3077
+ partition<F extends T, C>(
3078
+ predicate: (this: C, value: T, index: number, iter: this) => value is F,
3079
+ context?: C
3080
+ ): [Seq.Indexed<T>, Seq.Indexed<F>];
3081
+ partition<C>(
3082
+ predicate: (this: C, value: T, index: number, iter: this) => unknown,
3083
+ context?: C
3084
+ ): [this, this];
3085
+
2961
3086
  /**
2962
3087
  * Returns a Seq "zipped" with the provided collections.
2963
3088
  *
@@ -3052,7 +3177,7 @@ declare namespace Immutable {
3052
3177
  /**
3053
3178
  * Deeply converts this Set Seq to equivalent native JavaScript Array.
3054
3179
  */
3055
- toJS(): Array<unknown>;
3180
+ toJS(): Array<DeepCopy<T>>;
3056
3181
 
3057
3182
  /**
3058
3183
  * Shallowly converts this Set Seq to equivalent native JavaScript Array.
@@ -3120,6 +3245,19 @@ declare namespace Immutable {
3120
3245
  context?: unknown
3121
3246
  ): this;
3122
3247
 
3248
+ /**
3249
+ * Returns a new set Seq with the values for which the `predicate`
3250
+ * function returns false and another for which is returns true.
3251
+ */
3252
+ partition<F extends T, C>(
3253
+ predicate: (this: C, value: T, key: T, iter: this) => value is F,
3254
+ context?: C
3255
+ ): [Seq.Set<T>, Seq.Set<F>];
3256
+ partition<C>(
3257
+ predicate: (this: C, value: T, key: T, iter: this) => unknown,
3258
+ context?: C
3259
+ ): [this, this];
3260
+
3123
3261
  [Symbol.iterator](): IterableIterator<T>;
3124
3262
  }
3125
3263
  }
@@ -3264,6 +3402,19 @@ declare namespace Immutable {
3264
3402
  predicate: (value: V, key: K, iter: this) => unknown,
3265
3403
  context?: unknown
3266
3404
  ): this;
3405
+
3406
+ /**
3407
+ * Returns a new Seq with the values for which the `predicate` function
3408
+ * returns false and another for which is returns true.
3409
+ */
3410
+ partition<F extends V, C>(
3411
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
3412
+ context?: C
3413
+ ): [Seq<K, V>, Seq<K, F>];
3414
+ partition<C>(
3415
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
3416
+ context?: C
3417
+ ): [this, this];
3267
3418
  }
3268
3419
 
3269
3420
  /**
@@ -3336,14 +3487,14 @@ declare namespace Immutable {
3336
3487
  *
3337
3488
  * Converts keys to Strings.
3338
3489
  */
3339
- toJS(): { [key: string]: unknown };
3490
+ toJS(): { [key in string | number | symbol]: DeepCopy<V> };
3340
3491
 
3341
3492
  /**
3342
3493
  * Shallowly converts this Keyed collection to equivalent native JavaScript Object.
3343
3494
  *
3344
3495
  * Converts keys to Strings.
3345
3496
  */
3346
- toJSON(): { [key: string]: V };
3497
+ toJSON(): { [key in string | number | symbol]: V };
3347
3498
 
3348
3499
  /**
3349
3500
  * Shallowly converts this collection to an Array.
@@ -3470,6 +3621,20 @@ declare namespace Immutable {
3470
3621
  context?: unknown
3471
3622
  ): this;
3472
3623
 
3624
+ /**
3625
+ * Returns a new keyed Collection with the values for which the
3626
+ * `predicate` function returns false and another for which is returns
3627
+ * true.
3628
+ */
3629
+ partition<F extends V, C>(
3630
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
3631
+ context?: C
3632
+ ): [Collection.Keyed<K, V>, Collection.Keyed<K, F>];
3633
+ partition<C>(
3634
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
3635
+ context?: C
3636
+ ): [this, this];
3637
+
3473
3638
  [Symbol.iterator](): IterableIterator<[K, V]>;
3474
3639
  }
3475
3640
 
@@ -3504,7 +3669,7 @@ declare namespace Immutable {
3504
3669
  /**
3505
3670
  * Deeply converts this Indexed collection to equivalent native JavaScript Array.
3506
3671
  */
3507
- toJS(): Array<unknown>;
3672
+ toJS(): Array<DeepCopy<T>>;
3508
3673
 
3509
3674
  /**
3510
3675
  * Shallowly converts this Indexed collection to equivalent native JavaScript Array.
@@ -3767,6 +3932,20 @@ declare namespace Immutable {
3767
3932
  context?: unknown
3768
3933
  ): this;
3769
3934
 
3935
+ /**
3936
+ * Returns a new indexed Collection with the values for which the
3937
+ * `predicate` function returns false and another for which is returns
3938
+ * true.
3939
+ */
3940
+ partition<F extends T, C>(
3941
+ predicate: (this: C, value: T, index: number, iter: this) => value is F,
3942
+ context?: C
3943
+ ): [Collection.Indexed<T>, Collection.Indexed<F>];
3944
+ partition<C>(
3945
+ predicate: (this: C, value: T, index: number, iter: this) => unknown,
3946
+ context?: C
3947
+ ): [this, this];
3948
+
3770
3949
  [Symbol.iterator](): IterableIterator<T>;
3771
3950
  }
3772
3951
 
@@ -3801,7 +3980,7 @@ declare namespace Immutable {
3801
3980
  /**
3802
3981
  * Deeply converts this Set collection to equivalent native JavaScript Array.
3803
3982
  */
3804
- toJS(): Array<unknown>;
3983
+ toJS(): Array<DeepCopy<T>>;
3805
3984
 
3806
3985
  /**
3807
3986
  * Shallowly converts this Set collection to equivalent native JavaScript Array.
@@ -3869,6 +4048,20 @@ declare namespace Immutable {
3869
4048
  context?: unknown
3870
4049
  ): this;
3871
4050
 
4051
+ /**
4052
+ * Returns a new set Collection with the values for which the
4053
+ * `predicate` function returns false and another for which is returns
4054
+ * true.
4055
+ */
4056
+ partition<F extends T, C>(
4057
+ predicate: (this: C, value: T, key: T, iter: this) => value is F,
4058
+ context?: C
4059
+ ): [Collection.Set<T>, Collection.Set<F>];
4060
+ partition<C>(
4061
+ predicate: (this: C, value: T, key: T, iter: this) => unknown,
4062
+ context?: C
4063
+ ): [this, this];
4064
+
3872
4065
  [Symbol.iterator](): IterableIterator<T>;
3873
4066
  }
3874
4067
  }
@@ -4049,7 +4242,9 @@ declare namespace Immutable {
4049
4242
  * `Collection.Indexed`, and `Collection.Set` become `Array`, while
4050
4243
  * `Collection.Keyed` become `Object`, converting keys to Strings.
4051
4244
  */
4052
- toJS(): Array<unknown> | { [key: string]: unknown };
4245
+ toJS():
4246
+ | Array<DeepCopy<V>>
4247
+ | { [key in string | number | symbol]: DeepCopy<V> };
4053
4248
 
4054
4249
  /**
4055
4250
  * Shallowly converts this Collection to equivalent native JavaScript Array or Object.
@@ -4057,7 +4252,7 @@ declare namespace Immutable {
4057
4252
  * `Collection.Indexed`, and `Collection.Set` become `Array`, while
4058
4253
  * `Collection.Keyed` become `Object`, converting keys to Strings.
4059
4254
  */
4060
- toJSON(): Array<V> | { [key: string]: V };
4255
+ toJSON(): Array<V> | { [key in string | number | symbol]: V };
4061
4256
 
4062
4257
  /**
4063
4258
  * Shallowly converts this collection to an Array.
@@ -4299,6 +4494,19 @@ declare namespace Immutable {
4299
4494
  context?: unknown
4300
4495
  ): this;
4301
4496
 
4497
+ /**
4498
+ * Returns a new Collection with the values for which the `predicate`
4499
+ * function returns false and another for which is returns true.
4500
+ */
4501
+ partition<F extends V, C>(
4502
+ predicate: (this: C, value: V, key: K, iter: this) => value is F,
4503
+ context?: C
4504
+ ): [Collection<K, V>, Collection<K, F>];
4505
+ partition<C>(
4506
+ predicate: (this: C, value: V, key: K, iter: this) => unknown,
4507
+ context?: C
4508
+ ): [this, this];
4509
+
4302
4510
  /**
4303
4511
  * Returns a new Collection of the same type in reverse order.
4304
4512
  */
@@ -1410,6 +1410,18 @@ function groupByFactory(collection, grouper, context) {
1410
1410
  return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable();
1411
1411
  }
1412
1412
 
1413
+ function partitionFactory(collection, predicate, context) {
1414
+ var isKeyedIter = isKeyed(collection);
1415
+ var groups = [[], []];
1416
+ collection.__iterate(function (v, k) {
1417
+ groups[predicate.call(context, v, k, collection) ? 1 : 0].push(
1418
+ isKeyedIter ? [k, v] : v
1419
+ );
1420
+ });
1421
+ var coerce = collectionClass(collection);
1422
+ return groups.map(function (arr) { return reify(collection, coerce(arr)); });
1423
+ }
1424
+
1413
1425
  function sliceFactory(collection, begin, end, useKeys) {
1414
1426
  var originalSize = collection.size;
1415
1427
 
@@ -4407,7 +4419,11 @@ var Set = /*@__PURE__*/(function (SetCollection) {
4407
4419
  }
4408
4420
  return this.withMutations(function (set) {
4409
4421
  for (var ii = 0; ii < iters.length; ii++) {
4410
- SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
4422
+ if (typeof iters[ii] === 'string') {
4423
+ set.add(iters[ii]);
4424
+ } else {
4425
+ SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
4426
+ }
4411
4427
  }
4412
4428
  });
4413
4429
  };
@@ -4844,6 +4860,10 @@ mixin(Collection, {
4844
4860
  return reify(this, filterFactory(this, predicate, context, true));
4845
4861
  },
4846
4862
 
4863
+ partition: function partition(predicate, context) {
4864
+ return partitionFactory(this, predicate, context);
4865
+ },
4866
+
4847
4867
  find: function find(predicate, context, notSetValue) {
4848
4868
  var entry = this.findEntry(predicate, context);
4849
4869
  return entry ? entry[1] : notSetValue;
@@ -5866,7 +5886,7 @@ function defaultConverter(k, v) {
5866
5886
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5867
5887
  }
5868
5888
 
5869
- var version = "4.1.0";
5889
+ var version = "4.2.2";
5870
5890
 
5871
5891
  var Immutable = {
5872
5892
  version: version,
package/dist/immutable.js CHANGED
@@ -1416,6 +1416,18 @@
1416
1416
  return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable();
1417
1417
  }
1418
1418
 
1419
+ function partitionFactory(collection, predicate, context) {
1420
+ var isKeyedIter = isKeyed(collection);
1421
+ var groups = [[], []];
1422
+ collection.__iterate(function (v, k) {
1423
+ groups[predicate.call(context, v, k, collection) ? 1 : 0].push(
1424
+ isKeyedIter ? [k, v] : v
1425
+ );
1426
+ });
1427
+ var coerce = collectionClass(collection);
1428
+ return groups.map(function (arr) { return reify(collection, coerce(arr)); });
1429
+ }
1430
+
1419
1431
  function sliceFactory(collection, begin, end, useKeys) {
1420
1432
  var originalSize = collection.size;
1421
1433
 
@@ -4413,7 +4425,11 @@
4413
4425
  }
4414
4426
  return this.withMutations(function (set) {
4415
4427
  for (var ii = 0; ii < iters.length; ii++) {
4416
- SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
4428
+ if (typeof iters[ii] === 'string') {
4429
+ set.add(iters[ii]);
4430
+ } else {
4431
+ SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
4432
+ }
4417
4433
  }
4418
4434
  });
4419
4435
  };
@@ -4850,6 +4866,10 @@
4850
4866
  return reify(this, filterFactory(this, predicate, context, true));
4851
4867
  },
4852
4868
 
4869
+ partition: function partition(predicate, context) {
4870
+ return partitionFactory(this, predicate, context);
4871
+ },
4872
+
4853
4873
  find: function find(predicate, context, notSetValue) {
4854
4874
  var entry = this.findEntry(predicate, context);
4855
4875
  return entry ? entry[1] : notSetValue;
@@ -5872,7 +5892,7 @@
5872
5892
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5873
5893
  }
5874
5894
 
5875
- var version = "4.1.0";
5895
+ var version = "4.2.2";
5876
5896
 
5877
5897
  var Immutable = {
5878
5898
  version: version,
@@ -332,6 +332,11 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
332
332
  context?: mixed
333
333
  ): KeyedCollection<K, V>;
334
334
 
335
+ partition(
336
+ predicate: (value: V, key: K, iter: this) => mixed,
337
+ context?: mixed
338
+ ): [this, this];
339
+
335
340
  map<M>(
336
341
  mapper: (value: V, key: K, iter: this) => M,
337
342
  context?: mixed
@@ -484,6 +489,11 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
484
489
  context?: mixed
485
490
  ): IndexedCollection<T>;
486
491
 
492
+ partition(
493
+ predicate: (value: T, index: number, iter: this) => mixed,
494
+ context?: mixed
495
+ ): [this, this];
496
+
487
497
  map<M>(
488
498
  mapper: (value: T, index: number, iter: this) => M,
489
499
  context?: mixed
@@ -519,6 +529,11 @@ declare class SetCollection<+T> extends Collection<T, T> {
519
529
  context?: mixed
520
530
  ): SetCollection<T>;
521
531
 
532
+ partition(
533
+ predicate: (value: T, value: T, iter: this) => mixed,
534
+ context?: mixed
535
+ ): [this, this];
536
+
522
537
  map<M>(
523
538
  mapper: (value: T, value: T, iter: this) => M,
524
539
  context?: mixed
@@ -570,6 +585,11 @@ declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
570
585
  context?: mixed
571
586
  ): KeyedSeq<K, V>;
572
587
 
588
+ partition(
589
+ predicate: (value: V, key: K, iter: this) => mixed,
590
+ context?: mixed
591
+ ): [this, this];
592
+
573
593
  map<M>(
574
594
  mapper: (value: V, key: K, iter: this) => M,
575
595
  context?: mixed
@@ -612,6 +632,11 @@ declare class IndexedSeq<+T>
612
632
  context?: mixed
613
633
  ): IndexedSeq<T>;
614
634
 
635
+ partition(
636
+ predicate: (value: T, index: number, iter: this) => mixed,
637
+ context?: mixed
638
+ ): [this, this];
639
+
615
640
  map<M>(
616
641
  mapper: (value: T, index: number, iter: this) => M,
617
642
  context?: mixed
@@ -729,6 +754,11 @@ declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
729
754
  context?: mixed
730
755
  ): SetSeq<T>;
731
756
 
757
+ partition(
758
+ predicate: (value: T, value: T, iter: this) => mixed,
759
+ context?: mixed
760
+ ): [this, this];
761
+
732
762
  map<M>(
733
763
  mapper: (value: T, value: T, iter: this) => M,
734
764
  context?: mixed
@@ -949,6 +979,11 @@ declare class List<+T>
949
979
  context?: mixed
950
980
  ): List<T>;
951
981
 
982
+ partition(
983
+ predicate: (value: T, index: number, iter: this) => mixed,
984
+ context?: mixed
985
+ ): [this, this];
986
+
952
987
  map<M>(
953
988
  mapper: (value: T, index: number, iter: this) => M,
954
989
  context?: mixed
@@ -1124,6 +1159,11 @@ declare class Map<K, +V>
1124
1159
  context?: mixed
1125
1160
  ): Map<K, V>;
1126
1161
 
1162
+ partition(
1163
+ predicate: (value: V, key: K, iter: this) => mixed,
1164
+ context?: mixed
1165
+ ): [this, this];
1166
+
1127
1167
  map<M>(
1128
1168
  mapper: (value: V, key: K, iter: this) => M,
1129
1169
  context?: mixed
@@ -1221,6 +1261,11 @@ declare class OrderedMap<K, +V>
1221
1261
  context?: mixed
1222
1262
  ): OrderedMap<K, V>;
1223
1263
 
1264
+ partition(
1265
+ predicate: (value: V, key: K, iter: this) => mixed,
1266
+ context?: mixed
1267
+ ): [this, this];
1268
+
1224
1269
  map<M>(
1225
1270
  mapper: (value: V, key: K, iter: this) => M,
1226
1271
  context?: mixed
@@ -1285,6 +1330,11 @@ declare class Set<+T> extends SetCollection<T> {
1285
1330
  context?: mixed
1286
1331
  ): Set<T>;
1287
1332
 
1333
+ partition(
1334
+ predicate: (value: T, value: T, iter: this) => mixed,
1335
+ context?: mixed
1336
+ ): [this, this];
1337
+
1288
1338
  map<M>(
1289
1339
  mapper: (value: T, value: T, iter: this) => M,
1290
1340
  context?: mixed
@@ -1327,6 +1377,11 @@ declare class OrderedSet<+T> extends Set<T> {
1327
1377
  context?: mixed
1328
1378
  ): OrderedSet<T>;
1329
1379
 
1380
+ partition(
1381
+ predicate: (value: T, value: T, iter: this) => mixed,
1382
+ context?: mixed
1383
+ ): [this, this];
1384
+
1330
1385
  map<M>(
1331
1386
  mapper: (value: T, value: T, iter: this) => M,
1332
1387
  context?: mixed
@@ -42,14 +42,14 @@ var n,i=t&&t.array,o=a<r?0:a-r>>e,u=1+(c-r>>e);l<u&&(u=l);return function(){for(
42
42
  t.forEach(function(t,e){return r.set(e,t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){t=this._map.get(t);return void 0!==t?this._list.get(t)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):zr()},e.prototype.set=function(t,e){return br(this,t,e)},e.prototype.remove=function(t){return br(this,t,v)},e.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],r)},t)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Sr(e,r,t,this.__hash):0===this.size?zr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Ke);function Sr(t,e,r,n){var i=Object.create(wr.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function zr(){return mr=mr||Sr(Qe(),pr())}function br(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===v){if(!a)return t;l<=u.size&&2*o.size<=u.size?(n=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):Sr(n,i)}wr.isOrderedMap=ft,wr.prototype[k]=!0,wr.prototype[e]=wr.prototype.remove;var Ir="@@__IMMUTABLE_STACK__@@";function Or(t){return!(!t||!t[Ir])}var Er=function(i){function t(t){return null==t?Dr():Or(t)?t:Dr().pushAll(t)}return i&&(t.__proto__=i),((
43
43
  t.prototype=Object.create(i&&i.prototype)).constructor=t).of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(t,e){var r=this._head;for(t=h(this,t);r&&t--;)r=r.next;return r?r.value:e},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;0<=n;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;if(0===this.size&&Or(t))return t;te(t.size);var e=this.size,r=this._head;return t.__iterate(function(t){e++,r={value:t,next:r}},!0),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Mr(e,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Dr()},t.prototype.slice=function(t,e){if(p(t,e,this.size))return this;var r=y(t,this.size);if(w(e,this.size)!==this.size)return i.prototype.slice.call(this,t,e);for(var e=this.size-r,n=this._head;r--;)n=n.next;return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Mr(e,n)},t.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Mr(this.size,this._head,t,this.__hash):0===this.size?Dr():(this.__ownerID=t,this.__altered=!1,this)},t.prototype.__iterate=function(r,t){var n=this;if(t)return new tt(this.toArray()).__iterate(function(t,e){return r(t,e,n)},t);for(var e=0,i=this._head;i&&!1!==r(i.value,e++,this);)i=i.next;return e},t.prototype.__iterator=function(e,t){if(t)return new tt(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new P(function(){if(n){var t=n.value;return n=n.next,W(e,r++,t)}return N()})},t}(E);Er.isStack=Or;var jr,qr=Er.prototype;function Mr(t,e,r,n){
44
44
  var i=Object.create(qr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Dr(){return jr=jr||Mr(0)}qr[Ir]=!0,qr.shift=qr.pop,qr.unshift=qr.push,qr.unshiftAll=qr.pushAll,qr.withMutations=Ae,qr.wasAltered=Ue,qr.asImmutable=Re,qr["@@transducer/init"]=qr.asMutable=ke,qr["@@transducer/step"]=function(t,e){return t.unshift(e)},qr["@@transducer/result"]=function(t){return t.asImmutable()};var xr="@@__IMMUTABLE_SET__@@";function Ar(t){return!(!t||!t[xr])}function kr(t){return Ar(t)&&R(t)}function Rr(r,t){if(r===t)return!0;if(!f(t)||void 0!==r.size&&void 0!==t.size&&r.size!==t.size||void 0!==r.__hash&&void 0!==t.__hash&&r.__hash!==t.__hash||a(r)!==a(t)||z(r)!==z(t)||R(r)!==R(t))return!1;if(0===r.size&&0===t.size)return!0;var n=!b(r);if(R(r)){var i=r.entries();return t.every(function(t,e){var r=i.next().value;return r&&_t(r[1],t)&&(n||_t(r[0],e))})&&i.next().done}var e,o=!1;void 0===r.size&&(void 0===t.size?"function"==typeof r.cacheResult&&r.cacheResult():(o=!0,e=r,r=t,t=e));var u=!0,t=t.__iterate(function(t,e){if(n?!r.has(t):o?!_t(t,r.get(e,v)):!_t(r.get(e,v),t))return u=!1});return u&&r.size===t}function Ur(e,r){function t(t){e.prototype[t]=r[t]}return Object.keys(r).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(r).forEach(t),e}function Kr(t){if(!t||"object"!=typeof t)return t;if(!f(t)){if(!ie(t))return t;t=F(t)}if(a(t)){var r={};return t.__iterate(function(t,e){r[e]=Kr(t)}),r}var e=[];return t.__iterate(function(t){e.push(Kr(t))}),e}var Tr=function(n){function e(r){return null==r?Wr():Ar(r)&&!R(r)?r:Wr().withMutations(function(e){var t=n(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.intersect=function(t){return(t=I(t).toArray()).length?Lr.intersect.apply(e(t.pop()),t):Wr()},e.union=function(t){return(t=I(t).toArray()).length?Lr.union.apply(e(t.pop()),t):Wr()},
45
- e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Br(this,this._map.set(t,t))},e.prototype.remove=function(t){return Br(this,this._map.remove(t))},e.prototype.clear=function(){return Br(this,this._map.clear())},e.prototype.map=function(r,n){var i=this,o=!1,t=Br(this,this._map.mapEntries(function(t){var e=t[1],t=r.call(n,e,e,i);return t!==e&&(o=!0),[t,t]},n));return o?t:this},e.prototype.union=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return 0===(r=r.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){for(var t=0;t<r.length;t++)n(r[t]).forEach(function(t){return e.add(t)})}):this.constructor(r[0])},e.prototype.intersect=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.every(function(t){return t.includes(e)})||r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.subtract=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.sort=function(t){return an(Wt(this,t))},e.prototype.sortBy=function(t,e){return an(Wt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(j);Tr.isSet=Ar;var Cr,Lr=Tr.prototype;function Br(t,
46
- e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Pr(t,e){var r=Object.create(Lr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Wr(){return Cr=Cr||Pr(Qe())}Lr[xr]=!0,Lr[e]=Lr.remove,Lr.merge=Lr.concat=Lr.union,Lr.withMutations=Ae,Lr.asImmutable=Re,Lr["@@transducer/init"]=Lr.asMutable=ke,Lr["@@transducer/step"]=function(t,e){return t.add(e)},Lr["@@transducer/result"]=function(t){return t.asImmutable()},Lr.__empty=Wr,Lr.__make=Pr;var Nr,Hr=function(t){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if($t(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,1+Math.ceil((e-t)/r-1)),0===this.size){if(Nr)return Nr;Nr=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},n.prototype.get=function(t,e){return this.has(t)?this._start+h(this,t)*this._step:e},n.prototype.includes=function(t){t=(t-this._start)/this._step;return 0<=t&&t<this.size&&t==Math.floor(t)},n.prototype.slice=function(t,e){return p(t,e,this.size)?this:(t=y(t,this.size),(e=w(e,this.size))<=t?new n(0,0):new n(this.get(t,this._end),this.get(e,this._end),this._step))},n.prototype.indexOf=function(t){t-=this._start;if(t%this._step==0){t=t/this._step;if(0<=t&&t<this.size)return t}return-1},n.prototype.lastIndexOf=function(t){return this.indexOf(t)},n.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},n.prototype.__iterator=function(e,r){var n=this.size,i=this._step,o=r?this._start+(n-1)*i:this._start,u=0;return new P(function(){if(u===n)return N();var t=o;return o+=r?-i:i,W(e,r?n-++u:u++,t)})},n.prototype.equals=function(t){
45
+ e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Br(this,this._map.set(t,t))},e.prototype.remove=function(t){return Br(this,this._map.remove(t))},e.prototype.clear=function(){return Br(this,this._map.clear())},e.prototype.map=function(r,n){var i=this,o=!1,t=Br(this,this._map.mapEntries(function(t){var e=t[1],t=r.call(n,e,e,i);return t!==e&&(o=!0),[t,t]},n));return o?t:this},e.prototype.union=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return 0===(r=r.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations(function(e){for(var t=0;t<r.length;t++)"string"==typeof r[t]?e.add(r[t]):n(r[t]).forEach(function(t){return e.add(t)})}):this.constructor(r[0])},e.prototype.intersect=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.every(function(t){return t.includes(e)})||r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.subtract=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return n(t)});var r=[];return this.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.push(e)}),this.withMutations(function(e){r.forEach(function(t){e.remove(t)})})},e.prototype.sort=function(t){return an(Wt(this,t))},e.prototype.sortBy=function(t,e){return an(Wt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate(function(t){return e(t,t,r)},t)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(j);Tr.isSet=Ar
46
+ ;var Cr,Lr=Tr.prototype;function Br(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Pr(t,e){var r=Object.create(Lr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Wr(){return Cr=Cr||Pr(Qe())}Lr[xr]=!0,Lr[e]=Lr.remove,Lr.merge=Lr.concat=Lr.union,Lr.withMutations=Ae,Lr.asImmutable=Re,Lr["@@transducer/init"]=Lr.asMutable=ke,Lr["@@transducer/step"]=function(t,e){return t.add(e)},Lr["@@transducer/result"]=function(t){return t.asImmutable()},Lr.__empty=Wr,Lr.__make=Pr;var Nr,Hr=function(t){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if($t(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,1+Math.ceil((e-t)/r-1)),0===this.size){if(Nr)return Nr;Nr=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},n.prototype.get=function(t,e){return this.has(t)?this._start+h(this,t)*this._step:e},n.prototype.includes=function(t){t=(t-this._start)/this._step;return 0<=t&&t<this.size&&t==Math.floor(t)},n.prototype.slice=function(t,e){return p(t,e,this.size)?this:(t=y(t,this.size),(e=w(e,this.size))<=t?new n(0,0):new n(this.get(t,this._end),this.get(e,this._end),this._step))},n.prototype.indexOf=function(t){t-=this._start;if(t%this._step==0){t=t/this._step;if(0<=t&&t<this.size)return t}return-1},n.prototype.lastIndexOf=function(t){return this.indexOf(t)},n.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},n.prototype.__iterator=function(e,r){var n=this.size,i=this._step,o=r?this._start+(n-1)*i:this._start,u=0;return new P(function(){if(u===n)return N();var t=o;return o+=r?-i:i,W(e,r?n-++u:u++,t)})},n.prototype.equals=function(t){
47
47
  return t instanceof n?this._start===t._start&&this._end===t._end&&this._step===t._step:Rr(this,t)},n}(Z);function Jr(t,e,r){for(var n=ee(e),i=0;i!==n.length;)if((t=se(t,n[i++],v))===v)return r;return t}function Vr(t,e){return Jr(this,t,e)}function Yr(t,e){return Jr(t,e,v)!==v}function Qr(){te(this.size);var r={};return this.__iterate(function(t,e){r[e]=t}),r}I.isIterable=f,I.isKeyed=a,I.isIndexed=z,I.isAssociative=b,I.isOrdered=R,I.Iterator=P,Ur(I,{toArray:function(){te(this.size);var r=Array(this.size||0),n=a(this),i=0;return this.__iterate(function(t,e){r[i++]=n?[e,t]:t}),r},toIndexedSeq:function(){return new At(this)},toJS:function(){return Kr(this)},toKeyedSeq:function(){return new xt(this,!0)},toMap:function(){return Ke(this.toKeyedSeq())},toObject:Qr,toOrderedMap:function(){return wr(this.toKeyedSeq())},toOrderedSet:function(){return an(a(this)?this.valueSeq():this)},toSet:function(){return Tr(a(this)?this.valueSeq():this)},toSetSeq:function(){return new kt(this)},toSeq:function(){return z(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Er(a(this)?this.valueSeq():this)},toList:function(){return ur(a(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Vt(this,function(t,e){var r=a(t);if(0===(e=[t].concat(e).map(function(t){return f(t)?r&&(t=O(t)):t=r?ot(t):ut(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size})).length)return t;if(1===e.length){var n=e[0];if(n===t||r&&a(n)||z(t)&&z(n))return n}return n=new tt(e),r?n=n.toKeyedSeq():z(t)||(n=n.toSetSeq()),(n=n.flatten(!0)).size=e.reduce(function(t,e){if(void 0!==t){e=e.size;if(void 0!==e)return t+e}},0),n}(this,t))},includes:function(e){return this.some(function(t){return _t(t,e)})},entries:function(){return this.__iterator(T)},every:function(n,i){te(this.size);var o=!0
48
- ;return this.__iterate(function(t,e,r){if(!n.call(i,t,e,r))return o=!1}),o},filter:function(t,e){return Vt(this,Ct(this,t,e,!0))},find:function(t,e,r){e=this.findEntry(t,e);return e?e[1]:r},forEach:function(t,e){return te(this.size),this.__iterate(e?t.bind(e):t)},join:function(e){te(this.size),e=void 0!==e?""+e:",";var r="",n=!0;return this.__iterate(function(t){n?n=!1:r+=e,r+=null!=t?""+t:""}),r},keys:function(){return this.__iterator(U)},map:function(t,e){return Vt(this,Kt(this,t,e))},reduce:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Vt(this,Tt(this,!0))},slice:function(t,e){return Vt(this,Lt(this,t,e,!0))},some:function(t,e){return!this.every(rn(t),e)},sort:function(t){return Vt(this,Wt(this,t))},values:function(){return this.__iterator(K)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return r=this,n=t,i=e,o=Ke().asMutable(),r.__iterate(function(t,e){o.update(n.call(i,t,e,r),0,function(t){return t+1})}),o.asImmutable();var r,n,i,o},equals:function(t){return Rr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(en).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(rn(t),e)},findEntry:function(n,i,t){var o=t;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=[e,t])}),o},findKey:function(t,e){e=this.findEntry(t,e);return e&&e[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(r,null,t)},flatMap:function(t,e){return Vt(this,(n=t,i=e,o=Qt(r=this),r.toSeq().map(function(t,e){return o(n.call(i
49
- ,t,e,r))}).flatten(!0)));var r,n,i,o},flatten:function(t){return Vt(this,Pt(this,t,!0))},fromEntrySeq:function(){return new Rt(this)},get:function(r,t){return this.find(function(t,e){return _t(e,r)},void 0,t)},getIn:Vr,groupBy:function(t,e){return function(n,t,i){var o=a(n),u=(R(n)?wr:Ke)().asMutable();n.__iterate(function(e,r){u.update(t.call(i,e,r,n),function(t){return(t=t||[]).push(o?[r,e]:e),t})});var e=Qt(n);return u.map(function(t){return Vt(n,e(t))}).asImmutable()}(this,t,e)},has:function(t){return this.get(t,v)!==v},hasIn:function(t){return Yr(this,t)},isSubset:function(e){return e="function"==typeof e.includes?e:I(e),this.every(function(t){return e.includes(t)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:I(t)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return _t(t,e)})},keySeq:function(){return this.toSeq().map(tn).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Nt(this,t)},maxBy:function(t,e){return Nt(this,e,t)},min:function(t){return Nt(this,t?nn(t):un)},minBy:function(t,e){return Nt(this,e?nn(e):un,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(rn(t),e)},sortBy:function(t,e){return Vt(this,Wt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Vt(this,(s=t,a=e,(e=Xt(r=this)).__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterate(n,t);var o=0;return r.__iterate(function(t,e,r){return s.call(a,t,e,r)&&++o&&n(t,e,i)}),o},e.__iteratorUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterator(n,t);var o=r.__iterator(T,t),u=!0;return new P(function(){if(!u)return N();var t=o.next()
50
- ;if(t.done)return t;var e=t.value,r=e[0],e=e[1];return s.call(a,e,r,i)?n===T?t:W(n,r,e,t):(u=!1,N())})},e));var r,s,a},takeUntil:function(t,e){return this.takeWhile(rn(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=R(t),r=a(t),n=e?1:0;return function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=lt((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+sn(yt(t),yt(e))|0}:function(t,e){n=n+sn(yt(t),yt(e))|0}:e?function(t){n=31*n+yt(t)|0}:function(t){n=n+yt(t)|0}),n)}(this))}});var Xr=I.prototype;Xr[o]=!0,Xr[B]=Xr.values,Xr.toJSON=Xr.toArray,Xr.__toStringMapper=oe,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,Xr.contains=Xr.includes,Ur(O,{flip:function(){return Vt(this,Ut(this))},mapEntries:function(r,n){var i=this,o=0;return Vt(this,this.toSeq().map(function(t,e){return r.call(n,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(r,n){var i=this;return Vt(this,this.toSeq().flip().map(function(t,e){return r.call(n,t,e,i)}).flip())}});var Fr=O.prototype;Fr[s]=!0,Fr[B]=Xr.entries,Fr.toJSON=Qr,Fr.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Ur(E,{toKeyedSeq:function(){return new xt(this,!1)},filter:function(t,e){return Vt(this,Ct(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Vt(this,Tt(this,!1))},slice:function(t,e){return Vt(this,Lt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=y(t,t<0?this.count():this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){
51
- return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size<r?t:this.find(function(t,e){return e===r},void 0,t)},has:function(t){return 0<=(t=h(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:!!~this.indexOf(t))},interpose:function(t){return Vt(this,(u=t,(t=Xt(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(e,t){var r=this,n=0;return o.__iterate(function(t){return(!n||!1!==e(u,n++,r))&&!1!==e(t,n++,r)},t),n},t.__iteratorUncached=function(t,e){var r,n=o.__iterator(K,e),i=0;return new P(function(){return(!r||i%2)&&(r=n.next()).done?r:i%2?W(t,i++,u):W(t,i++,r.value,r)})},t));var o,u},interleave:function(){var t=[this].concat(Zt(arguments)),e=Jt(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Vt(this,r)},keySeq:function(){return Hr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!1))},zip:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t))},zipAll:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t,!0))},zipWith:function(t){var e=Zt(arguments);return Vt(e[0]=this,Jt(this,t,e))}});var Gr=E.prototype;Gr[S]=!0,Gr[k]=!0,Ur(j,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Zr=j.prototype;function $r(t,n,i,o,u,e){return te(t.size),t.__iterate(function(t,e,r){i=u?(u=!1,t):n.call(o,i,t,e,r)},e),i}function tn(t,e){return e}function en(t,e){return[e,t]}function rn(t){return function(){return!t.apply(this,arguments)}}function nn(t){return function(){return-t.apply(this,arguments)}}function on(){return Zt(arguments)}function un(t,e){return t<e?1:e<t?-1:0}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(
52
- r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Tr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i<e.length;i++){var o=e[i];r[o]=i,f[o]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+vn(this)+' with property "'+o+'" since that property name is part of the Record API.'):function(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){$t(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}(f,o)}}return this.__ownerID=void 0,this._values=ur().withMutations(function(r){r.setSize(n._keys.length),O(t).forEach(function(t,e){r.set(n._indices[e],t===n._defaultValues[e]?void 0:t)})}),this},f=c.prototype=Object.create(pn);return f.constructor=c,s&&(c.displayName=s),c};Gr.prototype.toString=function(){for(var t,e=vn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+oe(this.get(t));return e+" }"},
53
- Gr.prototype.equals=function(t){return this===t||x(t)&&yn(this).equals(yn(t))},Gr.prototype.hashCode=function(){return yn(this).hashCode()},Gr.prototype.has=function(t){return this._indices.hasOwnProperty(t)},Gr.prototype.get=function(t,e){if(!this.has(t))return e;e=this._values.get(this._indices[t]);return void 0===e?this._defaultValues[t]:e},Gr.prototype.set=function(t,e){if(this.has(t)){e=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(e!==this._values&&!this.__ownerID)return ln(this,e)}return this},Gr.prototype.remove=function(t){return this.set(t)},Gr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ln(this,t)},Gr.prototype.wasAltered=function(){return this._values.wasAltered()},Gr.prototype.toSeq=function(){return yn(this)},Gr.prototype.toJS=function(){return Kr(this)},Gr.prototype.entries=function(){return this.__iterator(T)},Gr.prototype.__iterator=function(t,e){return yn(this).__iterator(t,e)},Gr.prototype.__iterate=function(t,e){return yn(this).__iterate(t,e)},Gr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ln(this,e,t):(this.__ownerID=t,this._values=e,this)},Gr.isRecord=x,Gr.getDescriptiveName=vn;var pn=Gr.prototype;function ln(t,e,r){t=Object.create(Object.getPrototypeOf(t));return t._values=e,t.__ownerID=r,t}function vn(t){return t.constructor.displayName||t.constructor.name||"Record"}function yn(e){return ot(e._keys.map(function(t){return[t,e.get(t)]}))}pn[D]=!0,pn[e]=pn.remove,pn.deleteIn=pn.removeIn=ve,pn.getIn=Vr,pn.hasIn=Xr.hasIn,pn.merge=me,pn.mergeWith=we,pn.mergeIn=De,pn.mergeDeep=qe,pn.mergeDeepWith=Me,pn.mergeDeepIn=xe,pn.setIn=pe,pn.update=de,pn.updateIn=ge,pn.withMutations=Ae,pn.asMutable=ke,pn.asImmutable=Re,pn[B]=pn.entries,pn.toJSON=pn.toObject=Xr.toObject,pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0
54
- ,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.1.0",Collection:I,Iterable:I,Seq:F,Map:Ke,OrderedMap:wr,List:ur,Stack:Er,Set:Tr,OrderedSet:an,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Ke,t.OrderedMap=wr,t.OrderedSet=an,t.Range=Hr,
55
- t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Tr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.1.0",Object.defineProperty(t,"__esModule",{value:!0})});
48
+ ;return this.__iterate(function(t,e,r){if(!n.call(i,t,e,r))return o=!1}),o},filter:function(t,e){return Vt(this,Ct(this,t,e,!0))},partition:function(t,e){return function(r,n,i){var o=a(r),u=[[],[]];r.__iterate(function(t,e){u[n.call(i,t,e,r)?1:0].push(o?[e,t]:t)});var e=Qt(r);return u.map(function(t){return Vt(r,e(t))})}(this,t,e)},find:function(t,e,r){e=this.findEntry(t,e);return e?e[1]:r},forEach:function(t,e){return te(this.size),this.__iterate(e?t.bind(e):t)},join:function(e){te(this.size),e=void 0!==e?""+e:",";var r="",n=!0;return this.__iterate(function(t){n?n=!1:r+=e,r+=null!=t?""+t:""}),r},keys:function(){return this.__iterator(U)},map:function(t,e){return Vt(this,Kt(this,t,e))},reduce:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return $r(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Vt(this,Tt(this,!0))},slice:function(t,e){return Vt(this,Lt(this,t,e,!0))},some:function(t,e){return!this.every(rn(t),e)},sort:function(t){return Vt(this,Wt(this,t))},values:function(){return this.__iterator(K)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return r=this,n=t,i=e,o=Ke().asMutable(),r.__iterate(function(t,e){o.update(n.call(i,t,e,r),0,function(t){return t+1})}),o.asImmutable();var r,n,i,o},equals:function(t){return Rr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(en).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(rn(t),e)},findEntry:function(n,i,t){var o=t;return this.__iterate(function(t,e,r){if(n.call(i,t,e,r))return!(o=[e,t])}),o},findKey:function(t,e){e=this.findEntry(t,e);return e&&e[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(
49
+ t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(r,null,t)},flatMap:function(t,e){return Vt(this,(n=t,i=e,o=Qt(r=this),r.toSeq().map(function(t,e){return o(n.call(i,t,e,r))}).flatten(!0)));var r,n,i,o},flatten:function(t){return Vt(this,Pt(this,t,!0))},fromEntrySeq:function(){return new Rt(this)},get:function(r,t){return this.find(function(t,e){return _t(e,r)},void 0,t)},getIn:Vr,groupBy:function(t,e){return function(n,t,i){var o=a(n),u=(R(n)?wr:Ke)().asMutable();n.__iterate(function(e,r){u.update(t.call(i,e,r,n),function(t){return(t=t||[]).push(o?[r,e]:e),t})});var e=Qt(n);return u.map(function(t){return Vt(n,e(t))}).asImmutable()}(this,t,e)},has:function(t){return this.get(t,v)!==v},hasIn:function(t){return Yr(this,t)},isSubset:function(e){return e="function"==typeof e.includes?e:I(e),this.every(function(t){return e.includes(t)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:I(t)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return _t(t,e)})},keySeq:function(){return this.toSeq().map(tn).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Nt(this,t)},maxBy:function(t,e){return Nt(this,e,t)},min:function(t){return Nt(this,t?nn(t):un)},minBy:function(t,e){return Nt(this,e?nn(e):un,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(rn(t),e)},sortBy:function(t,e){return Vt(this,Wt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Vt(this,(s=t,a=e,(e=Xt(r=this)).__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterate(n,t);var o=0;return r.__iterate(function(t,e,r){return s.call(a,
50
+ t,e,r)&&++o&&n(t,e,i)}),o},e.__iteratorUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterator(n,t);var o=r.__iterator(T,t),u=!0;return new P(function(){if(!u)return N();var t=o.next();if(t.done)return t;var e=t.value,r=e[0],e=e[1];return s.call(a,e,r,i)?n===T?t:W(n,r,e,t):(u=!1,N())})},e));var r,s,a},takeUntil:function(t,e){return this.takeWhile(rn(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=R(t),r=a(t),n=e?1:0;return function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=lt((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+sn(yt(t),yt(e))|0}:function(t,e){n=n+sn(yt(t),yt(e))|0}:e?function(t){n=31*n+yt(t)|0}:function(t){n=n+yt(t)|0}),n)}(this))}});var Xr=I.prototype;Xr[o]=!0,Xr[B]=Xr.values,Xr.toJSON=Xr.toArray,Xr.__toStringMapper=oe,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,Xr.contains=Xr.includes,Ur(O,{flip:function(){return Vt(this,Ut(this))},mapEntries:function(r,n){var i=this,o=0;return Vt(this,this.toSeq().map(function(t,e){return r.call(n,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(r,n){var i=this;return Vt(this,this.toSeq().flip().map(function(t,e){return r.call(n,t,e,i)}).flip())}});var Fr=O.prototype;Fr[s]=!0,Fr[B]=Xr.entries,Fr.toJSON=Qr,Fr.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Ur(E,{toKeyedSeq:function(){return new xt(this,!1)},filter:function(t,e){return Vt(this,Ct(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Vt(this,Tt(this,!1))},slice:function(t,e){return Vt(this,Lt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=y(t,t<0?this.count(
51
+ ):this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size<r?t:this.find(function(t,e){return e===r},void 0,t)},has:function(t){return 0<=(t=h(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:!!~this.indexOf(t))},interpose:function(t){return Vt(this,(u=t,(t=Xt(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(e,t){var r=this,n=0;return o.__iterate(function(t){return(!n||!1!==e(u,n++,r))&&!1!==e(t,n++,r)},t),n},t.__iteratorUncached=function(t,e){var r,n=o.__iterator(K,e),i=0;return new P(function(){return(!r||i%2)&&(r=n.next()).done?r:i%2?W(t,i++,u):W(t,i++,r.value,r)})},t));var o,u},interleave:function(){var t=[this].concat(Zt(arguments)),e=Jt(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Vt(this,r)},keySeq:function(){return Hr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!1))},zip:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t))},zipAll:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t,!0))},zipWith:function(t){var e=Zt(arguments);return Vt(e[0]=this,Jt(this,t,e))}});var Gr=E.prototype;Gr[S]=!0,Gr[k]=!0,Ur(j,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Zr=j.prototype;function $r(t,n,i,o,u,e){return te(t.size),t.__iterate(function(t,e,r){i=u?(u=!1,t):n.call(o,i,t,e,r)},e),i}function tn(t,e){return e}function en(t,e){return[e,t]}function rn(t){return function(){return!t.apply(this,arguments)}}function nn(t){return function(){return-t.apply(this,arguments)}}function on(){return Zt(arguments)}function un(t,e){return t<e?1:e<t?-1:0}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2
52
+ )|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Tr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i<e.length;i++){var o=e[i];r[o]=i,f[o]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+vn(this)+' with property "'+o+'" since that property name is part of the Record API.'):function(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){$t(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}(f,o)}}return this.__ownerID=void 0,this._values=ur().withMutations(function(r){r.setSize(n._keys.length),O(t).forEach(function(t,e){r.set(n._indices[e],t===n._defaultValues[e]?void 0:t)})}),this},f=c.prototype=Object.create(pn);return f.constructor=c,s&&(
53
+ c.displayName=s),c};Gr.prototype.toString=function(){for(var t,e=vn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+oe(this.get(t));return e+" }"},Gr.prototype.equals=function(t){return this===t||x(t)&&yn(this).equals(yn(t))},Gr.prototype.hashCode=function(){return yn(this).hashCode()},Gr.prototype.has=function(t){return this._indices.hasOwnProperty(t)},Gr.prototype.get=function(t,e){if(!this.has(t))return e;e=this._values.get(this._indices[t]);return void 0===e?this._defaultValues[t]:e},Gr.prototype.set=function(t,e){if(this.has(t)){e=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(e!==this._values&&!this.__ownerID)return ln(this,e)}return this},Gr.prototype.remove=function(t){return this.set(t)},Gr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ln(this,t)},Gr.prototype.wasAltered=function(){return this._values.wasAltered()},Gr.prototype.toSeq=function(){return yn(this)},Gr.prototype.toJS=function(){return Kr(this)},Gr.prototype.entries=function(){return this.__iterator(T)},Gr.prototype.__iterator=function(t,e){return yn(this).__iterator(t,e)},Gr.prototype.__iterate=function(t,e){return yn(this).__iterate(t,e)},Gr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ln(this,e,t):(this.__ownerID=t,this._values=e,this)},Gr.isRecord=x,Gr.getDescriptiveName=vn;var pn=Gr.prototype;function ln(t,e,r){t=Object.create(Object.getPrototypeOf(t));return t._values=e,t.__ownerID=r,t}function vn(t){return t.constructor.displayName||t.constructor.name||"Record"}function yn(e){return ot(e._keys.map(function(t){return[t,e.get(t)]}))}pn[D]=!0,pn[e]=pn.remove,pn.deleteIn=pn.removeIn=ve,pn.getIn=Vr,pn.hasIn=Xr.hasIn,pn.merge=me,pn.mergeWith=we,pn.mergeIn=De,pn.mergeDeep=qe,pn.mergeDeepWith=Me,pn.mergeDeepIn=xe,pn.setIn=pe,pn.update=de,pn.updateIn=ge,pn.withMutations=Ae,pn.asMutable=ke,pn.asImmutable=Re,pn[B]=pn.entries,pn.toJSON=pn.toObject=Xr.toObject,
54
+ pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.2.2",Collection:I,Iterable:I,Seq:F,Map:Ke,OrderedMap:wr,List:ur,Stack:Er,Set:Tr,OrderedSet:an,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,
55
+ mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Ke,t.OrderedMap=wr,t.OrderedSet=an,t.Range=Hr,t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Tr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.2.2",Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "immutable",
3
- "version": "4.1.0",
3
+ "version": "4.2.2",
4
4
  "description": "Immutable Data Collections",
5
5
  "license": "MIT",
6
6
  "homepage": "https://immutable-js.com",