@thecb/components 3.3.1 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1590 -26
- package/package.json +2 -2
- package/src/components/molecules/email-form/EmailForm.js +1 -14
- package/src/components/molecules/email-form/EmailForm.state.js +1 -9
- package/src/components/molecules/nav-menu/NavMenu.theme.js +3 -1
- package/src/components/molecules/nav-menu/NavMenuDesktop.js +1 -1
- package/src/components/molecules/radio-section/RadioSection.js +2 -1
- package/.tool-versions +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -10,7 +10,6 @@ var styled = require('styled-components');
|
|
|
10
10
|
var styled__default = _interopDefault(styled);
|
|
11
11
|
var theme = _interopDefault(require('styled-theming'));
|
|
12
12
|
var reactRouterDom = require('react-router-dom');
|
|
13
|
-
var R = require('ramda');
|
|
14
13
|
var reactDom = _interopDefault(require('react-dom'));
|
|
15
14
|
|
|
16
15
|
function _typeof(obj) {
|
|
@@ -14501,6 +14500,1581 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
14501
14500
|
})));
|
|
14502
14501
|
};
|
|
14503
14502
|
|
|
14503
|
+
function _isPlaceholder(a) {
|
|
14504
|
+
return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
|
|
14505
|
+
}
|
|
14506
|
+
|
|
14507
|
+
/**
|
|
14508
|
+
* Optimized internal one-arity curry function.
|
|
14509
|
+
*
|
|
14510
|
+
* @private
|
|
14511
|
+
* @category Function
|
|
14512
|
+
* @param {Function} fn The function to curry.
|
|
14513
|
+
* @return {Function} The curried function.
|
|
14514
|
+
*/
|
|
14515
|
+
|
|
14516
|
+
function _curry1(fn) {
|
|
14517
|
+
return function f1(a) {
|
|
14518
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
|
14519
|
+
return f1;
|
|
14520
|
+
} else {
|
|
14521
|
+
return fn.apply(this, arguments);
|
|
14522
|
+
}
|
|
14523
|
+
};
|
|
14524
|
+
}
|
|
14525
|
+
|
|
14526
|
+
/**
|
|
14527
|
+
* Optimized internal two-arity curry function.
|
|
14528
|
+
*
|
|
14529
|
+
* @private
|
|
14530
|
+
* @category Function
|
|
14531
|
+
* @param {Function} fn The function to curry.
|
|
14532
|
+
* @return {Function} The curried function.
|
|
14533
|
+
*/
|
|
14534
|
+
|
|
14535
|
+
function _curry2(fn) {
|
|
14536
|
+
return function f2(a, b) {
|
|
14537
|
+
switch (arguments.length) {
|
|
14538
|
+
case 0:
|
|
14539
|
+
return f2;
|
|
14540
|
+
|
|
14541
|
+
case 1:
|
|
14542
|
+
return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
|
|
14543
|
+
return fn(a, _b);
|
|
14544
|
+
});
|
|
14545
|
+
|
|
14546
|
+
default:
|
|
14547
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
|
|
14548
|
+
return fn(_a, b);
|
|
14549
|
+
}) : _isPlaceholder(b) ? _curry1(function (_b) {
|
|
14550
|
+
return fn(a, _b);
|
|
14551
|
+
}) : fn(a, b);
|
|
14552
|
+
}
|
|
14553
|
+
};
|
|
14554
|
+
}
|
|
14555
|
+
|
|
14556
|
+
function _arity(n, fn) {
|
|
14557
|
+
/* eslint-disable no-unused-vars */
|
|
14558
|
+
switch (n) {
|
|
14559
|
+
case 0:
|
|
14560
|
+
return function () {
|
|
14561
|
+
return fn.apply(this, arguments);
|
|
14562
|
+
};
|
|
14563
|
+
|
|
14564
|
+
case 1:
|
|
14565
|
+
return function (a0) {
|
|
14566
|
+
return fn.apply(this, arguments);
|
|
14567
|
+
};
|
|
14568
|
+
|
|
14569
|
+
case 2:
|
|
14570
|
+
return function (a0, a1) {
|
|
14571
|
+
return fn.apply(this, arguments);
|
|
14572
|
+
};
|
|
14573
|
+
|
|
14574
|
+
case 3:
|
|
14575
|
+
return function (a0, a1, a2) {
|
|
14576
|
+
return fn.apply(this, arguments);
|
|
14577
|
+
};
|
|
14578
|
+
|
|
14579
|
+
case 4:
|
|
14580
|
+
return function (a0, a1, a2, a3) {
|
|
14581
|
+
return fn.apply(this, arguments);
|
|
14582
|
+
};
|
|
14583
|
+
|
|
14584
|
+
case 5:
|
|
14585
|
+
return function (a0, a1, a2, a3, a4) {
|
|
14586
|
+
return fn.apply(this, arguments);
|
|
14587
|
+
};
|
|
14588
|
+
|
|
14589
|
+
case 6:
|
|
14590
|
+
return function (a0, a1, a2, a3, a4, a5) {
|
|
14591
|
+
return fn.apply(this, arguments);
|
|
14592
|
+
};
|
|
14593
|
+
|
|
14594
|
+
case 7:
|
|
14595
|
+
return function (a0, a1, a2, a3, a4, a5, a6) {
|
|
14596
|
+
return fn.apply(this, arguments);
|
|
14597
|
+
};
|
|
14598
|
+
|
|
14599
|
+
case 8:
|
|
14600
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7) {
|
|
14601
|
+
return fn.apply(this, arguments);
|
|
14602
|
+
};
|
|
14603
|
+
|
|
14604
|
+
case 9:
|
|
14605
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
|
|
14606
|
+
return fn.apply(this, arguments);
|
|
14607
|
+
};
|
|
14608
|
+
|
|
14609
|
+
case 10:
|
|
14610
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
14611
|
+
return fn.apply(this, arguments);
|
|
14612
|
+
};
|
|
14613
|
+
|
|
14614
|
+
default:
|
|
14615
|
+
throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
|
|
14616
|
+
}
|
|
14617
|
+
}
|
|
14618
|
+
|
|
14619
|
+
/**
|
|
14620
|
+
* Internal curryN function.
|
|
14621
|
+
*
|
|
14622
|
+
* @private
|
|
14623
|
+
* @category Function
|
|
14624
|
+
* @param {Number} length The arity of the curried function.
|
|
14625
|
+
* @param {Array} received An array of arguments received thus far.
|
|
14626
|
+
* @param {Function} fn The function to curry.
|
|
14627
|
+
* @return {Function} The curried function.
|
|
14628
|
+
*/
|
|
14629
|
+
|
|
14630
|
+
function _curryN(length, received, fn) {
|
|
14631
|
+
return function () {
|
|
14632
|
+
var combined = [];
|
|
14633
|
+
var argsIdx = 0;
|
|
14634
|
+
var left = length;
|
|
14635
|
+
var combinedIdx = 0;
|
|
14636
|
+
|
|
14637
|
+
while (combinedIdx < received.length || argsIdx < arguments.length) {
|
|
14638
|
+
var result;
|
|
14639
|
+
|
|
14640
|
+
if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {
|
|
14641
|
+
result = received[combinedIdx];
|
|
14642
|
+
} else {
|
|
14643
|
+
result = arguments[argsIdx];
|
|
14644
|
+
argsIdx += 1;
|
|
14645
|
+
}
|
|
14646
|
+
|
|
14647
|
+
combined[combinedIdx] = result;
|
|
14648
|
+
|
|
14649
|
+
if (!_isPlaceholder(result)) {
|
|
14650
|
+
left -= 1;
|
|
14651
|
+
}
|
|
14652
|
+
|
|
14653
|
+
combinedIdx += 1;
|
|
14654
|
+
}
|
|
14655
|
+
|
|
14656
|
+
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
|
|
14657
|
+
};
|
|
14658
|
+
}
|
|
14659
|
+
|
|
14660
|
+
/**
|
|
14661
|
+
* Returns a curried equivalent of the provided function, with the specified
|
|
14662
|
+
* arity. The curried function has two unusual capabilities. First, its
|
|
14663
|
+
* arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
|
|
14664
|
+
* following are equivalent:
|
|
14665
|
+
*
|
|
14666
|
+
* - `g(1)(2)(3)`
|
|
14667
|
+
* - `g(1)(2, 3)`
|
|
14668
|
+
* - `g(1, 2)(3)`
|
|
14669
|
+
* - `g(1, 2, 3)`
|
|
14670
|
+
*
|
|
14671
|
+
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
|
14672
|
+
* "gaps", allowing partial application of any combination of arguments,
|
|
14673
|
+
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
|
14674
|
+
* the following are equivalent:
|
|
14675
|
+
*
|
|
14676
|
+
* - `g(1, 2, 3)`
|
|
14677
|
+
* - `g(_, 2, 3)(1)`
|
|
14678
|
+
* - `g(_, _, 3)(1)(2)`
|
|
14679
|
+
* - `g(_, _, 3)(1, 2)`
|
|
14680
|
+
* - `g(_, 2)(1)(3)`
|
|
14681
|
+
* - `g(_, 2)(1, 3)`
|
|
14682
|
+
* - `g(_, 2)(_, 3)(1)`
|
|
14683
|
+
*
|
|
14684
|
+
* @func
|
|
14685
|
+
* @memberOf R
|
|
14686
|
+
* @since v0.5.0
|
|
14687
|
+
* @category Function
|
|
14688
|
+
* @sig Number -> (* -> a) -> (* -> a)
|
|
14689
|
+
* @param {Number} length The arity for the returned function.
|
|
14690
|
+
* @param {Function} fn The function to curry.
|
|
14691
|
+
* @return {Function} A new, curried function.
|
|
14692
|
+
* @see R.curry
|
|
14693
|
+
* @example
|
|
14694
|
+
*
|
|
14695
|
+
* const sumArgs = (...args) => R.sum(args);
|
|
14696
|
+
*
|
|
14697
|
+
* const curriedAddFourNumbers = R.curryN(4, sumArgs);
|
|
14698
|
+
* const f = curriedAddFourNumbers(1, 2);
|
|
14699
|
+
* const g = f(3);
|
|
14700
|
+
* g(4); //=> 10
|
|
14701
|
+
*/
|
|
14702
|
+
|
|
14703
|
+
var curryN =
|
|
14704
|
+
/*#__PURE__*/
|
|
14705
|
+
_curry2(function curryN(length, fn) {
|
|
14706
|
+
if (length === 1) {
|
|
14707
|
+
return _curry1(fn);
|
|
14708
|
+
}
|
|
14709
|
+
|
|
14710
|
+
return _arity(length, _curryN(length, [], fn));
|
|
14711
|
+
});
|
|
14712
|
+
|
|
14713
|
+
/**
|
|
14714
|
+
* Optimized internal three-arity curry function.
|
|
14715
|
+
*
|
|
14716
|
+
* @private
|
|
14717
|
+
* @category Function
|
|
14718
|
+
* @param {Function} fn The function to curry.
|
|
14719
|
+
* @return {Function} The curried function.
|
|
14720
|
+
*/
|
|
14721
|
+
|
|
14722
|
+
function _curry3(fn) {
|
|
14723
|
+
return function f3(a, b, c) {
|
|
14724
|
+
switch (arguments.length) {
|
|
14725
|
+
case 0:
|
|
14726
|
+
return f3;
|
|
14727
|
+
|
|
14728
|
+
case 1:
|
|
14729
|
+
return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
|
|
14730
|
+
return fn(a, _b, _c);
|
|
14731
|
+
});
|
|
14732
|
+
|
|
14733
|
+
case 2:
|
|
14734
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
|
|
14735
|
+
return fn(_a, b, _c);
|
|
14736
|
+
}) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
|
|
14737
|
+
return fn(a, _b, _c);
|
|
14738
|
+
}) : _curry1(function (_c) {
|
|
14739
|
+
return fn(a, b, _c);
|
|
14740
|
+
});
|
|
14741
|
+
|
|
14742
|
+
default:
|
|
14743
|
+
return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
|
|
14744
|
+
return fn(_a, _b, c);
|
|
14745
|
+
}) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
|
|
14746
|
+
return fn(_a, b, _c);
|
|
14747
|
+
}) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
|
|
14748
|
+
return fn(a, _b, _c);
|
|
14749
|
+
}) : _isPlaceholder(a) ? _curry1(function (_a) {
|
|
14750
|
+
return fn(_a, b, c);
|
|
14751
|
+
}) : _isPlaceholder(b) ? _curry1(function (_b) {
|
|
14752
|
+
return fn(a, _b, c);
|
|
14753
|
+
}) : _isPlaceholder(c) ? _curry1(function (_c) {
|
|
14754
|
+
return fn(a, b, _c);
|
|
14755
|
+
}) : fn(a, b, c);
|
|
14756
|
+
}
|
|
14757
|
+
};
|
|
14758
|
+
}
|
|
14759
|
+
|
|
14760
|
+
/**
|
|
14761
|
+
* Tests whether or not an object is an array.
|
|
14762
|
+
*
|
|
14763
|
+
* @private
|
|
14764
|
+
* @param {*} val The object to test.
|
|
14765
|
+
* @return {Boolean} `true` if `val` is an array, `false` otherwise.
|
|
14766
|
+
* @example
|
|
14767
|
+
*
|
|
14768
|
+
* _isArray([]); //=> true
|
|
14769
|
+
* _isArray(null); //=> false
|
|
14770
|
+
* _isArray({}); //=> false
|
|
14771
|
+
*/
|
|
14772
|
+
var _isArray = Array.isArray || function _isArray(val) {
|
|
14773
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';
|
|
14774
|
+
};
|
|
14775
|
+
|
|
14776
|
+
function _isTransformer(obj) {
|
|
14777
|
+
return obj != null && typeof obj['@@transducer/step'] === 'function';
|
|
14778
|
+
}
|
|
14779
|
+
|
|
14780
|
+
/**
|
|
14781
|
+
* Returns a function that dispatches with different strategies based on the
|
|
14782
|
+
* object in list position (last argument). If it is an array, executes [fn].
|
|
14783
|
+
* Otherwise, if it has a function with one of the given method names, it will
|
|
14784
|
+
* execute that function (functor case). Otherwise, if it is a transformer,
|
|
14785
|
+
* uses transducer [xf] to return a new transformer (transducer case).
|
|
14786
|
+
* Otherwise, it will default to executing [fn].
|
|
14787
|
+
*
|
|
14788
|
+
* @private
|
|
14789
|
+
* @param {Array} methodNames properties to check for a custom implementation
|
|
14790
|
+
* @param {Function} xf transducer to initialize if object is transformer
|
|
14791
|
+
* @param {Function} fn default ramda implementation
|
|
14792
|
+
* @return {Function} A function that dispatches on object in list position
|
|
14793
|
+
*/
|
|
14794
|
+
|
|
14795
|
+
function _dispatchable(methodNames, xf, fn) {
|
|
14796
|
+
return function () {
|
|
14797
|
+
if (arguments.length === 0) {
|
|
14798
|
+
return fn();
|
|
14799
|
+
}
|
|
14800
|
+
|
|
14801
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
|
14802
|
+
var obj = args.pop();
|
|
14803
|
+
|
|
14804
|
+
if (!_isArray(obj)) {
|
|
14805
|
+
var idx = 0;
|
|
14806
|
+
|
|
14807
|
+
while (idx < methodNames.length) {
|
|
14808
|
+
if (typeof obj[methodNames[idx]] === 'function') {
|
|
14809
|
+
return obj[methodNames[idx]].apply(obj, args);
|
|
14810
|
+
}
|
|
14811
|
+
|
|
14812
|
+
idx += 1;
|
|
14813
|
+
}
|
|
14814
|
+
|
|
14815
|
+
if (_isTransformer(obj)) {
|
|
14816
|
+
var transducer = xf.apply(null, args);
|
|
14817
|
+
return transducer(obj);
|
|
14818
|
+
}
|
|
14819
|
+
}
|
|
14820
|
+
|
|
14821
|
+
return fn.apply(this, arguments);
|
|
14822
|
+
};
|
|
14823
|
+
}
|
|
14824
|
+
|
|
14825
|
+
var _xfBase = {
|
|
14826
|
+
init: function () {
|
|
14827
|
+
return this.xf['@@transducer/init']();
|
|
14828
|
+
},
|
|
14829
|
+
result: function (result) {
|
|
14830
|
+
return this.xf['@@transducer/result'](result);
|
|
14831
|
+
}
|
|
14832
|
+
};
|
|
14833
|
+
|
|
14834
|
+
function _map(fn, functor) {
|
|
14835
|
+
var idx = 0;
|
|
14836
|
+
var len = functor.length;
|
|
14837
|
+
var result = Array(len);
|
|
14838
|
+
|
|
14839
|
+
while (idx < len) {
|
|
14840
|
+
result[idx] = fn(functor[idx]);
|
|
14841
|
+
idx += 1;
|
|
14842
|
+
}
|
|
14843
|
+
|
|
14844
|
+
return result;
|
|
14845
|
+
}
|
|
14846
|
+
|
|
14847
|
+
function _isString(x) {
|
|
14848
|
+
return Object.prototype.toString.call(x) === '[object String]';
|
|
14849
|
+
}
|
|
14850
|
+
|
|
14851
|
+
/**
|
|
14852
|
+
* Tests whether or not an object is similar to an array.
|
|
14853
|
+
*
|
|
14854
|
+
* @private
|
|
14855
|
+
* @category Type
|
|
14856
|
+
* @category List
|
|
14857
|
+
* @sig * -> Boolean
|
|
14858
|
+
* @param {*} x The object to test.
|
|
14859
|
+
* @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.
|
|
14860
|
+
* @example
|
|
14861
|
+
*
|
|
14862
|
+
* _isArrayLike([]); //=> true
|
|
14863
|
+
* _isArrayLike(true); //=> false
|
|
14864
|
+
* _isArrayLike({}); //=> false
|
|
14865
|
+
* _isArrayLike({length: 10}); //=> false
|
|
14866
|
+
* _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
|
|
14867
|
+
*/
|
|
14868
|
+
|
|
14869
|
+
var _isArrayLike =
|
|
14870
|
+
/*#__PURE__*/
|
|
14871
|
+
_curry1(function isArrayLike(x) {
|
|
14872
|
+
if (_isArray(x)) {
|
|
14873
|
+
return true;
|
|
14874
|
+
}
|
|
14875
|
+
|
|
14876
|
+
if (!x) {
|
|
14877
|
+
return false;
|
|
14878
|
+
}
|
|
14879
|
+
|
|
14880
|
+
if (typeof x !== 'object') {
|
|
14881
|
+
return false;
|
|
14882
|
+
}
|
|
14883
|
+
|
|
14884
|
+
if (_isString(x)) {
|
|
14885
|
+
return false;
|
|
14886
|
+
}
|
|
14887
|
+
|
|
14888
|
+
if (x.nodeType === 1) {
|
|
14889
|
+
return !!x.length;
|
|
14890
|
+
}
|
|
14891
|
+
|
|
14892
|
+
if (x.length === 0) {
|
|
14893
|
+
return true;
|
|
14894
|
+
}
|
|
14895
|
+
|
|
14896
|
+
if (x.length > 0) {
|
|
14897
|
+
return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
|
|
14898
|
+
}
|
|
14899
|
+
|
|
14900
|
+
return false;
|
|
14901
|
+
});
|
|
14902
|
+
|
|
14903
|
+
var XWrap =
|
|
14904
|
+
/*#__PURE__*/
|
|
14905
|
+
function () {
|
|
14906
|
+
function XWrap(fn) {
|
|
14907
|
+
this.f = fn;
|
|
14908
|
+
}
|
|
14909
|
+
|
|
14910
|
+
XWrap.prototype['@@transducer/init'] = function () {
|
|
14911
|
+
throw new Error('init not implemented on XWrap');
|
|
14912
|
+
};
|
|
14913
|
+
|
|
14914
|
+
XWrap.prototype['@@transducer/result'] = function (acc) {
|
|
14915
|
+
return acc;
|
|
14916
|
+
};
|
|
14917
|
+
|
|
14918
|
+
XWrap.prototype['@@transducer/step'] = function (acc, x) {
|
|
14919
|
+
return this.f(acc, x);
|
|
14920
|
+
};
|
|
14921
|
+
|
|
14922
|
+
return XWrap;
|
|
14923
|
+
}();
|
|
14924
|
+
|
|
14925
|
+
function _xwrap(fn) {
|
|
14926
|
+
return new XWrap(fn);
|
|
14927
|
+
}
|
|
14928
|
+
|
|
14929
|
+
/**
|
|
14930
|
+
* Creates a function that is bound to a context.
|
|
14931
|
+
* Note: `R.bind` does not provide the additional argument-binding capabilities of
|
|
14932
|
+
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
|
14933
|
+
*
|
|
14934
|
+
* @func
|
|
14935
|
+
* @memberOf R
|
|
14936
|
+
* @since v0.6.0
|
|
14937
|
+
* @category Function
|
|
14938
|
+
* @category Object
|
|
14939
|
+
* @sig (* -> *) -> {*} -> (* -> *)
|
|
14940
|
+
* @param {Function} fn The function to bind to context
|
|
14941
|
+
* @param {Object} thisObj The context to bind `fn` to
|
|
14942
|
+
* @return {Function} A function that will execute in the context of `thisObj`.
|
|
14943
|
+
* @see R.partial
|
|
14944
|
+
* @example
|
|
14945
|
+
*
|
|
14946
|
+
* const log = R.bind(console.log, console);
|
|
14947
|
+
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
|
|
14948
|
+
* // logs {a: 2}
|
|
14949
|
+
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
|
|
14950
|
+
*/
|
|
14951
|
+
|
|
14952
|
+
var bind =
|
|
14953
|
+
/*#__PURE__*/
|
|
14954
|
+
_curry2(function bind(fn, thisObj) {
|
|
14955
|
+
return _arity(fn.length, function () {
|
|
14956
|
+
return fn.apply(thisObj, arguments);
|
|
14957
|
+
});
|
|
14958
|
+
});
|
|
14959
|
+
|
|
14960
|
+
function _arrayReduce(xf, acc, list) {
|
|
14961
|
+
var idx = 0;
|
|
14962
|
+
var len = list.length;
|
|
14963
|
+
|
|
14964
|
+
while (idx < len) {
|
|
14965
|
+
acc = xf['@@transducer/step'](acc, list[idx]);
|
|
14966
|
+
|
|
14967
|
+
if (acc && acc['@@transducer/reduced']) {
|
|
14968
|
+
acc = acc['@@transducer/value'];
|
|
14969
|
+
break;
|
|
14970
|
+
}
|
|
14971
|
+
|
|
14972
|
+
idx += 1;
|
|
14973
|
+
}
|
|
14974
|
+
|
|
14975
|
+
return xf['@@transducer/result'](acc);
|
|
14976
|
+
}
|
|
14977
|
+
|
|
14978
|
+
function _iterableReduce(xf, acc, iter) {
|
|
14979
|
+
var step = iter.next();
|
|
14980
|
+
|
|
14981
|
+
while (!step.done) {
|
|
14982
|
+
acc = xf['@@transducer/step'](acc, step.value);
|
|
14983
|
+
|
|
14984
|
+
if (acc && acc['@@transducer/reduced']) {
|
|
14985
|
+
acc = acc['@@transducer/value'];
|
|
14986
|
+
break;
|
|
14987
|
+
}
|
|
14988
|
+
|
|
14989
|
+
step = iter.next();
|
|
14990
|
+
}
|
|
14991
|
+
|
|
14992
|
+
return xf['@@transducer/result'](acc);
|
|
14993
|
+
}
|
|
14994
|
+
|
|
14995
|
+
function _methodReduce(xf, acc, obj, methodName) {
|
|
14996
|
+
return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc));
|
|
14997
|
+
}
|
|
14998
|
+
|
|
14999
|
+
var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
15000
|
+
function _reduce(fn, acc, list) {
|
|
15001
|
+
if (typeof fn === 'function') {
|
|
15002
|
+
fn = _xwrap(fn);
|
|
15003
|
+
}
|
|
15004
|
+
|
|
15005
|
+
if (_isArrayLike(list)) {
|
|
15006
|
+
return _arrayReduce(fn, acc, list);
|
|
15007
|
+
}
|
|
15008
|
+
|
|
15009
|
+
if (typeof list['fantasy-land/reduce'] === 'function') {
|
|
15010
|
+
return _methodReduce(fn, acc, list, 'fantasy-land/reduce');
|
|
15011
|
+
}
|
|
15012
|
+
|
|
15013
|
+
if (list[symIterator] != null) {
|
|
15014
|
+
return _iterableReduce(fn, acc, list[symIterator]());
|
|
15015
|
+
}
|
|
15016
|
+
|
|
15017
|
+
if (typeof list.next === 'function') {
|
|
15018
|
+
return _iterableReduce(fn, acc, list);
|
|
15019
|
+
}
|
|
15020
|
+
|
|
15021
|
+
if (typeof list.reduce === 'function') {
|
|
15022
|
+
return _methodReduce(fn, acc, list, 'reduce');
|
|
15023
|
+
}
|
|
15024
|
+
|
|
15025
|
+
throw new TypeError('reduce: list must be array or iterable');
|
|
15026
|
+
}
|
|
15027
|
+
|
|
15028
|
+
function _has(prop, obj) {
|
|
15029
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
15030
|
+
}
|
|
15031
|
+
|
|
15032
|
+
var toString = Object.prototype.toString;
|
|
15033
|
+
|
|
15034
|
+
var _isArguments =
|
|
15035
|
+
/*#__PURE__*/
|
|
15036
|
+
function () {
|
|
15037
|
+
return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
|
|
15038
|
+
return toString.call(x) === '[object Arguments]';
|
|
15039
|
+
} : function _isArguments(x) {
|
|
15040
|
+
return _has('callee', x);
|
|
15041
|
+
};
|
|
15042
|
+
}();
|
|
15043
|
+
|
|
15044
|
+
var hasEnumBug = !
|
|
15045
|
+
/*#__PURE__*/
|
|
15046
|
+
{
|
|
15047
|
+
toString: null
|
|
15048
|
+
}.propertyIsEnumerable('toString');
|
|
15049
|
+
var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; // Safari bug
|
|
15050
|
+
|
|
15051
|
+
var hasArgsEnumBug =
|
|
15052
|
+
/*#__PURE__*/
|
|
15053
|
+
function () {
|
|
15054
|
+
|
|
15055
|
+
return arguments.propertyIsEnumerable('length');
|
|
15056
|
+
}();
|
|
15057
|
+
|
|
15058
|
+
var contains = function contains(list, item) {
|
|
15059
|
+
var idx = 0;
|
|
15060
|
+
|
|
15061
|
+
while (idx < list.length) {
|
|
15062
|
+
if (list[idx] === item) {
|
|
15063
|
+
return true;
|
|
15064
|
+
}
|
|
15065
|
+
|
|
15066
|
+
idx += 1;
|
|
15067
|
+
}
|
|
15068
|
+
|
|
15069
|
+
return false;
|
|
15070
|
+
};
|
|
15071
|
+
/**
|
|
15072
|
+
* Returns a list containing the names of all the enumerable own properties of
|
|
15073
|
+
* the supplied object.
|
|
15074
|
+
* Note that the order of the output array is not guaranteed to be consistent
|
|
15075
|
+
* across different JS platforms.
|
|
15076
|
+
*
|
|
15077
|
+
* @func
|
|
15078
|
+
* @memberOf R
|
|
15079
|
+
* @since v0.1.0
|
|
15080
|
+
* @category Object
|
|
15081
|
+
* @sig {k: v} -> [k]
|
|
15082
|
+
* @param {Object} obj The object to extract properties from
|
|
15083
|
+
* @return {Array} An array of the object's own properties.
|
|
15084
|
+
* @see R.keysIn, R.values
|
|
15085
|
+
* @example
|
|
15086
|
+
*
|
|
15087
|
+
* R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']
|
|
15088
|
+
*/
|
|
15089
|
+
|
|
15090
|
+
|
|
15091
|
+
var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ?
|
|
15092
|
+
/*#__PURE__*/
|
|
15093
|
+
_curry1(function keys(obj) {
|
|
15094
|
+
return Object(obj) !== obj ? [] : Object.keys(obj);
|
|
15095
|
+
}) :
|
|
15096
|
+
/*#__PURE__*/
|
|
15097
|
+
_curry1(function keys(obj) {
|
|
15098
|
+
if (Object(obj) !== obj) {
|
|
15099
|
+
return [];
|
|
15100
|
+
}
|
|
15101
|
+
|
|
15102
|
+
var prop, nIdx;
|
|
15103
|
+
var ks = [];
|
|
15104
|
+
|
|
15105
|
+
var checkArgsLength = hasArgsEnumBug && _isArguments(obj);
|
|
15106
|
+
|
|
15107
|
+
for (prop in obj) {
|
|
15108
|
+
if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
|
|
15109
|
+
ks[ks.length] = prop;
|
|
15110
|
+
}
|
|
15111
|
+
}
|
|
15112
|
+
|
|
15113
|
+
if (hasEnumBug) {
|
|
15114
|
+
nIdx = nonEnumerableProps.length - 1;
|
|
15115
|
+
|
|
15116
|
+
while (nIdx >= 0) {
|
|
15117
|
+
prop = nonEnumerableProps[nIdx];
|
|
15118
|
+
|
|
15119
|
+
if (_has(prop, obj) && !contains(ks, prop)) {
|
|
15120
|
+
ks[ks.length] = prop;
|
|
15121
|
+
}
|
|
15122
|
+
|
|
15123
|
+
nIdx -= 1;
|
|
15124
|
+
}
|
|
15125
|
+
}
|
|
15126
|
+
|
|
15127
|
+
return ks;
|
|
15128
|
+
});
|
|
15129
|
+
|
|
15130
|
+
/**
|
|
15131
|
+
* Determine if the passed argument is an integer.
|
|
15132
|
+
*
|
|
15133
|
+
* @private
|
|
15134
|
+
* @param {*} n
|
|
15135
|
+
* @category Type
|
|
15136
|
+
* @return {Boolean}
|
|
15137
|
+
*/
|
|
15138
|
+
var _isInteger = Number.isInteger || function _isInteger(n) {
|
|
15139
|
+
return n << 0 === n;
|
|
15140
|
+
};
|
|
15141
|
+
|
|
15142
|
+
/**
|
|
15143
|
+
* Returns the nth element of the given list or string. If n is negative the
|
|
15144
|
+
* element at index length + n is returned.
|
|
15145
|
+
*
|
|
15146
|
+
* @func
|
|
15147
|
+
* @memberOf R
|
|
15148
|
+
* @since v0.1.0
|
|
15149
|
+
* @category List
|
|
15150
|
+
* @sig Number -> [a] -> a | Undefined
|
|
15151
|
+
* @sig Number -> String -> String
|
|
15152
|
+
* @param {Number} offset
|
|
15153
|
+
* @param {*} list
|
|
15154
|
+
* @return {*}
|
|
15155
|
+
* @example
|
|
15156
|
+
*
|
|
15157
|
+
* const list = ['foo', 'bar', 'baz', 'quux'];
|
|
15158
|
+
* R.nth(1, list); //=> 'bar'
|
|
15159
|
+
* R.nth(-1, list); //=> 'quux'
|
|
15160
|
+
* R.nth(-99, list); //=> undefined
|
|
15161
|
+
*
|
|
15162
|
+
* R.nth(2, 'abc'); //=> 'c'
|
|
15163
|
+
* R.nth(3, 'abc'); //=> ''
|
|
15164
|
+
* @symb R.nth(-1, [a, b, c]) = c
|
|
15165
|
+
* @symb R.nth(0, [a, b, c]) = a
|
|
15166
|
+
* @symb R.nth(1, [a, b, c]) = b
|
|
15167
|
+
*/
|
|
15168
|
+
|
|
15169
|
+
var nth =
|
|
15170
|
+
/*#__PURE__*/
|
|
15171
|
+
_curry2(function nth(offset, list) {
|
|
15172
|
+
var idx = offset < 0 ? list.length + offset : offset;
|
|
15173
|
+
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
15174
|
+
});
|
|
15175
|
+
|
|
15176
|
+
/**
|
|
15177
|
+
* Retrieves the values at given paths of an object.
|
|
15178
|
+
*
|
|
15179
|
+
* @func
|
|
15180
|
+
* @memberOf R
|
|
15181
|
+
* @since v0.27.0
|
|
15182
|
+
* @category Object
|
|
15183
|
+
* @typedefn Idx = [String | Int]
|
|
15184
|
+
* @sig [Idx] -> {a} -> [a | Undefined]
|
|
15185
|
+
* @param {Array} pathsArray The array of paths to be fetched.
|
|
15186
|
+
* @param {Object} obj The object to retrieve the nested properties from.
|
|
15187
|
+
* @return {Array} A list consisting of values at paths specified by "pathsArray".
|
|
15188
|
+
* @see R.path
|
|
15189
|
+
* @example
|
|
15190
|
+
*
|
|
15191
|
+
* R.paths([['a', 'b'], ['p', 0, 'q']], {a: {b: 2}, p: [{q: 3}]}); //=> [2, 3]
|
|
15192
|
+
* R.paths([['a', 'b'], ['p', 'r']], {a: {b: 2}, p: [{q: 3}]}); //=> [2, undefined]
|
|
15193
|
+
*/
|
|
15194
|
+
|
|
15195
|
+
var paths =
|
|
15196
|
+
/*#__PURE__*/
|
|
15197
|
+
_curry2(function paths(pathsArray, obj) {
|
|
15198
|
+
return pathsArray.map(function (paths) {
|
|
15199
|
+
var val = obj;
|
|
15200
|
+
var idx = 0;
|
|
15201
|
+
var p;
|
|
15202
|
+
|
|
15203
|
+
while (idx < paths.length) {
|
|
15204
|
+
if (val == null) {
|
|
15205
|
+
return;
|
|
15206
|
+
}
|
|
15207
|
+
|
|
15208
|
+
p = paths[idx];
|
|
15209
|
+
val = _isInteger(p) ? nth(p, val) : val[p];
|
|
15210
|
+
idx += 1;
|
|
15211
|
+
}
|
|
15212
|
+
|
|
15213
|
+
return val;
|
|
15214
|
+
});
|
|
15215
|
+
});
|
|
15216
|
+
|
|
15217
|
+
/**
|
|
15218
|
+
* Retrieve the value at a given path.
|
|
15219
|
+
*
|
|
15220
|
+
* @func
|
|
15221
|
+
* @memberOf R
|
|
15222
|
+
* @since v0.2.0
|
|
15223
|
+
* @category Object
|
|
15224
|
+
* @typedefn Idx = String | Int
|
|
15225
|
+
* @sig [Idx] -> {a} -> a | Undefined
|
|
15226
|
+
* @param {Array} path The path to use.
|
|
15227
|
+
* @param {Object} obj The object to retrieve the nested property from.
|
|
15228
|
+
* @return {*} The data at `path`.
|
|
15229
|
+
* @see R.prop, R.nth
|
|
15230
|
+
* @example
|
|
15231
|
+
*
|
|
15232
|
+
* R.path(['a', 'b'], {a: {b: 2}}); //=> 2
|
|
15233
|
+
* R.path(['a', 'b'], {c: {b: 2}}); //=> undefined
|
|
15234
|
+
* R.path(['a', 'b', 0], {a: {b: [1, 2, 3]}}); //=> 1
|
|
15235
|
+
* R.path(['a', 'b', -2], {a: {b: [1, 2, 3]}}); //=> 2
|
|
15236
|
+
*/
|
|
15237
|
+
|
|
15238
|
+
var path =
|
|
15239
|
+
/*#__PURE__*/
|
|
15240
|
+
_curry2(function path(pathAr, obj) {
|
|
15241
|
+
return paths([pathAr], obj)[0];
|
|
15242
|
+
});
|
|
15243
|
+
|
|
15244
|
+
/**
|
|
15245
|
+
* Returns a function that always returns the given value. Note that for
|
|
15246
|
+
* non-primitives the value returned is a reference to the original value.
|
|
15247
|
+
*
|
|
15248
|
+
* This function is known as `const`, `constant`, or `K` (for K combinator) in
|
|
15249
|
+
* other languages and libraries.
|
|
15250
|
+
*
|
|
15251
|
+
* @func
|
|
15252
|
+
* @memberOf R
|
|
15253
|
+
* @since v0.1.0
|
|
15254
|
+
* @category Function
|
|
15255
|
+
* @sig a -> (* -> a)
|
|
15256
|
+
* @param {*} val The value to wrap in a function
|
|
15257
|
+
* @return {Function} A Function :: * -> val.
|
|
15258
|
+
* @example
|
|
15259
|
+
*
|
|
15260
|
+
* const t = R.always('Tee');
|
|
15261
|
+
* t(); //=> 'Tee'
|
|
15262
|
+
*/
|
|
15263
|
+
|
|
15264
|
+
var always =
|
|
15265
|
+
/*#__PURE__*/
|
|
15266
|
+
_curry1(function always(val) {
|
|
15267
|
+
return function () {
|
|
15268
|
+
return val;
|
|
15269
|
+
};
|
|
15270
|
+
});
|
|
15271
|
+
|
|
15272
|
+
/**
|
|
15273
|
+
* Checks if the input value is `null` or `undefined`.
|
|
15274
|
+
*
|
|
15275
|
+
* @func
|
|
15276
|
+
* @memberOf R
|
|
15277
|
+
* @since v0.9.0
|
|
15278
|
+
* @category Type
|
|
15279
|
+
* @sig * -> Boolean
|
|
15280
|
+
* @param {*} x The value to test.
|
|
15281
|
+
* @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.
|
|
15282
|
+
* @example
|
|
15283
|
+
*
|
|
15284
|
+
* R.isNil(null); //=> true
|
|
15285
|
+
* R.isNil(undefined); //=> true
|
|
15286
|
+
* R.isNil(0); //=> false
|
|
15287
|
+
* R.isNil([]); //=> false
|
|
15288
|
+
*/
|
|
15289
|
+
|
|
15290
|
+
var isNil =
|
|
15291
|
+
/*#__PURE__*/
|
|
15292
|
+
_curry1(function isNil(x) {
|
|
15293
|
+
return x == null;
|
|
15294
|
+
});
|
|
15295
|
+
|
|
15296
|
+
function _cloneRegExp(pattern) {
|
|
15297
|
+
return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));
|
|
15298
|
+
}
|
|
15299
|
+
|
|
15300
|
+
/**
|
|
15301
|
+
* Gives a single-word string description of the (native) type of a value,
|
|
15302
|
+
* returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
|
|
15303
|
+
* attempt to distinguish user Object types any further, reporting them all as
|
|
15304
|
+
* 'Object'.
|
|
15305
|
+
*
|
|
15306
|
+
* @func
|
|
15307
|
+
* @memberOf R
|
|
15308
|
+
* @since v0.8.0
|
|
15309
|
+
* @category Type
|
|
15310
|
+
* @sig (* -> {*}) -> String
|
|
15311
|
+
* @param {*} val The value to test
|
|
15312
|
+
* @return {String}
|
|
15313
|
+
* @example
|
|
15314
|
+
*
|
|
15315
|
+
* R.type({}); //=> "Object"
|
|
15316
|
+
* R.type(1); //=> "Number"
|
|
15317
|
+
* R.type(false); //=> "Boolean"
|
|
15318
|
+
* R.type('s'); //=> "String"
|
|
15319
|
+
* R.type(null); //=> "Null"
|
|
15320
|
+
* R.type([]); //=> "Array"
|
|
15321
|
+
* R.type(/[A-z]/); //=> "RegExp"
|
|
15322
|
+
* R.type(() => {}); //=> "Function"
|
|
15323
|
+
* R.type(undefined); //=> "Undefined"
|
|
15324
|
+
*/
|
|
15325
|
+
|
|
15326
|
+
var type =
|
|
15327
|
+
/*#__PURE__*/
|
|
15328
|
+
_curry1(function type(val) {
|
|
15329
|
+
return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
|
|
15330
|
+
});
|
|
15331
|
+
|
|
15332
|
+
function _arrayFromIterator(iter) {
|
|
15333
|
+
var list = [];
|
|
15334
|
+
var next;
|
|
15335
|
+
|
|
15336
|
+
while (!(next = iter.next()).done) {
|
|
15337
|
+
list.push(next.value);
|
|
15338
|
+
}
|
|
15339
|
+
|
|
15340
|
+
return list;
|
|
15341
|
+
}
|
|
15342
|
+
|
|
15343
|
+
function _includesWith(pred, x, list) {
|
|
15344
|
+
var idx = 0;
|
|
15345
|
+
var len = list.length;
|
|
15346
|
+
|
|
15347
|
+
while (idx < len) {
|
|
15348
|
+
if (pred(x, list[idx])) {
|
|
15349
|
+
return true;
|
|
15350
|
+
}
|
|
15351
|
+
|
|
15352
|
+
idx += 1;
|
|
15353
|
+
}
|
|
15354
|
+
|
|
15355
|
+
return false;
|
|
15356
|
+
}
|
|
15357
|
+
|
|
15358
|
+
function _functionName(f) {
|
|
15359
|
+
// String(x => x) evaluates to "x => x", so the pattern may not match.
|
|
15360
|
+
var match = String(f).match(/^function (\w*)/);
|
|
15361
|
+
return match == null ? '' : match[1];
|
|
15362
|
+
}
|
|
15363
|
+
|
|
15364
|
+
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
15365
|
+
function _objectIs(a, b) {
|
|
15366
|
+
// SameValue algorithm
|
|
15367
|
+
if (a === b) {
|
|
15368
|
+
// Steps 1-5, 7-10
|
|
15369
|
+
// Steps 6.b-6.e: +0 != -0
|
|
15370
|
+
return a !== 0 || 1 / a === 1 / b;
|
|
15371
|
+
} else {
|
|
15372
|
+
// Step 6.a: NaN == NaN
|
|
15373
|
+
return a !== a && b !== b;
|
|
15374
|
+
}
|
|
15375
|
+
}
|
|
15376
|
+
|
|
15377
|
+
var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
|
|
15378
|
+
|
|
15379
|
+
/**
|
|
15380
|
+
* private _uniqContentEquals function.
|
|
15381
|
+
* That function is checking equality of 2 iterator contents with 2 assumptions
|
|
15382
|
+
* - iterators lengths are the same
|
|
15383
|
+
* - iterators values are unique
|
|
15384
|
+
*
|
|
15385
|
+
* false-positive result will be returned for comparision of, e.g.
|
|
15386
|
+
* - [1,2,3] and [1,2,3,4]
|
|
15387
|
+
* - [1,1,1] and [1,2,3]
|
|
15388
|
+
* */
|
|
15389
|
+
|
|
15390
|
+
function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
|
|
15391
|
+
var a = _arrayFromIterator(aIterator);
|
|
15392
|
+
|
|
15393
|
+
var b = _arrayFromIterator(bIterator);
|
|
15394
|
+
|
|
15395
|
+
function eq(_a, _b) {
|
|
15396
|
+
return _equals(_a, _b, stackA.slice(), stackB.slice());
|
|
15397
|
+
} // if *a* array contains any element that is not included in *b*
|
|
15398
|
+
|
|
15399
|
+
|
|
15400
|
+
return !_includesWith(function (b, aItem) {
|
|
15401
|
+
return !_includesWith(eq, aItem, b);
|
|
15402
|
+
}, b, a);
|
|
15403
|
+
}
|
|
15404
|
+
|
|
15405
|
+
function _equals(a, b, stackA, stackB) {
|
|
15406
|
+
if (_objectIs$1(a, b)) {
|
|
15407
|
+
return true;
|
|
15408
|
+
}
|
|
15409
|
+
|
|
15410
|
+
var typeA = type(a);
|
|
15411
|
+
|
|
15412
|
+
if (typeA !== type(b)) {
|
|
15413
|
+
return false;
|
|
15414
|
+
}
|
|
15415
|
+
|
|
15416
|
+
if (a == null || b == null) {
|
|
15417
|
+
return false;
|
|
15418
|
+
}
|
|
15419
|
+
|
|
15420
|
+
if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
|
|
15421
|
+
return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
|
|
15422
|
+
}
|
|
15423
|
+
|
|
15424
|
+
if (typeof a.equals === 'function' || typeof b.equals === 'function') {
|
|
15425
|
+
return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);
|
|
15426
|
+
}
|
|
15427
|
+
|
|
15428
|
+
switch (typeA) {
|
|
15429
|
+
case 'Arguments':
|
|
15430
|
+
case 'Array':
|
|
15431
|
+
case 'Object':
|
|
15432
|
+
if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {
|
|
15433
|
+
return a === b;
|
|
15434
|
+
}
|
|
15435
|
+
|
|
15436
|
+
break;
|
|
15437
|
+
|
|
15438
|
+
case 'Boolean':
|
|
15439
|
+
case 'Number':
|
|
15440
|
+
case 'String':
|
|
15441
|
+
if (!(typeof a === typeof b && _objectIs$1(a.valueOf(), b.valueOf()))) {
|
|
15442
|
+
return false;
|
|
15443
|
+
}
|
|
15444
|
+
|
|
15445
|
+
break;
|
|
15446
|
+
|
|
15447
|
+
case 'Date':
|
|
15448
|
+
if (!_objectIs$1(a.valueOf(), b.valueOf())) {
|
|
15449
|
+
return false;
|
|
15450
|
+
}
|
|
15451
|
+
|
|
15452
|
+
break;
|
|
15453
|
+
|
|
15454
|
+
case 'Error':
|
|
15455
|
+
return a.name === b.name && a.message === b.message;
|
|
15456
|
+
|
|
15457
|
+
case 'RegExp':
|
|
15458
|
+
if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
|
|
15459
|
+
return false;
|
|
15460
|
+
}
|
|
15461
|
+
|
|
15462
|
+
break;
|
|
15463
|
+
}
|
|
15464
|
+
|
|
15465
|
+
var idx = stackA.length - 1;
|
|
15466
|
+
|
|
15467
|
+
while (idx >= 0) {
|
|
15468
|
+
if (stackA[idx] === a) {
|
|
15469
|
+
return stackB[idx] === b;
|
|
15470
|
+
}
|
|
15471
|
+
|
|
15472
|
+
idx -= 1;
|
|
15473
|
+
}
|
|
15474
|
+
|
|
15475
|
+
switch (typeA) {
|
|
15476
|
+
case 'Map':
|
|
15477
|
+
if (a.size !== b.size) {
|
|
15478
|
+
return false;
|
|
15479
|
+
}
|
|
15480
|
+
|
|
15481
|
+
return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
|
|
15482
|
+
|
|
15483
|
+
case 'Set':
|
|
15484
|
+
if (a.size !== b.size) {
|
|
15485
|
+
return false;
|
|
15486
|
+
}
|
|
15487
|
+
|
|
15488
|
+
return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
|
|
15489
|
+
|
|
15490
|
+
case 'Arguments':
|
|
15491
|
+
case 'Array':
|
|
15492
|
+
case 'Object':
|
|
15493
|
+
case 'Boolean':
|
|
15494
|
+
case 'Number':
|
|
15495
|
+
case 'String':
|
|
15496
|
+
case 'Date':
|
|
15497
|
+
case 'Error':
|
|
15498
|
+
case 'RegExp':
|
|
15499
|
+
case 'Int8Array':
|
|
15500
|
+
case 'Uint8Array':
|
|
15501
|
+
case 'Uint8ClampedArray':
|
|
15502
|
+
case 'Int16Array':
|
|
15503
|
+
case 'Uint16Array':
|
|
15504
|
+
case 'Int32Array':
|
|
15505
|
+
case 'Uint32Array':
|
|
15506
|
+
case 'Float32Array':
|
|
15507
|
+
case 'Float64Array':
|
|
15508
|
+
case 'ArrayBuffer':
|
|
15509
|
+
break;
|
|
15510
|
+
|
|
15511
|
+
default:
|
|
15512
|
+
// Values of other types are only equal if identical.
|
|
15513
|
+
return false;
|
|
15514
|
+
}
|
|
15515
|
+
|
|
15516
|
+
var keysA = keys(a);
|
|
15517
|
+
|
|
15518
|
+
if (keysA.length !== keys(b).length) {
|
|
15519
|
+
return false;
|
|
15520
|
+
}
|
|
15521
|
+
|
|
15522
|
+
var extendedStackA = stackA.concat([a]);
|
|
15523
|
+
var extendedStackB = stackB.concat([b]);
|
|
15524
|
+
idx = keysA.length - 1;
|
|
15525
|
+
|
|
15526
|
+
while (idx >= 0) {
|
|
15527
|
+
var key = keysA[idx];
|
|
15528
|
+
|
|
15529
|
+
if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
|
|
15530
|
+
return false;
|
|
15531
|
+
}
|
|
15532
|
+
|
|
15533
|
+
idx -= 1;
|
|
15534
|
+
}
|
|
15535
|
+
|
|
15536
|
+
return true;
|
|
15537
|
+
}
|
|
15538
|
+
|
|
15539
|
+
/**
|
|
15540
|
+
* Returns `true` if its arguments are equivalent, `false` otherwise. Handles
|
|
15541
|
+
* cyclical data structures.
|
|
15542
|
+
*
|
|
15543
|
+
* Dispatches symmetrically to the `equals` methods of both arguments, if
|
|
15544
|
+
* present.
|
|
15545
|
+
*
|
|
15546
|
+
* @func
|
|
15547
|
+
* @memberOf R
|
|
15548
|
+
* @since v0.15.0
|
|
15549
|
+
* @category Relation
|
|
15550
|
+
* @sig a -> b -> Boolean
|
|
15551
|
+
* @param {*} a
|
|
15552
|
+
* @param {*} b
|
|
15553
|
+
* @return {Boolean}
|
|
15554
|
+
* @example
|
|
15555
|
+
*
|
|
15556
|
+
* R.equals(1, 1); //=> true
|
|
15557
|
+
* R.equals(1, '1'); //=> false
|
|
15558
|
+
* R.equals([1, 2, 3], [1, 2, 3]); //=> true
|
|
15559
|
+
*
|
|
15560
|
+
* const a = {}; a.v = a;
|
|
15561
|
+
* const b = {}; b.v = b;
|
|
15562
|
+
* R.equals(a, b); //=> true
|
|
15563
|
+
*/
|
|
15564
|
+
|
|
15565
|
+
var equals =
|
|
15566
|
+
/*#__PURE__*/
|
|
15567
|
+
_curry2(function equals(a, b) {
|
|
15568
|
+
return _equals(a, b, [], []);
|
|
15569
|
+
});
|
|
15570
|
+
|
|
15571
|
+
function _indexOf(list, a, idx) {
|
|
15572
|
+
var inf, item; // Array.prototype.indexOf doesn't exist below IE9
|
|
15573
|
+
|
|
15574
|
+
if (typeof list.indexOf === 'function') {
|
|
15575
|
+
switch (typeof a) {
|
|
15576
|
+
case 'number':
|
|
15577
|
+
if (a === 0) {
|
|
15578
|
+
// manually crawl the list to distinguish between +0 and -0
|
|
15579
|
+
inf = 1 / a;
|
|
15580
|
+
|
|
15581
|
+
while (idx < list.length) {
|
|
15582
|
+
item = list[idx];
|
|
15583
|
+
|
|
15584
|
+
if (item === 0 && 1 / item === inf) {
|
|
15585
|
+
return idx;
|
|
15586
|
+
}
|
|
15587
|
+
|
|
15588
|
+
idx += 1;
|
|
15589
|
+
}
|
|
15590
|
+
|
|
15591
|
+
return -1;
|
|
15592
|
+
} else if (a !== a) {
|
|
15593
|
+
// NaN
|
|
15594
|
+
while (idx < list.length) {
|
|
15595
|
+
item = list[idx];
|
|
15596
|
+
|
|
15597
|
+
if (typeof item === 'number' && item !== item) {
|
|
15598
|
+
return idx;
|
|
15599
|
+
}
|
|
15600
|
+
|
|
15601
|
+
idx += 1;
|
|
15602
|
+
}
|
|
15603
|
+
|
|
15604
|
+
return -1;
|
|
15605
|
+
} // non-zero numbers can utilise Set
|
|
15606
|
+
|
|
15607
|
+
|
|
15608
|
+
return list.indexOf(a, idx);
|
|
15609
|
+
// all these types can utilise Set
|
|
15610
|
+
|
|
15611
|
+
case 'string':
|
|
15612
|
+
case 'boolean':
|
|
15613
|
+
case 'function':
|
|
15614
|
+
case 'undefined':
|
|
15615
|
+
return list.indexOf(a, idx);
|
|
15616
|
+
|
|
15617
|
+
case 'object':
|
|
15618
|
+
if (a === null) {
|
|
15619
|
+
// null can utilise Set
|
|
15620
|
+
return list.indexOf(a, idx);
|
|
15621
|
+
}
|
|
15622
|
+
|
|
15623
|
+
}
|
|
15624
|
+
} // anything else not covered above, defer to R.equals
|
|
15625
|
+
|
|
15626
|
+
|
|
15627
|
+
while (idx < list.length) {
|
|
15628
|
+
if (equals(list[idx], a)) {
|
|
15629
|
+
return idx;
|
|
15630
|
+
}
|
|
15631
|
+
|
|
15632
|
+
idx += 1;
|
|
15633
|
+
}
|
|
15634
|
+
|
|
15635
|
+
return -1;
|
|
15636
|
+
}
|
|
15637
|
+
|
|
15638
|
+
function _includes(a, list) {
|
|
15639
|
+
return _indexOf(list, a, 0) >= 0;
|
|
15640
|
+
}
|
|
15641
|
+
|
|
15642
|
+
function _quote(s) {
|
|
15643
|
+
var escaped = s.replace(/\\/g, '\\\\').replace(/[\b]/g, '\\b') // \b matches word boundary; [\b] matches backspace
|
|
15644
|
+
.replace(/\f/g, '\\f').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\t/g, '\\t').replace(/\v/g, '\\v').replace(/\0/g, '\\0');
|
|
15645
|
+
return '"' + escaped.replace(/"/g, '\\"') + '"';
|
|
15646
|
+
}
|
|
15647
|
+
|
|
15648
|
+
/**
|
|
15649
|
+
* Polyfill from <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>.
|
|
15650
|
+
*/
|
|
15651
|
+
var pad = function pad(n) {
|
|
15652
|
+
return (n < 10 ? '0' : '') + n;
|
|
15653
|
+
};
|
|
15654
|
+
|
|
15655
|
+
var _toISOString = typeof Date.prototype.toISOString === 'function' ? function _toISOString(d) {
|
|
15656
|
+
return d.toISOString();
|
|
15657
|
+
} : function _toISOString(d) {
|
|
15658
|
+
return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z';
|
|
15659
|
+
};
|
|
15660
|
+
|
|
15661
|
+
function _complement(f) {
|
|
15662
|
+
return function () {
|
|
15663
|
+
return !f.apply(this, arguments);
|
|
15664
|
+
};
|
|
15665
|
+
}
|
|
15666
|
+
|
|
15667
|
+
function _filter(fn, list) {
|
|
15668
|
+
var idx = 0;
|
|
15669
|
+
var len = list.length;
|
|
15670
|
+
var result = [];
|
|
15671
|
+
|
|
15672
|
+
while (idx < len) {
|
|
15673
|
+
if (fn(list[idx])) {
|
|
15674
|
+
result[result.length] = list[idx];
|
|
15675
|
+
}
|
|
15676
|
+
|
|
15677
|
+
idx += 1;
|
|
15678
|
+
}
|
|
15679
|
+
|
|
15680
|
+
return result;
|
|
15681
|
+
}
|
|
15682
|
+
|
|
15683
|
+
function _isObject(x) {
|
|
15684
|
+
return Object.prototype.toString.call(x) === '[object Object]';
|
|
15685
|
+
}
|
|
15686
|
+
|
|
15687
|
+
var XFilter =
|
|
15688
|
+
/*#__PURE__*/
|
|
15689
|
+
function () {
|
|
15690
|
+
function XFilter(f, xf) {
|
|
15691
|
+
this.xf = xf;
|
|
15692
|
+
this.f = f;
|
|
15693
|
+
}
|
|
15694
|
+
|
|
15695
|
+
XFilter.prototype['@@transducer/init'] = _xfBase.init;
|
|
15696
|
+
XFilter.prototype['@@transducer/result'] = _xfBase.result;
|
|
15697
|
+
|
|
15698
|
+
XFilter.prototype['@@transducer/step'] = function (result, input) {
|
|
15699
|
+
return this.f(input) ? this.xf['@@transducer/step'](result, input) : result;
|
|
15700
|
+
};
|
|
15701
|
+
|
|
15702
|
+
return XFilter;
|
|
15703
|
+
}();
|
|
15704
|
+
|
|
15705
|
+
var _xfilter =
|
|
15706
|
+
/*#__PURE__*/
|
|
15707
|
+
_curry2(function _xfilter(f, xf) {
|
|
15708
|
+
return new XFilter(f, xf);
|
|
15709
|
+
});
|
|
15710
|
+
|
|
15711
|
+
/**
|
|
15712
|
+
* Takes a predicate and a `Filterable`, and returns a new filterable of the
|
|
15713
|
+
* same type containing the members of the given filterable which satisfy the
|
|
15714
|
+
* given predicate. Filterable objects include plain objects or any object
|
|
15715
|
+
* that has a filter method such as `Array`.
|
|
15716
|
+
*
|
|
15717
|
+
* Dispatches to the `filter` method of the second argument, if present.
|
|
15718
|
+
*
|
|
15719
|
+
* Acts as a transducer if a transformer is given in list position.
|
|
15720
|
+
*
|
|
15721
|
+
* @func
|
|
15722
|
+
* @memberOf R
|
|
15723
|
+
* @since v0.1.0
|
|
15724
|
+
* @category List
|
|
15725
|
+
* @sig Filterable f => (a -> Boolean) -> f a -> f a
|
|
15726
|
+
* @param {Function} pred
|
|
15727
|
+
* @param {Array} filterable
|
|
15728
|
+
* @return {Array} Filterable
|
|
15729
|
+
* @see R.reject, R.transduce, R.addIndex
|
|
15730
|
+
* @example
|
|
15731
|
+
*
|
|
15732
|
+
* const isEven = n => n % 2 === 0;
|
|
15733
|
+
*
|
|
15734
|
+
* R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]
|
|
15735
|
+
*
|
|
15736
|
+
* R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
|
|
15737
|
+
*/
|
|
15738
|
+
|
|
15739
|
+
var filter =
|
|
15740
|
+
/*#__PURE__*/
|
|
15741
|
+
_curry2(
|
|
15742
|
+
/*#__PURE__*/
|
|
15743
|
+
_dispatchable(['filter'], _xfilter, function (pred, filterable) {
|
|
15744
|
+
return _isObject(filterable) ? _reduce(function (acc, key) {
|
|
15745
|
+
if (pred(filterable[key])) {
|
|
15746
|
+
acc[key] = filterable[key];
|
|
15747
|
+
}
|
|
15748
|
+
|
|
15749
|
+
return acc;
|
|
15750
|
+
}, {}, keys(filterable)) : // else
|
|
15751
|
+
_filter(pred, filterable);
|
|
15752
|
+
}));
|
|
15753
|
+
|
|
15754
|
+
/**
|
|
15755
|
+
* The complement of [`filter`](#filter).
|
|
15756
|
+
*
|
|
15757
|
+
* Acts as a transducer if a transformer is given in list position. Filterable
|
|
15758
|
+
* objects include plain objects or any object that has a filter method such
|
|
15759
|
+
* as `Array`.
|
|
15760
|
+
*
|
|
15761
|
+
* @func
|
|
15762
|
+
* @memberOf R
|
|
15763
|
+
* @since v0.1.0
|
|
15764
|
+
* @category List
|
|
15765
|
+
* @sig Filterable f => (a -> Boolean) -> f a -> f a
|
|
15766
|
+
* @param {Function} pred
|
|
15767
|
+
* @param {Array} filterable
|
|
15768
|
+
* @return {Array}
|
|
15769
|
+
* @see R.filter, R.transduce, R.addIndex
|
|
15770
|
+
* @example
|
|
15771
|
+
*
|
|
15772
|
+
* const isOdd = (n) => n % 2 === 1;
|
|
15773
|
+
*
|
|
15774
|
+
* R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]
|
|
15775
|
+
*
|
|
15776
|
+
* R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
|
|
15777
|
+
*/
|
|
15778
|
+
|
|
15779
|
+
var reject =
|
|
15780
|
+
/*#__PURE__*/
|
|
15781
|
+
_curry2(function reject(pred, filterable) {
|
|
15782
|
+
return filter(_complement(pred), filterable);
|
|
15783
|
+
});
|
|
15784
|
+
|
|
15785
|
+
function _toString(x, seen) {
|
|
15786
|
+
var recur = function recur(y) {
|
|
15787
|
+
var xs = seen.concat([x]);
|
|
15788
|
+
return _includes(y, xs) ? '<Circular>' : _toString(y, xs);
|
|
15789
|
+
}; // mapPairs :: (Object, [String]) -> [String]
|
|
15790
|
+
|
|
15791
|
+
|
|
15792
|
+
var mapPairs = function (obj, keys) {
|
|
15793
|
+
return _map(function (k) {
|
|
15794
|
+
return _quote(k) + ': ' + recur(obj[k]);
|
|
15795
|
+
}, keys.slice().sort());
|
|
15796
|
+
};
|
|
15797
|
+
|
|
15798
|
+
switch (Object.prototype.toString.call(x)) {
|
|
15799
|
+
case '[object Arguments]':
|
|
15800
|
+
return '(function() { return arguments; }(' + _map(recur, x).join(', ') + '))';
|
|
15801
|
+
|
|
15802
|
+
case '[object Array]':
|
|
15803
|
+
return '[' + _map(recur, x).concat(mapPairs(x, reject(function (k) {
|
|
15804
|
+
return /^\d+$/.test(k);
|
|
15805
|
+
}, keys(x)))).join(', ') + ']';
|
|
15806
|
+
|
|
15807
|
+
case '[object Boolean]':
|
|
15808
|
+
return typeof x === 'object' ? 'new Boolean(' + recur(x.valueOf()) + ')' : x.toString();
|
|
15809
|
+
|
|
15810
|
+
case '[object Date]':
|
|
15811
|
+
return 'new Date(' + (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString(x))) + ')';
|
|
15812
|
+
|
|
15813
|
+
case '[object Null]':
|
|
15814
|
+
return 'null';
|
|
15815
|
+
|
|
15816
|
+
case '[object Number]':
|
|
15817
|
+
return typeof x === 'object' ? 'new Number(' + recur(x.valueOf()) + ')' : 1 / x === -Infinity ? '-0' : x.toString(10);
|
|
15818
|
+
|
|
15819
|
+
case '[object String]':
|
|
15820
|
+
return typeof x === 'object' ? 'new String(' + recur(x.valueOf()) + ')' : _quote(x);
|
|
15821
|
+
|
|
15822
|
+
case '[object Undefined]':
|
|
15823
|
+
return 'undefined';
|
|
15824
|
+
|
|
15825
|
+
default:
|
|
15826
|
+
if (typeof x.toString === 'function') {
|
|
15827
|
+
var repr = x.toString();
|
|
15828
|
+
|
|
15829
|
+
if (repr !== '[object Object]') {
|
|
15830
|
+
return repr;
|
|
15831
|
+
}
|
|
15832
|
+
}
|
|
15833
|
+
|
|
15834
|
+
return '{' + mapPairs(x, keys(x)).join(', ') + '}';
|
|
15835
|
+
}
|
|
15836
|
+
}
|
|
15837
|
+
|
|
15838
|
+
/**
|
|
15839
|
+
* Returns the string representation of the given value. `eval`'ing the output
|
|
15840
|
+
* should result in a value equivalent to the input value. Many of the built-in
|
|
15841
|
+
* `toString` methods do not satisfy this requirement.
|
|
15842
|
+
*
|
|
15843
|
+
* If the given value is an `[object Object]` with a `toString` method other
|
|
15844
|
+
* than `Object.prototype.toString`, this method is invoked with no arguments
|
|
15845
|
+
* to produce the return value. This means user-defined constructor functions
|
|
15846
|
+
* can provide a suitable `toString` method. For example:
|
|
15847
|
+
*
|
|
15848
|
+
* function Point(x, y) {
|
|
15849
|
+
* this.x = x;
|
|
15850
|
+
* this.y = y;
|
|
15851
|
+
* }
|
|
15852
|
+
*
|
|
15853
|
+
* Point.prototype.toString = function() {
|
|
15854
|
+
* return 'new Point(' + this.x + ', ' + this.y + ')';
|
|
15855
|
+
* };
|
|
15856
|
+
*
|
|
15857
|
+
* R.toString(new Point(1, 2)); //=> 'new Point(1, 2)'
|
|
15858
|
+
*
|
|
15859
|
+
* @func
|
|
15860
|
+
* @memberOf R
|
|
15861
|
+
* @since v0.14.0
|
|
15862
|
+
* @category String
|
|
15863
|
+
* @sig * -> String
|
|
15864
|
+
* @param {*} val
|
|
15865
|
+
* @return {String}
|
|
15866
|
+
* @example
|
|
15867
|
+
*
|
|
15868
|
+
* R.toString(42); //=> '42'
|
|
15869
|
+
* R.toString('abc'); //=> '"abc"'
|
|
15870
|
+
* R.toString([1, 2, 3]); //=> '[1, 2, 3]'
|
|
15871
|
+
* R.toString({foo: 1, bar: 2, baz: 3}); //=> '{"bar": 2, "baz": 3, "foo": 1}'
|
|
15872
|
+
* R.toString(new Date('2001-02-03T04:05:06Z')); //=> 'new Date("2001-02-03T04:05:06.000Z")'
|
|
15873
|
+
*/
|
|
15874
|
+
|
|
15875
|
+
var toString$1 =
|
|
15876
|
+
/*#__PURE__*/
|
|
15877
|
+
_curry1(function toString(val) {
|
|
15878
|
+
return _toString(val, []);
|
|
15879
|
+
});
|
|
15880
|
+
|
|
15881
|
+
/**
|
|
15882
|
+
* Returns the second argument if it is not `null`, `undefined` or `NaN`;
|
|
15883
|
+
* otherwise the first argument is returned.
|
|
15884
|
+
*
|
|
15885
|
+
* @func
|
|
15886
|
+
* @memberOf R
|
|
15887
|
+
* @since v0.10.0
|
|
15888
|
+
* @category Logic
|
|
15889
|
+
* @sig a -> b -> a | b
|
|
15890
|
+
* @param {a} default The default value.
|
|
15891
|
+
* @param {b} val `val` will be returned instead of `default` unless `val` is `null`, `undefined` or `NaN`.
|
|
15892
|
+
* @return {*} The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value
|
|
15893
|
+
* @example
|
|
15894
|
+
*
|
|
15895
|
+
* const defaultTo42 = R.defaultTo(42);
|
|
15896
|
+
*
|
|
15897
|
+
* defaultTo42(null); //=> 42
|
|
15898
|
+
* defaultTo42(undefined); //=> 42
|
|
15899
|
+
* defaultTo42(false); //=> false
|
|
15900
|
+
* defaultTo42('Ramda'); //=> 'Ramda'
|
|
15901
|
+
* // parseInt('string') results in NaN
|
|
15902
|
+
* defaultTo42(parseInt('string')); //=> 42
|
|
15903
|
+
*/
|
|
15904
|
+
|
|
15905
|
+
var defaultTo =
|
|
15906
|
+
/*#__PURE__*/
|
|
15907
|
+
_curry2(function defaultTo(d, v) {
|
|
15908
|
+
return v == null || v !== v ? d : v;
|
|
15909
|
+
});
|
|
15910
|
+
|
|
15911
|
+
/**
|
|
15912
|
+
* Creates a function that will process either the `onTrue` or the `onFalse`
|
|
15913
|
+
* function depending upon the result of the `condition` predicate.
|
|
15914
|
+
*
|
|
15915
|
+
* @func
|
|
15916
|
+
* @memberOf R
|
|
15917
|
+
* @since v0.8.0
|
|
15918
|
+
* @category Logic
|
|
15919
|
+
* @sig (*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)
|
|
15920
|
+
* @param {Function} condition A predicate function
|
|
15921
|
+
* @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value.
|
|
15922
|
+
* @param {Function} onFalse A function to invoke when the `condition` evaluates to a falsy value.
|
|
15923
|
+
* @return {Function} A new function that will process either the `onTrue` or the `onFalse`
|
|
15924
|
+
* function depending upon the result of the `condition` predicate.
|
|
15925
|
+
* @see R.unless, R.when, R.cond
|
|
15926
|
+
* @example
|
|
15927
|
+
*
|
|
15928
|
+
* const incCount = R.ifElse(
|
|
15929
|
+
* R.has('count'),
|
|
15930
|
+
* R.over(R.lensProp('count'), R.inc),
|
|
15931
|
+
* R.assoc('count', 1)
|
|
15932
|
+
* );
|
|
15933
|
+
* incCount({}); //=> { count: 1 }
|
|
15934
|
+
* incCount({ count: 1 }); //=> { count: 2 }
|
|
15935
|
+
*/
|
|
15936
|
+
|
|
15937
|
+
var ifElse =
|
|
15938
|
+
/*#__PURE__*/
|
|
15939
|
+
_curry3(function ifElse(condition, onTrue, onFalse) {
|
|
15940
|
+
return curryN(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {
|
|
15941
|
+
return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);
|
|
15942
|
+
});
|
|
15943
|
+
});
|
|
15944
|
+
|
|
15945
|
+
/**
|
|
15946
|
+
* If the given, non-null object has a value at the given path, returns the
|
|
15947
|
+
* value at that path. Otherwise returns the provided default value.
|
|
15948
|
+
*
|
|
15949
|
+
* @func
|
|
15950
|
+
* @memberOf R
|
|
15951
|
+
* @since v0.18.0
|
|
15952
|
+
* @category Object
|
|
15953
|
+
* @typedefn Idx = String | Int
|
|
15954
|
+
* @sig a -> [Idx] -> {a} -> a
|
|
15955
|
+
* @param {*} d The default value.
|
|
15956
|
+
* @param {Array} p The path to use.
|
|
15957
|
+
* @param {Object} obj The object to retrieve the nested property from.
|
|
15958
|
+
* @return {*} The data at `path` of the supplied object or the default value.
|
|
15959
|
+
* @example
|
|
15960
|
+
*
|
|
15961
|
+
* R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2
|
|
15962
|
+
* R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> "N/A"
|
|
15963
|
+
*/
|
|
15964
|
+
|
|
15965
|
+
var pathOr =
|
|
15966
|
+
/*#__PURE__*/
|
|
15967
|
+
_curry3(function pathOr(d, p, obj) {
|
|
15968
|
+
return defaultTo(d, path(p, obj));
|
|
15969
|
+
});
|
|
15970
|
+
|
|
15971
|
+
/**
|
|
15972
|
+
* Calls an input function `n` times, returning an array containing the results
|
|
15973
|
+
* of those function calls.
|
|
15974
|
+
*
|
|
15975
|
+
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
15976
|
+
* and is gradually incremented to `n - 1`.
|
|
15977
|
+
*
|
|
15978
|
+
* @func
|
|
15979
|
+
* @memberOf R
|
|
15980
|
+
* @since v0.2.3
|
|
15981
|
+
* @category List
|
|
15982
|
+
* @sig (Number -> a) -> Number -> [a]
|
|
15983
|
+
* @param {Function} fn The function to invoke. Passed one argument, the current value of `n`.
|
|
15984
|
+
* @param {Number} n A value between `0` and `n - 1`. Increments after each function call.
|
|
15985
|
+
* @return {Array} An array containing the return values of all calls to `fn`.
|
|
15986
|
+
* @see R.repeat
|
|
15987
|
+
* @example
|
|
15988
|
+
*
|
|
15989
|
+
* R.times(R.identity, 5); //=> [0, 1, 2, 3, 4]
|
|
15990
|
+
* @symb R.times(f, 0) = []
|
|
15991
|
+
* @symb R.times(f, 1) = [f(0)]
|
|
15992
|
+
* @symb R.times(f, 2) = [f(0), f(1)]
|
|
15993
|
+
*/
|
|
15994
|
+
|
|
15995
|
+
var times =
|
|
15996
|
+
/*#__PURE__*/
|
|
15997
|
+
_curry2(function times(fn, n) {
|
|
15998
|
+
var len = Number(n);
|
|
15999
|
+
var idx = 0;
|
|
16000
|
+
var list;
|
|
16001
|
+
|
|
16002
|
+
if (len < 0 || isNaN(len)) {
|
|
16003
|
+
throw new RangeError('n must be a non-negative number');
|
|
16004
|
+
}
|
|
16005
|
+
|
|
16006
|
+
list = new Array(len);
|
|
16007
|
+
|
|
16008
|
+
while (idx < len) {
|
|
16009
|
+
list[idx] = fn(idx);
|
|
16010
|
+
idx += 1;
|
|
16011
|
+
}
|
|
16012
|
+
|
|
16013
|
+
return list;
|
|
16014
|
+
});
|
|
16015
|
+
|
|
16016
|
+
/**
|
|
16017
|
+
* Returns a fixed list of size `n` containing a specified identical value.
|
|
16018
|
+
*
|
|
16019
|
+
* @func
|
|
16020
|
+
* @memberOf R
|
|
16021
|
+
* @since v0.1.1
|
|
16022
|
+
* @category List
|
|
16023
|
+
* @sig a -> n -> [a]
|
|
16024
|
+
* @param {*} value The value to repeat.
|
|
16025
|
+
* @param {Number} n The desired size of the output list.
|
|
16026
|
+
* @return {Array} A new array containing `n` `value`s.
|
|
16027
|
+
* @see R.times
|
|
16028
|
+
* @example
|
|
16029
|
+
*
|
|
16030
|
+
* R.repeat('hi', 5); //=> ['hi', 'hi', 'hi', 'hi', 'hi']
|
|
16031
|
+
*
|
|
16032
|
+
* const obj = {};
|
|
16033
|
+
* const repeatedObjs = R.repeat(obj, 5); //=> [{}, {}, {}, {}, {}]
|
|
16034
|
+
* repeatedObjs[0] === repeatedObjs[1]; //=> true
|
|
16035
|
+
* @symb R.repeat(a, 0) = []
|
|
16036
|
+
* @symb R.repeat(a, 1) = [a]
|
|
16037
|
+
* @symb R.repeat(a, 2) = [a, a]
|
|
16038
|
+
*/
|
|
16039
|
+
|
|
16040
|
+
var repeat =
|
|
16041
|
+
/*#__PURE__*/
|
|
16042
|
+
_curry2(function repeat(value, n) {
|
|
16043
|
+
return times(always(value), n);
|
|
16044
|
+
});
|
|
16045
|
+
|
|
16046
|
+
function _isRegExp(x) {
|
|
16047
|
+
return Object.prototype.toString.call(x) === '[object RegExp]';
|
|
16048
|
+
}
|
|
16049
|
+
|
|
16050
|
+
/**
|
|
16051
|
+
* Determines whether a given string matches a given regular expression.
|
|
16052
|
+
*
|
|
16053
|
+
* @func
|
|
16054
|
+
* @memberOf R
|
|
16055
|
+
* @since v0.12.0
|
|
16056
|
+
* @category String
|
|
16057
|
+
* @sig RegExp -> String -> Boolean
|
|
16058
|
+
* @param {RegExp} pattern
|
|
16059
|
+
* @param {String} str
|
|
16060
|
+
* @return {Boolean}
|
|
16061
|
+
* @see R.match
|
|
16062
|
+
* @example
|
|
16063
|
+
*
|
|
16064
|
+
* R.test(/^x/, 'xyz'); //=> true
|
|
16065
|
+
* R.test(/^y/, 'xyz'); //=> false
|
|
16066
|
+
*/
|
|
16067
|
+
|
|
16068
|
+
var test =
|
|
16069
|
+
/*#__PURE__*/
|
|
16070
|
+
_curry2(function test(pattern, str) {
|
|
16071
|
+
if (!_isRegExp(pattern)) {
|
|
16072
|
+
throw new TypeError('‘test’ requires a value of type RegExp as its first argument; received ' + toString$1(pattern));
|
|
16073
|
+
}
|
|
16074
|
+
|
|
16075
|
+
return _cloneRegExp(pattern).test(str);
|
|
16076
|
+
});
|
|
16077
|
+
|
|
14504
16078
|
var URL_TEST = /(([a-z]{3,6}:\/\/)|(^|\s))([a-zA-Z0-9\-]+\.)+[a-z]{2,13}[\.\?\=\&\%\/\w\-]*\b([^@]|$)/;
|
|
14505
16079
|
|
|
14506
16080
|
var ButtonWithLink = function ButtonWithLink(_ref) {
|
|
@@ -14526,7 +16100,7 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
|
|
|
14526
16100
|
return safeChildren(children, /*#__PURE__*/React__default.createElement("span", null));
|
|
14527
16101
|
}
|
|
14528
16102
|
|
|
14529
|
-
return
|
|
16103
|
+
return test(URL_TEST, url) || fileLink ? /*#__PURE__*/React__default.createElement(ExternalLink, {
|
|
14530
16104
|
href: url,
|
|
14531
16105
|
tabIndex: "-1",
|
|
14532
16106
|
newTab: newTab,
|
|
@@ -17604,7 +19178,7 @@ var genErrorMessage = function genErrorMessage(strings) {
|
|
|
17604
19178
|
|
|
17605
19179
|
return function (inputState) {
|
|
17606
19180
|
return strings.reduce(function (accum, current, index) {
|
|
17607
|
-
return "".concat(accum).concat(current).concat(argKeys[index] ?
|
|
19181
|
+
return "".concat(accum).concat(current).concat(argKeys[index] ? pathOr("", [argKeys[index]], inputState) : "");
|
|
17608
19182
|
}, []);
|
|
17609
19183
|
};
|
|
17610
19184
|
};
|
|
@@ -17858,7 +19432,7 @@ var ProcessingFee = function ProcessingFee(_ref) {
|
|
|
17858
19432
|
hiddenStyles: hide
|
|
17859
19433
|
}, /*#__PURE__*/React__default.createElement(Alert$1, {
|
|
17860
19434
|
heading: "Processing Fee",
|
|
17861
|
-
text: "There is a processing fee of ".concat(feeType === "FLAT" ? "".concat(displayCurrency(feeValue)) : "".concat(feeValue * 100, "%"), " ").concat(
|
|
19435
|
+
text: "There is a processing fee of ".concat(feeType === "FLAT" ? "".concat(displayCurrency(feeValue)) : "".concat(feeValue * 100, "%"), " ").concat(ifElse(isNil, always(""), function (a) {
|
|
17862
19436
|
return "with a minimum of ".concat(displayCurrency(a), " ");
|
|
17863
19437
|
})(feeMinimum), "on all ").concat(feeName, " payments."),
|
|
17864
19438
|
variant: "info",
|
|
@@ -31014,7 +32588,7 @@ var TableListItem = function TableListItem(_ref) {
|
|
|
31014
32588
|
};
|
|
31015
32589
|
|
|
31016
32590
|
var EmailForm = function EmailForm(_ref) {
|
|
31017
|
-
var _emailFieldErrorMessa
|
|
32591
|
+
var _emailFieldErrorMessa;
|
|
31018
32592
|
|
|
31019
32593
|
var _ref$variant = _ref.variant,
|
|
31020
32594
|
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
@@ -31034,7 +32608,6 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
31034
32608
|
}
|
|
31035
32609
|
|
|
31036
32610
|
var emailFieldErrorMessages = (_emailFieldErrorMessa = {}, _defineProperty(_emailFieldErrorMessa, required.error, "Email is required"), _defineProperty(_emailFieldErrorMessa, isProbablyEmail.error, "Invalid email address"), _emailFieldErrorMessa);
|
|
31037
|
-
var confirmEmailFieldErrorMessages = (_confirmEmailFieldErr = {}, _defineProperty(_confirmEmailFieldErr, matchesField.error, "Confirm email must match email"), _defineProperty(_confirmEmailFieldErr, required.error, "Confirm email must match email"), _confirmEmailFieldErr);
|
|
31038
32611
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
31039
32612
|
variant: variant,
|
|
31040
32613
|
role: "form",
|
|
@@ -31049,25 +32622,12 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
31049
32622
|
onKeyDown: function onKeyDown(e) {
|
|
31050
32623
|
return e.key === "Enter" && handleSubmit(e);
|
|
31051
32624
|
}
|
|
31052
|
-
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
31053
|
-
labelTextWhenNoError: "Confirm email",
|
|
31054
|
-
errorMessages: confirmEmailFieldErrorMessages,
|
|
31055
|
-
type: "email",
|
|
31056
|
-
field: fields.confirmEmail,
|
|
31057
|
-
fieldActions: actions.fields.confirmEmail,
|
|
31058
|
-
showErrors: showErrors,
|
|
31059
|
-
onKeyDown: function onKeyDown(e) {
|
|
31060
|
-
return e.key === "Enter" && handleSubmit(e);
|
|
31061
|
-
}
|
|
31062
32625
|
})));
|
|
31063
32626
|
};
|
|
31064
32627
|
|
|
31065
32628
|
var formConfig$3 = {
|
|
31066
32629
|
email: {
|
|
31067
32630
|
validators: [required(), isProbablyEmail()]
|
|
31068
|
-
},
|
|
31069
|
-
confirmEmail: {
|
|
31070
|
-
validators: [required(), matchesField("email")]
|
|
31071
32631
|
}
|
|
31072
32632
|
};
|
|
31073
32633
|
|
|
@@ -31155,7 +32715,7 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
|
|
|
31155
32715
|
childWidth: "12rem",
|
|
31156
32716
|
justifyContent: "space-evenly",
|
|
31157
32717
|
disableScroll: true
|
|
31158
|
-
},
|
|
32718
|
+
}, repeat( /*#__PURE__*/React__default.createElement(Box, null), boxesBefore), tabs.map(function (t, i) {
|
|
31159
32719
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
31160
32720
|
key: t,
|
|
31161
32721
|
borderSize: "3px",
|
|
@@ -31168,7 +32728,7 @@ var HighlightTabRow = function HighlightTabRow(_ref) {
|
|
|
31168
32728
|
weight: FONT_WEIGHT_SEMIBOLD,
|
|
31169
32729
|
extraStyles: "display: block; white-space: nowrap;"
|
|
31170
32730
|
}, t));
|
|
31171
|
-
}),
|
|
32731
|
+
}), repeat( /*#__PURE__*/React__default.createElement(Box, null), boxesAfter)));
|
|
31172
32732
|
};
|
|
31173
32733
|
|
|
31174
32734
|
var HighlightTabRow$1 = /*#__PURE__*/React.memo(themeComponent(HighlightTabRow, "HighlightTabRow", fallbackValues$q));
|
|
@@ -32587,8 +34147,10 @@ var Module = function Module(_ref) {
|
|
|
32587
34147
|
var Module$1 = /*#__PURE__*/React.memo(themeComponent(Module, "Module", fallbackValues$r, "default"));
|
|
32588
34148
|
|
|
32589
34149
|
var backgroundColor$6 = "#3b414d";
|
|
34150
|
+
var shadowColor = "#292A33";
|
|
32590
34151
|
var fallbackValues$s = {
|
|
32591
|
-
backgroundColor: backgroundColor$6
|
|
34152
|
+
backgroundColor: backgroundColor$6,
|
|
34153
|
+
shadowColor: shadowColor
|
|
32592
34154
|
};
|
|
32593
34155
|
|
|
32594
34156
|
var NavMenuDesktop = function NavMenuDesktop(_ref) {
|
|
@@ -32617,7 +34179,7 @@ var NavMenuDesktop = function NavMenuDesktop(_ref) {
|
|
|
32617
34179
|
extraStyles: "position: relative; ".concat(menuCarat),
|
|
32618
34180
|
background: themeValues.backgroundColor,
|
|
32619
34181
|
borderRadius: "5px",
|
|
32620
|
-
boxShadow: "0px 3px 8px 0px ".concat(themeValues.
|
|
34182
|
+
boxShadow: "0px 3px 8px 0px ".concat(themeValues.shadowColor, ", 0px 2px 14px 0px ").concat(themeValues.shadowColor, ";"),
|
|
32621
34183
|
onMouseEnter: onMouseEnter,
|
|
32622
34184
|
onMouseLeave: onMouseLeave,
|
|
32623
34185
|
onFocus: onFocus,
|
|
@@ -34895,7 +36457,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
34895
36457
|
hidden: hideDefaultPayment
|
|
34896
36458
|
}), !!(fees === null || fees === void 0 ? void 0 : fees.value) && /*#__PURE__*/React__default.createElement(Alert$1, {
|
|
34897
36459
|
heading: "Processing Fee",
|
|
34898
|
-
text: "There is a processing fee of ".concat(fees.type === "FLAT" ? "".concat(displayCurrency(fees.value)) : "".concat(fees.value * 100, "%"), " ").concat(
|
|
36460
|
+
text: "There is a processing fee of ".concat(fees.type === "FLAT" ? "".concat(displayCurrency(fees.value)) : "".concat(fees.value * 100, "%"), " ").concat(ifElse(isNil, always(""), function (a) {
|
|
34899
36461
|
return "with a minimum of ".concat(displayCurrency(a), " ");
|
|
34900
36462
|
})(fees.minimumInCents), "on all bank account payments."),
|
|
34901
36463
|
variant: "info",
|
|
@@ -35259,10 +36821,12 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
35259
36821
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
35260
36822
|
justify: "space-between",
|
|
35261
36823
|
align: "center",
|
|
35262
|
-
childGap: "0.5rem"
|
|
36824
|
+
childGap: "0.5rem",
|
|
36825
|
+
nowrap: true
|
|
35263
36826
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
35264
36827
|
justify: "flex-start",
|
|
35265
|
-
align: "center"
|
|
36828
|
+
align: "center",
|
|
36829
|
+
nowrap: true
|
|
35266
36830
|
}, !section.hideRadioButton && /*#__PURE__*/React__default.createElement(Box, {
|
|
35267
36831
|
padding: "0"
|
|
35268
36832
|
}, /*#__PURE__*/React__default.createElement(RadioButton$2, {
|