{"ScriptPreparationCode":"/**\r\n * A function that always returns \u0060false\u0060. Any passed in parameters are ignored.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Function\r\n * @sig * -\u003E Boolean\r\n * @param {*}\r\n * @return {Boolean}\r\n * @see R.T\r\n * @example\r\n *\r\n * R.F(); //=\u003E false\r\n */\r\nvar F = function F() {\r\n return false;\r\n};\r\n\r\n/**\r\n * A function that always returns \u0060true\u0060. Any passed in parameters are ignored.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Function\r\n * @sig * -\u003E Boolean\r\n * @param {*}\r\n * @return {Boolean}\r\n * @see R.F\r\n * @example\r\n *\r\n * R.T(); //=\u003E true\r\n */\r\nvar T = function T() {\r\n return true;\r\n};\r\n\r\n/**\r\n * A special placeholder value used to specify \u0022gaps\u0022 within curried functions,\r\n * allowing partial application of any combination of arguments, regardless of\r\n * their positions.\r\n *\r\n * If \u0060g\u0060 is a curried ternary function and \u0060_\u0060 is \u0060R.__\u0060, the following are\r\n * equivalent:\r\n *\r\n * - \u0060g(1, 2, 3)\u0060\r\n * - \u0060g(_, 2, 3)(1)\u0060\r\n * - \u0060g(_, _, 3)(1)(2)\u0060\r\n * - \u0060g(_, _, 3)(1, 2)\u0060\r\n * - \u0060g(_, 2, _)(1, 3)\u0060\r\n * - \u0060g(_, 2)(1)(3)\u0060\r\n * - \u0060g(_, 2)(1, 3)\u0060\r\n * - \u0060g(_, 2)(_, 3)(1)\u0060\r\n *\r\n * @name __\r\n * @constant\r\n * @memberOf R\r\n * @since v0.6.0\r\n * @category Function\r\n * @example\r\n *\r\n * const greet = R.replace(\u0027{name}\u0027, R.__, \u0027Hello, {name}!\u0027);\r\n * greet(\u0027Alice\u0027); //=\u003E \u0027Hello, Alice!\u0027\r\n */\r\nvar __ = {\r\n \u0022@@functional/placeholder\u0022: true,\r\n};\r\n\r\nfunction _typeof(obj) {\r\n if (typeof Symbol === \u0022function\u0022 \u0026\u0026 typeof Symbol.iterator === \u0022symbol\u0022) {\r\n _typeof = function (obj) {\r\n return typeof obj;\r\n };\r\n } else {\r\n _typeof = function (obj) {\r\n return obj \u0026\u0026\r\n typeof Symbol === \u0022function\u0022 \u0026\u0026\r\n obj.constructor === Symbol \u0026\u0026\r\n obj !== Symbol.prototype\r\n ? \u0022symbol\u0022\r\n : typeof obj;\r\n };\r\n }\r\n\r\n return _typeof(obj);\r\n}\r\n\r\nfunction _isPlaceholder(a) {\r\n return (\r\n a != null \u0026\u0026\r\n _typeof(a) === \u0022object\u0022 \u0026\u0026\r\n a[\u0022@@functional/placeholder\u0022] === true\r\n );\r\n}\r\n\r\n/**\r\n * Optimized internal one-arity curry function.\r\n *\r\n * @private\r\n * @category Function\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} The curried function.\r\n */\r\n\r\nfunction _curry1(fn) {\r\n return function f1(a) {\r\n if (arguments.length === 0 || _isPlaceholder(a)) {\r\n return f1;\r\n } else {\r\n return fn.apply(this, arguments);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Optimized internal two-arity curry function.\r\n *\r\n * @private\r\n * @category Function\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} The curried function.\r\n */\r\n\r\nfunction _curry2(fn) {\r\n return function f2(a, b) {\r\n switch (arguments.length) {\r\n case 0:\r\n return f2;\r\n\r\n case 1:\r\n return _isPlaceholder(a)\r\n ? f2\r\n : _curry1(function (_b) {\r\n return fn(a, _b);\r\n });\r\n\r\n default:\r\n return _isPlaceholder(a) \u0026\u0026 _isPlaceholder(b)\r\n ? f2\r\n : _isPlaceholder(a)\r\n ? _curry1(function (_a) {\r\n return fn(_a, b);\r\n })\r\n : _isPlaceholder(b)\r\n ? _curry1(function (_b) {\r\n return fn(a, _b);\r\n })\r\n : fn(a, b);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Adds two values.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} a\r\n * @param {Number} b\r\n * @return {Number}\r\n * @see R.subtract\r\n * @example\r\n *\r\n * R.add(2, 3); //=\u003E 5\r\n * R.add(7)(10); //=\u003E 17\r\n */\r\n\r\nvar add = _curry2(function add(a, b) {\r\n return Number(a) \u002B Number(b);\r\n});\r\n\r\n/**\r\n * Private \u0060concat\u0060 function to merge two array-like objects.\r\n *\r\n * @private\r\n * @param {Array|Arguments} [set1=[]] An array-like object.\r\n * @param {Array|Arguments} [set2=[]] An array-like object.\r\n * @return {Array} A new, merged array.\r\n * @example\r\n *\r\n * _concat([4, 5, 6], [1, 2, 3]); //=\u003E [4, 5, 6, 1, 2, 3]\r\n */\r\nfunction _concat(set1, set2) {\r\n set1 = set1 || [];\r\n set2 = set2 || [];\r\n var idx;\r\n var len1 = set1.length;\r\n var len2 = set2.length;\r\n var result = [];\r\n idx = 0;\r\n\r\n while (idx \u003C len1) {\r\n result[result.length] = set1[idx];\r\n idx \u002B= 1;\r\n }\r\n\r\n idx = 0;\r\n\r\n while (idx \u003C len2) {\r\n result[result.length] = set2[idx];\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction _arity(n, fn) {\r\n /* eslint-disable no-unused-vars */\r\n switch (n) {\r\n case 0:\r\n return function () {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 1:\r\n return function (a0) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 2:\r\n return function (a0, a1) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 3:\r\n return function (a0, a1, a2) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 4:\r\n return function (a0, a1, a2, a3) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 5:\r\n return function (a0, a1, a2, a3, a4) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 6:\r\n return function (a0, a1, a2, a3, a4, a5) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 7:\r\n return function (a0, a1, a2, a3, a4, a5, a6) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 8:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 9:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n case 10:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\r\n return fn.apply(this, arguments);\r\n };\r\n\r\n default:\r\n throw new Error(\r\n \u0022First argument to _arity must be a non-negative integer no greater than ten\u0022\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Internal curryN function.\r\n *\r\n * @private\r\n * @category Function\r\n * @param {Number} length The arity of the curried function.\r\n * @param {Array} received An array of arguments received thus far.\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} The curried function.\r\n */\r\n\r\nfunction _curryN(length, received, fn) {\r\n return function () {\r\n var combined = [];\r\n var argsIdx = 0;\r\n var left = length;\r\n var combinedIdx = 0;\r\n\r\n while (combinedIdx \u003C received.length || argsIdx \u003C arguments.length) {\r\n var result;\r\n\r\n if (\r\n combinedIdx \u003C received.length \u0026\u0026\r\n (!_isPlaceholder(received[combinedIdx]) || argsIdx \u003E= arguments.length)\r\n ) {\r\n result = received[combinedIdx];\r\n } else {\r\n result = arguments[argsIdx];\r\n argsIdx \u002B= 1;\r\n }\r\n\r\n combined[combinedIdx] = result;\r\n\r\n if (!_isPlaceholder(result)) {\r\n left -= 1;\r\n }\r\n\r\n combinedIdx \u002B= 1;\r\n }\r\n\r\n return left \u003C= 0\r\n ? fn.apply(this, combined)\r\n : _arity(left, _curryN(length, combined, fn));\r\n };\r\n}\r\n\r\n/**\r\n * Returns a curried equivalent of the provided function, with the specified\r\n * arity. The curried function has two unusual capabilities. First, its\r\n * arguments needn\u0027t be provided one at a time. If \u0060g\u0060 is \u0060R.curryN(3, f)\u0060, the\r\n * following are equivalent:\r\n *\r\n * - \u0060g(1)(2)(3)\u0060\r\n * - \u0060g(1)(2, 3)\u0060\r\n * - \u0060g(1, 2)(3)\u0060\r\n * - \u0060g(1, 2, 3)\u0060\r\n *\r\n * Secondly, the special placeholder value [\u0060R.__\u0060](#__) may be used to specify\r\n * \u0022gaps\u0022, allowing partial application of any combination of arguments,\r\n * regardless of their positions. If \u0060g\u0060 is as above and \u0060_\u0060 is [\u0060R.__\u0060](#__),\r\n * the following are equivalent:\r\n *\r\n * - \u0060g(1, 2, 3)\u0060\r\n * - \u0060g(_, 2, 3)(1)\u0060\r\n * - \u0060g(_, _, 3)(1)(2)\u0060\r\n * - \u0060g(_, _, 3)(1, 2)\u0060\r\n * - \u0060g(_, 2)(1)(3)\u0060\r\n * - \u0060g(_, 2)(1, 3)\u0060\r\n * - \u0060g(_, 2)(_, 3)(1)\u0060\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.5.0\r\n * @category Function\r\n * @sig Number -\u003E (* -\u003E a) -\u003E (* -\u003E a)\r\n * @param {Number} length The arity for the returned function.\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} A new, curried function.\r\n * @see R.curry\r\n * @example\r\n *\r\n * const sumArgs = (...args) =\u003E R.sum(args);\r\n *\r\n * const curriedAddFourNumbers = R.curryN(4, sumArgs);\r\n * const f = curriedAddFourNumbers(1, 2);\r\n * const g = f(3);\r\n * g(4); //=\u003E 10\r\n */\r\n\r\nvar curryN = _curry2(function curryN(length, fn) {\r\n if (length === 1) {\r\n return _curry1(fn);\r\n }\r\n\r\n return _arity(length, _curryN(length, [], fn));\r\n});\r\n\r\n/**\r\n * Creates a new list iteration function from an existing one by adding two new\r\n * parameters to its callback function: the current index, and the entire list.\r\n *\r\n * This would turn, for instance, [\u0060R.map\u0060](#map) function into one that\r\n * more closely resembles \u0060Array.prototype.map\u0060. Note that this will only work\r\n * for functions in which the iteration callback function is the first\r\n * parameter, and where the list is the last parameter. (This latter might be\r\n * unimportant if the list parameter is not used.)\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.15.0\r\n * @category Function\r\n * @category List\r\n * @sig (((a ...) -\u003E b) ... -\u003E [a] -\u003E *) -\u003E (((a ..., Int, [a]) -\u003E b) ... -\u003E [a] -\u003E *)\r\n * @param {Function} fn A list iteration function that does not pass index or list to its callback\r\n * @return {Function} An altered list iteration function that passes (item, index, list) to its callback\r\n * @example\r\n *\r\n * const mapIndexed = R.addIndex(R.map);\r\n * mapIndexed((val, idx) =\u003E idx \u002B \u0027-\u0027 \u002B val, [\u0027f\u0027, \u0027o\u0027, \u0027o\u0027, \u0027b\u0027, \u0027a\u0027, \u0027r\u0027]);\r\n * //=\u003E [\u00270-f\u0027, \u00271-o\u0027, \u00272-o\u0027, \u00273-b\u0027, \u00274-a\u0027, \u00275-r\u0027]\r\n */\r\n\r\nvar addIndex = _curry1(function addIndex(fn) {\r\n return curryN(fn.length, function () {\r\n var idx = 0;\r\n var origFn = arguments[0];\r\n var list = arguments[arguments.length - 1];\r\n var args = Array.prototype.slice.call(arguments, 0);\r\n\r\n args[0] = function () {\r\n var result = origFn.apply(this, _concat(arguments, [idx, list]));\r\n idx \u002B= 1;\r\n return result;\r\n };\r\n\r\n return fn.apply(this, args);\r\n });\r\n});\r\n\r\n/**\r\n * As with \u0060addIndex\u0060, \u0060addIndexRight\u0060 creates a new list iteration function\r\n * from an existing one by adding two new parameters to its callback function:\r\n * the current index, and the entire list.\r\n *\r\n * Unlike \u0060addIndex\u0060, \u0060addIndexRight\u0060 iterates from the right to the left.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.29.0\r\n * @category Function\r\n * @category List\r\n * @sig ((a ... -\u003E b) ... -\u003E [a] -\u003E *) -\u003E (a ..., Int, [a] -\u003E b) ... -\u003E [a] -\u003E *)\r\n * @param {Function} fn A list iteration function that does not pass index or list to its callback\r\n * @return {Function} An altered list iteration function that passes (item, index, list) to its callback\r\n * @example\r\n *\r\n * const revmap = (fn, ary) =\u003E R.map(fn, R.reverse(ary));\r\n * const revmapIndexed = R.addIndexRight(revmap);\r\n * revmapIndexed((val, idx) =\u003E idx \u002B \u0027-\u0027 \u002B val, [\u0027f\u0027, \u0027o\u0027, \u0027o\u0027, \u0027b\u0027, \u0027a\u0027, \u0027r\u0027]);\r\n * //=\u003E [ \u00275-r\u0027, \u00274-a\u0027, \u00273-b\u0027, \u00272-o\u0027, \u00271-o\u0027, \u00270-f\u0027 ]\r\n */\r\n\r\nvar addIndexRight = _curry1(function addIndex(fn) {\r\n return curryN(fn.length, function () {\r\n var origFn = arguments[0];\r\n var list = arguments[arguments.length - 1];\r\n var idx = list.length - 1;\r\n var args = Array.prototype.slice.call(arguments, 0);\r\n\r\n args[0] = function () {\r\n var result = origFn.apply(this, _concat(arguments, [idx, list]));\r\n idx -= 1;\r\n return result;\r\n };\r\n\r\n return fn.apply(this, args);\r\n });\r\n});\r\n\r\n/**\r\n * Optimized internal three-arity curry function.\r\n *\r\n * @private\r\n * @category Function\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} The curried function.\r\n */\r\n\r\nfunction _curry3(fn) {\r\n return function f3(a, b, c) {\r\n switch (arguments.length) {\r\n case 0:\r\n return f3;\r\n\r\n case 1:\r\n return _isPlaceholder(a)\r\n ? f3\r\n : _curry2(function (_b, _c) {\r\n return fn(a, _b, _c);\r\n });\r\n\r\n case 2:\r\n return _isPlaceholder(a) \u0026\u0026 _isPlaceholder(b)\r\n ? f3\r\n : _isPlaceholder(a)\r\n ? _curry2(function (_a, _c) {\r\n return fn(_a, b, _c);\r\n })\r\n : _isPlaceholder(b)\r\n ? _curry2(function (_b, _c) {\r\n return fn(a, _b, _c);\r\n })\r\n : _curry1(function (_c) {\r\n return fn(a, b, _c);\r\n });\r\n\r\n default:\r\n return _isPlaceholder(a) \u0026\u0026 _isPlaceholder(b) \u0026\u0026 _isPlaceholder(c)\r\n ? f3\r\n : _isPlaceholder(a) \u0026\u0026 _isPlaceholder(b)\r\n ? _curry2(function (_a, _b) {\r\n return fn(_a, _b, c);\r\n })\r\n : _isPlaceholder(a) \u0026\u0026 _isPlaceholder(c)\r\n ? _curry2(function (_a, _c) {\r\n return fn(_a, b, _c);\r\n })\r\n : _isPlaceholder(b) \u0026\u0026 _isPlaceholder(c)\r\n ? _curry2(function (_b, _c) {\r\n return fn(a, _b, _c);\r\n })\r\n : _isPlaceholder(a)\r\n ? _curry1(function (_a) {\r\n return fn(_a, b, c);\r\n })\r\n : _isPlaceholder(b)\r\n ? _curry1(function (_b) {\r\n return fn(a, _b, c);\r\n })\r\n : _isPlaceholder(c)\r\n ? _curry1(function (_c) {\r\n return fn(a, b, _c);\r\n })\r\n : fn(a, b, c);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Applies a function to the value at the given index of an array, returning a\r\n * new copy of the array with the element at the given index replaced with the\r\n * result of the function application.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category List\r\n * @sig Number -\u003E (a -\u003E a) -\u003E [a] -\u003E [a]\r\n * @param {Number} idx The index.\r\n * @param {Function} fn The function to apply.\r\n * @param {Array|Arguments} list An array-like object whose value\r\n * at the supplied index will be replaced.\r\n * @return {Array} A copy of the supplied array-like object with\r\n * the element at index \u0060idx\u0060 replaced with the value\r\n * returned by applying \u0060fn\u0060 to the existing element.\r\n * @see R.update\r\n * @example\r\n *\r\n * R.adjust(1, R.toUpper, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027a\u0027, \u0027B\u0027, \u0027c\u0027, \u0027d\u0027]\r\n * R.adjust(-1, R.toUpper, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027D\u0027]\r\n * @symb R.adjust(-1, f, [a, b]) = [a, f(b)]\r\n * @symb R.adjust(0, f, [a, b]) = [f(a), b]\r\n */\r\n\r\nvar adjust = _curry3(function adjust(idx, fn, list) {\r\n var len = list.length;\r\n\r\n if (idx \u003E= len || idx \u003C -len) {\r\n return list;\r\n }\r\n\r\n var _idx = (len \u002B idx) % len;\r\n\r\n var _list = _concat(list);\r\n\r\n _list[_idx] = fn(list[_idx]);\r\n return _list;\r\n});\r\n\r\n/**\r\n * Tests whether or not an object is an array.\r\n *\r\n * @private\r\n * @param {*} val The object to test.\r\n * @return {Boolean} \u0060true\u0060 if \u0060val\u0060 is an array, \u0060false\u0060 otherwise.\r\n * @example\r\n *\r\n * _isArray([]); //=\u003E true\r\n * _isArray(null); //=\u003E false\r\n * _isArray({}); //=\u003E false\r\n */\r\nvar _isArray =\r\n Array.isArray ||\r\n function _isArray(val) {\r\n return (\r\n val != null \u0026\u0026\r\n val.length \u003E= 0 \u0026\u0026\r\n Object.prototype.toString.call(val) === \u0022[object Array]\u0022\r\n );\r\n };\r\n\r\nfunction _isTransformer(obj) {\r\n return obj != null \u0026\u0026 typeof obj[\u0022@@transducer/step\u0022] === \u0022function\u0022;\r\n}\r\n\r\n/**\r\n * Returns a function that dispatches with different strategies based on the\r\n * object in list position (last argument). If it is an array, executes [fn].\r\n * Otherwise, if it has a function with one of the given method names, it will\r\n * execute that function (functor case). Otherwise, if it is a transformer,\r\n * uses transducer created by [transducerCreator] to return a new transformer\r\n * (transducer case).\r\n * Otherwise, it will default to executing [fn].\r\n *\r\n * @private\r\n * @param {Array} methodNames properties to check for a custom implementation\r\n * @param {Function} transducerCreator transducer factory if object is transformer\r\n * @param {Function} fn default ramda implementation\r\n * @return {Function} A function that dispatches on object in list position\r\n */\r\n\r\nfunction _dispatchable(methodNames, transducerCreator, fn) {\r\n return function () {\r\n if (arguments.length === 0) {\r\n return fn();\r\n }\r\n\r\n var obj = arguments[arguments.length - 1];\r\n\r\n if (!_isArray(obj)) {\r\n var idx = 0;\r\n\r\n while (idx \u003C methodNames.length) {\r\n if (typeof obj[methodNames[idx]] === \u0022function\u0022) {\r\n return obj[methodNames[idx]].apply(\r\n obj,\r\n Array.prototype.slice.call(arguments, 0, -1)\r\n );\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n if (_isTransformer(obj)) {\r\n var transducer = transducerCreator.apply(\r\n null,\r\n Array.prototype.slice.call(arguments, 0, -1)\r\n );\r\n return transducer(obj);\r\n }\r\n }\r\n\r\n return fn.apply(this, arguments);\r\n };\r\n}\r\n\r\nfunction _reduced(x) {\r\n return x \u0026\u0026 x[\u0022@@transducer/reduced\u0022]\r\n ? x\r\n : {\r\n \u0022@@transducer/value\u0022: x,\r\n \u0022@@transducer/reduced\u0022: true,\r\n };\r\n}\r\n\r\nvar _xfBase = {\r\n init: function init() {\r\n return this.xf[\u0022@@transducer/init\u0022]();\r\n },\r\n result: function result(_result) {\r\n return this.xf[\u0022@@transducer/result\u0022](_result);\r\n },\r\n};\r\n\r\nfunction XAll(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.all = true;\r\n}\r\n\r\nXAll.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXAll.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n if (this.all) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, true);\r\n }\r\n\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXAll.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (!this.f(input)) {\r\n this.all = false;\r\n result = _reduced(this.xf[\u0022@@transducer/step\u0022](result, false));\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xall(f) {\r\n return function (xf) {\r\n return new XAll(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns \u0060true\u0060 if all elements of the list match the predicate, \u0060false\u0060 if\r\n * there are any that don\u0027t.\r\n *\r\n * Dispatches to the \u0060all\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Boolean\r\n * @param {Function} fn The predicate function.\r\n * @param {Array} list The array to consider.\r\n * @return {Boolean} \u0060true\u0060 if the predicate is satisfied by every element, \u0060false\u0060\r\n * otherwise.\r\n * @see R.any, R.none, R.transduce\r\n * @example\r\n *\r\n * const equals3 = R.equals(3);\r\n * R.all(equals3)([3, 3, 3, 3]); //=\u003E true\r\n * R.all(equals3)([3, 3, 1, 3]); //=\u003E false\r\n */\r\n\r\nvar all = _curry2(\r\n _dispatchable([\u0022all\u0022], _xall, function all(fn, list) {\r\n var idx = 0;\r\n\r\n while (idx \u003C list.length) {\r\n if (!fn(list[idx])) {\r\n return false;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return true;\r\n })\r\n);\r\n\r\nfunction _arrayFromIterator(iter) {\r\n var list = [];\r\n var next;\r\n\r\n while (!(next = iter.next()).done) {\r\n list.push(next.value);\r\n }\r\n\r\n return list;\r\n}\r\n\r\nfunction _includesWith(pred, x, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n\r\n while (idx \u003C len) {\r\n if (pred(x, list[idx])) {\r\n return true;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction _functionName(f) {\r\n // String(x =\u003E x) evaluates to \u0022x =\u003E x\u0022, so the pattern may not match.\r\n var match = String(f).match(/^function (\\w*)/);\r\n return match == null ? \u0022\u0022 : match[1];\r\n}\r\n\r\nfunction _has(prop, obj) {\r\n return Object.prototype.hasOwnProperty.call(obj, prop);\r\n}\r\n\r\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\r\nfunction _objectIs(a, b) {\r\n // SameValue algorithm\r\n if (a === b) {\r\n // Steps 1-5, 7-10\r\n // Steps 6.b-6.e: \u002B0 != -0\r\n return a !== 0 || 1 / a === 1 / b;\r\n } else {\r\n // Step 6.a: NaN == NaN\r\n return a !== a \u0026\u0026 b !== b;\r\n }\r\n}\r\n\r\nvar _objectIs$1 = typeof Object.is === \u0022function\u0022 ? Object.is : _objectIs;\r\n\r\nvar toString = Object.prototype.toString;\r\n\r\nvar _isArguments = (function () {\r\n return toString.call(arguments) === \u0022[object Arguments]\u0022\r\n ? function _isArguments(x) {\r\n return toString.call(x) === \u0022[object Arguments]\u0022;\r\n }\r\n : function _isArguments(x) {\r\n return _has(\u0022callee\u0022, x);\r\n };\r\n})();\r\n\r\nvar hasEnumBug = !{\r\n toString: null,\r\n}.propertyIsEnumerable(\u0022toString\u0022);\r\nvar nonEnumerableProps = [\r\n \u0022constructor\u0022,\r\n \u0022valueOf\u0022,\r\n \u0022isPrototypeOf\u0022,\r\n \u0022toString\u0022,\r\n \u0022propertyIsEnumerable\u0022,\r\n \u0022hasOwnProperty\u0022,\r\n \u0022toLocaleString\u0022,\r\n]; // Safari bug\r\n\r\nvar hasArgsEnumBug = (function () {\r\n return arguments.propertyIsEnumerable(\u0022length\u0022);\r\n})();\r\n\r\nvar contains = function contains(list, item) {\r\n var idx = 0;\r\n\r\n while (idx \u003C list.length) {\r\n if (list[idx] === item) {\r\n return true;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Returns a list containing the names of all the enumerable own properties of\r\n * the supplied object.\r\n * Note that the order of the output array is not guaranteed to be consistent\r\n * across different JS platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig {k: v} -\u003E [k]\r\n * @param {Object} obj The object to extract properties from\r\n * @return {Array} An array of the object\u0027s own properties.\r\n * @see R.keysIn, R.values, R.toPairs\r\n * @example\r\n *\r\n * R.keys({a: 1, b: 2, c: 3}); //=\u003E [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]\r\n */\r\n\r\nvar keys =\r\n typeof Object.keys === \u0022function\u0022 \u0026\u0026 !hasArgsEnumBug\r\n ? _curry1(function keys(obj) {\r\n return Object(obj) !== obj ? [] : Object.keys(obj);\r\n })\r\n : _curry1(function keys(obj) {\r\n if (Object(obj) !== obj) {\r\n return [];\r\n }\r\n\r\n var prop, nIdx;\r\n var ks = [];\r\n\r\n var checkArgsLength = hasArgsEnumBug \u0026\u0026 _isArguments(obj);\r\n\r\n for (prop in obj) {\r\n if (_has(prop, obj) \u0026\u0026 (!checkArgsLength || prop !== \u0022length\u0022)) {\r\n ks[ks.length] = prop;\r\n }\r\n }\r\n\r\n if (hasEnumBug) {\r\n nIdx = nonEnumerableProps.length - 1;\r\n\r\n while (nIdx \u003E= 0) {\r\n prop = nonEnumerableProps[nIdx];\r\n\r\n if (_has(prop, obj) \u0026\u0026 !contains(ks, prop)) {\r\n ks[ks.length] = prop;\r\n }\r\n\r\n nIdx -= 1;\r\n }\r\n }\r\n\r\n return ks;\r\n });\r\n\r\n/**\r\n * Gives a single-word string description of the (native) type of a value,\r\n * returning such answers as \u0027Object\u0027, \u0027Number\u0027, \u0027Array\u0027, or \u0027Null\u0027. Does not\r\n * attempt to distinguish user Object types any further, reporting them all as\r\n * \u0027Object\u0027.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Type\r\n * @sig * -\u003E String\r\n * @param {*} val The value to test\r\n * @return {String}\r\n * @example\r\n *\r\n * R.type({}); //=\u003E \u0022Object\u0022\r\n * R.type(1); //=\u003E \u0022Number\u0022\r\n * R.type(false); //=\u003E \u0022Boolean\u0022\r\n * R.type(\u0027s\u0027); //=\u003E \u0022String\u0022\r\n * R.type(null); //=\u003E \u0022Null\u0022\r\n * R.type([]); //=\u003E \u0022Array\u0022\r\n * R.type(/[A-z]/); //=\u003E \u0022RegExp\u0022\r\n * R.type(() =\u003E {}); //=\u003E \u0022Function\u0022\r\n * R.type(undefined); //=\u003E \u0022Undefined\u0022\r\n */\r\n\r\nvar type = _curry1(function type(val) {\r\n return val === null\r\n ? \u0022Null\u0022\r\n : val === undefined\r\n ? \u0022Undefined\u0022\r\n : Object.prototype.toString.call(val).slice(8, -1);\r\n});\r\n\r\n/**\r\n * private _uniqContentEquals function.\r\n * That function is checking equality of 2 iterator contents with 2 assumptions\r\n * - iterators lengths are the same\r\n * - iterators values are unique\r\n *\r\n * false-positive result will be returned for comparison of, e.g.\r\n * - [1,2,3] and [1,2,3,4]\r\n * - [1,1,1] and [1,2,3]\r\n * */\r\n\r\nfunction _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\r\n var a = _arrayFromIterator(aIterator);\r\n\r\n var b = _arrayFromIterator(bIterator);\r\n\r\n function eq(_a, _b) {\r\n return _equals(_a, _b, stackA.slice(), stackB.slice());\r\n } // if *a* array contains any element that is not included in *b*\r\n\r\n return !_includesWith(\r\n function (b, aItem) {\r\n return !_includesWith(eq, aItem, b);\r\n },\r\n b,\r\n a\r\n );\r\n}\r\n\r\nfunction _equals(a, b, stackA, stackB) {\r\n if (_objectIs$1(a, b)) {\r\n return true;\r\n }\r\n\r\n var typeA = type(a);\r\n\r\n if (typeA !== type(b)) {\r\n return false;\r\n }\r\n\r\n if (\r\n typeof a[\u0022fantasy-land/equals\u0022] === \u0022function\u0022 ||\r\n typeof b[\u0022fantasy-land/equals\u0022] === \u0022function\u0022\r\n ) {\r\n return (\r\n typeof a[\u0022fantasy-land/equals\u0022] === \u0022function\u0022 \u0026\u0026\r\n a[\u0022fantasy-land/equals\u0022](b) \u0026\u0026\r\n typeof b[\u0022fantasy-land/equals\u0022] === \u0022function\u0022 \u0026\u0026\r\n b[\u0022fantasy-land/equals\u0022](a)\r\n );\r\n }\r\n\r\n if (typeof a.equals === \u0022function\u0022 || typeof b.equals === \u0022function\u0022) {\r\n return (\r\n typeof a.equals === \u0022function\u0022 \u0026\u0026\r\n a.equals(b) \u0026\u0026\r\n typeof b.equals === \u0022function\u0022 \u0026\u0026\r\n b.equals(a)\r\n );\r\n }\r\n\r\n switch (typeA) {\r\n case \u0022Arguments\u0022:\r\n case \u0022Array\u0022:\r\n case \u0022Object\u0022:\r\n if (\r\n typeof a.constructor === \u0022function\u0022 \u0026\u0026\r\n _functionName(a.constructor) === \u0022Promise\u0022\r\n ) {\r\n return a === b;\r\n }\r\n\r\n break;\r\n\r\n case \u0022Boolean\u0022:\r\n case \u0022Number\u0022:\r\n case \u0022String\u0022:\r\n if (\r\n !(_typeof(a) === _typeof(b) \u0026\u0026 _objectIs$1(a.valueOf(), b.valueOf()))\r\n ) {\r\n return false;\r\n }\r\n\r\n break;\r\n\r\n case \u0022Date\u0022:\r\n if (!_objectIs$1(a.valueOf(), b.valueOf())) {\r\n return false;\r\n }\r\n\r\n break;\r\n\r\n case \u0022Error\u0022:\r\n return a.name === b.name \u0026\u0026 a.message === b.message;\r\n\r\n case \u0022RegExp\u0022:\r\n if (\r\n !(\r\n a.source === b.source \u0026\u0026\r\n a.global === b.global \u0026\u0026\r\n a.ignoreCase === b.ignoreCase \u0026\u0026\r\n a.multiline === b.multiline \u0026\u0026\r\n a.sticky === b.sticky \u0026\u0026\r\n a.unicode === b.unicode\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n break;\r\n }\r\n\r\n var idx = stackA.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n if (stackA[idx] === a) {\r\n return stackB[idx] === b;\r\n }\r\n\r\n idx -= 1;\r\n }\r\n\r\n switch (typeA) {\r\n case \u0022Map\u0022:\r\n if (a.size !== b.size) {\r\n return false;\r\n }\r\n\r\n return _uniqContentEquals(\r\n a.entries(),\r\n b.entries(),\r\n stackA.concat([a]),\r\n stackB.concat([b])\r\n );\r\n\r\n case \u0022Set\u0022:\r\n if (a.size !== b.size) {\r\n return false;\r\n }\r\n\r\n return _uniqContentEquals(\r\n a.values(),\r\n b.values(),\r\n stackA.concat([a]),\r\n stackB.concat([b])\r\n );\r\n\r\n case \u0022Arguments\u0022:\r\n case \u0022Array\u0022:\r\n case \u0022Object\u0022:\r\n case \u0022Boolean\u0022:\r\n case \u0022Number\u0022:\r\n case \u0022String\u0022:\r\n case \u0022Date\u0022:\r\n case \u0022Error\u0022:\r\n case \u0022RegExp\u0022:\r\n case \u0022Int8Array\u0022:\r\n case \u0022Uint8Array\u0022:\r\n case \u0022Uint8ClampedArray\u0022:\r\n case \u0022Int16Array\u0022:\r\n case \u0022Uint16Array\u0022:\r\n case \u0022Int32Array\u0022:\r\n case \u0022Uint32Array\u0022:\r\n case \u0022Float32Array\u0022:\r\n case \u0022Float64Array\u0022:\r\n case \u0022ArrayBuffer\u0022:\r\n break;\r\n\r\n default:\r\n // Values of other types are only equal if identical.\r\n return false;\r\n }\r\n\r\n var keysA = keys(a);\r\n\r\n if (keysA.length !== keys(b).length) {\r\n return false;\r\n }\r\n\r\n var extendedStackA = stackA.concat([a]);\r\n var extendedStackB = stackB.concat([b]);\r\n idx = keysA.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n var key = keysA[idx];\r\n\r\n if (\r\n !(_has(key, b) \u0026\u0026 _equals(b[key], a[key], extendedStackA, extendedStackB))\r\n ) {\r\n return false;\r\n }\r\n\r\n idx -= 1;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n/**\r\n * Returns \u0060true\u0060 if its arguments are equivalent, \u0060false\u0060 otherwise. Handles\r\n * cyclical data structures.\r\n *\r\n * Dispatches symmetrically to the \u0060equals\u0060 methods of both arguments, if\r\n * present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.15.0\r\n * @category Relation\r\n * @sig a -\u003E b -\u003E Boolean\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {Boolean}\r\n * @example\r\n *\r\n * R.equals(1, 1); //=\u003E true\r\n * R.equals(1, \u00271\u0027); //=\u003E false\r\n * R.equals([1, 2, 3], [1, 2, 3]); //=\u003E true\r\n *\r\n * const a = {}; a.v = a;\r\n * const b = {}; b.v = b;\r\n * R.equals(a, b); //=\u003E true\r\n */\r\n\r\nvar equals = _curry2(function equals(a, b) {\r\n return _equals(a, b, [], []);\r\n});\r\n\r\nfunction _indexOf(list, a, idx) {\r\n var inf, item; // Array.prototype.indexOf doesn\u0027t exist below IE9\r\n\r\n if (typeof list.indexOf === \u0022function\u0022) {\r\n switch (_typeof(a)) {\r\n case \u0022number\u0022:\r\n if (a === 0) {\r\n // manually crawl the list to distinguish between \u002B0 and -0\r\n inf = 1 / a;\r\n\r\n while (idx \u003C list.length) {\r\n item = list[idx];\r\n\r\n if (item === 0 \u0026\u0026 1 / item === inf) {\r\n return idx;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return -1;\r\n } else if (a !== a) {\r\n // NaN\r\n while (idx \u003C list.length) {\r\n item = list[idx];\r\n\r\n if (typeof item === \u0022number\u0022 \u0026\u0026 item !== item) {\r\n return idx;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return -1;\r\n } // non-zero numbers can utilise Set\r\n\r\n return list.indexOf(a, idx);\r\n // all these types can utilise Set\r\n\r\n case \u0022string\u0022:\r\n case \u0022boolean\u0022:\r\n case \u0022function\u0022:\r\n case \u0022undefined\u0022:\r\n return list.indexOf(a, idx);\r\n\r\n case \u0022object\u0022:\r\n if (a === null) {\r\n // null can utilise Set\r\n return list.indexOf(a, idx);\r\n }\r\n }\r\n } // anything else not covered above, defer to R.equals\r\n\r\n while (idx \u003C list.length) {\r\n if (equals(list[idx], a)) {\r\n return idx;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return -1;\r\n}\r\n\r\nfunction _includes(a, list) {\r\n return _indexOf(list, a, 0) \u003E= 0;\r\n}\r\n\r\nfunction _map(fn, functor) {\r\n var idx = 0;\r\n var len = functor.length;\r\n var result = Array(len);\r\n\r\n while (idx \u003C len) {\r\n result[idx] = fn(functor[idx]);\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction _quote(s) {\r\n var escaped = s\r\n .replace(/\\\\/g, \u0022\\\\\\\\\u0022)\r\n .replace(/[\\b]/g, \u0022\\\\b\u0022) // \\b matches word boundary; [\\b] matches backspace\r\n .replace(/\\f/g, \u0022\\\\f\u0022)\r\n .replace(/\\n/g, \u0022\\\\n\u0022)\r\n .replace(/\\r/g, \u0022\\\\r\u0022)\r\n .replace(/\\t/g, \u0022\\\\t\u0022)\r\n .replace(/\\v/g, \u0022\\\\v\u0022)\r\n .replace(/\\0/g, \u0022\\\\0\u0022);\r\n return \u0027\u0022\u0027 \u002B escaped.replace(/\u0022/g, \u0027\\\\\u0022\u0027) \u002B \u0027\u0022\u0027;\r\n}\r\n\r\n/**\r\n * Polyfill from \u003Chttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString\u003E.\r\n */\r\nvar pad = function pad(n) {\r\n return (n \u003C 10 ? \u00220\u0022 : \u0022\u0022) \u002B n;\r\n};\r\n\r\nvar _toISOString =\r\n typeof Date.prototype.toISOString === \u0022function\u0022\r\n ? function _toISOString(d) {\r\n return d.toISOString();\r\n }\r\n : function _toISOString(d) {\r\n return (\r\n d.getUTCFullYear() \u002B\r\n \u0022-\u0022 \u002B\r\n pad(d.getUTCMonth() \u002B 1) \u002B\r\n \u0022-\u0022 \u002B\r\n pad(d.getUTCDate()) \u002B\r\n \u0022T\u0022 \u002B\r\n pad(d.getUTCHours()) \u002B\r\n \u0022:\u0022 \u002B\r\n pad(d.getUTCMinutes()) \u002B\r\n \u0022:\u0022 \u002B\r\n pad(d.getUTCSeconds()) \u002B\r\n \u0022.\u0022 \u002B\r\n (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) \u002B\r\n \u0022Z\u0022\r\n );\r\n };\r\n\r\nfunction _complement(f) {\r\n return function () {\r\n return !f.apply(this, arguments);\r\n };\r\n}\r\n\r\nfunction _arrayReduce(reducer, acc, list) {\r\n var index = 0;\r\n var length = list.length;\r\n\r\n while (index \u003C length) {\r\n acc = reducer(acc, list[index]);\r\n index \u002B= 1;\r\n }\r\n\r\n return acc;\r\n}\r\n\r\nfunction _filter(fn, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n var result = [];\r\n\r\n while (idx \u003C len) {\r\n if (fn(list[idx])) {\r\n result[result.length] = list[idx];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction _isObject(x) {\r\n return Object.prototype.toString.call(x) === \u0022[object Object]\u0022;\r\n}\r\n\r\nfunction XFilter(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXFilter.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXFilter.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXFilter.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.f(input) ? this.xf[\u0022@@transducer/step\u0022](result, input) : result;\r\n};\r\n\r\nfunction _xfilter(f) {\r\n return function (xf) {\r\n return new XFilter(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Takes a predicate and a \u0060Filterable\u0060, and returns a new filterable of the\r\n * same type containing the members of the given filterable which satisfy the\r\n * given predicate. Filterable objects include plain objects or any object\r\n * that has a filter method such as \u0060Array\u0060.\r\n *\r\n * Dispatches to the \u0060filter\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @category Object\r\n * @sig Filterable f =\u003E (a -\u003E Boolean) -\u003E f a -\u003E f a\r\n * @param {Function} pred\r\n * @param {Array} filterable\r\n * @return {Array} Filterable\r\n * @see R.reject, R.transduce, R.addIndex\r\n * @example\r\n *\r\n * const isEven = n =\u003E n % 2 === 0;\r\n *\r\n * R.filter(isEven, [1, 2, 3, 4]); //=\u003E [2, 4]\r\n *\r\n * R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=\u003E {b: 2, d: 4}\r\n */\r\n\r\nvar filter = _curry2(\r\n _dispatchable(\r\n [\u0022fantasy-land/filter\u0022, \u0022filter\u0022],\r\n _xfilter,\r\n function (pred, filterable) {\r\n return _isObject(filterable)\r\n ? _arrayReduce(\r\n function (acc, key) {\r\n if (pred(filterable[key])) {\r\n acc[key] = filterable[key];\r\n }\r\n\r\n return acc;\r\n },\r\n {},\r\n keys(filterable)\r\n ) // else\r\n : _filter(pred, filterable);\r\n }\r\n )\r\n);\r\n\r\n/**\r\n * The complement of [\u0060filter\u0060](#filter).\r\n *\r\n * Acts as a transducer if a transformer is given in list position. Filterable\r\n * objects include plain objects or any object that has a filter method such\r\n * as \u0060Array\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Filterable f =\u003E (a -\u003E Boolean) -\u003E f a -\u003E f a\r\n * @param {Function} pred\r\n * @param {Array} filterable\r\n * @return {Array}\r\n * @see R.filter, R.transduce, R.addIndex\r\n * @example\r\n *\r\n * const isOdd = (n) =\u003E n % 2 !== 0;\r\n *\r\n * R.reject(isOdd, [1, 2, 3, 4]); //=\u003E [2, 4]\r\n *\r\n * R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=\u003E {b: 2, d: 4}\r\n */\r\n\r\nvar reject = _curry2(function reject(pred, filterable) {\r\n return filter(_complement(pred), filterable);\r\n});\r\n\r\nfunction _toString(x, seen) {\r\n var recur = function recur(y) {\r\n var xs = seen.concat([x]);\r\n return _includes(y, xs) ? \u0022\u003CCircular\u003E\u0022 : _toString(y, xs);\r\n }; // mapPairs :: (Object, [String]) -\u003E [String]\r\n\r\n var mapPairs = function mapPairs(obj, keys) {\r\n return _map(function (k) {\r\n return _quote(k) \u002B \u0022: \u0022 \u002B recur(obj[k]);\r\n }, keys.slice().sort());\r\n };\r\n\r\n switch (Object.prototype.toString.call(x)) {\r\n case \u0022[object Arguments]\u0022:\r\n return (\r\n \u0022(function() { return arguments; }(\u0022 \u002B _map(recur, x).join(\u0022, \u0022) \u002B \u0022))\u0022\r\n );\r\n\r\n case \u0022[object Array]\u0022:\r\n return (\r\n \u0022[\u0022 \u002B\r\n _map(recur, x)\r\n .concat(\r\n mapPairs(\r\n x,\r\n reject(function (k) {\r\n return /^\\d\u002B$/.test(k);\r\n }, keys(x))\r\n )\r\n )\r\n .join(\u0022, \u0022) \u002B\r\n \u0022]\u0022\r\n );\r\n\r\n case \u0022[object Boolean]\u0022:\r\n return _typeof(x) === \u0022object\u0022\r\n ? \u0022new Boolean(\u0022 \u002B recur(x.valueOf()) \u002B \u0022)\u0022\r\n : x.toString();\r\n\r\n case \u0022[object Date]\u0022:\r\n return (\r\n \u0022new Date(\u0022 \u002B\r\n (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString(x))) \u002B\r\n \u0022)\u0022\r\n );\r\n\r\n case \u0022[object Map]\u0022:\r\n return \u0022new Map(\u0022 \u002B recur(Array.from(x)) \u002B \u0022)\u0022;\r\n\r\n case \u0022[object Null]\u0022:\r\n return \u0022null\u0022;\r\n\r\n case \u0022[object Number]\u0022:\r\n return _typeof(x) === \u0022object\u0022\r\n ? \u0022new Number(\u0022 \u002B recur(x.valueOf()) \u002B \u0022)\u0022\r\n : 1 / x === -Infinity\r\n ? \u0022-0\u0022\r\n : x.toString(10);\r\n\r\n case \u0022[object Set]\u0022:\r\n return \u0022new Set(\u0022 \u002B recur(Array.from(x).sort()) \u002B \u0022)\u0022;\r\n\r\n case \u0022[object String]\u0022:\r\n return _typeof(x) === \u0022object\u0022\r\n ? \u0022new String(\u0022 \u002B recur(x.valueOf()) \u002B \u0022)\u0022\r\n : _quote(x);\r\n\r\n case \u0022[object Undefined]\u0022:\r\n return \u0022undefined\u0022;\r\n\r\n default:\r\n if (typeof x.toString === \u0022function\u0022) {\r\n var repr = x.toString();\r\n\r\n if (repr !== \u0022[object Object]\u0022) {\r\n return repr;\r\n }\r\n }\r\n\r\n return \u0022{\u0022 \u002B mapPairs(x, keys(x)).join(\u0022, \u0022) \u002B \u0022}\u0022;\r\n }\r\n}\r\n\r\n/**\r\n * Returns the string representation of the given value. \u0060eval\u0060\u0027ing the output\r\n * should result in a value equivalent to the input value. Many of the built-in\r\n * \u0060toString\u0060 methods do not satisfy this requirement.\r\n *\r\n * If the given value is an \u0060[object Object]\u0060 with a \u0060toString\u0060 method other\r\n * than \u0060Object.prototype.toString\u0060, this method is invoked with no arguments\r\n * to produce the return value. This means user-defined constructor functions\r\n * can provide a suitable \u0060toString\u0060 method. For example:\r\n *\r\n * function Point(x, y) {\r\n * this.x = x;\r\n * this.y = y;\r\n * }\r\n *\r\n * Point.prototype.toString = function() {\r\n * return \u0027new Point(\u0027 \u002B this.x \u002B \u0027, \u0027 \u002B this.y \u002B \u0027)\u0027;\r\n * };\r\n *\r\n * R.toString(new Point(1, 2)); //=\u003E \u0027new Point(1, 2)\u0027\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category String\r\n * @sig * -\u003E String\r\n * @param {*} val\r\n * @return {String}\r\n * @example\r\n *\r\n * R.toString(42); //=\u003E \u002742\u0027\r\n * R.toString(\u0027abc\u0027); //=\u003E \u0027\u0022abc\u0022\u0027\r\n * R.toString([1, 2, 3]); //=\u003E \u0027[1, 2, 3]\u0027\r\n * R.toString({foo: 1, bar: 2, baz: 3}); //=\u003E \u0027{\u0022bar\u0022: 2, \u0022baz\u0022: 3, \u0022foo\u0022: 1}\u0027\r\n * R.toString(new Date(\u00272001-02-03T04:05:06Z\u0027)); //=\u003E \u0027new Date(\u00222001-02-03T04:05:06.000Z\u0022)\u0027\r\n */\r\n\r\nvar toString$1 = _curry1(function toString(val) {\r\n return _toString(val, []);\r\n});\r\n\r\n/**\r\n * Returns the larger of its two arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E a\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n * @see R.maxBy, R.min\r\n * @example\r\n *\r\n * R.max(789, 123); //=\u003E 789\r\n * R.max(\u0027a\u0027, \u0027b\u0027); //=\u003E \u0027b\u0027\r\n */\r\n\r\nvar max = _curry2(function max(a, b) {\r\n if (a === b) {\r\n return b;\r\n }\r\n\r\n function safeMax(x, y) {\r\n if (x \u003E y !== y \u003E x) {\r\n return y \u003E x ? y : x;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n var maxByValue = safeMax(a, b);\r\n\r\n if (maxByValue !== undefined) {\r\n return maxByValue;\r\n }\r\n\r\n var maxByType = safeMax(_typeof(a), _typeof(b));\r\n\r\n if (maxByType !== undefined) {\r\n return maxByType === _typeof(a) ? a : b;\r\n }\r\n\r\n var stringA = toString$1(a);\r\n var maxByStringValue = safeMax(stringA, toString$1(b));\r\n\r\n if (maxByStringValue !== undefined) {\r\n return maxByStringValue === stringA ? a : b;\r\n }\r\n\r\n return b;\r\n});\r\n\r\nfunction XMap(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXMap.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXMap.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXMap.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.xf[\u0022@@transducer/step\u0022](result, this.f(input));\r\n};\r\n\r\nvar _xmap = function _xmap(f) {\r\n return function (xf) {\r\n return new XMap(f, xf);\r\n };\r\n};\r\n\r\n/**\r\n * Takes a function and\r\n * a [functor](https://github.com/fantasyland/fantasy-land#functor),\r\n * applies the function to each of the functor\u0027s values, and returns\r\n * a functor of the same shape.\r\n *\r\n * Ramda provides suitable \u0060map\u0060 implementations for \u0060Array\u0060 and \u0060Object\u0060,\r\n * so this function may be applied to \u0060[1, 2, 3]\u0060 or \u0060{x: 1, y: 2, z: 3}\u0060.\r\n *\r\n * Dispatches to the \u0060map\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * Also treats functions as functors and will compose them together.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Functor f =\u003E (a -\u003E b) -\u003E f a -\u003E f b\r\n * @param {Function} fn The function to be called on every element of the input \u0060list\u0060.\r\n * @param {Array} list The list to be iterated over.\r\n * @return {Array} The new list.\r\n * @see R.transduce, R.addIndex, R.pluck, R.project\r\n * @example\r\n *\r\n * const double = x =\u003E x * 2;\r\n *\r\n * R.map(double, [1, 2, 3]); //=\u003E [2, 4, 6]\r\n *\r\n * R.map(double, {x: 1, y: 2, z: 3}); //=\u003E {x: 2, y: 4, z: 6}\r\n * @symb R.map(f, [a, b]) = [f(a), f(b)]\r\n * @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }\r\n * @symb R.map(f, functor_o) = functor_o.map(f)\r\n */\r\n\r\nvar map = _curry2(\r\n _dispatchable([\u0022fantasy-land/map\u0022, \u0022map\u0022], _xmap, function map(fn, functor) {\r\n switch (Object.prototype.toString.call(functor)) {\r\n case \u0022[object Function]\u0022:\r\n return curryN(functor.length, function () {\r\n return fn.call(this, functor.apply(this, arguments));\r\n });\r\n\r\n case \u0022[object Object]\u0022:\r\n return _arrayReduce(\r\n function (acc, key) {\r\n acc[key] = fn(functor[key]);\r\n return acc;\r\n },\r\n {},\r\n keys(functor)\r\n );\r\n\r\n default:\r\n return _map(fn, functor);\r\n }\r\n })\r\n);\r\n\r\n/**\r\n * Determine if the passed argument is an integer.\r\n *\r\n * @private\r\n * @param {*} n\r\n * @category Type\r\n * @return {Boolean}\r\n */\r\nvar _isInteger =\r\n Number.isInteger ||\r\n function _isInteger(n) {\r\n return n \u003C\u003C 0 === n;\r\n };\r\n\r\nfunction _isString(x) {\r\n return Object.prototype.toString.call(x) === \u0022[object String]\u0022;\r\n}\r\n\r\n/**\r\n * Returns the nth element of the given list or string. If n is negative the\r\n * element at index length \u002B n is returned.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E a | Undefined\r\n * @sig Number -\u003E String -\u003E String\r\n * @param {Number} offset\r\n * @param {*} list\r\n * @return {*}\r\n * @example\r\n *\r\n * const list = [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027, \u0027quux\u0027];\r\n * R.nth(1, list); //=\u003E \u0027bar\u0027\r\n * R.nth(-1, list); //=\u003E \u0027quux\u0027\r\n * R.nth(-99, list); //=\u003E undefined\r\n *\r\n * R.nth(2, \u0027abc\u0027); //=\u003E \u0027c\u0027\r\n * R.nth(3, \u0027abc\u0027); //=\u003E \u0027\u0027\r\n * @symb R.nth(-1, [a, b, c]) = c\r\n * @symb R.nth(0, [a, b, c]) = a\r\n * @symb R.nth(1, [a, b, c]) = b\r\n */\r\n\r\nvar nth = _curry2(function nth(offset, list) {\r\n var idx = offset \u003C 0 ? list.length \u002B offset : offset;\r\n return _isString(list) ? list.charAt(idx) : list[idx];\r\n});\r\n\r\n/**\r\n * Returns a function that when supplied an object returns the indicated\r\n * property of that object, if it exists.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig Idx -\u003E {s: a} -\u003E a | Undefined\r\n * @param {String|Number} p The property name or array index\r\n * @param {Object} obj The object to query\r\n * @return {*} The value at \u0060obj.p\u0060.\r\n * @see R.path, R.props, R.pluck, R.project, R.nth\r\n * @example\r\n *\r\n * R.prop(\u0027x\u0027, {x: 100}); //=\u003E 100\r\n * R.prop(\u0027x\u0027, {}); //=\u003E undefined\r\n * R.prop(0, [100]); //=\u003E 100\r\n * R.compose(R.inc, R.prop(\u0027x\u0027))({ x: 3 }) //=\u003E 4\r\n */\r\n\r\nvar prop = _curry2(function prop(p, obj) {\r\n if (obj == null) {\r\n return;\r\n }\r\n\r\n return _isInteger(p) ? nth(p, obj) : obj[p];\r\n});\r\n\r\n/**\r\n * Returns a new list by plucking the same named property off all objects in\r\n * the list supplied.\r\n *\r\n * \u0060pluck\u0060 will work on\r\n * any [functor](https://github.com/fantasyland/fantasy-land#functor) in\r\n * addition to arrays, as it is equivalent to \u0060R.map(R.prop(k), f)\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Functor f =\u003E k -\u003E f {k: v} -\u003E f v\r\n * @param {Number|String} key The key name to pluck off of each object.\r\n * @param {Array} f The array or functor to consider.\r\n * @return {Array} The list of values for the given key.\r\n * @see R.project, R.prop, R.props\r\n * @example\r\n *\r\n * var getAges = R.pluck(\u0027age\u0027);\r\n * getAges([{name: \u0027fred\u0027, age: 29}, {name: \u0027wilma\u0027, age: 27}]); //=\u003E [29, 27]\r\n *\r\n * R.pluck(0, [[1, 2], [3, 4]]); //=\u003E [1, 3]\r\n * R.pluck(\u0027val\u0027, {a: {val: 3}, b: {val: 5}}); //=\u003E {a: 3, b: 5}\r\n * @symb R.pluck(\u0027x\u0027, [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]\r\n * @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]\r\n */\r\n\r\nvar pluck = _curry2(function pluck(p, list) {\r\n return map(prop(p), list);\r\n});\r\n\r\n/**\r\n * Tests whether or not an object is similar to an array.\r\n *\r\n * @private\r\n * @category Type\r\n * @category List\r\n * @sig * -\u003E Boolean\r\n * @param {*} x The object to test.\r\n * @return {Boolean} \u0060true\u0060 if \u0060x\u0060 has a numeric length property and extreme indices defined; \u0060false\u0060 otherwise.\r\n * @example\r\n *\r\n * _isArrayLike([]); //=\u003E true\r\n * _isArrayLike(true); //=\u003E false\r\n * _isArrayLike({}); //=\u003E false\r\n * _isArrayLike({length: 10}); //=\u003E false\r\n * _isArrayLike({0: \u0027zero\u0027, 9: \u0027nine\u0027, length: 10}); //=\u003E true\r\n * _isArrayLike({nodeType: 1, length: 1}) // =\u003E false\r\n */\r\n\r\nvar _isArrayLike = _curry1(function isArrayLike(x) {\r\n if (_isArray(x)) {\r\n return true;\r\n }\r\n\r\n if (!x) {\r\n return false;\r\n }\r\n\r\n if (_typeof(x) !== \u0022object\u0022) {\r\n return false;\r\n }\r\n\r\n if (_isString(x)) {\r\n return false;\r\n }\r\n\r\n if (x.length === 0) {\r\n return true;\r\n }\r\n\r\n if (x.length \u003E 0) {\r\n return x.hasOwnProperty(0) \u0026\u0026 x.hasOwnProperty(x.length - 1);\r\n }\r\n\r\n return false;\r\n});\r\n\r\nvar symIterator =\r\n typeof Symbol !== \u0022undefined\u0022 ? Symbol.iterator : \u0022@@iterator\u0022;\r\nfunction _createReduce(arrayReduce, methodReduce, iterableReduce) {\r\n return function _reduce(xf, acc, list) {\r\n if (_isArrayLike(list)) {\r\n return arrayReduce(xf, acc, list);\r\n }\r\n\r\n if (list == null) {\r\n return acc;\r\n }\r\n\r\n if (typeof list[\u0022fantasy-land/reduce\u0022] === \u0022function\u0022) {\r\n return methodReduce(xf, acc, list, \u0022fantasy-land/reduce\u0022);\r\n }\r\n\r\n if (list[symIterator] != null) {\r\n return iterableReduce(xf, acc, list[symIterator]());\r\n }\r\n\r\n if (typeof list.next === \u0022function\u0022) {\r\n return iterableReduce(xf, acc, list);\r\n }\r\n\r\n if (typeof list.reduce === \u0022function\u0022) {\r\n return methodReduce(xf, acc, list, \u0022reduce\u0022);\r\n }\r\n\r\n throw new TypeError(\u0022reduce: list must be array or iterable\u0022);\r\n };\r\n}\r\n\r\nfunction _xArrayReduce(xf, acc, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n\r\n while (idx \u003C len) {\r\n acc = xf[\u0022@@transducer/step\u0022](acc, list[idx]);\r\n\r\n if (acc \u0026\u0026 acc[\u0022@@transducer/reduced\u0022]) {\r\n acc = acc[\u0022@@transducer/value\u0022];\r\n break;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return xf[\u0022@@transducer/result\u0022](acc);\r\n}\r\n\r\n/**\r\n * Creates a function that is bound to a context.\r\n * Note: \u0060R.bind\u0060 does not provide the additional argument-binding capabilities of\r\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.6.0\r\n * @category Function\r\n * @category Object\r\n * @sig (* -\u003E *) -\u003E {*} -\u003E (* -\u003E *)\r\n * @param {Function} fn The function to bind to context\r\n * @param {Object} thisObj The context to bind \u0060fn\u0060 to\r\n * @return {Function} A function that will execute in the context of \u0060thisObj\u0060.\r\n * @see R.partial\r\n * @example\r\n *\r\n * const log = R.bind(console.log, console);\r\n * R.pipe(R.assoc(\u0027a\u0027, 2), R.tap(log), R.assoc(\u0027a\u0027, 3))({a: 1}); //=\u003E {a: 3}\r\n * // logs {a: 2}\r\n * @symb R.bind(f, o)(a, b) = f.call(o, a, b)\r\n */\r\n\r\nvar bind = _curry2(function bind(fn, thisObj) {\r\n return _arity(fn.length, function () {\r\n return fn.apply(thisObj, arguments);\r\n });\r\n});\r\n\r\nfunction _xIterableReduce(xf, acc, iter) {\r\n var step = iter.next();\r\n\r\n while (!step.done) {\r\n acc = xf[\u0022@@transducer/step\u0022](acc, step.value);\r\n\r\n if (acc \u0026\u0026 acc[\u0022@@transducer/reduced\u0022]) {\r\n acc = acc[\u0022@@transducer/value\u0022];\r\n break;\r\n }\r\n\r\n step = iter.next();\r\n }\r\n\r\n return xf[\u0022@@transducer/result\u0022](acc);\r\n}\r\n\r\nfunction _xMethodReduce(xf, acc, obj, methodName) {\r\n return xf[\u0022@@transducer/result\u0022](\r\n obj[methodName](bind(xf[\u0022@@transducer/step\u0022], xf), acc)\r\n );\r\n}\r\n\r\nvar _xReduce = _createReduce(_xArrayReduce, _xMethodReduce, _xIterableReduce);\r\n\r\nfunction XWrap(fn) {\r\n this.f = fn;\r\n}\r\n\r\nXWrap.prototype[\u0022@@transducer/init\u0022] = function () {\r\n throw new Error(\u0022init not implemented on XWrap\u0022);\r\n};\r\n\r\nXWrap.prototype[\u0022@@transducer/result\u0022] = function (acc) {\r\n return acc;\r\n};\r\n\r\nXWrap.prototype[\u0022@@transducer/step\u0022] = function (acc, x) {\r\n return this.f(acc, x);\r\n};\r\n\r\nfunction _xwrap(fn) {\r\n return new XWrap(fn);\r\n}\r\n\r\n/**\r\n * Returns a single item by iterating through the list, successively calling\r\n * the iterator function and passing it an accumulator value and the current\r\n * value from the array, and then passing the result to the next call.\r\n *\r\n * The iterator function receives two values: *(acc, value)*. It may use\r\n * [\u0060R.reduced\u0060](#reduced) to shortcut the iteration.\r\n *\r\n * The arguments\u0027 order of [\u0060reduceRight\u0060](#reduceRight)\u0027s iterator function\r\n * is *(value, acc)*.\r\n *\r\n * Note: \u0060R.reduce\u0060 does not skip deleted or unassigned indices (sparse\r\n * arrays), unlike the native \u0060Array.prototype.reduce\u0060 method. For more details\r\n * on this behavior, see:\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\r\n *\r\n * Be cautious of mutating and returning the accumulator. If you reuse it across\r\n * invocations, it will continue to accumulate onto the same value. The general\r\n * recommendation is to always return a new value. If you can\u0027t do so for\r\n * performance reasons, then be sure to reinitialize the accumulator on each\r\n * invocation.\r\n *\r\n * Dispatches to the \u0060reduce\u0060 method of the third argument, if present. When\r\n * doing so, it is up to the user to handle the [\u0060R.reduced\u0060](#reduced)\r\n * shortcuting, as this is not implemented by \u0060reduce\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig ((a, b) -\u003E a) -\u003E a -\u003E [b] -\u003E a\r\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\r\n * current element from the array.\r\n * @param {*} acc The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.reduced, R.addIndex, R.reduceRight\r\n * @example\r\n *\r\n * R.reduce(R.subtract, 0, [1, 2, 3, 4]) // =\u003E ((((0 - 1) - 2) - 3) - 4) = -10\r\n * // - -10\r\n * // / \\ / \\\r\n * // - 4 -6 4\r\n * // / \\ / \\\r\n * // - 3 ==\u003E -3 3\r\n * // / \\ / \\\r\n * // - 2 -1 2\r\n * // / \\ / \\\r\n * // 0 1 0 1\r\n *\r\n * @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d)\r\n */\r\n\r\nvar reduce = _curry3(function (xf, acc, list) {\r\n return _xReduce(typeof xf === \u0022function\u0022 ? _xwrap(xf) : xf, acc, list);\r\n});\r\n\r\n/**\r\n * Takes a list of predicates and returns a predicate that returns true for a\r\n * given list of arguments if every one of the provided predicates is satisfied\r\n * by those arguments.\r\n *\r\n * The function returned is a curried function whose arity matches that of the\r\n * highest-arity predicate.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Logic\r\n * @sig [(*... -\u003E Boolean)] -\u003E (*... -\u003E Boolean)\r\n * @param {Array} predicates An array of predicates to check\r\n * @return {Function} The combined predicate\r\n * @see R.anyPass, R.both\r\n * @example\r\n *\r\n * const isQueen = R.propEq(\u0027rank\u0027, \u0027Q\u0027);\r\n * const isSpade = R.propEq(\u0027suit\u0027, \u0027\u2660\uFE0E\u0027);\r\n * const isQueenOfSpades = R.allPass([isQueen, isSpade]);\r\n *\r\n * isQueenOfSpades({rank: \u0027Q\u0027, suit: \u0027\u2663\uFE0E\u0027}); //=\u003E false\r\n * isQueenOfSpades({rank: \u0027Q\u0027, suit: \u0027\u2660\uFE0E\u0027}); //=\u003E true\r\n */\r\n\r\nvar allPass = _curry1(function allPass(preds) {\r\n return curryN(reduce(max, 0, pluck(\u0022length\u0022, preds)), function () {\r\n var idx = 0;\r\n var len = preds.length;\r\n\r\n while (idx \u003C len) {\r\n if (!preds[idx].apply(this, arguments)) {\r\n return false;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return true;\r\n });\r\n});\r\n\r\n/**\r\n * Returns a function that always returns the given value. Note that for\r\n * non-primitives the value returned is a reference to the original value.\r\n *\r\n * This function is known as \u0060const\u0060, \u0060constant\u0060, or \u0060K\u0060 (for K combinator) in\r\n * other languages and libraries.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig a -\u003E (* -\u003E a)\r\n * @param {*} val The value to wrap in a function\r\n * @return {Function} A Function :: * -\u003E val.\r\n * @example\r\n *\r\n * const t = R.always(\u0027Tee\u0027);\r\n * t(); //=\u003E \u0027Tee\u0027\r\n */\r\n\r\nvar always = _curry1(function always(val) {\r\n return function () {\r\n return val;\r\n };\r\n});\r\n\r\n/**\r\n * Returns the first argument if it is falsy, otherwise the second argument.\r\n * Acts as the boolean \u0060and\u0060 statement if both inputs are \u0060Boolean\u0060s.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Logic\r\n * @sig a -\u003E b -\u003E a | b\r\n * @param {Any} a\r\n * @param {Any} b\r\n * @return {Any}\r\n * @see R.both, R.or\r\n * @example\r\n *\r\n * R.and(true, true); //=\u003E true\r\n * R.and(true, false); //=\u003E false\r\n * R.and(false, true); //=\u003E false\r\n * R.and(false, false); //=\u003E false\r\n */\r\n\r\nvar and = _curry2(function and(a, b) {\r\n return a \u0026\u0026 b;\r\n});\r\n\r\nfunction XAny(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.any = false;\r\n}\r\n\r\nXAny.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXAny.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n if (!this.any) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, false);\r\n }\r\n\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXAny.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.f(input)) {\r\n this.any = true;\r\n result = _reduced(this.xf[\u0022@@transducer/step\u0022](result, true));\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xany(f) {\r\n return function (xf) {\r\n return new XAny(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns \u0060true\u0060 if at least one of the elements of the list match the predicate,\r\n * \u0060false\u0060 otherwise.\r\n *\r\n * Dispatches to the \u0060any\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Boolean\r\n * @param {Function} fn The predicate function.\r\n * @param {Array} list The array to consider.\r\n * @return {Boolean} \u0060true\u0060 if the predicate is satisfied by at least one element, \u0060false\u0060\r\n * otherwise.\r\n * @see R.all, R.none, R.transduce\r\n * @example\r\n *\r\n * const lessThan0 = R.flip(R.lt)(0);\r\n * const lessThan2 = R.flip(R.lt)(2);\r\n * R.any(lessThan0)([1, 2]); //=\u003E false\r\n * R.any(lessThan2)([1, 2]); //=\u003E true\r\n */\r\n\r\nvar any = _curry2(\r\n _dispatchable([\u0022any\u0022], _xany, function any(fn, list) {\r\n var idx = 0;\r\n\r\n while (idx \u003C list.length) {\r\n if (fn(list[idx])) {\r\n return true;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return false;\r\n })\r\n);\r\n\r\n/**\r\n * Takes a list of predicates and returns a predicate that returns true for a\r\n * given list of arguments if at least one of the provided predicates is\r\n * satisfied by those arguments.\r\n *\r\n * The function returned is a curried function whose arity matches that of the\r\n * highest-arity predicate.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Logic\r\n * @sig [(*... -\u003E Boolean)] -\u003E (*... -\u003E Boolean)\r\n * @param {Array} predicates An array of predicates to check\r\n * @return {Function} The combined predicate\r\n * @see R.allPass, R.either\r\n * @example\r\n *\r\n * const isClub = R.propEq(\u0027suit\u0027, \u0027\u2663\u0027);\r\n * const isSpade = R.propEq(\u0027suit\u0027, \u0027\u2660\u0027);\r\n * const isBlackCard = R.anyPass([isClub, isSpade]);\r\n *\r\n * isBlackCard({rank: \u002710\u0027, suit: \u0027\u2663\u0027}); //=\u003E true\r\n * isBlackCard({rank: \u0027Q\u0027, suit: \u0027\u2660\u0027}); //=\u003E true\r\n * isBlackCard({rank: \u0027Q\u0027, suit: \u0027\u2666\u0027}); //=\u003E false\r\n */\r\n\r\nvar anyPass = _curry1(function anyPass(preds) {\r\n return curryN(reduce(max, 0, pluck(\u0022length\u0022, preds)), function () {\r\n var idx = 0;\r\n var len = preds.length;\r\n\r\n while (idx \u003C len) {\r\n if (preds[idx].apply(this, arguments)) {\r\n return true;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return false;\r\n });\r\n});\r\n\r\nfunction _iterableReduce(reducer, acc, iter) {\r\n var step = iter.next();\r\n\r\n while (!step.done) {\r\n acc = reducer(acc, step.value);\r\n step = iter.next();\r\n }\r\n\r\n return acc;\r\n}\r\n\r\nfunction _methodReduce(reducer, acc, obj, methodName) {\r\n return obj[methodName](reducer, acc);\r\n}\r\n\r\nvar _reduce = _createReduce(_arrayReduce, _methodReduce, _iterableReduce);\r\n\r\n/**\r\n * ap applies a list of functions to a list of values.\r\n *\r\n * Dispatches to the \u0060ap\u0060 method of the first argument, if present. Also\r\n * treats curried functions as applicatives.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category Function\r\n * @sig [a -\u003E b] -\u003E [a] -\u003E [b]\r\n * @sig Apply f =\u003E f (a -\u003E b) -\u003E f a -\u003E f b\r\n * @sig (r -\u003E a -\u003E b) -\u003E (r -\u003E a) -\u003E (r -\u003E b)\r\n * @param {*} applyF\r\n * @param {*} applyX\r\n * @return {*}\r\n * @example\r\n *\r\n * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=\u003E [2, 4, 6, 4, 5, 6]\r\n * R.ap([R.concat(\u0027tasty \u0027), R.toUpper], [\u0027pizza\u0027, \u0027salad\u0027]); //=\u003E [\u0022tasty pizza\u0022, \u0022tasty salad\u0022, \u0022PIZZA\u0022, \u0022SALAD\u0022]\r\n *\r\n * // R.ap can also be used as S combinator\r\n * // when only two functions are passed\r\n * R.ap(R.concat, R.toUpper)(\u0027Ramda\u0027) //=\u003E \u0027RamdaRAMDA\u0027\r\n * @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]\r\n */\r\n\r\nvar ap = _curry2(function ap(applyF, applyX) {\r\n return typeof applyX[\u0022fantasy-land/ap\u0022] === \u0022function\u0022\r\n ? applyX[\u0022fantasy-land/ap\u0022](applyF)\r\n : typeof applyF.ap === \u0022function\u0022\r\n ? applyF.ap(applyX)\r\n : typeof applyF === \u0022function\u0022\r\n ? function (x) {\r\n return applyF(x)(applyX(x));\r\n }\r\n : _reduce(\r\n function (acc, f) {\r\n return _concat(acc, map(f, applyX));\r\n },\r\n [],\r\n applyF\r\n );\r\n});\r\n\r\nfunction _aperture(n, list) {\r\n var idx = 0;\r\n var limit = list.length - (n - 1);\r\n var acc = new Array(limit \u003E= 0 ? limit : 0);\r\n\r\n while (idx \u003C limit) {\r\n acc[idx] = Array.prototype.slice.call(list, idx, idx \u002B n);\r\n idx \u002B= 1;\r\n }\r\n\r\n return acc;\r\n}\r\n\r\nfunction XAperture(n, xf) {\r\n this.xf = xf;\r\n this.pos = 0;\r\n this.full = false;\r\n this.acc = new Array(n);\r\n}\r\n\r\nXAperture.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXAperture.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n this.acc = null;\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXAperture.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n this.store(input);\r\n return this.full\r\n ? this.xf[\u0022@@transducer/step\u0022](result, this.getCopy())\r\n : result;\r\n};\r\n\r\nXAperture.prototype.store = function (input) {\r\n this.acc[this.pos] = input;\r\n this.pos \u002B= 1;\r\n\r\n if (this.pos === this.acc.length) {\r\n this.pos = 0;\r\n this.full = true;\r\n }\r\n};\r\n\r\nXAperture.prototype.getCopy = function () {\r\n return _concat(\r\n Array.prototype.slice.call(this.acc, this.pos),\r\n Array.prototype.slice.call(this.acc, 0, this.pos)\r\n );\r\n};\r\n\r\nfunction _xaperture(n) {\r\n return function (xf) {\r\n return new XAperture(n, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list, composed of n-tuples of consecutive elements. If \u0060n\u0060 is\r\n * greater than the length of the list, an empty list is returned.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [[a]]\r\n * @param {Number} n The size of the tuples to create\r\n * @param {Array} list The list to split into \u0060n\u0060-length tuples\r\n * @return {Array} The resulting list of \u0060n\u0060-length tuples\r\n * @see R.transduce\r\n * @example\r\n *\r\n * R.aperture(2, [1, 2, 3, 4, 5]); //=\u003E [[1, 2], [2, 3], [3, 4], [4, 5]]\r\n * R.aperture(3, [1, 2, 3, 4, 5]); //=\u003E [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\r\n * R.aperture(7, [1, 2, 3, 4, 5]); //=\u003E []\r\n */\r\n\r\nvar aperture = _curry2(_dispatchable([], _xaperture, _aperture));\r\n\r\n/**\r\n * Returns a new list containing the contents of the given list, followed by\r\n * the given element.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E [a]\r\n * @param {*} el The element to add to the end of the new list.\r\n * @param {Array} list The list of elements to add a new item to.\r\n * list.\r\n * @return {Array} A new list containing the elements of the old list followed by \u0060el\u0060.\r\n * @see R.prepend\r\n * @example\r\n *\r\n * R.append(\u0027tests\u0027, [\u0027write\u0027, \u0027more\u0027]); //=\u003E [\u0027write\u0027, \u0027more\u0027, \u0027tests\u0027]\r\n * R.append(\u0027tests\u0027, []); //=\u003E [\u0027tests\u0027]\r\n * R.append([\u0027tests\u0027], [\u0027write\u0027, \u0027more\u0027]); //=\u003E [\u0027write\u0027, \u0027more\u0027, [\u0027tests\u0027]]\r\n */\r\n\r\nvar append = _curry2(function append(el, list) {\r\n return _concat(list, [el]);\r\n});\r\n\r\n/**\r\n * Applies function \u0060fn\u0060 to the argument list \u0060args\u0060. This is useful for\r\n * creating a fixed-arity function from a variadic function. \u0060fn\u0060 should be a\r\n * bound function if context is significant.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Function\r\n * @sig (*... -\u003E a) -\u003E [*] -\u003E a\r\n * @param {Function} fn The function which will be called with \u0060args\u0060\r\n * @param {Array} args The arguments to call \u0060fn\u0060 with\r\n * @return {*} result The result, equivalent to \u0060fn(...args)\u0060\r\n * @see R.call, R.unapply\r\n * @example\r\n *\r\n * const nums = [1, 2, 3, -99, 42, 6, 7];\r\n * R.apply(Math.max, nums); //=\u003E 42\r\n * @symb R.apply(f, [a, b, c]) = f(a, b, c)\r\n */\r\n\r\nvar apply = _curry2(function apply(fn, args) {\r\n return fn.apply(this, args);\r\n});\r\n\r\n/**\r\n * Returns a list of all the enumerable own properties of the supplied object.\r\n * Note that the order of the output array is not guaranteed across different\r\n * JS platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig {k: v} -\u003E [v]\r\n * @param {Object} obj The object to extract values from\r\n * @return {Array} An array of the values of the object\u0027s own properties.\r\n * @see R.valuesIn, R.keys, R.toPairs\r\n * @example\r\n *\r\n * R.values({a: 1, b: 2, c: 3}); //=\u003E [1, 2, 3]\r\n */\r\n\r\nvar values = _curry1(function values(obj) {\r\n var props = keys(obj);\r\n var len = props.length;\r\n var vals = [];\r\n var idx = 0;\r\n\r\n while (idx \u003C len) {\r\n vals[idx] = obj[props[idx]];\r\n idx \u002B= 1;\r\n }\r\n\r\n return vals;\r\n});\r\n\r\n// delegating calls to .map\r\n\r\nfunction mapValues(fn, obj) {\r\n return _isArray(obj)\r\n ? obj.map(fn)\r\n : keys(obj).reduce(function (acc, key) {\r\n acc[key] = fn(obj[key]);\r\n return acc;\r\n }, {});\r\n}\r\n/**\r\n * Given a spec object recursively mapping properties to functions, creates a\r\n * function producing an object of the same structure, by mapping each property\r\n * to the result of calling its associated function with the supplied arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.20.0\r\n * @category Function\r\n * @sig {k: ((a, b, ..., m) -\u003E v)} -\u003E ((a, b, ..., m) -\u003E {k: v})\r\n * @param {Object} spec an object recursively mapping properties to functions for\r\n * producing the values for these properties.\r\n * @return {Function} A function that returns an object of the same structure\r\n * as \u0060spec\u0027, with each property set to the value returned by calling its\r\n * associated function with the supplied arguments.\r\n * @see R.converge, R.juxt\r\n * @example\r\n *\r\n * const getMetrics = R.applySpec({\r\n * sum: R.add,\r\n * nested: { mul: R.multiply }\r\n * });\r\n * getMetrics(2, 4); // =\u003E { sum: 6, nested: { mul: 8 } }\r\n * @symb R.applySpec({ x: f, y: { z: g } })(a, b) = { x: f(a, b), y: { z: g(a, b) } }\r\n */\r\n\r\nvar applySpec = _curry1(function applySpec(spec) {\r\n spec = mapValues(function (v) {\r\n return typeof v == \u0022function\u0022 ? v : applySpec(v);\r\n }, spec);\r\n return curryN(reduce(max, 0, pluck(\u0022length\u0022, values(spec))), function () {\r\n var args = arguments;\r\n return mapValues(function (f) {\r\n return apply(f, args);\r\n }, spec);\r\n });\r\n});\r\n\r\n/**\r\n * Takes a value and applies a function to it.\r\n *\r\n * This function is also known as the \u0060thrush\u0060 combinator.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.25.0\r\n * @category Function\r\n * @sig a -\u003E (a -\u003E b) -\u003E b\r\n * @param {*} x The value\r\n * @param {Function} f The function to apply\r\n * @return {*} The result of applying \u0060f\u0060 to \u0060x\u0060\r\n * @example\r\n *\r\n * const t42 = R.applyTo(42);\r\n * t42(R.identity); //=\u003E 42\r\n * t42(R.add(1)); //=\u003E 43\r\n */\r\n\r\nvar applyTo = _curry2(function applyTo(x, f) {\r\n return f(x);\r\n});\r\n\r\n/**\r\n * Makes an ascending comparator function out of a function that returns a value\r\n * that can be compared with \u0060\u003C\u0060 and \u0060\u003E\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.23.0\r\n * @category Function\r\n * @sig Ord b =\u003E (a -\u003E b) -\u003E a -\u003E a -\u003E Number\r\n * @param {Function} fn A function of arity one that returns a value that can be compared\r\n * @param {*} a The first item to be compared.\r\n * @param {*} b The second item to be compared.\r\n * @return {Number} \u0060-1\u0060 if fn(a) \u003C fn(b), \u00601\u0060 if fn(b) \u003C fn(a), otherwise \u00600\u0060\r\n * @see R.descend\r\n * @example\r\n *\r\n * const byAge = R.ascend(R.prop(\u0027age\u0027));\r\n * const people = [\r\n * { name: \u0027Emma\u0027, age: 70 },\r\n * { name: \u0027Peter\u0027, age: 78 },\r\n * { name: \u0027Mikhail\u0027, age: 62 },\r\n * ];\r\n * const peopleByYoungestFirst = R.sort(byAge, people);\r\n * //=\u003E [{ name: \u0027Mikhail\u0027, age: 62 },{ name: \u0027Emma\u0027, age: 70 }, { name: \u0027Peter\u0027, age: 78 }]\r\n */\r\n\r\nvar ascend = _curry3(function ascend(fn, a, b) {\r\n var aa = fn(a);\r\n var bb = fn(b);\r\n return aa \u003C bb ? -1 : aa \u003E bb ? 1 : 0;\r\n});\r\n\r\n/**\r\n * Makes a shallow clone of an object, setting or overriding the specified\r\n * property with the given value. Note that this copies and flattens prototype\r\n * properties onto the new object as well. All non-primitive properties are\r\n * copied by reference.\r\n *\r\n * @private\r\n * @param {String|Number} prop The property name to set\r\n * @param {*} val The new value\r\n * @param {Object|Array} obj The object to clone\r\n * @return {Object|Array} A new object equivalent to the original except for the changed property.\r\n */\r\n\r\nfunction _assoc(prop, val, obj) {\r\n if (_isInteger(prop) \u0026\u0026 _isArray(obj)) {\r\n var arr = [].concat(obj);\r\n arr[prop] = val;\r\n return arr;\r\n }\r\n\r\n var result = {};\r\n\r\n for (var p in obj) {\r\n result[p] = obj[p];\r\n }\r\n\r\n result[prop] = val;\r\n return result;\r\n}\r\n\r\n/**\r\n * Checks if the input value is \u0060null\u0060 or \u0060undefined\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Type\r\n * @sig * -\u003E Boolean\r\n * @param {*} x The value to test.\r\n * @return {Boolean} \u0060true\u0060 if \u0060x\u0060 is \u0060undefined\u0060 or \u0060null\u0060, otherwise \u0060false\u0060.\r\n * @example\r\n *\r\n * R.isNil(null); //=\u003E true\r\n * R.isNil(undefined); //=\u003E true\r\n * R.isNil(0); //=\u003E false\r\n * R.isNil([]); //=\u003E false\r\n */\r\n\r\nvar isNil = _curry1(function isNil(x) {\r\n return x == null;\r\n});\r\n\r\n/**\r\n * Makes a shallow clone of an object, setting or overriding the nodes required\r\n * to create the given path, and placing the specific value at the tail end of\r\n * that path. Note that this copies and flattens prototype properties onto the\r\n * new object as well. All non-primitive properties are copied by reference.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig [Idx] -\u003E a -\u003E {a} -\u003E {a}\r\n * @param {Array} path the path to set\r\n * @param {*} val The new value\r\n * @param {Object} obj The object to clone\r\n * @return {Object} A new object equivalent to the original except along the specified path.\r\n * @see R.dissocPath\r\n * @example\r\n *\r\n * R.assocPath([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027], 42, {a: {b: {c: 0}}}); //=\u003E {a: {b: {c: 42}}}\r\n *\r\n * // Any missing or non-object keys in path will be overridden\r\n * R.assocPath([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027], 42, {a: 5}); //=\u003E {a: {b: {c: 42}}}\r\n */\r\n\r\nvar assocPath = _curry3(function assocPath(path, val, obj) {\r\n if (path.length === 0) {\r\n return val;\r\n }\r\n\r\n var idx = path[0];\r\n\r\n if (path.length \u003E 1) {\r\n var nextObj =\r\n !isNil(obj) \u0026\u0026 _has(idx, obj) \u0026\u0026 _typeof(obj[idx]) === \u0022object\u0022\r\n ? obj[idx]\r\n : _isInteger(path[1])\r\n ? []\r\n : {};\r\n val = assocPath(Array.prototype.slice.call(path, 1), val, nextObj);\r\n }\r\n\r\n return _assoc(idx, val, obj);\r\n});\r\n\r\n/**\r\n * Makes a shallow clone of an object, setting or overriding the specified\r\n * property with the given value. Note that this copies and flattens prototype\r\n * properties onto the new object as well. All non-primitive properties are\r\n * copied by reference.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Object\r\n * @typedefn Idx = String | Int\r\n * @sig Idx -\u003E a -\u003E {k: v} -\u003E {k: v}\r\n * @param {String|Number} prop The property name to set\r\n * @param {*} val The new value\r\n * @param {Object} obj The object to clone\r\n * @return {Object} A new object equivalent to the original except for the changed property.\r\n * @see R.dissoc, R.pick\r\n * @example\r\n *\r\n * R.assoc(\u0027c\u0027, 3, {a: 1, b: 2}); //=\u003E {a: 1, b: 2, c: 3}\r\n */\r\n\r\nvar assoc = _curry3(function assoc(prop, val, obj) {\r\n return assocPath([prop], val, obj);\r\n});\r\n\r\n/**\r\n * Wraps a function of any arity (including nullary) in a function that accepts\r\n * exactly \u0060n\u0060 parameters. Any extraneous parameters will not be passed to the\r\n * supplied function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig Number -\u003E (* -\u003E a) -\u003E (* -\u003E a)\r\n * @param {Number} n The desired arity of the new function.\r\n * @param {Function} fn The function to wrap.\r\n * @return {Function} A new function wrapping \u0060fn\u0060. The new function is guaranteed to be of\r\n * arity \u0060n\u0060.\r\n * @see R.binary, R.unary\r\n * @example\r\n *\r\n * const takesTwoArgs = (a, b) =\u003E [a, b];\r\n *\r\n * takesTwoArgs.length; //=\u003E 2\r\n * takesTwoArgs(1, 2); //=\u003E [1, 2]\r\n *\r\n * const takesOneArg = R.nAry(1, takesTwoArgs);\r\n * takesOneArg.length; //=\u003E 1\r\n * // Only \u0060n\u0060 arguments are passed to the wrapped function\r\n * takesOneArg(1, 2); //=\u003E [1, undefined]\r\n * @symb R.nAry(0, f)(a, b) = f()\r\n * @symb R.nAry(1, f)(a, b) = f(a)\r\n * @symb R.nAry(2, f)(a, b) = f(a, b)\r\n */\r\n\r\nvar nAry = _curry2(function nAry(n, fn) {\r\n switch (n) {\r\n case 0:\r\n return function () {\r\n return fn.call(this);\r\n };\r\n\r\n case 1:\r\n return function (a0) {\r\n return fn.call(this, a0);\r\n };\r\n\r\n case 2:\r\n return function (a0, a1) {\r\n return fn.call(this, a0, a1);\r\n };\r\n\r\n case 3:\r\n return function (a0, a1, a2) {\r\n return fn.call(this, a0, a1, a2);\r\n };\r\n\r\n case 4:\r\n return function (a0, a1, a2, a3) {\r\n return fn.call(this, a0, a1, a2, a3);\r\n };\r\n\r\n case 5:\r\n return function (a0, a1, a2, a3, a4) {\r\n return fn.call(this, a0, a1, a2, a3, a4);\r\n };\r\n\r\n case 6:\r\n return function (a0, a1, a2, a3, a4, a5) {\r\n return fn.call(this, a0, a1, a2, a3, a4, a5);\r\n };\r\n\r\n case 7:\r\n return function (a0, a1, a2, a3, a4, a5, a6) {\r\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6);\r\n };\r\n\r\n case 8:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\r\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7);\r\n };\r\n\r\n case 9:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\r\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8);\r\n };\r\n\r\n case 10:\r\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\r\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);\r\n };\r\n\r\n default:\r\n throw new Error(\r\n \u0022First argument to nAry must be a non-negative integer no greater than ten\u0022\r\n );\r\n }\r\n});\r\n\r\n/**\r\n * Wraps a function of any arity (including nullary) in a function that accepts\r\n * exactly 2 parameters. Any extraneous parameters will not be passed to the\r\n * supplied function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category Function\r\n * @sig (a -\u003E b -\u003E c -\u003E ... -\u003E z) -\u003E ((a, b) -\u003E z)\r\n * @param {Function} fn The function to wrap.\r\n * @return {Function} A new function wrapping \u0060fn\u0060. The new function is guaranteed to be of\r\n * arity 2.\r\n * @see R.nAry, R.unary\r\n * @example\r\n *\r\n * const takesThreeArgs = function(a, b, c) {\r\n * return [a, b, c];\r\n * };\r\n * takesThreeArgs.length; //=\u003E 3\r\n * takesThreeArgs(1, 2, 3); //=\u003E [1, 2, 3]\r\n *\r\n * const takesTwoArgs = R.binary(takesThreeArgs);\r\n * takesTwoArgs.length; //=\u003E 2\r\n * // Only 2 arguments are passed to the wrapped function\r\n * takesTwoArgs(1, 2, 3); //=\u003E [1, 2, undefined]\r\n * @symb R.binary(f)(a, b, c) = f(a, b)\r\n */\r\n\r\nvar binary = _curry1(function binary(fn) {\r\n return nAry(2, fn);\r\n});\r\n\r\nfunction _isFunction(x) {\r\n var type = Object.prototype.toString.call(x);\r\n return (\r\n type === \u0022[object Function]\u0022 ||\r\n type === \u0022[object AsyncFunction]\u0022 ||\r\n type === \u0022[object GeneratorFunction]\u0022 ||\r\n type === \u0022[object AsyncGeneratorFunction]\u0022\r\n );\r\n}\r\n\r\n/**\r\n * \u0022lifts\u0022 a function to be the specified arity, so that it may \u0022map over\u0022 that\r\n * many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Function\r\n * @sig Number -\u003E (*... -\u003E *) -\u003E ([*]... -\u003E [*])\r\n * @param {Function} fn The function to lift into higher context\r\n * @return {Function} The lifted function.\r\n * @see R.lift, R.ap\r\n * @example\r\n *\r\n * const madd3 = R.liftN(3, (...args) =\u003E R.sum(args));\r\n * madd3([1,2,3], [1,2,3], [1]); //=\u003E [3, 4, 5, 4, 5, 6, 5, 6, 7]\r\n */\r\n\r\nvar liftN = _curry2(function liftN(arity, fn) {\r\n var lifted = curryN(arity, fn);\r\n return curryN(arity, function () {\r\n return _arrayReduce(\r\n ap,\r\n map(lifted, arguments[0]),\r\n Array.prototype.slice.call(arguments, 1)\r\n );\r\n });\r\n});\r\n\r\n/**\r\n * \u0022lifts\u0022 a function of arity \u003E= 1 so that it may \u0022map over\u0022 a list, Function or other\r\n * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Function\r\n * @sig (*... -\u003E *) -\u003E ([*]... -\u003E [*])\r\n * @param {Function} fn The function to lift into higher context\r\n * @return {Function} The lifted function.\r\n * @see R.liftN\r\n * @example\r\n *\r\n * const madd3 = R.lift((a, b, c) =\u003E a \u002B b \u002B c);\r\n *\r\n * madd3([100, 200], [30, 40], [5, 6, 7]); //=\u003E [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]\r\n *\r\n * const madd5 = R.lift((a, b, c, d, e) =\u003E a \u002B b \u002B c \u002B d \u002B e);\r\n *\r\n * madd5([10, 20], [1], [2, 3], [4], [100, 200]); //=\u003E [117, 217, 118, 218, 127, 227, 128, 228]\r\n */\r\n\r\nvar lift = _curry1(function lift(fn) {\r\n return liftN(fn.length, fn);\r\n});\r\n\r\n/**\r\n * A function which calls the two provided functions and returns the \u0060\u0026\u0026\u0060\r\n * of the results.\r\n * It returns the result of the first function if it is false-y and the result\r\n * of the second function otherwise. Note that this is short-circuited,\r\n * meaning that the second function will not be invoked if the first returns a\r\n * false-y value.\r\n *\r\n * In addition to functions, \u0060R.both\u0060 also accepts any fantasy-land compatible\r\n * applicative functor.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category Logic\r\n * @sig (*... -\u003E Boolean) -\u003E (*... -\u003E Boolean) -\u003E (*... -\u003E Boolean)\r\n * @param {Function} f A predicate\r\n * @param {Function} g Another predicate\r\n * @return {Function} a function that applies its arguments to \u0060f\u0060 and \u0060g\u0060 and \u0060\u0026\u0026\u0060s their outputs together.\r\n * @see R.either, R.allPass, R.and\r\n * @example\r\n *\r\n * const gt10 = R.gt(R.__, 10)\r\n * const lt20 = R.lt(R.__, 20)\r\n * const f = R.both(gt10, lt20);\r\n * f(15); //=\u003E true\r\n * f(30); //=\u003E false\r\n *\r\n * R.both(Maybe.Just(false), Maybe.Just(55)); // =\u003E Maybe.Just(false)\r\n * R.both([false, false, \u0027a\u0027], [11]); //=\u003E [false, false, 11]\r\n */\r\n\r\nvar both = _curry2(function both(f, g) {\r\n return _isFunction(f)\r\n ? function _both() {\r\n return f.apply(this, arguments) \u0026\u0026 g.apply(this, arguments);\r\n }\r\n : lift(and)(f, g);\r\n});\r\n\r\n/**\r\n * Returns the result of calling its first argument with the remaining\r\n * arguments. This is occasionally useful as a converging function for\r\n * [\u0060R.converge\u0060](#converge): the first branch can produce a function while the\r\n * remaining branches produce values to be passed to that function as its\r\n * arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Function\r\n * @sig ((*... -\u003E a), *...) -\u003E a\r\n * @param {Function} fn The function to apply to the remaining arguments.\r\n * @param {...*} args Any number of positional arguments.\r\n * @return {*}\r\n * @see R.apply\r\n * @example\r\n *\r\n * R.call(R.add, 1, 2); //=\u003E 3\r\n *\r\n * const indentN = R.pipe(\r\n * R.repeat(\u0027 \u0027),\r\n * R.join(\u0027\u0027),\r\n * R.replace(/^(?!$)/gm)\r\n * );\r\n *\r\n * const format = R.converge(\r\n * R.call,\r\n * [\r\n * R.pipe(R.prop(\u0027indent\u0027), indentN),\r\n * R.prop(\u0027value\u0027)\r\n * ]\r\n * );\r\n *\r\n * format({indent: 2, value: \u0027foo\\nbar\\nbaz\\n\u0027}); //=\u003E \u0027 foo\\n bar\\n baz\\n\u0027\r\n * @symb R.call(f, a, b) = f(a, b)\r\n */\r\n\r\nvar call = _curry1(function call(fn) {\r\n return fn.apply(this, Array.prototype.slice.call(arguments, 1));\r\n});\r\n\r\n/**\r\n * \u0060_makeFlat\u0060 is a helper function that returns a one-level or fully recursive\r\n * function based on the flag passed in.\r\n *\r\n * @private\r\n */\r\n\r\nfunction _makeFlat(recursive) {\r\n return function flatt(list) {\r\n var value, jlen, j;\r\n var result = [];\r\n var idx = 0;\r\n var ilen = list.length;\r\n\r\n while (idx \u003C ilen) {\r\n if (_isArrayLike(list[idx])) {\r\n value = recursive ? flatt(list[idx]) : list[idx];\r\n j = 0;\r\n jlen = value.length;\r\n\r\n while (j \u003C jlen) {\r\n result[result.length] = value[j];\r\n j \u002B= 1;\r\n }\r\n } else {\r\n result[result.length] = list[idx];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n };\r\n}\r\n\r\nfunction _forceReduced(x) {\r\n return {\r\n \u0022@@transducer/value\u0022: x,\r\n \u0022@@transducer/reduced\u0022: true,\r\n };\r\n}\r\n\r\nvar tInit = \u0022@@transducer/init\u0022;\r\nvar tStep = \u0022@@transducer/step\u0022;\r\nvar tResult = \u0022@@transducer/result\u0022;\r\n\r\nfunction XPreservingReduced(xf) {\r\n this.xf = xf;\r\n}\r\n\r\nXPreservingReduced.prototype[tInit] = _xfBase.init;\r\nXPreservingReduced.prototype[tResult] = _xfBase.result;\r\n\r\nXPreservingReduced.prototype[tStep] = function (result, input) {\r\n var ret = this.xf[tStep](result, input);\r\n return ret[\u0022@@transducer/reduced\u0022] ? _forceReduced(ret) : ret;\r\n};\r\n\r\nfunction XFlatCat(xf) {\r\n this.xf = new XPreservingReduced(xf);\r\n}\r\n\r\nXFlatCat.prototype[tInit] = _xfBase.init;\r\nXFlatCat.prototype[tResult] = _xfBase.result;\r\n\r\nXFlatCat.prototype[tStep] = function (result, input) {\r\n return !_isArrayLike(input)\r\n ? _xArrayReduce(this.xf, result, [input])\r\n : _xReduce(this.xf, result, input);\r\n};\r\n\r\nvar _flatCat = function _xcat(xf) {\r\n return new XFlatCat(xf);\r\n};\r\n\r\nfunction _xchain(f) {\r\n return function (xf) {\r\n return _xmap(f)(_flatCat(xf));\r\n };\r\n}\r\n\r\n/**\r\n * \u0060chain\u0060 maps a function over a list and concatenates the results. \u0060chain\u0060\r\n * is also known as \u0060flatMap\u0060 in some libraries.\r\n *\r\n * Dispatches to the \u0060chain\u0060 method of the second argument, if present,\r\n * according to the [FantasyLand Chain spec](https://github.com/fantasyland/fantasy-land#chain).\r\n *\r\n * If second argument is a function, \u0060chain(f, g)(x)\u0060 is equivalent to \u0060f(g(x), x)\u0060.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category List\r\n * @sig Chain m =\u003E (a -\u003E m b) -\u003E m a -\u003E m b\r\n * @param {Function} fn The function to map with\r\n * @param {Array} list The list to map over\r\n * @return {Array} The result of flat-mapping \u0060list\u0060 with \u0060fn\u0060\r\n * @example\r\n *\r\n * const duplicate = n =\u003E [n, n];\r\n * R.chain(duplicate, [1, 2, 3]); //=\u003E [1, 1, 2, 2, 3, 3]\r\n *\r\n * R.chain(R.append, R.head)([1, 2, 3]); //=\u003E [1, 2, 3, 1]\r\n */\r\n\r\nvar chain = _curry2(\r\n _dispatchable(\r\n [\u0022fantasy-land/chain\u0022, \u0022chain\u0022],\r\n _xchain,\r\n function chain(fn, monad) {\r\n if (typeof monad === \u0022function\u0022) {\r\n return function (x) {\r\n return fn(monad(x))(x);\r\n };\r\n }\r\n\r\n return _makeFlat(false)(map(fn, monad));\r\n }\r\n )\r\n);\r\n\r\n/**\r\n * Restricts a number to be within a range.\r\n *\r\n * Also works for other ordered types such as Strings and Dates.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.20.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E a -\u003E a\r\n * @param {Number} minimum The lower limit of the clamp (inclusive)\r\n * @param {Number} maximum The upper limit of the clamp (inclusive)\r\n * @param {Number} value Value to be clamped\r\n * @return {Number} Returns \u0060minimum\u0060 when \u0060val \u003C minimum\u0060, \u0060maximum\u0060 when \u0060val \u003E maximum\u0060, returns \u0060val\u0060 otherwise\r\n * @example\r\n *\r\n * R.clamp(1, 10, -5) // =\u003E 1\r\n * R.clamp(1, 10, 15) // =\u003E 10\r\n * R.clamp(1, 10, 4) // =\u003E 4\r\n */\r\n\r\nvar clamp = _curry3(function clamp(min, max, value) {\r\n if (min \u003E max) {\r\n throw new Error(\r\n \u0022min must not be greater than max in clamp(min, max, value)\u0022\r\n );\r\n }\r\n\r\n return value \u003C min ? min : value \u003E max ? max : value;\r\n});\r\n\r\nfunction _cloneRegExp(pattern) {\r\n return new RegExp(\r\n pattern.source,\r\n pattern.flags\r\n ? pattern.flags\r\n : (pattern.global ? \u0022g\u0022 : \u0022\u0022) \u002B\r\n (pattern.ignoreCase ? \u0022i\u0022 : \u0022\u0022) \u002B\r\n (pattern.multiline ? \u0022m\u0022 : \u0022\u0022) \u002B\r\n (pattern.sticky ? \u0022y\u0022 : \u0022\u0022) \u002B\r\n (pattern.unicode ? \u0022u\u0022 : \u0022\u0022) \u002B\r\n (pattern.dotAll ? \u0022s\u0022 : \u0022\u0022)\r\n );\r\n}\r\n\r\n/**\r\n * Copies an object.\r\n *\r\n * @private\r\n * @param {*} value The value to be copied\r\n * @param {Boolean} deep Whether or not to perform deep cloning.\r\n * @return {*} The copied value.\r\n */\r\n\r\nfunction _clone(value, deep, map) {\r\n map || (map = new _ObjectMap()); // this avoids the slower switch with a quick if decision removing some milliseconds in each run.\r\n\r\n if (_isPrimitive(value)) {\r\n return value;\r\n }\r\n\r\n var copy = function copy(copiedValue) {\r\n // Check for circular and same references on the object graph and return its corresponding clone.\r\n var cachedCopy = map.get(value);\r\n\r\n if (cachedCopy) {\r\n return cachedCopy;\r\n }\r\n\r\n map.set(value, copiedValue);\r\n\r\n for (var key in value) {\r\n if (Object.prototype.hasOwnProperty.call(value, key)) {\r\n copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];\r\n }\r\n }\r\n\r\n return copiedValue;\r\n };\r\n\r\n switch (type(value)) {\r\n case \u0022Object\u0022:\r\n return copy(Object.create(Object.getPrototypeOf(value)));\r\n\r\n case \u0022Array\u0022:\r\n return copy([]);\r\n\r\n case \u0022Date\u0022:\r\n return new Date(value.valueOf());\r\n\r\n case \u0022RegExp\u0022:\r\n return _cloneRegExp(value);\r\n\r\n case \u0022Int8Array\u0022:\r\n case \u0022Uint8Array\u0022:\r\n case \u0022Uint8ClampedArray\u0022:\r\n case \u0022Int16Array\u0022:\r\n case \u0022Uint16Array\u0022:\r\n case \u0022Int32Array\u0022:\r\n case \u0022Uint32Array\u0022:\r\n case \u0022Float32Array\u0022:\r\n case \u0022Float64Array\u0022:\r\n case \u0022BigInt64Array\u0022:\r\n case \u0022BigUint64Array\u0022:\r\n return value.slice();\r\n\r\n default:\r\n return value;\r\n }\r\n}\r\n\r\nfunction _isPrimitive(param) {\r\n var type = _typeof(param);\r\n\r\n return param == null || (type != \u0022object\u0022 \u0026\u0026 type != \u0022function\u0022);\r\n}\r\n\r\nfunction _ObjectMap() {\r\n this.map = {};\r\n this.length = 0;\r\n}\r\n\r\n_ObjectMap.prototype.set = function (key, value) {\r\n var hashedKey = this.hash(key);\r\n var bucket = this.map[hashedKey];\r\n\r\n if (!bucket) {\r\n this.map[hashedKey] = bucket = [];\r\n }\r\n\r\n bucket.push([key, value]);\r\n this.length \u002B= 1;\r\n};\r\n\r\n_ObjectMap.prototype.hash = function (key) {\r\n var hashedKey = [];\r\n\r\n for (var value in key) {\r\n hashedKey.push(Object.prototype.toString.call(key[value]));\r\n }\r\n\r\n return hashedKey.join();\r\n};\r\n\r\n_ObjectMap.prototype.get = function (key) {\r\n /**\r\n * depending on the number of objects to be cloned is faster to just iterate over the items in the map just because the hash function is so costly,\r\n * on my tests this number is 180, anything above that using the hash function is faster.\r\n */\r\n if (this.length \u003C= 180) {\r\n for (var p in this.map) {\r\n var _bucket = this.map[p];\r\n\r\n for (var i = 0; i \u003C _bucket.length; i \u002B= 1) {\r\n var element = _bucket[i];\r\n\r\n if (element[0] === key) {\r\n return element[1];\r\n }\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n var hashedKey = this.hash(key);\r\n var bucket = this.map[hashedKey];\r\n\r\n if (!bucket) {\r\n return;\r\n }\r\n\r\n for (var _i = 0; _i \u003C bucket.length; _i \u002B= 1) {\r\n var _element = bucket[_i];\r\n\r\n if (_element[0] === key) {\r\n return _element[1];\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Creates a deep copy of the source that can be used in place of the source\r\n * object without retaining any references to it.\r\n * The source object may contain (nested) \u0060Array\u0060s and \u0060Object\u0060s,\r\n * \u0060Number\u0060s, \u0060String\u0060s, \u0060Boolean\u0060s and \u0060Date\u0060s.\r\n * \u0060Function\u0060s are assigned by reference rather than copied.\r\n *\r\n * Dispatches to a \u0060clone\u0060 method if present.\r\n *\r\n * Note that if the source object has multiple nodes that share a reference,\r\n * the returned object will have the same structure, but the references will\r\n * be pointed to the location within the cloned value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig {*} -\u003E {*}\r\n * @param {*} value The object or array to clone\r\n * @return {*} A deeply cloned copy of \u0060val\u0060\r\n * @example\r\n *\r\n * const objects = [{}, {}, {}];\r\n * const objectsClone = R.clone(objects);\r\n * objects === objectsClone; //=\u003E false\r\n * objects[0] === objectsClone[0]; //=\u003E false\r\n */\r\n\r\nvar clone = _curry1(function clone(value) {\r\n return value != null \u0026\u0026 typeof value.clone === \u0022function\u0022\r\n ? value.clone()\r\n : _clone(value, true);\r\n});\r\n\r\n/**\r\n * Splits a list into sub-lists, based on the result of calling a key-returning function on each element,\r\n * and grouping the results according to values returned.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category List\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig Idx a =\u003E (b -\u003E a) -\u003E [b] -\u003E [[b]]\r\n * @param {Function} fn Function :: a -\u003E Idx\r\n * @param {Array} list The array to group\r\n * @return {Array}\r\n * An array of arrays where each sub-array contains items for which\r\n * the String-returning function has returned the same value.\r\n * @see R.groupBy, R.partition\r\n * @example\r\n * R.collectBy(R.prop(\u0027type\u0027), [\r\n * {type: \u0027breakfast\u0027, item: \u0027\u2615\uFE0F\u0027},\r\n * {type: \u0027lunch\u0027, item: \u0027\uD83C\uDF2F\u0027},\r\n * {type: \u0027dinner\u0027, item: \u0027\uD83C\uDF5D\u0027},\r\n * {type: \u0027breakfast\u0027, item: \u0027\uD83E\uDD50\u0027},\r\n * {type: \u0027lunch\u0027, item: \u0027\uD83C\uDF55\u0027}\r\n * ]);\r\n *\r\n * // [ [ {type: \u0027breakfast\u0027, item: \u0027\u2615\uFE0F\u0027},\r\n * // {type: \u0027breakfast\u0027, item: \u0027\uD83E\uDD50\u0027} ],\r\n * // [ {type: \u0027lunch\u0027, item: \u0027\uD83C\uDF2F\u0027},\r\n * // {type: \u0027lunch\u0027, item: \u0027\uD83C\uDF55\u0027} ],\r\n * // [ {type: \u0027dinner\u0027, item: \u0027\uD83C\uDF5D\u0027} ] ]\r\n */\r\n\r\nvar collectBy = _curry2(function collectBy(fn, list) {\r\n var group = _reduce(\r\n function (o, x) {\r\n var tag = fn(x);\r\n\r\n if (o[tag] === undefined) {\r\n o[tag] = [];\r\n }\r\n\r\n o[tag].push(x);\r\n return o;\r\n },\r\n {},\r\n list\r\n );\r\n\r\n var newList = [];\r\n\r\n for (var tag in group) {\r\n newList.push(group[tag]);\r\n }\r\n\r\n return newList;\r\n});\r\n\r\n/**\r\n * Makes a comparator function out of a function that reports whether the first\r\n * element is less than the second.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig ((a, b) -\u003E Boolean) -\u003E ((a, b) -\u003E Number)\r\n * @param {Function} pred A predicate function of arity two which will return \u0060true\u0060 if the first argument\r\n * is less than the second, \u0060false\u0060 otherwise\r\n * @return {Function} A Function :: a -\u003E b -\u003E Int that returns \u0060-1\u0060 if a \u003C b, \u00601\u0060 if b \u003C a, otherwise \u00600\u0060\r\n * @example\r\n *\r\n * const byAge = R.comparator((a, b) =\u003E a.age \u003C b.age);\r\n * const people = [\r\n * { name: \u0027Emma\u0027, age: 70 },\r\n * { name: \u0027Peter\u0027, age: 78 },\r\n * { name: \u0027Mikhail\u0027, age: 62 },\r\n * ];\r\n * const peopleByIncreasingAge = R.sort(byAge, people);\r\n * //=\u003E [{ name: \u0027Mikhail\u0027, age: 62 },{ name: \u0027Emma\u0027, age: 70 }, { name: \u0027Peter\u0027, age: 78 }]\r\n */\r\n\r\nvar comparator = _curry1(function comparator(pred) {\r\n return function (a, b) {\r\n return pred(a, b) ? -1 : pred(b, a) ? 1 : 0;\r\n };\r\n});\r\n\r\n/**\r\n * A function that returns the \u0060!\u0060 of its argument. It will return \u0060true\u0060 when\r\n * passed false-y value, and \u0060false\u0060 when passed a truth-y one.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Logic\r\n * @sig * -\u003E Boolean\r\n * @param {*} a any value\r\n * @return {Boolean} the logical inverse of passed argument.\r\n * @see R.complement\r\n * @example\r\n *\r\n * R.not(true); //=\u003E false\r\n * R.not(false); //=\u003E true\r\n * R.not(0); //=\u003E true\r\n * R.not(1); //=\u003E false\r\n */\r\n\r\nvar not = _curry1(function not(a) {\r\n return !a;\r\n});\r\n\r\n/**\r\n * Takes a function \u0060f\u0060 and returns a function \u0060g\u0060 such that if called with the same arguments\r\n * when \u0060f\u0060 returns a \u0022truthy\u0022 value, \u0060g\u0060 returns \u0060false\u0060 and when \u0060f\u0060 returns a \u0022falsy\u0022 value \u0060g\u0060 returns \u0060true\u0060.\r\n *\r\n * \u0060R.complement\u0060 may be applied to any functor\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category Logic\r\n * @sig (*... -\u003E *) -\u003E (*... -\u003E Boolean)\r\n * @param {Function} f\r\n * @return {Function}\r\n * @see R.not\r\n * @example\r\n *\r\n * const isNotNil = R.complement(R.isNil);\r\n * R.isNil(null); //=\u003E true\r\n * isNotNil(null); //=\u003E false\r\n * R.isNil(7); //=\u003E false\r\n * isNotNil(7); //=\u003E true\r\n */\r\n\r\nvar complement = lift(not);\r\n\r\nfunction _pipe(f, g) {\r\n return function () {\r\n return g.call(this, f.apply(this, arguments));\r\n };\r\n}\r\n\r\n/**\r\n * This checks whether a function has a [methodname] function. If it isn\u0027t an\r\n * array it will execute that function otherwise it will default to the ramda\r\n * implementation.\r\n *\r\n * @private\r\n * @param {Function} fn ramda implementation\r\n * @param {String} methodname property to check for a custom implementation\r\n * @return {Object} Whatever the return value of the method is.\r\n */\r\n\r\nfunction _checkForMethod(methodname, fn) {\r\n return function () {\r\n var length = arguments.length;\r\n\r\n if (length === 0) {\r\n return fn();\r\n }\r\n\r\n var obj = arguments[length - 1];\r\n return _isArray(obj) || typeof obj[methodname] !== \u0022function\u0022\r\n ? fn.apply(this, arguments)\r\n : obj[methodname].apply(\r\n obj,\r\n Array.prototype.slice.call(arguments, 0, length - 1)\r\n );\r\n };\r\n}\r\n\r\n/**\r\n * Returns the elements of the given list or string (or object with a \u0060slice\u0060\r\n * method) from \u0060fromIndex\u0060 (inclusive) to \u0060toIndex\u0060 (exclusive).\r\n *\r\n * Dispatches to the \u0060slice\u0060 method of the third argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.4\r\n * @category List\r\n * @sig Number -\u003E Number -\u003E [a] -\u003E [a]\r\n * @sig Number -\u003E Number -\u003E String -\u003E String\r\n * @param {Number} fromIndex The start index (inclusive).\r\n * @param {Number} toIndex The end index (exclusive).\r\n * @param {*} list\r\n * @return {*}\r\n * @example\r\n *\r\n * R.slice(1, 3, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027b\u0027, \u0027c\u0027]\r\n * R.slice(1, Infinity, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027b\u0027, \u0027c\u0027, \u0027d\u0027]\r\n * R.slice(0, -1, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]\r\n * R.slice(-3, -1, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027]); //=\u003E [\u0027b\u0027, \u0027c\u0027]\r\n * R.slice(0, 3, \u0027ramda\u0027); //=\u003E \u0027ram\u0027\r\n */\r\n\r\nvar slice = _curry3(\r\n _checkForMethod(\u0022slice\u0022, function slice(fromIndex, toIndex, list) {\r\n return Array.prototype.slice.call(list, fromIndex, toIndex);\r\n })\r\n);\r\n\r\n/**\r\n * Returns all but the first element of the given list or string (or object\r\n * with a \u0060tail\u0060 method).\r\n *\r\n * Dispatches to the \u0060slice\u0060 method of the first argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [a]\r\n * @sig String -\u003E String\r\n * @param {*} list\r\n * @return {*}\r\n * @see R.head, R.init, R.last\r\n * @example\r\n *\r\n * R.tail([1, 2, 3]); //=\u003E [2, 3]\r\n * R.tail([1, 2]); //=\u003E [2]\r\n * R.tail([1]); //=\u003E []\r\n * R.tail([]); //=\u003E []\r\n *\r\n * R.tail(\u0027abc\u0027); //=\u003E \u0027bc\u0027\r\n * R.tail(\u0027ab\u0027); //=\u003E \u0027b\u0027\r\n * R.tail(\u0027a\u0027); //=\u003E \u0027\u0027\r\n * R.tail(\u0027\u0027); //=\u003E \u0027\u0027\r\n */\r\n\r\nvar tail = _curry1(_checkForMethod(\u0022tail\u0022, slice(1, Infinity)));\r\n\r\n/**\r\n * Performs left-to-right function composition. The first argument may have\r\n * any arity; the remaining arguments must be unary.\r\n *\r\n * In some libraries this function is named \u0060sequence\u0060.\r\n *\r\n * **Note:** The result of pipe is not automatically curried.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig (((a, b, ..., n) -\u003E o), (o -\u003E p), ..., (x -\u003E y), (y -\u003E z)) -\u003E ((a, b, ..., n) -\u003E z)\r\n * @param {...Function} functions\r\n * @return {Function}\r\n * @see R.compose\r\n * @example\r\n *\r\n * const f = R.pipe(Math.pow, R.negate, R.inc);\r\n *\r\n * f(3, 4); // -(3^4) \u002B 1\r\n * @symb R.pipe(f, g, h)(a, b) = h(g(f(a, b)))\r\n * @symb R.pipe(f, g, h)(a)(b) = h(g(f(a)))(b)\r\n */\r\n\r\nfunction pipe() {\r\n if (arguments.length === 0) {\r\n throw new Error(\u0022pipe requires at least one argument\u0022);\r\n }\r\n\r\n return _arity(\r\n arguments[0].length,\r\n reduce(_pipe, arguments[0], tail(arguments))\r\n );\r\n}\r\n\r\n/**\r\n * Returns a new list or string with the elements or characters in reverse\r\n * order.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [a]\r\n * @sig String -\u003E String\r\n * @param {Array|String} list\r\n * @return {Array|String}\r\n * @example\r\n *\r\n * R.reverse([1, 2, 3]); //=\u003E [3, 2, 1]\r\n * R.reverse([1, 2]); //=\u003E [2, 1]\r\n * R.reverse([1]); //=\u003E [1]\r\n * R.reverse([]); //=\u003E []\r\n *\r\n * R.reverse(\u0027abc\u0027); //=\u003E \u0027cba\u0027\r\n * R.reverse(\u0027ab\u0027); //=\u003E \u0027ba\u0027\r\n * R.reverse(\u0027a\u0027); //=\u003E \u0027a\u0027\r\n * R.reverse(\u0027\u0027); //=\u003E \u0027\u0027\r\n */\r\n\r\nvar reverse = _curry1(function reverse(list) {\r\n return _isString(list)\r\n ? list.split(\u0022\u0022).reverse().join(\u0022\u0022)\r\n : Array.prototype.slice.call(list, 0).reverse();\r\n});\r\n\r\n/**\r\n * Performs right-to-left function composition. The last argument may have\r\n * any arity; the remaining arguments must be unary.\r\n *\r\n * **Note:** The result of compose is not automatically curried.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig ((y -\u003E z), (x -\u003E y), ..., (o -\u003E p), ((a, b, ..., n) -\u003E o)) -\u003E ((a, b, ..., n) -\u003E z)\r\n * @param {...Function} ...functions The functions to compose\r\n * @return {Function}\r\n * @see R.pipe\r\n * @example\r\n *\r\n * const classyGreeting = (firstName, lastName) =\u003E \u0022The name\u0027s \u0022 \u002B lastName \u002B \u0022, \u0022 \u002B firstName \u002B \u0022 \u0022 \u002B lastName\r\n * const yellGreeting = R.compose(R.toUpper, classyGreeting);\r\n * yellGreeting(\u0027James\u0027, \u0027Bond\u0027); //=\u003E \u0022THE NAME\u0027S BOND, JAMES BOND\u0022\r\n *\r\n * R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=\u003E 7\r\n *\r\n * @symb R.compose(f, g, h)(a, b) = f(g(h(a, b)))\r\n * @symb R.compose(f, g, h)(a)(b) = f(g(h(a)))(b)\r\n */\r\n\r\nfunction compose() {\r\n if (arguments.length === 0) {\r\n throw new Error(\u0022compose requires at least one argument\u0022);\r\n }\r\n\r\n return pipe.apply(this, reverse(arguments));\r\n}\r\n\r\n/**\r\n * Returns the first element of the given list or string. In some libraries\r\n * this function is named \u0060first\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E a | Undefined\r\n * @sig String -\u003E String\r\n * @param {Array|String} list\r\n * @return {*}\r\n * @see R.tail, R.init, R.last\r\n * @example\r\n *\r\n * R.head([\u0027fi\u0027, \u0027fo\u0027, \u0027fum\u0027]); //=\u003E \u0027fi\u0027\r\n * R.head([]); //=\u003E undefined\r\n *\r\n * R.head(\u0027abc\u0027); //=\u003E \u0027a\u0027\r\n * R.head(\u0027\u0027); //=\u003E \u0027\u0027\r\n */\r\n\r\nvar head = nth(0);\r\n\r\nfunction _identity(x) {\r\n return x;\r\n}\r\n\r\n/**\r\n * A function that does nothing but return the parameter supplied to it. Good\r\n * as a default or placeholder function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig a -\u003E a\r\n * @param {*} x The value to return.\r\n * @return {*} The input value, \u0060x\u0060.\r\n * @example\r\n *\r\n * R.identity(1); //=\u003E 1\r\n *\r\n * const obj = {};\r\n * R.identity(obj) === obj; //=\u003E true\r\n * @symb R.identity(a) = a\r\n */\r\n\r\nvar identity = _curry1(_identity);\r\n\r\n/**\r\n * Performs left-to-right function composition using transforming function. The first function may have\r\n * any arity; the remaining functions must be unary.\r\n *\r\n * **Note:** The result of pipeWith is not automatically curried. Transforming function is not used on the\r\n * first argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Function\r\n * @sig ((* -\u003E *), [((a, b, ..., n) -\u003E o), (o -\u003E p), ..., (x -\u003E y), (y -\u003E z)]) -\u003E ((a, b, ..., n) -\u003E z)\r\n * @param {Function} transformer The transforming function\r\n * @param {Array} functions The functions to pipe\r\n * @return {Function}\r\n * @see R.composeWith, R.pipe\r\n * @example\r\n *\r\n * const pipeWhileNotNil = R.pipeWith((f, res) =\u003E R.isNil(res) ? res : f(res));\r\n * const f = pipeWhileNotNil([Math.pow, R.negate, R.inc])\r\n *\r\n * f(3, 4); // -(3^4) \u002B 1\r\n * @symb R.pipeWith(f)([g, h, i])(...args) = f(i, f(h, g(...args)))\r\n */\r\n\r\nvar pipeWith = _curry2(function pipeWith(xf, list) {\r\n if (list.length \u003C= 0) {\r\n return identity;\r\n }\r\n\r\n var headList = head(list);\r\n var tailList = tail(list);\r\n return _arity(headList.length, function () {\r\n return _reduce(\r\n function (result, f) {\r\n return xf.call(this, f, result);\r\n },\r\n headList.apply(this, arguments),\r\n tailList\r\n );\r\n });\r\n});\r\n\r\n/**\r\n * Performs right-to-left function composition using transforming function. The last function may have\r\n * any arity; the remaining functions must be unary. Unlike \u0060compose\u0060, functions are passed in an array.\r\n *\r\n * **Note:** The result of composeWith is not automatically curried. Transforming function is not used\r\n * on the last argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Function\r\n * @sig ((* -\u003E *), [(y -\u003E z), (x -\u003E y), ..., (o -\u003E p), ((a, b, ..., n) -\u003E o)]) -\u003E ((a, b, ..., n) -\u003E z)\r\n * @param {Function} transformer The transforming function\r\n * @param {Array} functions The functions to compose\r\n * @return {Function}\r\n * @see R.compose, R.pipeWith\r\n * @example\r\n *\r\n * const composeWhileNotNil = R.composeWith((f, res) =\u003E R.isNil(res) ? res : f(res));\r\n *\r\n * composeWhileNotNil([R.inc, R.prop(\u0027age\u0027)])({age: 1}) //=\u003E 2\r\n * composeWhileNotNil([R.inc, R.prop(\u0027age\u0027)])({}) //=\u003E undefined\r\n *\r\n * @symb R.composeWith(f)([g, h, i])(...args) = f(g, f(h, i(...args)))\r\n */\r\n\r\nvar composeWith = _curry2(function composeWith(xf, list) {\r\n return pipeWith.apply(this, [xf, reverse(list)]);\r\n});\r\n\r\n/**\r\n * Returns the result of concatenating the given lists or strings.\r\n *\r\n * Note: \u0060R.concat\u0060 expects both arguments to be of the same type,\r\n * unlike the native \u0060Array.prototype.concat\u0060 method. It will throw\r\n * an error if you \u0060concat\u0060 an Array with a non-Array value.\r\n *\r\n * Dispatches to the \u0060concat\u0060 method of the first argument, if present.\r\n * Can also concatenate two members of a [fantasy-land\r\n * compatible semigroup](https://github.com/fantasyland/fantasy-land#semigroup).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [a] -\u003E [a]\r\n * @sig String -\u003E String -\u003E String\r\n * @param {Array|String} firstList The first list\r\n * @param {Array|String} secondList The second list\r\n * @return {Array|String} A list consisting of the elements of \u0060firstList\u0060 followed by the elements of\r\n * \u0060secondList\u0060.\r\n *\r\n * @example\r\n *\r\n * R.concat(\u0027ABC\u0027, \u0027DEF\u0027); // \u0027ABCDEF\u0027\r\n * R.concat([4, 5, 6], [1, 2, 3]); //=\u003E [4, 5, 6, 1, 2, 3]\r\n * R.concat([], []); //=\u003E []\r\n */\r\n\r\nvar concat = _curry2(function concat(a, b) {\r\n if (_isArray(a)) {\r\n if (_isArray(b)) {\r\n return a.concat(b);\r\n }\r\n\r\n throw new TypeError(toString$1(b) \u002B \u0022 is not an array\u0022);\r\n }\r\n\r\n if (_isString(a)) {\r\n if (_isString(b)) {\r\n return a \u002B b;\r\n }\r\n\r\n throw new TypeError(toString$1(b) \u002B \u0022 is not a string\u0022);\r\n }\r\n\r\n if (a != null \u0026\u0026 _isFunction(a[\u0022fantasy-land/concat\u0022])) {\r\n return a[\u0022fantasy-land/concat\u0022](b);\r\n }\r\n\r\n if (a != null \u0026\u0026 _isFunction(a.concat)) {\r\n return a.concat(b);\r\n }\r\n\r\n throw new TypeError(\r\n toString$1(a) \u002B\r\n \u0027 does not have a method named \u0022concat\u0022 or \u0022fantasy-land/concat\u0022\u0027\r\n );\r\n});\r\n\r\n/**\r\n * Returns a function, \u0060fn\u0060, which encapsulates \u0060if/else, if/else, ...\u0060 logic.\r\n * \u0060R.cond\u0060 takes a list of [predicate, transformer] pairs. All of the arguments\r\n * to \u0060fn\u0060 are applied to each of the predicates in turn until one returns a\r\n * \u0022truthy\u0022 value, at which point \u0060fn\u0060 returns the result of applying its\r\n * arguments to the corresponding transformer. If none of the predicates\r\n * matches, \u0060fn\u0060 returns undefined.\r\n *\r\n * **Please note**: This is not a direct substitute for a \u0060switch\u0060 statement.\r\n * Remember that both elements of every pair passed to \u0060cond\u0060 are *functions*,\r\n * and \u0060cond\u0060 returns a function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.6.0\r\n * @category Logic\r\n * @sig [[(*... -\u003E Boolean),(*... -\u003E *)]] -\u003E (*... -\u003E *)\r\n * @param {Array} pairs A list of [predicate, transformer]\r\n * @return {Function}\r\n * @see R.ifElse, R.unless, R.when\r\n * @example\r\n *\r\n * const fn = R.cond([\r\n * [R.equals(0), R.always(\u0027water freezes at 0\u00B0C\u0027)],\r\n * [R.equals(100), R.always(\u0027water boils at 100\u00B0C\u0027)],\r\n * [R.T, temp =\u003E \u0027nothing special happens at \u0027 \u002B temp \u002B \u0027\u00B0C\u0027]\r\n * ]);\r\n * fn(0); //=\u003E \u0027water freezes at 0\u00B0C\u0027\r\n * fn(50); //=\u003E \u0027nothing special happens at 50\u00B0C\u0027\r\n * fn(100); //=\u003E \u0027water boils at 100\u00B0C\u0027\r\n */\r\n\r\nvar cond = _curry1(function cond(pairs) {\r\n var arity = reduce(\r\n max,\r\n 0,\r\n map(function (pair) {\r\n return pair[0].length;\r\n }, pairs)\r\n );\r\n return _arity(arity, function () {\r\n var idx = 0;\r\n\r\n while (idx \u003C pairs.length) {\r\n if (pairs[idx][0].apply(this, arguments)) {\r\n return pairs[idx][1].apply(this, arguments);\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n });\r\n});\r\n\r\n/**\r\n * Returns a curried equivalent of the provided function. The curried function\r\n * has two unusual capabilities. First, its arguments needn\u0027t be provided one\r\n * at a time. If \u0060f\u0060 is a ternary function and \u0060g\u0060 is \u0060R.curry(f)\u0060, the\r\n * following are equivalent:\r\n *\r\n * - \u0060g(1)(2)(3)\u0060\r\n * - \u0060g(1)(2, 3)\u0060\r\n * - \u0060g(1, 2)(3)\u0060\r\n * - \u0060g(1, 2, 3)\u0060\r\n *\r\n * Secondly, the special placeholder value [\u0060R.__\u0060](#__) may be used to specify\r\n * \u0022gaps\u0022, allowing partial application of any combination of arguments,\r\n * regardless of their positions. If \u0060g\u0060 is as above and \u0060_\u0060 is [\u0060R.__\u0060](#__),\r\n * the following are equivalent:\r\n *\r\n * - \u0060g(1, 2, 3)\u0060\r\n * - \u0060g(_, 2, 3)(1)\u0060\r\n * - \u0060g(_, _, 3)(1)(2)\u0060\r\n * - \u0060g(_, _, 3)(1, 2)\u0060\r\n * - \u0060g(_, 2)(1)(3)\u0060\r\n * - \u0060g(_, 2)(1, 3)\u0060\r\n * - \u0060g(_, 2)(_, 3)(1)\u0060\r\n *\r\n * Please note that default parameters don\u0027t count towards a [function arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length)\r\n * and therefore \u0060curry\u0060 won\u0027t work well with those:\r\n *\r\n * \u0060\u0060\u0060\r\n * const h = R.curry((a, b, c = 2) =\u003E a \u002B b \u002B c);\r\n *\r\n * h(40);\r\n * //=\u003E function (waits for \u0060b\u0060)\r\n *\r\n * h(39)(1);\r\n * //=\u003E 42\r\n *\r\n * h(1)(2, 3);\r\n * //=\u003E 6\r\n *\r\n * h(1)(2)(7);\r\n * //=\u003E Error! (\u00603\u0060 is not a function!)\r\n * \u0060\u0060\u0060\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig (* -\u003E a) -\u003E (* -\u003E a)\r\n * @param {Function} fn The function to curry.\r\n * @return {Function} A new, curried function.\r\n * @see R.curryN, R.partial\r\n * @example\r\n *\r\n * const addFourNumbers = (a, b, c, d) =\u003E a \u002B b \u002B c \u002B d;\r\n *\r\n * const curriedAddFourNumbers = R.curry(addFourNumbers);\r\n * const f = curriedAddFourNumbers(1, 2);\r\n * const g = f(3);\r\n * g(4); //=\u003E 10\r\n */\r\n\r\nvar curry = _curry1(function curry(fn) {\r\n return curryN(fn.length, fn);\r\n});\r\n\r\n/**\r\n * Wraps a constructor function inside a curried function that can be called\r\n * with the same arguments and returns the same type. The arity of the function\r\n * returned is specified to allow using variadic constructor functions.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.4.0\r\n * @category Function\r\n * @sig Number -\u003E (* -\u003E {*}) -\u003E (* -\u003E {*})\r\n * @param {Number} n The arity of the constructor function.\r\n * @param {Function} Fn The constructor function to wrap.\r\n * @return {Function} A wrapped, curried constructor function.\r\n * @example\r\n *\r\n * // Variadic Constructor function\r\n * function Salad() {\r\n * this.ingredients = arguments;\r\n * }\r\n *\r\n * Salad.prototype.recipe = function() {\r\n * const instructions = R.map(ingredient =\u003E \u0027Add a dollop of \u0027 \u002B ingredient, this.ingredients);\r\n * return R.join(\u0027\\n\u0027, instructions);\r\n * };\r\n *\r\n * const ThreeLayerSalad = R.constructN(3, Salad);\r\n *\r\n * // Notice we no longer need the \u0027new\u0027 keyword, and the constructor is curried for 3 arguments.\r\n * const salad = ThreeLayerSalad(\u0027Mayonnaise\u0027)(\u0027Potato Chips\u0027)(\u0027Ketchup\u0027);\r\n *\r\n * console.log(salad.recipe());\r\n * // Add a dollop of Mayonnaise\r\n * // Add a dollop of Potato Chips\r\n * // Add a dollop of Ketchup\r\n */\r\n\r\nvar constructN = _curry2(function constructN(n, Fn) {\r\n if (n \u003E 10) {\r\n throw new Error(\u0022Constructor with greater than ten arguments\u0022);\r\n }\r\n\r\n if (n === 0) {\r\n return function () {\r\n return new Fn();\r\n };\r\n }\r\n\r\n return curry(\r\n nAry(n, function ($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {\r\n switch (n) {\r\n case 1:\r\n return new Fn($0);\r\n\r\n case 2:\r\n return new Fn($0, $1);\r\n\r\n case 3:\r\n return new Fn($0, $1, $2);\r\n\r\n case 4:\r\n return new Fn($0, $1, $2, $3);\r\n\r\n case 5:\r\n return new Fn($0, $1, $2, $3, $4);\r\n\r\n case 6:\r\n return new Fn($0, $1, $2, $3, $4, $5);\r\n\r\n case 7:\r\n return new Fn($0, $1, $2, $3, $4, $5, $6);\r\n\r\n case 8:\r\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7);\r\n\r\n case 9:\r\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8);\r\n\r\n case 10:\r\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8, $9);\r\n }\r\n })\r\n );\r\n});\r\n\r\n/**\r\n * Wraps a constructor function inside a curried function that can be called\r\n * with the same arguments and returns the same type.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig (* -\u003E {*}) -\u003E (* -\u003E {*})\r\n * @param {Function} fn The constructor function to wrap.\r\n * @return {Function} A wrapped, curried constructor function.\r\n * @see R.invoker\r\n * @example\r\n *\r\n * // Constructor function\r\n * function Animal(kind) {\r\n * this.kind = kind;\r\n * };\r\n * Animal.prototype.sighting = function() {\r\n * return \u0022It\u0027s a \u0022 \u002B this.kind \u002B \u0022!\u0022;\r\n * }\r\n *\r\n * const AnimalConstructor = R.construct(Animal)\r\n *\r\n * // Notice we no longer need the \u0027new\u0027 keyword:\r\n * AnimalConstructor(\u0027Pig\u0027); //=\u003E {\u0022kind\u0022: \u0022Pig\u0022, \u0022sighting\u0022: function (){...}};\r\n *\r\n * const animalTypes = [\u0022Lion\u0022, \u0022Tiger\u0022, \u0022Bear\u0022];\r\n * const animalSighting = R.invoker(0, \u0027sighting\u0027);\r\n * const sightNewAnimal = R.compose(animalSighting, AnimalConstructor);\r\n * R.map(sightNewAnimal, animalTypes); //=\u003E [\u0022It\u0027s a Lion!\u0022, \u0022It\u0027s a Tiger!\u0022, \u0022It\u0027s a Bear!\u0022]\r\n */\r\n\r\nvar construct = _curry1(function construct(Fn) {\r\n return constructN(Fn.length, Fn);\r\n});\r\n\r\n/**\r\n * Accepts a converging function and a list of branching functions and returns\r\n * a new function. The arity of the new function is the same as the arity of\r\n * the longest branching function. When invoked, this new function is applied\r\n * to some arguments, and each branching function is applied to those same\r\n * arguments. The results of each branching function are passed as arguments\r\n * to the converging function to produce the return value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.4.2\r\n * @category Function\r\n * @sig ((x1, x2, ...) -\u003E z) -\u003E [((a, b, ...) -\u003E x1), ((a, b, ...) -\u003E x2), ...] -\u003E (a -\u003E b -\u003E ... -\u003E z)\r\n * @param {Function} after A function. \u0060after\u0060 will be invoked with the return values of\r\n * \u0060fn1\u0060 and \u0060fn2\u0060 as its arguments.\r\n * @param {Array} functions A list of functions.\r\n * @return {Function} A new function.\r\n * @see R.useWith\r\n * @example\r\n *\r\n * const average = R.converge(R.divide, [R.sum, R.length])\r\n * average([1, 2, 3, 4, 5, 6, 7]) //=\u003E 4\r\n *\r\n * const strangeConcat = R.converge(R.concat, [R.toUpper, R.toLower])\r\n * strangeConcat(\u0022Yodel\u0022) //=\u003E \u0022YODELyodel\u0022\r\n *\r\n * @symb R.converge(f, [g, h])(a, b) = f(g(a, b), h(a, b))\r\n */\r\n\r\nvar converge = _curry2(function converge(after, fns) {\r\n return curryN(reduce(max, 0, pluck(\u0022length\u0022, fns)), function () {\r\n var args = arguments;\r\n var context = this;\r\n return after.apply(\r\n context,\r\n _map(function (fn) {\r\n return fn.apply(context, args);\r\n }, fns)\r\n );\r\n });\r\n});\r\n\r\n/**\r\n * Returns the number of items in a given \u0060list\u0060 matching the predicate \u0060f\u0060\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Number\r\n * @param {Function} predicate to match items against\r\n * @return {Array} list of items to count in\r\n * @example\r\n *\r\n * const even = x =\u003E x % 2 == 0;\r\n *\r\n * R.count(even, [1, 2, 3, 4, 5]); // =\u003E 2\r\n * R.map(R.count(even), [[1, 1, 1], [2, 3, 4, 5], [6]]); // =\u003E [0, 2, 1]\r\n */\r\n\r\nvar count = curry(function (pred, list) {\r\n return _reduce(\r\n function (a, e) {\r\n return pred(e) ? a \u002B 1 : a;\r\n },\r\n 0,\r\n list\r\n );\r\n});\r\n\r\nfunction XReduceBy(valueFn, valueAcc, keyFn, xf) {\r\n this.valueFn = valueFn;\r\n this.valueAcc = valueAcc;\r\n this.keyFn = keyFn;\r\n this.xf = xf;\r\n this.inputs = {};\r\n}\r\n\r\nXReduceBy.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXReduceBy.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n var key;\r\n\r\n for (key in this.inputs) {\r\n if (_has(key, this.inputs)) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, this.inputs[key]);\r\n\r\n if (result[\u0022@@transducer/reduced\u0022]) {\r\n result = result[\u0022@@transducer/value\u0022];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.inputs = null;\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXReduceBy.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n var key = this.keyFn(input);\r\n this.inputs[key] = this.inputs[key] || [key, _clone(this.valueAcc, false)];\r\n this.inputs[key][1] = this.valueFn(this.inputs[key][1], input);\r\n return result;\r\n};\r\n\r\nfunction _xreduceBy(valueFn, valueAcc, keyFn) {\r\n return function (xf) {\r\n return new XReduceBy(valueFn, valueAcc, keyFn, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Groups the elements of the list according to the result of calling\r\n * the String-returning function \u0060keyFn\u0060 on each element and reduces the elements\r\n * of each group to a single value via the reducer function \u0060valueFn\u0060.\r\n *\r\n * The value function receives two values: *(acc, value)*. It may use\r\n * [\u0060R.reduced\u0060](#reduced) to short circuit the iteration.\r\n *\r\n * This function is basically a more general [\u0060groupBy\u0060](#groupBy) function.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.20.0\r\n * @category List\r\n * @sig ((a, b) -\u003E a) -\u003E a -\u003E (b -\u003E String) -\u003E [b] -\u003E {String: a}\r\n * @param {Function} valueFn The function that reduces the elements of each group to a single\r\n * value. Receives two values, accumulator for a particular group and the current element.\r\n * @param {*} acc The (initial) accumulator value for each group.\r\n * @param {Function} keyFn The function that maps the list\u0027s element into a key.\r\n * @param {Array} list The array to group.\r\n * @return {Object} An object with the output of \u0060keyFn\u0060 for keys, mapped to the output of\r\n * \u0060valueFn\u0060 for elements which produced that key when passed to \u0060keyFn\u0060.\r\n * @see R.groupBy, R.reduce, R.reduced\r\n * @example\r\n *\r\n * const groupNames = (acc, {name}) =\u003E acc.concat(name)\r\n * const toGrade = ({score}) =\u003E\r\n * score \u003C 65 ? \u0027F\u0027 :\r\n * score \u003C 70 ? \u0027D\u0027 :\r\n * score \u003C 80 ? \u0027C\u0027 :\r\n * score \u003C 90 ? \u0027B\u0027 : \u0027A\u0027\r\n *\r\n * var students = [\r\n * {name: \u0027Abby\u0027, score: 83},\r\n * {name: \u0027Bart\u0027, score: 62},\r\n * {name: \u0027Curt\u0027, score: 88},\r\n * {name: \u0027Dora\u0027, score: 92},\r\n * ]\r\n *\r\n * reduceBy(groupNames, [], toGrade, students)\r\n * //=\u003E {\u0022A\u0022: [\u0022Dora\u0022], \u0022B\u0022: [\u0022Abby\u0022, \u0022Curt\u0022], \u0022F\u0022: [\u0022Bart\u0022]}\r\n */\r\n\r\nvar reduceBy = _curryN(\r\n 4,\r\n [],\r\n _dispatchable(\r\n [],\r\n _xreduceBy,\r\n function reduceBy(valueFn, valueAcc, keyFn, list) {\r\n var xf = _xwrap(function (acc, elt) {\r\n var key = keyFn(elt);\r\n var value = valueFn(\r\n _has(key, acc) ? acc[key] : _clone(valueAcc, false),\r\n elt\r\n );\r\n\r\n if (value \u0026\u0026 value[\u0022@@transducer/reduced\u0022]) {\r\n return _reduced(acc);\r\n }\r\n\r\n acc[key] = value;\r\n return acc;\r\n });\r\n\r\n return _xReduce(xf, {}, list);\r\n }\r\n )\r\n);\r\n\r\n/**\r\n * Counts the elements of a list according to how many match each value of a\r\n * key generated by the supplied function. Returns an object mapping the keys\r\n * produced by \u0060fn\u0060 to the number of occurrences in the list. Note that all\r\n * keys are coerced to strings because of how JavaScript objects work.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig (a -\u003E String) -\u003E [a] -\u003E {*}\r\n * @param {Function} fn The function used to map values to keys.\r\n * @param {Array} list The list to count elements from.\r\n * @return {Object} An object mapping keys to number of occurrences in the list.\r\n * @example\r\n *\r\n * const numbers = [1.0, 1.1, 1.2, 2.0, 3.0, 2.2];\r\n * R.countBy(Math.floor)(numbers); //=\u003E {\u00271\u0027: 3, \u00272\u0027: 2, \u00273\u0027: 1}\r\n *\r\n * const letters = [\u0027a\u0027, \u0027b\u0027, \u0027A\u0027, \u0027a\u0027, \u0027B\u0027, \u0027c\u0027];\r\n * R.countBy(R.toLower)(letters); //=\u003E {\u0027a\u0027: 3, \u0027b\u0027: 2, \u0027c\u0027: 1}\r\n */\r\n\r\nvar countBy = reduceBy(function (acc, elem) {\r\n return acc \u002B 1;\r\n}, 0);\r\n\r\n/**\r\n * Decrements its argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Math\r\n * @sig Number -\u003E Number\r\n * @param {Number} n\r\n * @return {Number} n - 1\r\n * @see R.inc\r\n * @example\r\n *\r\n * R.dec(42); //=\u003E 41\r\n */\r\n\r\nvar dec = add(-1);\r\n\r\n/**\r\n * Returns the second argument if it is not \u0060null\u0060, \u0060undefined\u0060 or \u0060NaN\u0060;\r\n * otherwise the first argument is returned.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category Logic\r\n * @sig a -\u003E b -\u003E a | b\r\n * @param {a} default The default value.\r\n * @param {b} val \u0060val\u0060 will be returned instead of \u0060default\u0060 unless \u0060val\u0060 is \u0060null\u0060, \u0060undefined\u0060 or \u0060NaN\u0060.\r\n * @return {*} The second value if it is not \u0060null\u0060, \u0060undefined\u0060 or \u0060NaN\u0060, otherwise the default value\r\n * @example\r\n *\r\n * const defaultTo42 = R.defaultTo(42);\r\n *\r\n * defaultTo42(null); //=\u003E 42\r\n * defaultTo42(undefined); //=\u003E 42\r\n * defaultTo42(false); //=\u003E false\r\n * defaultTo42(\u0027Ramda\u0027); //=\u003E \u0027Ramda\u0027\r\n * // parseInt(\u0027string\u0027) results in NaN\r\n * defaultTo42(parseInt(\u0027string\u0027)); //=\u003E 42\r\n */\r\n\r\nvar defaultTo = _curry2(function defaultTo(d, v) {\r\n return v == null || v !== v ? d : v;\r\n});\r\n\r\n/**\r\n * Makes a descending comparator function out of a function that returns a value\r\n * that can be compared with \u0060\u003C\u0060 and \u0060\u003E\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.23.0\r\n * @category Function\r\n * @sig Ord b =\u003E (a -\u003E b) -\u003E a -\u003E a -\u003E Number\r\n * @param {Function} fn A function of arity one that returns a value that can be compared\r\n * @param {*} a The first item to be compared.\r\n * @param {*} b The second item to be compared.\r\n * @return {Number} \u0060-1\u0060 if fn(a) \u003E fn(b), \u00601\u0060 if fn(b) \u003E fn(a), otherwise \u00600\u0060\r\n * @see R.ascend\r\n * @example\r\n *\r\n * const byAge = R.descend(R.prop(\u0027age\u0027));\r\n * const people = [\r\n * { name: \u0027Emma\u0027, age: 70 },\r\n * { name: \u0027Peter\u0027, age: 78 },\r\n * { name: \u0027Mikhail\u0027, age: 62 },\r\n * ];\r\n * const peopleByOldestFirst = R.sort(byAge, people);\r\n * //=\u003E [{ name: \u0027Peter\u0027, age: 78 }, { name: \u0027Emma\u0027, age: 70 }, { name: \u0027Mikhail\u0027, age: 62 }]\r\n */\r\n\r\nvar descend = _curry3(function descend(fn, a, b) {\r\n var aa = fn(a);\r\n var bb = fn(b);\r\n return aa \u003E bb ? -1 : aa \u003C bb ? 1 : 0;\r\n});\r\n\r\nfunction _Set() {\r\n /* globals Set */\r\n this._nativeSet = typeof Set === \u0022function\u0022 ? new Set() : null;\r\n this._items = {};\r\n} // until we figure out why jsdoc chokes on this\r\n// @param item The item to add to the Set\r\n// @returns {boolean} true if the item did not exist prior, otherwise false\r\n//\r\n\r\n_Set.prototype.add = function (item) {\r\n return !hasOrAdd(item, true, this);\r\n}; //\r\n// @param item The item to check for existence in the Set\r\n// @returns {boolean} true if the item exists in the Set, otherwise false\r\n//\r\n\r\n_Set.prototype.has = function (item) {\r\n return hasOrAdd(item, false, this);\r\n}; //\r\n// Combines the logic for checking whether an item is a member of the set and\r\n// for adding a new item to the set.\r\n//\r\n// @param item The item to check or add to the Set instance.\r\n// @param shouldAdd If true, the item will be added to the set if it doesn\u0027t\r\n// already exist.\r\n// @param set The set instance to check or add to.\r\n// @return {boolean} true if the item already existed, otherwise false.\r\n//\r\n\r\nfunction hasOrAdd(item, shouldAdd, set) {\r\n var type = _typeof(item);\r\n\r\n var prevSize, newSize;\r\n\r\n switch (type) {\r\n case \u0022string\u0022:\r\n case \u0022number\u0022:\r\n // distinguish between \u002B0 and -0\r\n if (item === 0 \u0026\u0026 1 / item === -Infinity) {\r\n if (set._items[\u0022-0\u0022]) {\r\n return true;\r\n } else {\r\n if (shouldAdd) {\r\n set._items[\u0022-0\u0022] = true;\r\n }\r\n\r\n return false;\r\n }\r\n } // these types can all utilise the native Set\r\n\r\n if (set._nativeSet !== null) {\r\n if (shouldAdd) {\r\n prevSize = set._nativeSet.size;\r\n\r\n set._nativeSet.add(item);\r\n\r\n newSize = set._nativeSet.size;\r\n return newSize === prevSize;\r\n } else {\r\n return set._nativeSet.has(item);\r\n }\r\n } else {\r\n if (!(type in set._items)) {\r\n if (shouldAdd) {\r\n set._items[type] = {};\r\n set._items[type][item] = true;\r\n }\r\n\r\n return false;\r\n } else if (item in set._items[type]) {\r\n return true;\r\n } else {\r\n if (shouldAdd) {\r\n set._items[type][item] = true;\r\n }\r\n\r\n return false;\r\n }\r\n }\r\n\r\n case \u0022boolean\u0022:\r\n // set._items[\u0027boolean\u0027] holds a two element array\r\n // representing [ falseExists, trueExists ]\r\n if (type in set._items) {\r\n var bIdx = item ? 1 : 0;\r\n\r\n if (set._items[type][bIdx]) {\r\n return true;\r\n } else {\r\n if (shouldAdd) {\r\n set._items[type][bIdx] = true;\r\n }\r\n\r\n return false;\r\n }\r\n } else {\r\n if (shouldAdd) {\r\n set._items[type] = item ? [false, true] : [true, false];\r\n }\r\n\r\n return false;\r\n }\r\n\r\n case \u0022function\u0022:\r\n // compare functions for reference equality\r\n if (set._nativeSet !== null) {\r\n if (shouldAdd) {\r\n prevSize = set._nativeSet.size;\r\n\r\n set._nativeSet.add(item);\r\n\r\n newSize = set._nativeSet.size;\r\n return newSize === prevSize;\r\n } else {\r\n return set._nativeSet.has(item);\r\n }\r\n } else {\r\n if (!(type in set._items)) {\r\n if (shouldAdd) {\r\n set._items[type] = [item];\r\n }\r\n\r\n return false;\r\n }\r\n\r\n if (!_includes(item, set._items[type])) {\r\n if (shouldAdd) {\r\n set._items[type].push(item);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n case \u0022undefined\u0022:\r\n if (set._items[type]) {\r\n return true;\r\n } else {\r\n if (shouldAdd) {\r\n set._items[type] = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n case \u0022object\u0022:\r\n if (item === null) {\r\n if (!set._items[\u0022null\u0022]) {\r\n if (shouldAdd) {\r\n set._items[\u0022null\u0022] = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /* falls through */\r\n\r\n default:\r\n // reduce the search size of heterogeneous sets by creating buckets\r\n // for each type.\r\n type = Object.prototype.toString.call(item);\r\n\r\n if (!(type in set._items)) {\r\n if (shouldAdd) {\r\n set._items[type] = [item];\r\n }\r\n\r\n return false;\r\n } // scan through all previously applied items\r\n\r\n if (!_includes(item, set._items[type])) {\r\n if (shouldAdd) {\r\n set._items[type].push(item);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n} // A simple Set type that honours R.equals semantics\r\n\r\n/**\r\n * Finds the set (i.e. no duplicates) of all elements in the first list not\r\n * contained in the second list. Objects and Arrays are compared in terms of\r\n * value equality, not reference equality.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig [*] -\u003E [*] -\u003E [*]\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The elements in \u0060list1\u0060 that are not in \u0060list2\u0060.\r\n * @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without\r\n * @example\r\n *\r\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=\u003E [1,2]\r\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=\u003E [7,6,5]\r\n * R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=\u003E [{b: 2}]\r\n */\r\n\r\nvar difference = _curry2(function difference(first, second) {\r\n var out = [];\r\n var idx = 0;\r\n var firstLen = first.length;\r\n var secondLen = second.length;\r\n var toFilterOut = new _Set();\r\n\r\n for (var i = 0; i \u003C secondLen; i \u002B= 1) {\r\n toFilterOut.add(second[i]);\r\n }\r\n\r\n while (idx \u003C firstLen) {\r\n if (toFilterOut.add(first[idx])) {\r\n out[out.length] = first[idx];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n});\r\n\r\n/**\r\n * Finds the set (i.e. no duplicates) of all elements in the first list not\r\n * contained in the second list. Duplication is determined according to the\r\n * value returned by applying the supplied predicate to two list elements.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig ((a, a) -\u003E Boolean) -\u003E [a] -\u003E [a] -\u003E [a]\r\n * @param {Function} pred A predicate used to test whether two items are equal.\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The elements in \u0060list1\u0060 that are not in \u0060list2\u0060.\r\n * @see R.difference, R.symmetricDifference, R.symmetricDifferenceWith\r\n * @example\r\n *\r\n * const cmp = (x, y) =\u003E x.a === y.a;\r\n * const l1 = [{a: 1}, {a: 2}, {a: 3}];\r\n * const l2 = [{a: 3}, {a: 4}];\r\n * R.differenceWith(cmp, l1, l2); //=\u003E [{a: 1}, {a: 2}]\r\n *\r\n * R.differenceWith(R.equals, [1, 2, 3, 3, 3], []); //=\u003E [1, 2, 3]\r\n * R.differenceWith(R.equals, [1, 2, 3, 3, 3], [1]); //=\u003E [2, 3]\r\n */\r\n\r\nvar differenceWith = _curry3(function differenceWith(pred, first, second) {\r\n var out = [];\r\n var idx = 0;\r\n var firstLen = first.length;\r\n\r\n while (idx \u003C firstLen) {\r\n if (\r\n !_includesWith(pred, first[idx], second) \u0026\u0026\r\n !_includesWith(pred, first[idx], out)\r\n ) {\r\n out.push(first[idx]);\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n});\r\n\r\n/**\r\n * Removes the sub-list of \u0060list\u0060 starting at index \u0060start\u0060 and containing\r\n * \u0060count\u0060 elements. _Note that this is not destructive_: it returns a copy of\r\n * the list with the changes.\r\n * \u003Csmall\u003ENo lists have been harmed in the application of this function.\u003C/small\u003E\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.2\r\n * @category List\r\n * @sig Number -\u003E Number -\u003E [a] -\u003E [a]\r\n * @param {Number} start The position to start removing elements\r\n * @param {Number} count The number of elements to remove\r\n * @param {Array} list The list to remove from\r\n * @return {Array} A new Array with \u0060count\u0060 elements from \u0060start\u0060 removed.\r\n * @see R.without\r\n * @example\r\n *\r\n * R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=\u003E [1,2,6,7,8]\r\n */\r\n\r\nvar remove = _curry3(function remove(start, count, list) {\r\n var result = Array.prototype.slice.call(list, 0);\r\n result.splice(start, count);\r\n return result;\r\n});\r\n\r\n/**\r\n * Returns a new object that does not contain a \u0060prop\u0060 property.\r\n *\r\n * @private\r\n * @param {String|Number} prop The name of the property to dissociate\r\n * @param {Object|Array} obj The object to clone\r\n * @return {Object} A new object equivalent to the original but without the specified property\r\n */\r\n\r\nfunction _dissoc(prop, obj) {\r\n if (obj == null) {\r\n return obj;\r\n }\r\n\r\n if (_isInteger(prop) \u0026\u0026 _isArray(obj)) {\r\n return remove(prop, 1, obj);\r\n }\r\n\r\n var result = {};\r\n\r\n for (var p in obj) {\r\n result[p] = obj[p];\r\n }\r\n\r\n delete result[prop];\r\n return result;\r\n}\r\n\r\n/**\r\n * Makes a shallow clone of an object. Note that this copies and flattens\r\n * prototype properties onto the new object as well. All non-primitive\r\n * properties are copied by reference.\r\n *\r\n * @private\r\n * @param {String|Integer} prop The prop operating\r\n * @param {Object|Array} obj The object to clone\r\n * @return {Object|Array} A new object equivalent to the original.\r\n */\r\n\r\nfunction _shallowCloneObject(prop, obj) {\r\n if (_isInteger(prop) \u0026\u0026 _isArray(obj)) {\r\n return [].concat(obj);\r\n }\r\n\r\n var result = {};\r\n\r\n for (var p in obj) {\r\n result[p] = obj[p];\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Makes a shallow clone of an object, omitting the property at the given path.\r\n * Note that this copies and flattens prototype properties onto the new object\r\n * as well. All non-primitive properties are copied by reference.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.11.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig [Idx] -\u003E {k: v} -\u003E {k: v}\r\n * @param {Array} path The path to the value to omit\r\n * @param {Object} obj The object to clone\r\n * @return {Object} A new object without the property at path\r\n * @see R.assocPath\r\n * @example\r\n *\r\n * R.dissocPath([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027], {a: {b: {c: 42}}}); //=\u003E {a: {b: {}}}\r\n */\r\n\r\nvar dissocPath = _curry2(function dissocPath(path, obj) {\r\n if (obj == null) {\r\n return obj;\r\n }\r\n\r\n switch (path.length) {\r\n case 0:\r\n return obj;\r\n\r\n case 1:\r\n return _dissoc(path[0], obj);\r\n\r\n default:\r\n var head = path[0];\r\n var tail = Array.prototype.slice.call(path, 1);\r\n\r\n if (obj[head] == null) {\r\n return _shallowCloneObject(head, obj);\r\n } else {\r\n return assoc(head, dissocPath(tail, obj[head]), obj);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Returns a new object that does not contain a \u0060prop\u0060 property.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category Object\r\n * @sig String -\u003E {k: v} -\u003E {k: v}\r\n * @param {String} prop The name of the property to dissociate\r\n * @param {Object} obj The object to clone\r\n * @return {Object} A new object equivalent to the original but without the specified property\r\n * @see R.assoc, R.omit\r\n * @example\r\n *\r\n * R.dissoc(\u0027b\u0027, {a: 1, b: 2, c: 3}); //=\u003E {a: 1, c: 3}\r\n */\r\n\r\nvar dissoc = _curry2(function dissoc(prop, obj) {\r\n return dissocPath([prop], obj);\r\n});\r\n\r\n/**\r\n * Divides two numbers. Equivalent to \u0060a / b\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} a The first value.\r\n * @param {Number} b The second value.\r\n * @return {Number} The result of \u0060a / b\u0060.\r\n * @see R.multiply\r\n * @example\r\n *\r\n * R.divide(71, 100); //=\u003E 0.71\r\n *\r\n * const half = R.divide(R.__, 2);\r\n * half(42); //=\u003E 21\r\n *\r\n * const reciprocal = R.divide(1);\r\n * reciprocal(4); //=\u003E 0.25\r\n */\r\n\r\nvar divide = _curry2(function divide(a, b) {\r\n return a / b;\r\n});\r\n\r\nfunction XDrop(n, xf) {\r\n this.xf = xf;\r\n this.n = n;\r\n}\r\n\r\nXDrop.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXDrop.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXDrop.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.n \u003E 0) {\r\n this.n -= 1;\r\n return result;\r\n }\r\n\r\n return this.xf[\u0022@@transducer/step\u0022](result, input);\r\n};\r\n\r\nfunction _xdrop(n) {\r\n return function (xf) {\r\n return new XDrop(n, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns all but the first \u0060n\u0060 elements of the given list, string, or\r\n * transducer/transformer (or object with a \u0060drop\u0060 method).\r\n *\r\n * Dispatches to the \u0060drop\u0060 method of the second argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [a]\r\n * @sig Number -\u003E String -\u003E String\r\n * @param {Number} n\r\n * @param {*} list\r\n * @return {*} A copy of list without the first \u0060n\u0060 elements\r\n * @see R.take, R.transduce, R.dropLast, R.dropWhile\r\n * @example\r\n *\r\n * R.drop(1, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027bar\u0027, \u0027baz\u0027]\r\n * R.drop(2, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027baz\u0027]\r\n * R.drop(3, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E []\r\n * R.drop(4, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E []\r\n * R.drop(3, \u0027ramda\u0027); //=\u003E \u0027da\u0027\r\n */\r\n\r\nvar drop = _curry2(\r\n _dispatchable([\u0022drop\u0022], _xdrop, function drop(n, xs) {\r\n return slice(Math.max(0, n), Infinity, xs);\r\n })\r\n);\r\n\r\nfunction XTake(n, xf) {\r\n this.xf = xf;\r\n this.n = n;\r\n this.i = 0;\r\n}\r\n\r\nXTake.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXTake.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXTake.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n this.i \u002B= 1;\r\n var ret = this.n === 0 ? result : this.xf[\u0022@@transducer/step\u0022](result, input);\r\n return this.n \u003E= 0 \u0026\u0026 this.i \u003E= this.n ? _reduced(ret) : ret;\r\n};\r\n\r\nfunction _xtake(n) {\r\n return function (xf) {\r\n return new XTake(n, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the first \u0060n\u0060 elements of the given list, string, or\r\n * transducer/transformer (or object with a \u0060take\u0060 method).\r\n *\r\n * Dispatches to the \u0060take\u0060 method of the second argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [a]\r\n * @sig Number -\u003E String -\u003E String\r\n * @param {Number} n\r\n * @param {*} list\r\n * @return {*}\r\n * @see R.drop\r\n * @example\r\n *\r\n * R.take(1, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027]\r\n * R.take(2, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027]\r\n * R.take(3, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n * R.take(4, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n * R.take(3, \u0027ramda\u0027); //=\u003E \u0027ram\u0027\r\n *\r\n * const personnel = [\r\n * \u0027Dave Brubeck\u0027,\r\n * \u0027Paul Desmond\u0027,\r\n * \u0027Eugene Wright\u0027,\r\n * \u0027Joe Morello\u0027,\r\n * \u0027Gerry Mulligan\u0027,\r\n * \u0027Bob Bates\u0027,\r\n * \u0027Joe Dodge\u0027,\r\n * \u0027Ron Crotty\u0027\r\n * ];\r\n *\r\n * const takeFive = R.take(5);\r\n * takeFive(personnel);\r\n * //=\u003E [\u0027Dave Brubeck\u0027, \u0027Paul Desmond\u0027, \u0027Eugene Wright\u0027, \u0027Joe Morello\u0027, \u0027Gerry Mulligan\u0027]\r\n * @symb R.take(-1, [a, b]) = [a, b]\r\n * @symb R.take(0, [a, b]) = []\r\n * @symb R.take(1, [a, b]) = [a]\r\n * @symb R.take(2, [a, b]) = [a, b]\r\n */\r\n\r\nvar take = _curry2(\r\n _dispatchable([\u0022take\u0022], _xtake, function take(n, xs) {\r\n return slice(0, n \u003C 0 ? Infinity : n, xs);\r\n })\r\n);\r\n\r\nfunction dropLast(n, xs) {\r\n return take(n \u003C xs.length ? xs.length - n : 0, xs);\r\n}\r\n\r\nfunction XDropLast(n, xf) {\r\n if (n \u003C= 0) {\r\n return xf;\r\n }\r\n\r\n this.xf = xf;\r\n this.pos = 0;\r\n this.full = false;\r\n this.acc = new Array(n);\r\n}\r\n\r\nXDropLast.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXDropLast.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n this.acc = null;\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXDropLast.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.full) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, this.acc[this.pos]);\r\n }\r\n\r\n this.store(input);\r\n return result;\r\n};\r\n\r\nXDropLast.prototype.store = function (input) {\r\n this.acc[this.pos] = input;\r\n this.pos \u002B= 1;\r\n\r\n if (this.pos === this.acc.length) {\r\n this.pos = 0;\r\n this.full = true;\r\n }\r\n};\r\n\r\nfunction _xdropLast(n) {\r\n return function (xf) {\r\n return new XDropLast(n, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a list containing all but the last \u0060n\u0060 elements of the given \u0060list\u0060.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [a]\r\n * @sig Number -\u003E String -\u003E String\r\n * @param {Number} n The number of elements of \u0060list\u0060 to skip.\r\n * @param {Array} list The list of elements to consider.\r\n * @return {Array} A copy of the list with only the first \u0060list.length - n\u0060 elements\r\n * @see R.takeLast, R.drop, R.dropWhile, R.dropLastWhile\r\n * @example\r\n *\r\n * R.dropLast(1, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027]\r\n * R.dropLast(2, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027]\r\n * R.dropLast(3, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E []\r\n * R.dropLast(4, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E []\r\n * R.dropLast(3, \u0027ramda\u0027); //=\u003E \u0027ra\u0027\r\n */\r\n\r\nvar dropLast$1 = _curry2(_dispatchable([], _xdropLast, dropLast));\r\n\r\nfunction dropLastWhile(pred, xs) {\r\n var idx = xs.length - 1;\r\n\r\n while (idx \u003E= 0 \u0026\u0026 pred(xs[idx])) {\r\n idx -= 1;\r\n }\r\n\r\n return slice(0, idx \u002B 1, xs);\r\n}\r\n\r\nfunction XDropLastWhile(fn, xf) {\r\n this.f = fn;\r\n this.retained = [];\r\n this.xf = xf;\r\n}\r\n\r\nXDropLastWhile.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXDropLastWhile.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n this.retained = null;\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXDropLastWhile.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.f(input) ? this.retain(result, input) : this.flush(result, input);\r\n};\r\n\r\nXDropLastWhile.prototype.flush = function (result, input) {\r\n result = _xReduce(this.xf, result, this.retained);\r\n this.retained = [];\r\n return this.xf[\u0022@@transducer/step\u0022](result, input);\r\n};\r\n\r\nXDropLastWhile.prototype.retain = function (result, input) {\r\n this.retained.push(input);\r\n return result;\r\n};\r\n\r\nfunction _xdropLastWhile(fn) {\r\n return function (xf) {\r\n return new XDropLastWhile(fn, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list excluding all the tailing elements of a given list which\r\n * satisfy the supplied predicate function. It passes each value from the right\r\n * to the supplied predicate function, skipping elements until the predicate\r\n * function returns a \u0060falsy\u0060 value. The predicate function is applied to one argument:\r\n * *(value)*.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @sig (a -\u003E Boolean) -\u003E String -\u003E String\r\n * @param {Function} predicate The function to be called on each element\r\n * @param {Array} xs The collection to iterate over.\r\n * @return {Array} A new array without any trailing elements that return \u0060falsy\u0060 values from the \u0060predicate\u0060.\r\n * @see R.takeLastWhile, R.addIndex, R.drop, R.dropWhile\r\n * @example\r\n *\r\n * const lteThree = x =\u003E x \u003C= 3;\r\n *\r\n * R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=\u003E [1, 2, 3, 4]\r\n *\r\n * R.dropLastWhile(x =\u003E x !== \u0027d\u0027 , \u0027Ramda\u0027); //=\u003E \u0027Ramd\u0027\r\n */\r\n\r\nvar dropLastWhile$1 = _curry2(\r\n _dispatchable([], _xdropLastWhile, dropLastWhile)\r\n);\r\n\r\nfunction XDropRepeatsWith(pred, xf) {\r\n this.xf = xf;\r\n this.pred = pred;\r\n this.lastValue = undefined;\r\n this.seenFirstValue = false;\r\n}\r\n\r\nXDropRepeatsWith.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXDropRepeatsWith.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXDropRepeatsWith.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n var sameAsLast = false;\r\n\r\n if (!this.seenFirstValue) {\r\n this.seenFirstValue = true;\r\n } else if (this.pred(this.lastValue, input)) {\r\n sameAsLast = true;\r\n }\r\n\r\n this.lastValue = input;\r\n return sameAsLast ? result : this.xf[\u0022@@transducer/step\u0022](result, input);\r\n};\r\n\r\nfunction _xdropRepeatsWith(pred) {\r\n return function (xf) {\r\n return new XDropRepeatsWith(pred, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the last element of the given list or string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.4\r\n * @category List\r\n * @sig [a] -\u003E a | Undefined\r\n * @sig String -\u003E String\r\n * @param {*} list\r\n * @return {*}\r\n * @see R.init, R.head, R.tail\r\n * @example\r\n *\r\n * R.last([\u0027fi\u0027, \u0027fo\u0027, \u0027fum\u0027]); //=\u003E \u0027fum\u0027\r\n * R.last([]); //=\u003E undefined\r\n *\r\n * R.last(\u0027abc\u0027); //=\u003E \u0027c\u0027\r\n * R.last(\u0027\u0027); //=\u003E \u0027\u0027\r\n */\r\n\r\nvar last = nth(-1);\r\n\r\n/**\r\n * Returns a new list without any consecutively repeating elements. Equality is\r\n * determined by applying the supplied predicate to each pair of consecutive elements. The\r\n * first element in a series of equal elements will be preserved.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category List\r\n * @sig ((a, a) -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @param {Function} pred A predicate used to test whether two items are equal.\r\n * @param {Array} list The array to consider.\r\n * @return {Array} \u0060list\u0060 without repeating elements.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * const l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];\r\n * R.dropRepeatsWith(R.eqBy(Math.abs), l); //=\u003E [1, 3, 4, -5, 3]\r\n */\r\n\r\nvar dropRepeatsWith = _curry2(\r\n _dispatchable([], _xdropRepeatsWith, function dropRepeatsWith(pred, list) {\r\n var result = [];\r\n var idx = 1;\r\n var len = list.length;\r\n\r\n if (len !== 0) {\r\n result[0] = list[0];\r\n\r\n while (idx \u003C len) {\r\n if (!pred(last(result), list[idx])) {\r\n result[result.length] = list[idx];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n }\r\n\r\n return result;\r\n })\r\n);\r\n\r\n/**\r\n * Returns a new list without any consecutively repeating elements.\r\n * [\u0060R.equals\u0060](#equals) is used to determine equality.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category List\r\n * @sig [a] -\u003E [a]\r\n * @param {Array} list The array to consider.\r\n * @return {Array} \u0060list\u0060 without repeating elements.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=\u003E [1, 2, 3, 4, 2]\r\n */\r\n\r\nvar dropRepeats = _curry1(\r\n _dispatchable(\r\n [],\r\n function () {\r\n return _xdropRepeatsWith(equals);\r\n },\r\n dropRepeatsWith(equals)\r\n )\r\n);\r\n\r\n/**\r\n * Takes a function and two values in its domain and returns \u0060true\u0060 if the\r\n * values map to the same value in the codomain; \u0060false\u0060 otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category Relation\r\n * @sig (a -\u003E b) -\u003E a -\u003E a -\u003E Boolean\r\n * @param {Function} f\r\n * @param {*} x\r\n * @param {*} y\r\n * @return {Boolean}\r\n * @example\r\n *\r\n * R.eqBy(Math.abs, 5, -5); //=\u003E true\r\n */\r\n\r\nvar eqBy = _curry3(function eqBy(f, x, y) {\r\n return equals(f(x), f(y));\r\n});\r\n\r\n/**\r\n * Returns a new list without any consecutively repeating elements,\r\n * based upon the value returned by applying the supplied function to\r\n * each list element. [\u0060R.equals\u0060](#equals) is used to determine equality.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.29.0\r\n * @category List\r\n * @sig (a -\u003E b) -\u003E [a] -\u003E [a]\r\n * @param {Function} fn A function used to produce a value to use during comparisons.\r\n * @param {Array} list The array to consider.\r\n * @return {Array} \u0060list\u0060 without repeating elements.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * R.dropRepeatsBy(Math.abs, [1, -1, -1, 2, 3, -4, 4, 2, 2]); //=\u003E [1, 2, 3, -4, 2]\r\n */\r\n\r\nvar dropRepeatsBy = _curry2(function (fn, list) {\r\n return _dispatchable(\r\n [],\r\n function () {\r\n return _xdropRepeatsWith(eqBy(fn));\r\n },\r\n dropRepeatsWith(eqBy(fn))\r\n )(list);\r\n});\r\n\r\nfunction XDropWhile(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXDropWhile.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXDropWhile.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXDropWhile.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.f) {\r\n if (this.f(input)) {\r\n return result;\r\n }\r\n\r\n this.f = null;\r\n }\r\n\r\n return this.xf[\u0022@@transducer/step\u0022](result, input);\r\n};\r\n\r\nfunction _xdropWhile(f) {\r\n return function (xf) {\r\n return new XDropWhile(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list excluding the leading elements of a given list which\r\n * satisfy the supplied predicate function. It passes each value to the supplied\r\n * predicate function, skipping elements while the predicate function returns\r\n * \u0060true\u0060. The predicate function is applied to one argument: *(value)*.\r\n *\r\n * Dispatches to the \u0060dropWhile\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @sig (a -\u003E Boolean) -\u003E String -\u003E String\r\n * @param {Function} fn The function called per iteration.\r\n * @param {Array} xs The collection to iterate over.\r\n * @return {Array} A new array.\r\n * @see R.takeWhile, R.transduce, R.addIndex\r\n * @example\r\n *\r\n * const lteTwo = x =\u003E x \u003C= 2;\r\n *\r\n * R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=\u003E [3, 4, 3, 2, 1]\r\n *\r\n * R.dropWhile(x =\u003E x !== \u0027d\u0027 , \u0027Ramda\u0027); //=\u003E \u0027da\u0027\r\n */\r\n\r\nvar dropWhile = _curry2(\r\n _dispatchable([\u0022dropWhile\u0022], _xdropWhile, function dropWhile(pred, xs) {\r\n var idx = 0;\r\n var len = xs.length;\r\n\r\n while (idx \u003C len \u0026\u0026 pred(xs[idx])) {\r\n idx \u002B= 1;\r\n }\r\n\r\n return slice(idx, Infinity, xs);\r\n })\r\n);\r\n\r\n/**\r\n * Returns the first argument if it is truthy, otherwise the second argument.\r\n * Acts as the boolean \u0060or\u0060 statement if both inputs are \u0060Boolean\u0060s.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Logic\r\n * @sig a -\u003E b -\u003E a | b\r\n * @param {Any} a\r\n * @param {Any} b\r\n * @return {Any}\r\n * @see R.either, R.and\r\n * @example\r\n *\r\n * R.or(true, true); //=\u003E true\r\n * R.or(true, false); //=\u003E true\r\n * R.or(false, true); //=\u003E true\r\n * R.or(false, false); //=\u003E false\r\n */\r\n\r\nvar or = _curry2(function or(a, b) {\r\n return a || b;\r\n});\r\n\r\n/**\r\n * A function wrapping calls to the two functions in an \u0060||\u0060 operation,\r\n * returning the result of the first function if it is truth-y and the result\r\n * of the second function otherwise. Note that this is short-circuited,\r\n * meaning that the second function will not be invoked if the first returns a\r\n * truth-y value.\r\n *\r\n * In addition to functions, \u0060R.either\u0060 also accepts any fantasy-land compatible\r\n * applicative functor.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category Logic\r\n * @sig (*... -\u003E Boolean) -\u003E (*... -\u003E Boolean) -\u003E (*... -\u003E Boolean)\r\n * @param {Function} f a predicate\r\n * @param {Function} g another predicate\r\n * @return {Function} a function that applies its arguments to \u0060f\u0060 and \u0060g\u0060 and \u0060||\u0060s their outputs together.\r\n * @see R.both, R.anyPass, R.or\r\n * @example\r\n *\r\n * const gt10 = x =\u003E x \u003E 10;\r\n * const even = x =\u003E x % 2 === 0;\r\n * const f = R.either(gt10, even);\r\n * f(101); //=\u003E true\r\n * f(8); //=\u003E true\r\n *\r\n * R.either(Maybe.Just(false), Maybe.Just(55)); // =\u003E Maybe.Just(55)\r\n * R.either([false, false, \u0027a\u0027], [11]) // =\u003E [11, 11, \u0022a\u0022]\r\n */\r\n\r\nvar either = _curry2(function either(f, g) {\r\n return _isFunction(f)\r\n ? function _either() {\r\n return f.apply(this, arguments) || g.apply(this, arguments);\r\n }\r\n : lift(or)(f, g);\r\n});\r\n\r\n/**\r\n * Tests whether or not an object is a typed array.\r\n *\r\n * @private\r\n * @param {*} val The object to test.\r\n * @return {Boolean} \u0060true\u0060 if \u0060val\u0060 is a typed array, \u0060false\u0060 otherwise.\r\n * @example\r\n *\r\n * _isTypedArray(new Uint8Array([])); //=\u003E true\r\n * _isTypedArray(new Float32Array([])); //=\u003E true\r\n * _isTypedArray([]); //=\u003E false\r\n * _isTypedArray(null); //=\u003E false\r\n * _isTypedArray({}); //=\u003E false\r\n */\r\nfunction _isTypedArray(val) {\r\n var type = Object.prototype.toString.call(val);\r\n return (\r\n type === \u0022[object Uint8ClampedArray]\u0022 ||\r\n type === \u0022[object Int8Array]\u0022 ||\r\n type === \u0022[object Uint8Array]\u0022 ||\r\n type === \u0022[object Int16Array]\u0022 ||\r\n type === \u0022[object Uint16Array]\u0022 ||\r\n type === \u0022[object Int32Array]\u0022 ||\r\n type === \u0022[object Uint32Array]\u0022 ||\r\n type === \u0022[object Float32Array]\u0022 ||\r\n type === \u0022[object Float64Array]\u0022 ||\r\n type === \u0022[object BigInt64Array]\u0022 ||\r\n type === \u0022[object BigUint64Array]\u0022\r\n );\r\n}\r\n\r\n/**\r\n * Returns the empty value of its argument\u0027s type. Ramda defines the empty\r\n * value of Array (\u0060[]\u0060), Object (\u0060{}\u0060), String (\u0060\u0027\u0027\u0060),\r\n * TypedArray (\u0060Uint8Array []\u0060, \u0060Float32Array []\u0060, etc), and Arguments. Other\r\n * types are supported if they define \u0060\u003CType\u003E.empty\u0060,\r\n * \u0060\u003CType\u003E.prototype.empty\u0060 or implement the\r\n * [FantasyLand Monoid spec](https://github.com/fantasyland/fantasy-land#monoid).\r\n *\r\n * Dispatches to the \u0060empty\u0060 method of the first argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category Function\r\n * @sig a -\u003E a\r\n * @param {*} x\r\n * @return {*}\r\n * @example\r\n *\r\n * R.empty(Just(42)); //=\u003E Nothing()\r\n * R.empty([1, 2, 3]); //=\u003E []\r\n * R.empty(\u0027unicorns\u0027); //=\u003E \u0027\u0027\r\n * R.empty({x: 1, y: 2}); //=\u003E {}\r\n * R.empty(Uint8Array.from(\u0027123\u0027)); //=\u003E Uint8Array []\r\n */\r\n\r\nvar empty = _curry1(function empty(x) {\r\n return x != null \u0026\u0026 typeof x[\u0022fantasy-land/empty\u0022] === \u0022function\u0022\r\n ? x[\u0022fantasy-land/empty\u0022]()\r\n : x != null \u0026\u0026\r\n x.constructor != null \u0026\u0026\r\n typeof x.constructor[\u0022fantasy-land/empty\u0022] === \u0022function\u0022\r\n ? x.constructor[\u0022fantasy-land/empty\u0022]()\r\n : x != null \u0026\u0026 typeof x.empty === \u0022function\u0022\r\n ? x.empty()\r\n : x != null \u0026\u0026\r\n x.constructor != null \u0026\u0026\r\n typeof x.constructor.empty === \u0022function\u0022\r\n ? x.constructor.empty()\r\n : _isArray(x)\r\n ? []\r\n : _isString(x)\r\n ? \u0022\u0022\r\n : _isObject(x)\r\n ? {}\r\n : _isArguments(x)\r\n ? (function () {\r\n return arguments;\r\n })()\r\n : _isTypedArray(x)\r\n ? x.constructor.from(\u0022\u0022)\r\n : void 0; // else\r\n});\r\n\r\n/**\r\n * Returns a new list containing the last \u0060n\u0060 elements of the given list.\r\n * If \u0060n \u003E list.length\u0060, returns a list of \u0060list.length\u0060 elements.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [a]\r\n * @sig Number -\u003E String -\u003E String\r\n * @param {Number} n The number of elements to return.\r\n * @param {Array} xs The collection to consider.\r\n * @return {Array}\r\n * @see R.dropLast\r\n * @example\r\n *\r\n * R.takeLast(1, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027baz\u0027]\r\n * R.takeLast(2, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027bar\u0027, \u0027baz\u0027]\r\n * R.takeLast(3, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n * R.takeLast(4, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n * R.takeLast(3, \u0027ramda\u0027); //=\u003E \u0027mda\u0027\r\n */\r\n\r\nvar takeLast = _curry2(function takeLast(n, xs) {\r\n return drop(n \u003E= 0 ? xs.length - n : 0, xs);\r\n});\r\n\r\n/**\r\n * Checks if a list ends with the provided sublist.\r\n *\r\n * Similarly, checks if a string ends with the provided substring.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category List\r\n * @sig [a] -\u003E [a] -\u003E Boolean\r\n * @sig String -\u003E String -\u003E Boolean\r\n * @param {*} suffix\r\n * @param {*} list\r\n * @return {Boolean}\r\n * @see R.startsWith\r\n * @example\r\n *\r\n * R.endsWith(\u0027c\u0027, \u0027abc\u0027) //=\u003E true\r\n * R.endsWith(\u0027b\u0027, \u0027abc\u0027) //=\u003E false\r\n * R.endsWith([\u0027c\u0027], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]) //=\u003E true\r\n * R.endsWith([\u0027b\u0027], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]) //=\u003E false\r\n */\r\n\r\nvar endsWith = _curry2(function (suffix, list) {\r\n return equals(takeLast(suffix.length, list), suffix);\r\n});\r\n\r\n/**\r\n * Reports whether two objects have the same value, in [\u0060R.equals\u0060](#equals)\r\n * terms, for the specified property. Useful as a curried predicate.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig k -\u003E {k: v} -\u003E {k: v} -\u003E Boolean\r\n * @param {String} prop The name of the property to compare\r\n * @param {Object} obj1\r\n * @param {Object} obj2\r\n * @return {Boolean}\r\n *\r\n * @example\r\n *\r\n * const o1 = { a: 1, b: 2, c: 3, d: 4 };\r\n * const o2 = { a: 10, b: 20, c: 3, d: 40 };\r\n * R.eqProps(\u0027a\u0027, o1, o2); //=\u003E false\r\n * R.eqProps(\u0027c\u0027, o1, o2); //=\u003E true\r\n */\r\n\r\nvar eqProps = _curry3(function eqProps(prop, obj1, obj2) {\r\n return equals(obj1[prop], obj2[prop]);\r\n});\r\n\r\n/**\r\n * Creates a new object by recursively evolving a shallow copy of \u0060object\u0060,\r\n * according to the \u0060transformation\u0060 functions. All non-primitive properties\r\n * are copied by reference.\r\n *\r\n * A \u0060transformation\u0060 function will not be invoked if its corresponding key\r\n * does not exist in the evolved object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Object\r\n * @sig {k: (v -\u003E v)} -\u003E {k: v} -\u003E {k: v}\r\n * @param {Object} transformations The object specifying transformation functions to apply\r\n * to the object.\r\n * @param {Object} object The object to be transformed.\r\n * @return {Object} The transformed object.\r\n * @example\r\n *\r\n * const tomato = {firstName: \u0027 Tomato \u0027, data: {elapsed: 100, remaining: 1400}, id:123};\r\n * const transformations = {\r\n * firstName: R.trim,\r\n * lastName: R.trim, // Will not get invoked.\r\n * data: {elapsed: R.add(1), remaining: R.add(-1)}\r\n * };\r\n * R.evolve(transformations, tomato); //=\u003E {firstName: \u0027Tomato\u0027, data: {elapsed: 101, remaining: 1399}, id:123}\r\n */\r\n\r\nvar evolve = _curry2(function evolve(transformations, object) {\r\n if (!_isObject(object) \u0026\u0026 !_isArray(object)) {\r\n return object;\r\n }\r\n\r\n var result = object instanceof Array ? [] : {};\r\n var transformation, key, type;\r\n\r\n for (key in object) {\r\n transformation = transformations[key];\r\n type = _typeof(transformation);\r\n result[key] =\r\n type === \u0022function\u0022\r\n ? transformation(object[key])\r\n : transformation \u0026\u0026 type === \u0022object\u0022\r\n ? evolve(transformation, object[key])\r\n : object[key];\r\n }\r\n\r\n return result;\r\n});\r\n\r\nfunction XFind(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.found = false;\r\n}\r\n\r\nXFind.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXFind.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n if (!this.found) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, void 0);\r\n }\r\n\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXFind.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.f(input)) {\r\n this.found = true;\r\n result = _reduced(this.xf[\u0022@@transducer/step\u0022](result, input));\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xfind(f) {\r\n return function (xf) {\r\n return new XFind(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the first element of the list which matches the predicate, or\r\n * \u0060undefined\u0060 if no element matches.\r\n *\r\n * Dispatches to the \u0060find\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E a | undefined\r\n * @param {Function} fn The predicate function used to determine if the element is the\r\n * desired one.\r\n * @param {Array} list The array to consider.\r\n * @return {Object} The element found, or \u0060undefined\u0060.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * const xs = [{a: 1}, {a: 2}, {a: 3}];\r\n * R.find(R.propEq(\u0027a\u0027, 2))(xs); //=\u003E {a: 2}\r\n * R.find(R.propEq(\u0027a\u0027, 4))(xs); //=\u003E undefined\r\n */\r\n\r\nvar find = _curry2(\r\n _dispatchable([\u0022find\u0022], _xfind, function find(fn, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n\r\n while (idx \u003C len) {\r\n if (fn(list[idx])) {\r\n return list[idx];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n })\r\n);\r\n\r\nfunction XFindIndex(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.idx = -1;\r\n this.found = false;\r\n}\r\n\r\nXFindIndex.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXFindIndex.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n if (!this.found) {\r\n result = this.xf[\u0022@@transducer/step\u0022](result, -1);\r\n }\r\n\r\n return this.xf[\u0022@@transducer/result\u0022](result);\r\n};\r\n\r\nXFindIndex.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n this.idx \u002B= 1;\r\n\r\n if (this.f(input)) {\r\n this.found = true;\r\n result = _reduced(this.xf[\u0022@@transducer/step\u0022](result, this.idx));\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xfindIndex(f) {\r\n return function (xf) {\r\n return new XFindIndex(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the index of the first element of the list which matches the\r\n * predicate, or \u0060-1\u0060 if no element matches.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Number\r\n * @param {Function} fn The predicate function used to determine if the element is the\r\n * desired one.\r\n * @param {Array} list The array to consider.\r\n * @return {Number} The index of the element found, or \u0060-1\u0060.\r\n * @see R.transduce, R.indexOf\r\n * @example\r\n *\r\n * const xs = [{a: 1}, {a: 2}, {a: 3}];\r\n * R.findIndex(R.propEq(\u0027a\u0027, 2))(xs); //=\u003E 1\r\n * R.findIndex(R.propEq(\u0027a\u0027, 4))(xs); //=\u003E -1\r\n */\r\n\r\nvar findIndex = _curry2(\r\n _dispatchable([], _xfindIndex, function findIndex(fn, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n\r\n while (idx \u003C len) {\r\n if (fn(list[idx])) {\r\n return idx;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return -1;\r\n })\r\n);\r\n\r\nfunction XFindLast(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXFindLast.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXFindLast.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n return this.xf[\u0022@@transducer/result\u0022](\r\n this.xf[\u0022@@transducer/step\u0022](result, this.last)\r\n );\r\n};\r\n\r\nXFindLast.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (this.f(input)) {\r\n this.last = input;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xfindLast(f) {\r\n return function (xf) {\r\n return new XFindLast(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the last element of the list which matches the predicate, or\r\n * \u0060undefined\u0060 if no element matches.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E a | undefined\r\n * @param {Function} fn The predicate function used to determine if the element is the\r\n * desired one.\r\n * @param {Array} list The array to consider.\r\n * @return {Object} The element found, or \u0060undefined\u0060.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * const xs = [{a: 1, b: 0}, {a:1, b: 1}];\r\n * R.findLast(R.propEq(\u0027a\u0027, 1))(xs); //=\u003E {a: 1, b: 1}\r\n * R.findLast(R.propEq(\u0027a\u0027, 4))(xs); //=\u003E undefined\r\n */\r\n\r\nvar findLast = _curry2(\r\n _dispatchable([], _xfindLast, function findLast(fn, list) {\r\n var idx = list.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n if (fn(list[idx])) {\r\n return list[idx];\r\n }\r\n\r\n idx -= 1;\r\n }\r\n })\r\n);\r\n\r\nfunction XFindLastIndex(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.idx = -1;\r\n this.lastIdx = -1;\r\n}\r\n\r\nXFindLastIndex.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\n\r\nXFindLastIndex.prototype[\u0022@@transducer/result\u0022] = function (result) {\r\n return this.xf[\u0022@@transducer/result\u0022](\r\n this.xf[\u0022@@transducer/step\u0022](result, this.lastIdx)\r\n );\r\n};\r\n\r\nXFindLastIndex.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n this.idx \u002B= 1;\r\n\r\n if (this.f(input)) {\r\n this.lastIdx = this.idx;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction _xfindLastIndex(f) {\r\n return function (xf) {\r\n return new XFindLastIndex(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the index of the last element of the list which matches the\r\n * predicate, or \u0060-1\u0060 if no element matches.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Number\r\n * @param {Function} fn The predicate function used to determine if the element is the\r\n * desired one.\r\n * @param {Array} list The array to consider.\r\n * @return {Number} The index of the element found, or \u0060-1\u0060.\r\n * @see R.transduce, R.lastIndexOf\r\n * @example\r\n *\r\n * const xs = [{a: 1, b: 0}, {a:1, b: 1}];\r\n * R.findLastIndex(R.propEq(\u0027a\u0027, 1))(xs); //=\u003E 1\r\n * R.findLastIndex(R.propEq(\u0027a\u0027, 4))(xs); //=\u003E -1\r\n */\r\n\r\nvar findLastIndex = _curry2(\r\n _dispatchable([], _xfindLastIndex, function findLastIndex(fn, list) {\r\n var idx = list.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n if (fn(list[idx])) {\r\n return idx;\r\n }\r\n\r\n idx -= 1;\r\n }\r\n\r\n return -1;\r\n })\r\n);\r\n\r\n/**\r\n * Returns a new list by pulling every item out of it (and all its sub-arrays)\r\n * and putting them in a new array, depth-first.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [b]\r\n * @param {Array} list The array to consider.\r\n * @return {Array} The flattened list.\r\n * @see R.unnest\r\n * @example\r\n *\r\n * R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);\r\n * //=\u003E [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\r\n */\r\n\r\nvar flatten = _curry1(_makeFlat(true));\r\n\r\n/**\r\n * Returns a new function much like the supplied one, except that the first two\r\n * arguments\u0027 order is reversed.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig ((a, b, c, ...) -\u003E z) -\u003E (b -\u003E a -\u003E c -\u003E ... -\u003E z)\r\n * @param {Function} fn The function to invoke with its first two parameters reversed.\r\n * @return {*} The result of invoking \u0060fn\u0060 with its first two parameters\u0027 order reversed.\r\n * @example\r\n *\r\n * const mergeThree = (a, b, c) =\u003E [].concat(a, b, c);\r\n *\r\n * mergeThree(1, 2, 3); //=\u003E [1, 2, 3]\r\n *\r\n * R.flip(mergeThree)(1, 2, 3); //=\u003E [2, 1, 3]\r\n * @symb R.flip(f)(a, b, c) = f(b, a, c)\r\n */\r\n\r\nvar flip = _curry1(function flip(fn) {\r\n return curryN(fn.length, function (a, b) {\r\n var args = Array.prototype.slice.call(arguments, 0);\r\n args[0] = b;\r\n args[1] = a;\r\n return fn.apply(this, args);\r\n });\r\n});\r\n\r\n/**\r\n * Iterate over an input \u0060list\u0060, calling a provided function \u0060fn\u0060 for each\r\n * element in the list.\r\n *\r\n * \u0060fn\u0060 receives one argument: *(value)*.\r\n *\r\n * Note: \u0060R.forEach\u0060 does not skip deleted or unassigned indices (sparse\r\n * arrays), unlike the native \u0060Array.prototype.forEach\u0060 method. For more\r\n * details on this behavior, see:\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description\r\n *\r\n * Also note that, unlike \u0060Array.prototype.forEach\u0060, Ramda\u0027s \u0060forEach\u0060 returns\r\n * the original array. In some libraries this function is named \u0060each\u0060.\r\n *\r\n * Dispatches to the \u0060forEach\u0060 method of the second argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category List\r\n * @sig (a -\u003E *) -\u003E [a] -\u003E [a]\r\n * @param {Function} fn The function to invoke. Receives one argument, \u0060value\u0060.\r\n * @param {Array} list The list to iterate over.\r\n * @return {Array} The original list.\r\n * @see R.addIndex\r\n * @example\r\n *\r\n * const printXPlusFive = x =\u003E console.log(x \u002B 5);\r\n * R.forEach(printXPlusFive, [1, 2, 3]); //=\u003E [1, 2, 3]\r\n * // logs 6\r\n * // logs 7\r\n * // logs 8\r\n * @symb R.forEach(f, [a, b, c]) = [a, b, c]\r\n */\r\n\r\nvar forEach = _curry2(\r\n _checkForMethod(\u0022forEach\u0022, function forEach(fn, list) {\r\n var len = list.length;\r\n var idx = 0;\r\n\r\n while (idx \u003C len) {\r\n fn(list[idx]);\r\n idx \u002B= 1;\r\n }\r\n\r\n return list;\r\n })\r\n);\r\n\r\n/**\r\n * Iterate over an input \u0060object\u0060, calling a provided function \u0060fn\u0060 for each\r\n * key and value in the object.\r\n *\r\n * \u0060fn\u0060 receives three argument: *(value, key, obj)*.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.23.0\r\n * @category Object\r\n * @sig ((a, String, StrMap a) -\u003E Any) -\u003E StrMap a -\u003E StrMap a\r\n * @param {Function} fn The function to invoke. Receives three argument, \u0060value\u0060, \u0060key\u0060, \u0060obj\u0060.\r\n * @param {Object} obj The object to iterate over.\r\n * @return {Object} The original object.\r\n * @example\r\n *\r\n * const printKeyConcatValue = (value, key) =\u003E console.log(key \u002B \u0027:\u0027 \u002B value);\r\n * R.forEachObjIndexed(printKeyConcatValue, {x: 1, y: 2}); //=\u003E {x: 1, y: 2}\r\n * // logs x:1\r\n * // logs y:2\r\n * @symb R.forEachObjIndexed(f, {x: a, y: b}) = {x: a, y: b}\r\n */\r\n\r\nvar forEachObjIndexed = _curry2(function forEachObjIndexed(fn, obj) {\r\n var keyList = keys(obj);\r\n var idx = 0;\r\n\r\n while (idx \u003C keyList.length) {\r\n var key = keyList[idx];\r\n fn(obj[key], key, obj);\r\n idx \u002B= 1;\r\n }\r\n\r\n return obj;\r\n});\r\n\r\n/**\r\n * Creates a new object from a list key-value pairs. If a key appears in\r\n * multiple pairs, the rightmost pair is included in the object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category List\r\n * @sig [[k,v]] -\u003E {k: v}\r\n * @param {Array} pairs An array of two-element arrays that will be the keys and values of the output object.\r\n * @return {Object} The object made by pairing up \u0060keys\u0060 and \u0060values\u0060.\r\n * @see R.toPairs, R.pair\r\n * @example\r\n *\r\n * R.fromPairs([[\u0027a\u0027, 1], [\u0027b\u0027, 2], [\u0027c\u0027, 3]]); //=\u003E {a: 1, b: 2, c: 3}\r\n */\r\n\r\nvar fromPairs = _curry1(function fromPairs(pairs) {\r\n var result = {};\r\n var idx = 0;\r\n\r\n while (idx \u003C pairs.length) {\r\n result[pairs[idx][0]] = pairs[idx][1];\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Splits a list into sub-lists stored in an object, based on the result of\r\n * calling a key-returning function on each element, and grouping the\r\n * results according to values returned.\r\n *\r\n * Dispatches to the \u0060groupBy\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig Idx a =\u003E (b -\u003E a) -\u003E [b] -\u003E {a: [b]}\r\n * @param {Function} fn Function :: a -\u003E Idx\r\n * @param {Array} list The array to group\r\n * @return {Object} An object with the output of \u0060fn\u0060 for keys, mapped to arrays of elements\r\n * that produced that key when passed to \u0060fn\u0060.\r\n * @see R.reduceBy, R.transduce, R.indexBy, R.collectBy\r\n * @example\r\n *\r\n * const byGrade = R.groupBy(function(student) {\r\n * const score = student.score;\r\n * return score \u003C 65 ? \u0027F\u0027 :\r\n * score \u003C 70 ? \u0027D\u0027 :\r\n * score \u003C 80 ? \u0027C\u0027 :\r\n * score \u003C 90 ? \u0027B\u0027 : \u0027A\u0027;\r\n * });\r\n * const students = [{name: \u0027Abby\u0027, score: 84},\r\n * {name: \u0027Eddy\u0027, score: 58},\r\n * // ...\r\n * {name: \u0027Jack\u0027, score: 69}];\r\n * byGrade(students);\r\n * // {\r\n * // \u0027A\u0027: [{name: \u0027Dianne\u0027, score: 99}],\r\n * // \u0027B\u0027: [{name: \u0027Abby\u0027, score: 84}]\r\n * // // ...,\r\n * // \u0027F\u0027: [{name: \u0027Eddy\u0027, score: 58}]\r\n * // }\r\n */\r\n\r\nvar groupBy = _curry2(\r\n _checkForMethod(\r\n \u0022groupBy\u0022,\r\n reduceBy(function (acc, item) {\r\n acc.push(item);\r\n return acc;\r\n }, [])\r\n )\r\n);\r\n\r\n/**\r\n * Takes a list and returns a list of lists where each sublist\u0027s elements are\r\n * all satisfied pairwise comparison according to the provided function.\r\n * Only adjacent elements are passed to the comparison function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.21.0\r\n * @category List\r\n * @sig ((a, a) \u2192 Boolean) \u2192 [a] \u2192 [[a]]\r\n * @param {Function} fn Function for determining whether two given (adjacent)\r\n * elements should be in the same group\r\n * @param {Array} list The array to group. Also accepts a string, which will be\r\n * treated as a list of characters.\r\n * @return {List} A list that contains sublists of elements,\r\n * whose concatenations are equal to the original list.\r\n * @example\r\n *\r\n * R.groupWith(R.equals, [0, 1, 1, 2, 3, 5, 8, 13, 21])\r\n * //=\u003E [[0], [1, 1], [2], [3], [5], [8], [13], [21]]\r\n *\r\n * R.groupWith((a, b) =\u003E a \u002B 1 === b, [0, 1, 1, 2, 3, 5, 8, 13, 21])\r\n * //=\u003E [[0, 1], [1, 2, 3], [5], [8], [13], [21]]\r\n *\r\n * R.groupWith((a, b) =\u003E a % 2 === b % 2, [0, 1, 1, 2, 3, 5, 8, 13, 21])\r\n * //=\u003E [[0], [1, 1], [2], [3, 5], [8], [13, 21]]\r\n *\r\n * const isVowel = R.test(/^[aeiou]$/i);\r\n * R.groupWith(R.eqBy(isVowel), \u0027aestiou\u0027)\r\n * //=\u003E [\u0027ae\u0027, \u0027st\u0027, \u0027iou\u0027]\r\n */\r\n\r\nvar groupWith = _curry2(function (fn, list) {\r\n var res = [];\r\n var idx = 0;\r\n var len = list.length;\r\n\r\n while (idx \u003C len) {\r\n var nextidx = idx \u002B 1;\r\n\r\n while (nextidx \u003C len \u0026\u0026 fn(list[nextidx - 1], list[nextidx])) {\r\n nextidx \u002B= 1;\r\n }\r\n\r\n res.push(list.slice(idx, nextidx));\r\n idx = nextidx;\r\n }\r\n\r\n return res;\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the first argument is greater than the second; \u0060false\u0060\r\n * otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E Boolean\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {Boolean}\r\n * @see R.lt\r\n * @example\r\n *\r\n * R.gt(2, 1); //=\u003E true\r\n * R.gt(2, 2); //=\u003E false\r\n * R.gt(2, 3); //=\u003E false\r\n * R.gt(\u0027a\u0027, \u0027z\u0027); //=\u003E false\r\n * R.gt(\u0027z\u0027, \u0027a\u0027); //=\u003E true\r\n */\r\n\r\nvar gt = _curry2(function gt(a, b) {\r\n return a \u003E b;\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the first argument is greater than or equal to the second;\r\n * \u0060false\u0060 otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E Boolean\r\n * @param {Number} a\r\n * @param {Number} b\r\n * @return {Boolean}\r\n * @see R.lte\r\n * @example\r\n *\r\n * R.gte(2, 1); //=\u003E true\r\n * R.gte(2, 2); //=\u003E true\r\n * R.gte(2, 3); //=\u003E false\r\n * R.gte(\u0027a\u0027, \u0027z\u0027); //=\u003E false\r\n * R.gte(\u0027z\u0027, \u0027a\u0027); //=\u003E true\r\n */\r\n\r\nvar gte = _curry2(function gte(a, b) {\r\n return a \u003E= b;\r\n});\r\n\r\n/**\r\n * Returns whether or not a path exists in an object. Only the object\u0027s\r\n * own properties are checked.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig [Idx] -\u003E {a} -\u003E Boolean\r\n * @param {Array} path The path to use.\r\n * @param {Object} obj The object to check the path in.\r\n * @return {Boolean} Whether the path exists.\r\n * @see R.has\r\n * @example\r\n *\r\n * R.hasPath([\u0027a\u0027, \u0027b\u0027], {a: {b: 2}}); // =\u003E true\r\n * R.hasPath([\u0027a\u0027, \u0027b\u0027], {a: {b: undefined}}); // =\u003E true\r\n * R.hasPath([\u0027a\u0027, \u0027b\u0027], {a: {c: 2}}); // =\u003E false\r\n * R.hasPath([\u0027a\u0027, \u0027b\u0027], {}); // =\u003E false\r\n */\r\n\r\nvar hasPath = _curry2(function hasPath(_path, obj) {\r\n if (_path.length === 0 || isNil(obj)) {\r\n return false;\r\n }\r\n\r\n var val = obj;\r\n var idx = 0;\r\n\r\n while (idx \u003C _path.length) {\r\n if (!isNil(val) \u0026\u0026 _has(_path[idx], val)) {\r\n val = val[_path[idx]];\r\n idx \u002B= 1;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n});\r\n\r\n/**\r\n * Returns whether or not an object has an own property with the specified name\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Object\r\n * @sig s -\u003E {s: x} -\u003E Boolean\r\n * @param {String} prop The name of the property to check for.\r\n * @param {Object} obj The object to query.\r\n * @return {Boolean} Whether the property exists.\r\n * @example\r\n *\r\n * const hasName = R.has(\u0027name\u0027);\r\n * hasName({name: \u0027alice\u0027}); //=\u003E true\r\n * hasName({name: \u0027bob\u0027}); //=\u003E true\r\n * hasName({}); //=\u003E false\r\n *\r\n * const point = {x: 0, y: 0};\r\n * const pointHas = R.has(R.__, point);\r\n * pointHas(\u0027x\u0027); //=\u003E true\r\n * pointHas(\u0027y\u0027); //=\u003E true\r\n * pointHas(\u0027z\u0027); //=\u003E false\r\n */\r\n\r\nvar has = _curry2(function has(prop, obj) {\r\n return hasPath([prop], obj);\r\n});\r\n\r\n/**\r\n * Returns whether or not an object or its prototype chain has a property with\r\n * the specified name\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Object\r\n * @sig s -\u003E {s: x} -\u003E Boolean\r\n * @param {String} prop The name of the property to check for.\r\n * @param {Object} obj The object to query.\r\n * @return {Boolean} Whether the property exists.\r\n * @example\r\n *\r\n * function Rectangle(width, height) {\r\n * this.width = width;\r\n * this.height = height;\r\n * }\r\n * Rectangle.prototype.area = function() {\r\n * return this.width * this.height;\r\n * };\r\n *\r\n * const square = new Rectangle(2, 2);\r\n * R.hasIn(\u0027width\u0027, square); //=\u003E true\r\n * R.hasIn(\u0027area\u0027, square); //=\u003E true\r\n */\r\n\r\nvar hasIn = _curry2(function hasIn(prop, obj) {\r\n if (isNil(obj)) {\r\n return false;\r\n }\r\n\r\n return prop in obj;\r\n});\r\n\r\n/**\r\n * Returns true if its arguments are identical, false otherwise. Values are\r\n * identical if they reference the same memory. \u0060NaN\u0060 is identical to \u0060NaN\u0060;\r\n * \u00600\u0060 and \u0060-0\u0060 are not identical.\r\n *\r\n * Note this is merely a curried version of ES6 \u0060Object.is\u0060.\r\n *\r\n * \u0060identical\u0060 does not support the \u0060__\u0060 placeholder.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.15.0\r\n * @category Relation\r\n * @sig a -\u003E a -\u003E Boolean\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {Boolean}\r\n * @example\r\n *\r\n * const o = {};\r\n * R.identical(o, o); //=\u003E true\r\n * R.identical(1, 1); //=\u003E true\r\n * R.identical(1, \u00271\u0027); //=\u003E false\r\n * R.identical([], []); //=\u003E false\r\n * R.identical(0, -0); //=\u003E false\r\n * R.identical(NaN, NaN); //=\u003E true\r\n */\r\n\r\nvar identical = function identical(a, b) {\r\n switch (arguments.length) {\r\n case 0:\r\n return identical;\r\n\r\n case 1:\r\n return (function () {\r\n return function unaryIdentical(_b) {\r\n switch (arguments.length) {\r\n case 0:\r\n return unaryIdentical;\r\n\r\n default:\r\n return _objectIs$1(a, _b);\r\n }\r\n };\r\n })();\r\n\r\n default:\r\n return _objectIs$1(a, b);\r\n }\r\n}; // In order to support Cross-origin Window objects as arguments to identical,\r\n\r\n/**\r\n * Creates a function that will process either the \u0060onTrue\u0060 or the \u0060onFalse\u0060\r\n * function depending upon the result of the \u0060condition\u0060 predicate.\r\n *\r\n * Note that \u0060ifElse\u0060 takes its arity from the longest of the three functions passed to it.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Logic\r\n * @sig (*... -\u003E Boolean) -\u003E (*... -\u003E *) -\u003E (*... -\u003E *) -\u003E (*... -\u003E *)\r\n * @param {Function} condition A predicate function\r\n * @param {Function} onTrue A function to invoke when the \u0060condition\u0060 evaluates to a truthy value.\r\n * @param {Function} onFalse A function to invoke when the \u0060condition\u0060 evaluates to a falsy value.\r\n * @return {Function} A new function that will process either the \u0060onTrue\u0060 or the \u0060onFalse\u0060\r\n * function depending upon the result of the \u0060condition\u0060 predicate.\r\n * @see R.unless, R.when, R.cond\r\n * @example\r\n *\r\n * const incCount = R.ifElse(\r\n * R.has(\u0027count\u0027),\r\n * R.over(R.lensProp(\u0027count\u0027), R.inc),\r\n * R.assoc(\u0027count\u0027, 1)\r\n * );\r\n * incCount({ count: 1 }); //=\u003E { count: 2 }\r\n * incCount({}); //=\u003E { count: 1 }\r\n */\r\n\r\nvar ifElse = _curry3(function ifElse(condition, onTrue, onFalse) {\r\n return curryN(\r\n Math.max(condition.length, onTrue.length, onFalse.length),\r\n function _ifElse() {\r\n return condition.apply(this, arguments)\r\n ? onTrue.apply(this, arguments)\r\n : onFalse.apply(this, arguments);\r\n }\r\n );\r\n});\r\n\r\n/**\r\n * Increments its argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Math\r\n * @sig Number -\u003E Number\r\n * @param {Number} n\r\n * @return {Number} n \u002B 1\r\n * @see R.dec\r\n * @example\r\n *\r\n * R.inc(42); //=\u003E 43\r\n */\r\n\r\nvar inc = add(1);\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the specified value is equal, in [\u0060R.equals\u0060](#equals)\r\n * terms, to at least one element of the given list; \u0060false\u0060 otherwise.\r\n * Also works with strings.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E Boolean\r\n * @param {Object} a The item to compare against.\r\n * @param {Array} list The array to consider.\r\n * @return {Boolean} \u0060true\u0060 if an equivalent item is in the list, \u0060false\u0060 otherwise.\r\n * @see R.any\r\n * @example\r\n *\r\n * R.includes(3, [1, 2, 3]); //=\u003E true\r\n * R.includes(4, [1, 2, 3]); //=\u003E false\r\n * R.includes({ name: \u0027Fred\u0027 }, [{ name: \u0027Fred\u0027 }]); //=\u003E true\r\n * R.includes([42], [[42]]); //=\u003E true\r\n * R.includes(\u0027ba\u0027, \u0027banana\u0027); //=\u003Etrue\r\n */\r\n\r\nvar includes = _curry2(_includes);\r\n\r\n/**\r\n * Given a function that generates a key, turns a list of objects into an\r\n * object indexing the objects by the given key. Note that if multiple\r\n * objects generate the same value for the indexing key only the last value\r\n * will be included in the generated object.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig Idx a =\u003E (b -\u003E a) -\u003E [b] -\u003E {a: b}\r\n * @param {Function} fn Function :: a -\u003E Idx\r\n * @param {Array} array The array of objects to index\r\n * @return {Object} An object indexing each array element by the given property.\r\n * @see R.groupBy\r\n * @example\r\n *\r\n * const list = [{id: \u0027xyz\u0027, title: \u0027A\u0027}, {id: \u0027abc\u0027, title: \u0027B\u0027}];\r\n * R.indexBy(R.prop(\u0027id\u0027), list);\r\n * //=\u003E {abc: {id: \u0027abc\u0027, title: \u0027B\u0027}, xyz: {id: \u0027xyz\u0027, title: \u0027A\u0027}}\r\n */\r\n\r\nvar indexBy = reduceBy(function (acc, elem) {\r\n return elem;\r\n}, null);\r\n\r\n/**\r\n * Returns the position of the first occurrence of an item in an array, or -1\r\n * if the item is not included in the array. [\u0060R.equals\u0060](#equals) is used to\r\n * determine equality.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E Number\r\n * @param {*} target The item to find.\r\n * @param {Array} xs The array to search in.\r\n * @return {Number} the index of the target, or -1 if the target is not found.\r\n * @see R.lastIndexOf, R.findIndex\r\n * @example\r\n *\r\n * R.indexOf(3, [1,2,3,4]); //=\u003E 2\r\n * R.indexOf(10, [1,2,3,4]); //=\u003E -1\r\n */\r\n\r\nvar indexOf = _curry2(function indexOf(target, xs) {\r\n return typeof xs.indexOf === \u0022function\u0022 \u0026\u0026 !_isArray(xs)\r\n ? xs.indexOf(target)\r\n : _indexOf(xs, target, 0);\r\n});\r\n\r\n/**\r\n * Returns all but the last element of the given list or string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category List\r\n * @sig [a] -\u003E [a]\r\n * @sig String -\u003E String\r\n * @param {*} list\r\n * @return {*}\r\n * @see R.last, R.head, R.tail\r\n * @example\r\n *\r\n * R.init([1, 2, 3]); //=\u003E [1, 2]\r\n * R.init([1, 2]); //=\u003E [1]\r\n * R.init([1]); //=\u003E []\r\n * R.init([]); //=\u003E []\r\n *\r\n * R.init(\u0027abc\u0027); //=\u003E \u0027ab\u0027\r\n * R.init(\u0027ab\u0027); //=\u003E \u0027a\u0027\r\n * R.init(\u0027a\u0027); //=\u003E \u0027\u0027\r\n * R.init(\u0027\u0027); //=\u003E \u0027\u0027\r\n */\r\n\r\nvar init = slice(0, -1);\r\n\r\n/**\r\n * Takes a predicate \u0060pred\u0060, a list \u0060xs\u0060, and a list \u0060ys\u0060, and returns a list\r\n * \u0060xs\u0027\u0060 comprising each of the elements of \u0060xs\u0060 which is equal to one or more\r\n * elements of \u0060ys\u0060 according to \u0060pred\u0060.\r\n *\r\n * \u0060pred\u0060 must be a binary function expecting an element from each list.\r\n *\r\n * \u0060xs\u0060, \u0060ys\u0060, and \u0060xs\u0027\u0060 are treated as sets, semantically, so ordering should\r\n * not be significant, but since \u0060xs\u0027\u0060 is ordered the implementation guarantees\r\n * that its values are in the same order as they appear in \u0060xs\u0060. Duplicates are\r\n * not removed, so \u0060xs\u0027\u0060 may contain duplicates if \u0060xs\u0060 contains duplicates.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Relation\r\n * @sig ((a, b) -\u003E Boolean) -\u003E [a] -\u003E [b] -\u003E [a]\r\n * @param {Function} pred\r\n * @param {Array} xs\r\n * @param {Array} ys\r\n * @return {Array}\r\n * @see R.intersection\r\n * @example\r\n *\r\n * R.innerJoin(\r\n * (record, id) =\u003E record.id === id,\r\n * [{id: 824, name: \u0027Richie Furay\u0027},\r\n * {id: 956, name: \u0027Dewey Martin\u0027},\r\n * {id: 313, name: \u0027Bruce Palmer\u0027},\r\n * {id: 456, name: \u0027Stephen Stills\u0027},\r\n * {id: 177, name: \u0027Neil Young\u0027}],\r\n * [177, 456, 999]\r\n * );\r\n * //=\u003E [{id: 456, name: \u0027Stephen Stills\u0027}, {id: 177, name: \u0027Neil Young\u0027}]\r\n */\r\n\r\nvar innerJoin = _curry3(function innerJoin(pred, xs, ys) {\r\n return _filter(function (x) {\r\n return _includesWith(pred, x, ys);\r\n }, xs);\r\n});\r\n\r\n/**\r\n * Inserts the supplied element into the list, at the specified \u0060index\u0060. _Note that\r\n\r\n * this is not destructive_: it returns a copy of the list with the changes.\r\n * \u003Csmall\u003ENo lists have been harmed in the application of this function.\u003C/small\u003E\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.2\r\n * @category List\r\n * @sig Number -\u003E a -\u003E [a] -\u003E [a]\r\n * @param {Number} index The position to insert the element\r\n * @param {*} elt The element to insert into the Array\r\n * @param {Array} list The list to insert into\r\n * @return {Array} A new Array with \u0060elt\u0060 inserted at \u0060index\u0060.\r\n * @example\r\n *\r\n * R.insert(2, \u0027x\u0027, [1,2,3,4]); //=\u003E [1,2,\u0027x\u0027,3,4]\r\n */\r\n\r\nvar insert = _curry3(function insert(idx, elt, list) {\r\n idx = idx \u003C list.length \u0026\u0026 idx \u003E= 0 ? idx : list.length;\r\n var result = Array.prototype.slice.call(list, 0);\r\n result.splice(idx, 0, elt);\r\n return result;\r\n});\r\n\r\n/**\r\n * Inserts the sub-list into the list, at the specified \u0060index\u0060. _Note that this is not\r\n * destructive_: it returns a copy of the list with the changes.\r\n * \u003Csmall\u003ENo lists have been harmed in the application of this function.\u003C/small\u003E\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [a] -\u003E [a]\r\n * @param {Number} index The position to insert the sub-list\r\n * @param {Array} elts The sub-list to insert into the Array\r\n * @param {Array} list The list to insert the sub-list into\r\n * @return {Array} A new Array with \u0060elts\u0060 inserted starting at \u0060index\u0060.\r\n * @example\r\n *\r\n * R.insertAll(2, [\u0027x\u0027,\u0027y\u0027,\u0027z\u0027], [1,2,3,4]); //=\u003E [1,2,\u0027x\u0027,\u0027y\u0027,\u0027z\u0027,3,4]\r\n */\r\n\r\nvar insertAll = _curry3(function insertAll(idx, elts, list) {\r\n idx = idx \u003C list.length \u0026\u0026 idx \u003E= 0 ? idx : list.length;\r\n return [].concat(\r\n Array.prototype.slice.call(list, 0, idx),\r\n elts,\r\n Array.prototype.slice.call(list, idx)\r\n );\r\n});\r\n\r\nfunction XUniqBy(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.set = new _Set();\r\n}\r\n\r\nXUniqBy.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXUniqBy.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXUniqBy.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.set.add(this.f(input))\r\n ? this.xf[\u0022@@transducer/step\u0022](result, input)\r\n : result;\r\n};\r\n\r\nfunction _xuniqBy(f) {\r\n return function (xf) {\r\n return new XUniqBy(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list containing only one copy of each element in the original\r\n * list, based upon the value returned by applying the supplied function to\r\n * each list element. Prefers the first item if the supplied function produces\r\n * the same value on two items. [\u0060R.equals\u0060](#equals) is used for comparison.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig (a -\u003E b) -\u003E [a] -\u003E [a]\r\n * @param {Function} fn A function used to produce a value to use during comparisons.\r\n * @param {Array} list The array to consider.\r\n * @return {Array} The list of unique items.\r\n * @example\r\n *\r\n * R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=\u003E [-1, -5, 2, 10]\r\n */\r\n\r\nvar uniqBy = _curry2(\r\n _dispatchable([], _xuniqBy, function (fn, list) {\r\n var set = new _Set();\r\n var result = [];\r\n var idx = 0;\r\n var appliedItem, item;\r\n\r\n while (idx \u003C list.length) {\r\n item = list[idx];\r\n appliedItem = fn(item);\r\n\r\n if (set.add(appliedItem)) {\r\n result.push(item);\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n })\r\n);\r\n\r\n/**\r\n * Returns a new list containing only one copy of each element in the original\r\n * list. [\u0060R.equals\u0060](#equals) is used to determine equality.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [a]\r\n * @param {Array} list The array to consider.\r\n * @return {Array} The list of unique items.\r\n * @example\r\n *\r\n * R.uniq([1, 1, 2, 1]); //=\u003E [1, 2]\r\n * R.uniq([1, \u00271\u0027]); //=\u003E [1, \u00271\u0027]\r\n * R.uniq([[42], [42]]); //=\u003E [[42]]\r\n */\r\n\r\nvar uniq = uniqBy(identity);\r\n\r\n/**\r\n * Combines two lists into a set (i.e. no duplicates) composed of those\r\n * elements common to both lists.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig [*] -\u003E [*] -\u003E [*]\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The list of elements found in both \u0060list1\u0060 and \u0060list2\u0060.\r\n * @see R.innerJoin\r\n * @example\r\n *\r\n * R.intersection([1,2,3,4], [7,6,5,4,3]); //=\u003E [4, 3]\r\n */\r\n\r\nvar intersection = _curry2(function intersection(list1, list2) {\r\n var toKeep = new _Set();\r\n\r\n for (var i = 0; i \u003C list1.length; i \u002B= 1) {\r\n toKeep.add(list1[i]);\r\n }\r\n\r\n return uniq(_filter(toKeep.has.bind(toKeep), list2));\r\n});\r\n\r\n/**\r\n * Creates a new list with the separator interposed between elements.\r\n *\r\n * Dispatches to the \u0060intersperse\u0060 method of the second argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E [a]\r\n * @param {*} separator The element to add to the list.\r\n * @param {Array} list The list to be interposed.\r\n * @return {Array} The new list.\r\n * @example\r\n *\r\n * R.intersperse(\u0027a\u0027, [\u0027b\u0027, \u0027n\u0027, \u0027n\u0027, \u0027s\u0027]); //=\u003E [\u0027b\u0027, \u0027a\u0027, \u0027n\u0027, \u0027a\u0027, \u0027n\u0027, \u0027a\u0027, \u0027s\u0027]\r\n */\r\n\r\nvar intersperse = _curry2(\r\n _checkForMethod(\u0022intersperse\u0022, function intersperse(separator, list) {\r\n var out = [];\r\n var idx = 0;\r\n var length = list.length;\r\n\r\n while (idx \u003C length) {\r\n if (idx === length - 1) {\r\n out.push(list[idx]);\r\n } else {\r\n out.push(list[idx], separator);\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n })\r\n);\r\n\r\nfunction _objectAssign(target) {\r\n if (target == null) {\r\n throw new TypeError(\u0022Cannot convert undefined or null to object\u0022);\r\n }\r\n\r\n var output = Object(target);\r\n var idx = 1;\r\n var length = arguments.length;\r\n\r\n while (idx \u003C length) {\r\n var source = arguments[idx];\r\n\r\n if (source != null) {\r\n for (var nextKey in source) {\r\n if (_has(nextKey, source)) {\r\n output[nextKey] = source[nextKey];\r\n }\r\n }\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nvar _objectAssign$1 =\r\n typeof Object.assign === \u0022function\u0022 ? Object.assign : _objectAssign;\r\n\r\n/**\r\n * Creates an object containing a single key:value pair.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category Object\r\n * @sig String -\u003E a -\u003E {String:a}\r\n * @param {String} key\r\n * @param {*} val\r\n * @return {Object}\r\n * @see R.pair\r\n * @example\r\n *\r\n * const matchPhrases = R.compose(\r\n * R.objOf(\u0027must\u0027),\r\n * R.map(R.objOf(\u0027match_phrase\u0027))\r\n * );\r\n * matchPhrases([\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E {must: [{match_phrase: \u0027foo\u0027}, {match_phrase: \u0027bar\u0027}, {match_phrase: \u0027baz\u0027}]}\r\n */\r\n\r\nvar objOf = _curry2(function objOf(key, val) {\r\n var obj = {};\r\n obj[key] = val;\r\n return obj;\r\n});\r\n\r\nvar _stepCatArray = {\r\n \u0022@@transducer/init\u0022: Array,\r\n \u0022@@transducer/step\u0022: function transducerStep(xs, x) {\r\n xs.push(x);\r\n return xs;\r\n },\r\n \u0022@@transducer/result\u0022: _identity,\r\n};\r\nvar _stepCatString = {\r\n \u0022@@transducer/init\u0022: String,\r\n \u0022@@transducer/step\u0022: function transducerStep(a, b) {\r\n return a \u002B b;\r\n },\r\n \u0022@@transducer/result\u0022: _identity,\r\n};\r\nvar _stepCatObject = {\r\n \u0022@@transducer/init\u0022: Object,\r\n \u0022@@transducer/step\u0022: function transducerStep(result, input) {\r\n return _objectAssign$1(\r\n result,\r\n _isArrayLike(input) ? objOf(input[0], input[1]) : input\r\n );\r\n },\r\n \u0022@@transducer/result\u0022: _identity,\r\n};\r\nfunction _stepCat(obj) {\r\n if (_isTransformer(obj)) {\r\n return obj;\r\n }\r\n\r\n if (_isArrayLike(obj)) {\r\n return _stepCatArray;\r\n }\r\n\r\n if (typeof obj === \u0022string\u0022) {\r\n return _stepCatString;\r\n }\r\n\r\n if (_typeof(obj) === \u0022object\u0022) {\r\n return _stepCatObject;\r\n }\r\n\r\n throw new Error(\u0022Cannot create transformer for \u0022 \u002B obj);\r\n}\r\n\r\n/**\r\n * Transforms the items of the list with the transducer and appends the\r\n * transformed items to the accumulator using an appropriate iterator function\r\n * based on the accumulator type.\r\n *\r\n * The accumulator can be an array, string, object or a transformer. Iterated\r\n * items will be appended to arrays and concatenated to strings. Objects will\r\n * be merged directly or 2-item arrays will be merged as key, value pairs.\r\n *\r\n * The accumulator can also be a transformer object that provides a 2-arity\r\n * reducing iterator function, step, 0-arity initial value function, init, and\r\n * 1-arity result extraction function result. The step function is used as the\r\n * iterator function in reduce. The result function is used to convert the\r\n * final accumulator into the return type and in most cases is R.identity. The\r\n * init function is used to provide the initial accumulator.\r\n *\r\n * The iteration is performed with [\u0060R.reduce\u0060](#reduce) after initializing the\r\n * transducer.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category List\r\n * @sig a -\u003E (b -\u003E b) -\u003E [c] -\u003E a\r\n * @param {*} acc The initial accumulator value.\r\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.transduce\r\n * @example\r\n *\r\n * const numbers = [1, 2, 3, 4];\r\n * const transducer = R.compose(R.map(R.add(1)), R.take(2));\r\n *\r\n * R.into([], transducer, numbers); //=\u003E [2, 3]\r\n *\r\n * const intoArray = R.into([]);\r\n * intoArray(transducer, numbers); //=\u003E [2, 3]\r\n */\r\n\r\nvar into = _curry3(function into(acc, transducer, list) {\r\n var xf = transducer(_isTransformer(acc) ? acc : _stepCat(acc));\r\n return _xReduce(xf, xf[\u0022@@transducer/init\u0022](), list);\r\n});\r\n\r\n/**\r\n * Same as [\u0060R.invertObj\u0060](#invertObj), however this accounts for objects with\r\n * duplicate values by putting the values into an array.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Object\r\n * @sig {s: x} -\u003E {x: [ s, ... ]}\r\n * @param {Object} obj The object or array to invert\r\n * @return {Object} out A new object with keys in an array.\r\n * @see R.invertObj\r\n * @example\r\n *\r\n * const raceResultsByFirstName = {\r\n * first: \u0027alice\u0027,\r\n * second: \u0027jake\u0027,\r\n * third: \u0027alice\u0027,\r\n * };\r\n * R.invert(raceResultsByFirstName);\r\n * //=\u003E { \u0027alice\u0027: [\u0027first\u0027, \u0027third\u0027], \u0027jake\u0027:[\u0027second\u0027] }\r\n */\r\n\r\nvar invert = _curry1(function invert(obj) {\r\n var props = keys(obj);\r\n var len = props.length;\r\n var idx = 0;\r\n var out = {};\r\n\r\n while (idx \u003C len) {\r\n var key = props[idx];\r\n var val = obj[key];\r\n var list = _has(val, out) ? out[val] : (out[val] = []);\r\n list[list.length] = key;\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n});\r\n\r\n/**\r\n * Returns a new object with the keys of the given object as values, and the\r\n * values of the given object, which are coerced to strings, as keys. Note\r\n * that the last key found is preferred when handling the same value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Object\r\n * @sig {s: x} -\u003E {x: s}\r\n * @param {Object} obj The object or array to invert\r\n * @return {Object} out A new object\r\n * @see R.invert\r\n * @example\r\n *\r\n * const raceResults = {\r\n * first: \u0027alice\u0027,\r\n * second: \u0027jake\u0027\r\n * };\r\n * R.invertObj(raceResults);\r\n * //=\u003E { \u0027alice\u0027: \u0027first\u0027, \u0027jake\u0027:\u0027second\u0027 }\r\n *\r\n * // Alternatively:\r\n * const raceResults = [\u0027alice\u0027, \u0027jake\u0027];\r\n * R.invertObj(raceResults);\r\n * //=\u003E { \u0027alice\u0027: \u00270\u0027, \u0027jake\u0027:\u00271\u0027 }\r\n */\r\n\r\nvar invertObj = _curry1(function invertObj(obj) {\r\n var props = keys(obj);\r\n var len = props.length;\r\n var idx = 0;\r\n var out = {};\r\n\r\n while (idx \u003C len) {\r\n var key = props[idx];\r\n out[obj[key]] = key;\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n});\r\n\r\n/**\r\n * Given an \u0060arity\u0060 (Number) and a \u0060name\u0060 (String) the \u0060invoker\u0060 function\r\n * returns a curried function that takes \u0060arity\u0060 arguments and a \u0060context\u0060\r\n * object. It will \u0022invoke\u0022 the \u0060name\u0060\u0027d function (a method) on the \u0060context\u0060\r\n * object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig Number -\u003E String -\u003E (a -\u003E b -\u003E ... -\u003E n -\u003E Object -\u003E *)\r\n * @param {Number} arity Number of arguments the returned function should take\r\n * before the target object.\r\n * @param {String} method Name of any of the target object\u0027s methods to call.\r\n * @return {Function} A new curried function.\r\n * @see R.construct\r\n * @example\r\n * // A function with no arguments\r\n * const asJson = invoker(0, \u0022json\u0022)\r\n * // Just like calling .then((response) =\u003E response.json())\r\n * fetch(\u0022http://example.com/index.json\u0022).then(asJson)\r\n *\r\n * // A function with one argument\r\n * const sliceFrom = invoker(1, \u0027slice\u0027);\r\n * sliceFrom(6, \u0027abcdefghijklm\u0027); //=\u003E \u0027ghijklm\u0027\r\n *\r\n * // A function with two arguments\r\n * const sliceFrom6 = invoker(2, \u0027slice\u0027)(6);\r\n * sliceFrom6(8, \u0027abcdefghijklm\u0027); //=\u003E \u0027gh\u0027\r\n *\r\n * // NOTE: You can\u0027t simply pass some of the arguments to the initial invoker function.\r\n * const firstCreditCardSection = invoker(2, \u0022slice\u0022, 0, 4)\r\n * firstCreditCardSection(\u00224242 4242 4242 4242\u0022) // =\u003E Function\u003C...\u003E\r\n *\r\n * // Since invoker returns a curried function, you may partially apply it to create the function you need.\r\n * const firstCreditCardSection = invoker(2, \u0022slice\u0022)(0, 4)\r\n * firstCreditCardSection(\u00224242 4242 4242 4242\u0022) // =\u003E \u00224242\u0022\r\n *\r\n * @symb R.invoker(0, \u0027method\u0027)(o) = o[\u0027method\u0027]()\r\n * @symb R.invoker(1, \u0027method\u0027)(a, o) = o[\u0027method\u0027](a)\r\n * @symb R.invoker(2, \u0027method\u0027)(a, b, o) = o[\u0027method\u0027](a, b)\r\n */\r\n\r\nvar invoker = _curry2(function invoker(arity, method) {\r\n return curryN(arity \u002B 1, function () {\r\n var target = arguments[arity];\r\n\r\n if (target != null \u0026\u0026 _isFunction(target[method])) {\r\n return target[method].apply(\r\n target,\r\n Array.prototype.slice.call(arguments, 0, arity)\r\n );\r\n }\r\n\r\n throw new TypeError(\r\n toString$1(target) \u002B \u0027 does not have a method named \u0022\u0027 \u002B method \u002B \u0027\u0022\u0027\r\n );\r\n });\r\n});\r\n\r\n/**\r\n * See if an object (i.e. \u0060val\u0060) is an instance of the supplied constructor. This\r\n * function will check up the inheritance chain, if any.\r\n * If \u0060val\u0060 was created using \u0060Object.create\u0060, \u0060R.is(Object, val) === true\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category Type\r\n * @sig (* -\u003E {*}) -\u003E a -\u003E Boolean\r\n * @param {Object} ctor A constructor\r\n * @param {*} val The value to test\r\n * @return {Boolean}\r\n * @example\r\n *\r\n * R.is(Object, {}); //=\u003E true\r\n * R.is(Number, 1); //=\u003E true\r\n * R.is(Object, 1); //=\u003E false\r\n * R.is(String, \u0027s\u0027); //=\u003E true\r\n * R.is(String, new String(\u0027\u0027)); //=\u003E true\r\n * R.is(Object, new String(\u0027\u0027)); //=\u003E true\r\n * R.is(Object, \u0027s\u0027); //=\u003E false\r\n * R.is(Number, {}); //=\u003E false\r\n */\r\n\r\nvar is = _curry2(function is(Ctor, val) {\r\n return (\r\n val instanceof Ctor ||\r\n (val != null \u0026\u0026\r\n (val.constructor === Ctor ||\r\n (Ctor.name === \u0022Object\u0022 \u0026\u0026 _typeof(val) === \u0022object\u0022)))\r\n );\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the given value is its type\u0027s empty value; \u0060false\u0060\r\n * otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Logic\r\n * @sig a -\u003E Boolean\r\n * @param {*} x\r\n * @return {Boolean}\r\n * @see R.empty\r\n * @example\r\n *\r\n * R.isEmpty([1, 2, 3]); //=\u003E false\r\n * R.isEmpty([]); //=\u003E true\r\n * R.isEmpty(\u0027\u0027); //=\u003E true\r\n * R.isEmpty(null); //=\u003E false\r\n * R.isEmpty({}); //=\u003E true\r\n * R.isEmpty({length: 0}); //=\u003E false\r\n * R.isEmpty(Uint8Array.from(\u0027\u0027)); //=\u003E true\r\n */\r\n\r\nvar isEmpty = _curry1(function isEmpty(x) {\r\n return x != null \u0026\u0026 equals(x, empty(x));\r\n});\r\n\r\n/**\r\n * Checks if the input value is not \u0060null\u0060 and not \u0060undefined\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.29.0\r\n * @category Type\r\n * @sig * -\u003E Boolean\r\n * @param {*} x The value to test.\r\n * @return {Boolean} \u0060true\u0060 if \u0060x\u0060 is not \u0060undefined\u0060 or not \u0060null\u0060, otherwise \u0060false\u0060.\r\n * @example\r\n *\r\n * R.isNotNil(null); //=\u003E false\r\n * R.isNotNil(undefined); //=\u003E false\r\n * R.isNotNil(0); //=\u003E true\r\n * R.isNotNil([]); //=\u003E true\r\n */\r\n\r\nvar isNotNil = _curry1(function isNotNil(x) {\r\n return !isNil(x);\r\n});\r\n\r\n/**\r\n * Returns a string made by inserting the \u0060separator\u0060 between each element and\r\n * concatenating all the elements into a single string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig String -\u003E [a] -\u003E String\r\n * @param {Number|String} separator The string used to separate the elements.\r\n * @param {Array} xs The elements to join into a string.\r\n * @return {String} str The string made by concatenating \u0060xs\u0060 with \u0060separator\u0060.\r\n * @see R.split\r\n * @example\r\n *\r\n * const spacer = R.join(\u0027 \u0027);\r\n * spacer([\u0027a\u0027, 2, 3.4]); //=\u003E \u0027a 2 3.4\u0027\r\n * R.join(\u0027|\u0027, [1, 2, 3]); //=\u003E \u00271|2|3\u0027\r\n */\r\n\r\nvar join = invoker(1, \u0022join\u0022);\r\n\r\n/**\r\n * juxt applies a list of functions to a list of values.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Function\r\n * @sig [(a, b, ..., m) -\u003E n] -\u003E ((a, b, ..., m) -\u003E [n])\r\n * @param {Array} fns An array of functions\r\n * @return {Function} A function that returns a list of values after applying each of the original \u0060fns\u0060 to its parameters.\r\n * @see R.applySpec\r\n * @example\r\n *\r\n * const getRange = R.juxt([Math.min, Math.max]);\r\n * getRange(3, 4, 9, -3); //=\u003E [-3, 9]\r\n * @symb R.juxt([f, g, h])(a, b) = [f(a, b), g(a, b), h(a, b)]\r\n */\r\n\r\nvar juxt = _curry1(function juxt(fns) {\r\n return converge(function () {\r\n return Array.prototype.slice.call(arguments, 0);\r\n }, fns);\r\n});\r\n\r\n/**\r\n * Returns a list containing the names of all the properties of the supplied\r\n * object, including prototype properties.\r\n * Note that the order of the output array is not guaranteed to be consistent\r\n * across different JS platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category Object\r\n * @sig {k: v} -\u003E [k]\r\n * @param {Object} obj The object to extract properties from\r\n * @return {Array} An array of the object\u0027s own and prototype properties.\r\n * @see R.keys, R.valuesIn\r\n * @example\r\n *\r\n * const F = function() { this.x = \u0027X\u0027; };\r\n * F.prototype.y = \u0027Y\u0027;\r\n * const f = new F();\r\n * R.keysIn(f); //=\u003E [\u0027x\u0027, \u0027y\u0027]\r\n */\r\n\r\nvar keysIn = _curry1(function keysIn(obj) {\r\n var prop;\r\n var ks = [];\r\n\r\n for (prop in obj) {\r\n ks[ks.length] = prop;\r\n }\r\n\r\n return ks;\r\n});\r\n\r\n/**\r\n * Returns the position of the last occurrence of an item in an array, or -1 if\r\n * the item is not included in the array. [\u0060R.equals\u0060](#equals) is used to\r\n * determine equality.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E Number\r\n * @param {*} target The item to find.\r\n * @param {Array} xs The array to search in.\r\n * @return {Number} the index of the target, or -1 if the target is not found.\r\n * @see R.indexOf, R.findLastIndex\r\n * @example\r\n *\r\n * R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=\u003E 6\r\n * R.lastIndexOf(10, [1,2,3,4]); //=\u003E -1\r\n */\r\n\r\nvar lastIndexOf = _curry2(function lastIndexOf(target, xs) {\r\n if (typeof xs.lastIndexOf === \u0022function\u0022 \u0026\u0026 !_isArray(xs)) {\r\n return xs.lastIndexOf(target);\r\n } else {\r\n var idx = xs.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n if (equals(xs[idx], target)) {\r\n return idx;\r\n }\r\n\r\n idx -= 1;\r\n }\r\n\r\n return -1;\r\n }\r\n});\r\n\r\nfunction _isNumber(x) {\r\n return Object.prototype.toString.call(x) === \u0022[object Number]\u0022;\r\n}\r\n\r\n/**\r\n * Returns the number of elements in the array by returning \u0060list.length\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category List\r\n * @sig [a] -\u003E Number\r\n * @param {Array} list The array to inspect.\r\n * @return {Number} The length of the array.\r\n * @example\r\n *\r\n * R.length([]); //=\u003E 0\r\n * R.length([1, 2, 3]); //=\u003E 3\r\n */\r\n\r\nvar length = _curry1(function length(list) {\r\n return list != null \u0026\u0026 _isNumber(list.length) ? list.length : NaN;\r\n});\r\n\r\n/**\r\n * Returns a lens for the given getter and setter functions. The getter \u0022gets\u0022\r\n * the value of the focus; the setter \u0022sets\u0022 the value of the focus. The setter\r\n * should not mutate the data structure.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig (s -\u003E a) -\u003E ((a, s) -\u003E s) -\u003E Lens s a\r\n * @param {Function} getter\r\n * @param {Function} setter\r\n * @return {Lens}\r\n * @see R.view, R.set, R.over, R.lensIndex, R.lensProp\r\n * @example\r\n *\r\n * const xLens = R.lens(R.prop(\u0027x\u0027), R.assoc(\u0027x\u0027));\r\n *\r\n * R.view(xLens, {x: 1, y: 2}); //=\u003E 1\r\n * R.set(xLens, 4, {x: 1, y: 2}); //=\u003E {x: 4, y: 2}\r\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=\u003E {x: -1, y: 2}\r\n */\r\n\r\nvar lens = _curry2(function lens(getter, setter) {\r\n return function (toFunctorFn) {\r\n return function (target) {\r\n return map(function (focus) {\r\n return setter(focus, target);\r\n }, toFunctorFn(getter(target)));\r\n };\r\n };\r\n});\r\n\r\n/**\r\n * Returns a new copy of the array with the element at the provided index\r\n * replaced with the given value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category List\r\n * @sig Number -\u003E a -\u003E [a] -\u003E [a]\r\n * @param {Number} idx The index to update.\r\n * @param {*} x The value to exist at the given index of the returned array.\r\n * @param {Array|Arguments} list The source array-like object to be updated.\r\n * @return {Array} A copy of \u0060list\u0060 with the value at index \u0060idx\u0060 replaced with \u0060x\u0060.\r\n * @see R.adjust\r\n * @example\r\n *\r\n * R.update(1, \u0027_\u0027, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E [\u0027a\u0027, \u0027_\u0027, \u0027c\u0027]\r\n * R.update(-1, \u0027_\u0027, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E [\u0027a\u0027, \u0027b\u0027, \u0027_\u0027]\r\n * @symb R.update(-1, a, [b, c]) = [b, a]\r\n * @symb R.update(0, a, [b, c]) = [a, c]\r\n * @symb R.update(1, a, [b, c]) = [b, a]\r\n */\r\n\r\nvar update = _curry3(function update(idx, x, list) {\r\n return adjust(idx, always(x), list);\r\n});\r\n\r\n/**\r\n * Returns a lens whose focus is the specified index.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig Number -\u003E Lens s a\r\n * @param {Number} n\r\n * @return {Lens}\r\n * @see R.view, R.set, R.over, R.nth\r\n * @example\r\n *\r\n * const headLens = R.lensIndex(0);\r\n *\r\n * R.view(headLens, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E \u0027a\u0027\r\n * R.set(headLens, \u0027x\u0027, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E [\u0027x\u0027, \u0027b\u0027, \u0027c\u0027]\r\n * R.over(headLens, R.toUpper, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E [\u0027A\u0027, \u0027b\u0027, \u0027c\u0027]\r\n */\r\n\r\nvar lensIndex = _curry1(function lensIndex(n) {\r\n return lens(nth(n), update(n));\r\n});\r\n\r\n/**\r\n * Retrieves the values at given paths of an object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.27.1\r\n * @category Object\r\n * @typedefn Idx = [String | Int | Symbol]\r\n * @sig [Idx] -\u003E {a} -\u003E [a | Undefined]\r\n * @param {Array} pathsArray The array of paths to be fetched.\r\n * @param {Object} obj The object to retrieve the nested properties from.\r\n * @return {Array} A list consisting of values at paths specified by \u0022pathsArray\u0022.\r\n * @see R.path\r\n * @example\r\n *\r\n * R.paths([[\u0027a\u0027, \u0027b\u0027], [\u0027p\u0027, 0, \u0027q\u0027]], {a: {b: 2}, p: [{q: 3}]}); //=\u003E [2, 3]\r\n * R.paths([[\u0027a\u0027, \u0027b\u0027], [\u0027p\u0027, \u0027r\u0027]], {a: {b: 2}, p: [{q: 3}]}); //=\u003E [2, undefined]\r\n */\r\n\r\nvar paths = _curry2(function paths(pathsArray, obj) {\r\n return pathsArray.map(function (paths) {\r\n var val = obj;\r\n var idx = 0;\r\n var p;\r\n\r\n while (idx \u003C paths.length) {\r\n if (val == null) {\r\n return;\r\n }\r\n\r\n p = paths[idx];\r\n val = _isInteger(p) ? nth(p, val) : val[p];\r\n idx \u002B= 1;\r\n }\r\n\r\n return val;\r\n });\r\n});\r\n\r\n/**\r\n * Retrieves the value at a given path. The nodes of the path can be arbitrary strings or non-negative integers.\r\n * For anything else, the value is unspecified. Integer paths are meant to index arrays, strings are meant for objects.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig [Idx] -\u003E {a} -\u003E a | Undefined\r\n * @sig Idx = String | NonNegativeInt\r\n * @param {Array} path The path to use.\r\n * @param {Object} obj The object or array to retrieve the nested property from.\r\n * @return {*} The data at \u0060path\u0060.\r\n * @see R.prop, R.nth, R.assocPath, R.dissocPath\r\n * @example\r\n *\r\n * R.path([\u0027a\u0027, \u0027b\u0027], {a: {b: 2}}); //=\u003E 2\r\n * R.path([\u0027a\u0027, \u0027b\u0027], {c: {b: 2}}); //=\u003E undefined\r\n * R.path([\u0027a\u0027, \u0027b\u0027, 0], {a: {b: [1, 2, 3]}}); //=\u003E 1\r\n * R.path([\u0027a\u0027, \u0027b\u0027, -2], {a: {b: [1, 2, 3]}}); //=\u003E 2\r\n * R.path([2], {\u00272\u0027: 2}); //=\u003E 2\r\n * R.path([-2], {\u0027-2\u0027: \u0027a\u0027}); //=\u003E undefined\r\n */\r\n\r\nvar path = _curry2(function path(pathAr, obj) {\r\n return paths([pathAr], obj)[0];\r\n});\r\n\r\n/**\r\n * Returns a lens whose focus is the specified path.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig [Idx] -\u003E Lens s a\r\n * @param {Array} path The path to use.\r\n * @return {Lens}\r\n * @see R.view, R.set, R.over\r\n * @example\r\n *\r\n * const xHeadYLens = R.lensPath([\u0027x\u0027, 0, \u0027y\u0027]);\r\n *\r\n * R.view(xHeadYLens, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\r\n * //=\u003E 2\r\n * R.set(xHeadYLens, 1, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\r\n * //=\u003E {x: [{y: 1, z: 3}, {y: 4, z: 5}]}\r\n * R.over(xHeadYLens, R.negate, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\r\n * //=\u003E {x: [{y: -2, z: 3}, {y: 4, z: 5}]}\r\n */\r\n\r\nvar lensPath = _curry1(function lensPath(p) {\r\n return lens(path(p), assocPath(p));\r\n});\r\n\r\n/**\r\n * Returns a lens whose focus is the specified property.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig String -\u003E Lens s a\r\n * @param {String} k\r\n * @return {Lens}\r\n * @see R.view, R.set, R.over\r\n * @example\r\n *\r\n * const xLens = R.lensProp(\u0027x\u0027);\r\n *\r\n * R.view(xLens, {x: 1, y: 2}); //=\u003E 1\r\n * R.set(xLens, 4, {x: 1, y: 2}); //=\u003E {x: 4, y: 2}\r\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=\u003E {x: -1, y: 2}\r\n */\r\n\r\nvar lensProp = _curry1(function lensProp(k) {\r\n return lens(prop(k), assoc(k));\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the first argument is less than the second; \u0060false\u0060\r\n * otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E Boolean\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {Boolean}\r\n * @see R.gt\r\n * @example\r\n *\r\n * R.lt(2, 1); //=\u003E false\r\n * R.lt(2, 2); //=\u003E false\r\n * R.lt(2, 3); //=\u003E true\r\n * R.lt(\u0027a\u0027, \u0027z\u0027); //=\u003E true\r\n * R.lt(\u0027z\u0027, \u0027a\u0027); //=\u003E false\r\n */\r\n\r\nvar lt = _curry2(function lt(a, b) {\r\n return a \u003C b;\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the first argument is less than or equal to the second;\r\n * \u0060false\u0060 otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E Boolean\r\n * @param {Number} a\r\n * @param {Number} b\r\n * @return {Boolean}\r\n * @see R.gte\r\n * @example\r\n *\r\n * R.lte(2, 1); //=\u003E false\r\n * R.lte(2, 2); //=\u003E true\r\n * R.lte(2, 3); //=\u003E true\r\n * R.lte(\u0027a\u0027, \u0027z\u0027); //=\u003E true\r\n * R.lte(\u0027z\u0027, \u0027a\u0027); //=\u003E false\r\n */\r\n\r\nvar lte = _curry2(function lte(a, b) {\r\n return a \u003C= b;\r\n});\r\n\r\n/**\r\n * The \u0060mapAccum\u0060 function behaves like a combination of map and reduce; it\r\n * applies a function to each element of a list, passing an accumulating\r\n * parameter from left to right, and returning a final value of this\r\n * accumulator together with the new list.\r\n *\r\n * The iterator function receives two arguments, *acc* and *value*, and should\r\n * return a tuple *[acc, value]*.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category List\r\n * @sig ((acc, x) -\u003E (acc, y)) -\u003E acc -\u003E [x] -\u003E (acc, [y])\r\n * @param {Function} fn The function to be called on every element of the input \u0060list\u0060.\r\n * @param {*} acc The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.scan, R.addIndex, R.mapAccumRight\r\n * @example\r\n *\r\n * const digits = [\u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027];\r\n * const appender = (a, b) =\u003E [a \u002B b, a \u002B b];\r\n *\r\n * R.mapAccum(appender, 0, digits); //=\u003E [\u002701234\u0027, [\u002701\u0027, \u0027012\u0027, \u00270123\u0027, \u002701234\u0027]]\r\n * @symb R.mapAccum(f, a, [b, c, d]) = [\r\n * f(f(f(a, b)[0], c)[0], d)[0],\r\n * [\r\n * f(a, b)[1],\r\n * f(f(a, b)[0], c)[1],\r\n * f(f(f(a, b)[0], c)[0], d)[1]\r\n * ]\r\n * ]\r\n */\r\n\r\nvar mapAccum = _curry3(function mapAccum(fn, acc, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n var result = [];\r\n var tuple = [acc];\r\n\r\n while (idx \u003C len) {\r\n tuple = fn(tuple[0], list[idx]);\r\n result[idx] = tuple[1];\r\n idx \u002B= 1;\r\n }\r\n\r\n return [tuple[0], result];\r\n});\r\n\r\n/**\r\n * The \u0060mapAccumRight\u0060 function behaves like a combination of map and reduce; it\r\n * applies a function to each element of a list, passing an accumulating\r\n * parameter from right to left, and returning a final value of this\r\n * accumulator together with the new list.\r\n *\r\n * Similar to [\u0060mapAccum\u0060](#mapAccum), except moves through the input list from\r\n * the right to the left.\r\n *\r\n * The iterator function receives two arguments, *acc* and *value*, and should\r\n * return a tuple *[acc, value]*.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category List\r\n * @sig ((acc, x) -\u003E (acc, y)) -\u003E acc -\u003E [x] -\u003E (acc, [y])\r\n * @param {Function} fn The function to be called on every element of the input \u0060list\u0060.\r\n * @param {*} acc The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.addIndex, R.mapAccum\r\n * @example\r\n *\r\n * const digits = [\u00271\u0027, \u00272\u0027, \u00273\u0027, \u00274\u0027];\r\n * const appender = (a, b) =\u003E [b \u002B a, b \u002B a];\r\n *\r\n * R.mapAccumRight(appender, 5, digits); //=\u003E [\u002712345\u0027, [\u002712345\u0027, \u00272345\u0027, \u0027345\u0027, \u002745\u0027]]\r\n * @symb R.mapAccumRight(f, a, [b, c, d]) = [\r\n * f(f(f(a, d)[0], c)[0], b)[0],\r\n * [\r\n * f(a, d)[1],\r\n * f(f(a, d)[0], c)[1],\r\n * f(f(f(a, d)[0], c)[0], b)[1]\r\n * ]\r\n * ]\r\n */\r\n\r\nvar mapAccumRight = _curry3(function mapAccumRight(fn, acc, list) {\r\n var idx = list.length - 1;\r\n var result = [];\r\n var tuple = [acc];\r\n\r\n while (idx \u003E= 0) {\r\n tuple = fn(tuple[0], list[idx]);\r\n result[idx] = tuple[1];\r\n idx -= 1;\r\n }\r\n\r\n return [tuple[0], result];\r\n});\r\n\r\n/**\r\n * An Object-specific version of [\u0060map\u0060](#map). The function is applied to three\r\n * arguments: *(value, key, obj)*. If only the value is significant, use\r\n * [\u0060map\u0060](#map) instead.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Object\r\n * @sig ((*, String, Object) -\u003E *) -\u003E Object -\u003E Object\r\n * @param {Function} fn\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @see R.map\r\n * @example\r\n *\r\n * const xyz = { x: 1, y: 2, z: 3 };\r\n * const prependKeyAndDouble = (num, key, obj) =\u003E key \u002B (num * 2);\r\n *\r\n * R.mapObjIndexed(prependKeyAndDouble, xyz); //=\u003E { x: \u0027x2\u0027, y: \u0027y4\u0027, z: \u0027z6\u0027 }\r\n */\r\n\r\nvar mapObjIndexed = _curry2(function mapObjIndexed(fn, obj) {\r\n return _arrayReduce(\r\n function (acc, key) {\r\n acc[key] = fn(obj[key], key, obj);\r\n return acc;\r\n },\r\n {},\r\n keys(obj)\r\n );\r\n});\r\n\r\n/**\r\n * Tests a regular expression against a String. Note that this function will\r\n * return an empty array when there are no matches. This differs from\r\n * [\u0060String.prototype.match\u0060](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\r\n * which returns \u0060null\u0060 when there are no matches.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category String\r\n * @sig RegExp -\u003E String -\u003E [String | Undefined]\r\n * @param {RegExp} rx A regular expression.\r\n * @param {String} str The string to match against\r\n * @return {Array} The list of matches or empty array.\r\n * @see R.test\r\n * @example\r\n *\r\n * R.match(/([a-z]a)/g, \u0027bananas\u0027); //=\u003E [\u0027ba\u0027, \u0027na\u0027, \u0027na\u0027]\r\n * R.match(/a/, \u0027b\u0027); //=\u003E []\r\n * R.match(/a/, null); //=\u003E TypeError: null does not have a method named \u0022match\u0022\r\n */\r\n\r\nvar match = _curry2(function match(rx, str) {\r\n return str.match(rx) || [];\r\n});\r\n\r\n/**\r\n * \u0060mathMod\u0060 behaves like the modulo operator should mathematically, unlike the\r\n * \u0060%\u0060 operator (and by extension, [\u0060R.modulo\u0060](#modulo)). So while\r\n * \u0060-17 % 5\u0060 is \u0060-2\u0060, \u0060mathMod(-17, 5)\u0060 is \u00603\u0060. \u0060mathMod\u0060 requires Integer\r\n * arguments, and returns NaN when the modulus is zero or negative.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} m The dividend.\r\n * @param {Number} p the modulus.\r\n * @return {Number} The result of \u0060b mod a\u0060.\r\n * @see R.modulo\r\n * @example\r\n *\r\n * R.mathMod(-17, 5); //=\u003E 3\r\n * R.mathMod(17, 5); //=\u003E 2\r\n * R.mathMod(17, -5); //=\u003E NaN\r\n * R.mathMod(17, 0); //=\u003E NaN\r\n * R.mathMod(17.2, 5); //=\u003E NaN\r\n * R.mathMod(17, 5.3); //=\u003E NaN\r\n *\r\n * const clock = R.mathMod(R.__, 12);\r\n * clock(15); //=\u003E 3\r\n * clock(24); //=\u003E 0\r\n *\r\n * const seventeenMod = R.mathMod(17);\r\n * seventeenMod(3); //=\u003E 2\r\n * seventeenMod(4); //=\u003E 1\r\n * seventeenMod(10); //=\u003E 7\r\n */\r\n\r\nvar mathMod = _curry2(function mathMod(m, p) {\r\n if (!_isInteger(m)) {\r\n return NaN;\r\n }\r\n\r\n if (!_isInteger(p) || p \u003C 1) {\r\n return NaN;\r\n }\r\n\r\n return ((m % p) \u002B p) % p;\r\n});\r\n\r\n/**\r\n * Takes a function and two values, and returns whichever value produces the\r\n * larger result when passed to the provided function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Relation\r\n * @sig Ord b =\u003E (a -\u003E b) -\u003E a -\u003E a -\u003E a\r\n * @param {Function} f\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n * @see R.max, R.minBy\r\n * @example\r\n *\r\n * // square :: Number -\u003E Number\r\n * const square = n =\u003E n * n;\r\n *\r\n * R.maxBy(square, -3, 2); //=\u003E -3\r\n *\r\n * R.reduce(R.maxBy(square), 0, [3, -5, 4, 1, -2]); //=\u003E -5\r\n * R.reduce(R.maxBy(square), 0, []); //=\u003E 0\r\n */\r\n\r\nvar maxBy = _curry3(function maxBy(f, a, b) {\r\n var resultB = f(b);\r\n return max(f(a), resultB) === resultB ? b : a;\r\n});\r\n\r\n/**\r\n * Adds together all the elements of a list.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig [Number] -\u003E Number\r\n * @param {Array} list An array of numbers\r\n * @return {Number} The sum of all the numbers in the list.\r\n * @see R.reduce\r\n * @example\r\n *\r\n * R.sum([2,4,6,8,100,1]); //=\u003E 121\r\n */\r\n\r\nvar sum = reduce(add, 0);\r\n\r\n/**\r\n * Returns the mean of the given list of numbers.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Math\r\n * @sig [Number] -\u003E Number\r\n * @param {Array} list\r\n * @return {Number}\r\n * @see R.median\r\n * @example\r\n *\r\n * R.mean([2, 7, 9]); //=\u003E 6\r\n * R.mean([]); //=\u003E NaN\r\n */\r\n\r\nvar mean = _curry1(function mean(list) {\r\n return sum(list) / list.length;\r\n});\r\n\r\n/**\r\n * Returns the median of the given list of numbers.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Math\r\n * @sig [Number] -\u003E Number\r\n * @param {Array} list\r\n * @return {Number}\r\n * @see R.mean\r\n * @example\r\n *\r\n * R.median([2, 9, 7]); //=\u003E 7\r\n * R.median([7, 2, 10, 9]); //=\u003E 8\r\n * R.median([]); //=\u003E NaN\r\n */\r\n\r\nvar median = _curry1(function median(list) {\r\n var len = list.length;\r\n\r\n if (len === 0) {\r\n return NaN;\r\n }\r\n\r\n var width = 2 - (len % 2);\r\n var idx = (len - width) / 2;\r\n return mean(\r\n Array.prototype.slice\r\n .call(list, 0)\r\n .sort(function (a, b) {\r\n return a \u003C b ? -1 : a \u003E b ? 1 : 0;\r\n })\r\n .slice(idx, idx \u002B width)\r\n );\r\n});\r\n\r\n/**\r\n * Takes a string-returning function \u0060keyGen\u0060 and a function \u0060fn\u0060 and returns\r\n * a new function that returns cached results for subsequent\r\n * calls with the same arguments.\r\n *\r\n * When the function is invoked, \u0060keyGen\u0060 is applied to the same arguments\r\n * and its result becomes the cache key. If the cache contains something\r\n * under that key, the function simply returns it and does not invoke \u0060fn\u0060 at all.\r\n *\r\n * Otherwise \u0060fn\u0060 is applied to the same arguments and its return value\r\n * is cached under that key and returned by the function.\r\n *\r\n * Care must be taken when implementing \u0060keyGen\u0060 to avoid key collision,\r\n * or if tracking references, memory leaks and mutating arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Function\r\n * @sig (*... -\u003E String) -\u003E (*... -\u003E a) -\u003E (*... -\u003E a)\r\n * @param {Function} keyGen The function to generate the cache key.\r\n * @param {Function} fn The function to memoize.\r\n * @return {Function} Memoized version of \u0060fn\u0060.\r\n * @example\r\n * const withAge = memoizeWith(o =\u003E \u0060${o.birth}/${o.death}\u0060, ({birth, death}) =\u003E {\r\n * // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^\r\n * // keyGen fn\r\n * console.log(\u0060computing age for ${birth}/${death}\u0060);\r\n * return ({birth, death, age: death - birth});\r\n * });\r\n *\r\n * withAge({birth: 1921, death: 1999});\r\n * //=\u003E LOG: computing age for 1921/1999\r\n * //=\u003E {birth: 1921, death: 1999, age: 78} (returned from fn)\r\n *\r\n * withAge({birth: 1921, death: 1999});\r\n * //=\u003E {birth: 1921, death: 1999, age: 78} (returned from cache)\r\n */\r\n\r\nvar memoizeWith = _curry2(function memoizeWith(keyGen, fn) {\r\n var cache = {};\r\n return _arity(fn.length, function () {\r\n var key = keyGen.apply(this, arguments);\r\n\r\n if (!_has(key, cache)) {\r\n cache[key] = fn.apply(this, arguments);\r\n }\r\n\r\n return cache[key];\r\n });\r\n});\r\n\r\n/**\r\n * Creates one new object with the own properties from a list of objects.\r\n * If a key exists in more than one object, the value from the last\r\n * object it exists in will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category List\r\n * @sig [{k: v}] -\u003E {k: v}\r\n * @param {Array} list An array of objects\r\n * @return {Object} A merged object.\r\n * @see R.reduce\r\n * @example\r\n *\r\n * R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=\u003E {foo:1,bar:2,baz:3}\r\n * R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=\u003E {foo:2,bar:2}\r\n * @symb R.mergeAll([{ x: 1 }, { y: 2 }, { z: 3 }]) = { x: 1, y: 2, z: 3 }\r\n */\r\n\r\nvar mergeAll = _curry1(function mergeAll(list) {\r\n return _objectAssign$1.apply(null, [{}].concat(list));\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the two provided objects. If\r\n * a key exists in both objects, the provided function is applied to the key\r\n * and the values associated with the key in each object, with the result being\r\n * used as the value associated with the key in the returned object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Object\r\n * @sig ((String, a, a) -\u003E a) -\u003E {a} -\u003E {a} -\u003E {a}\r\n * @param {Function} fn\r\n * @param {Object} l\r\n * @param {Object} r\r\n * @return {Object}\r\n * @see R.mergeDeepWithKey, R.merge, R.mergeWith\r\n * @example\r\n *\r\n * let concatValues = (k, l, r) =\u003E k == \u0027values\u0027 ? R.concat(l, r) : r\r\n * R.mergeWithKey(concatValues,\r\n * { a: true, thing: \u0027foo\u0027, values: [10, 20] },\r\n * { b: true, thing: \u0027bar\u0027, values: [15, 35] });\r\n * //=\u003E { a: true, b: true, thing: \u0027bar\u0027, values: [10, 20, 15, 35] }\r\n * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f(\u0027y\u0027, 2, 5), z: 3 }\r\n */\r\n\r\nvar mergeWithKey = _curry3(function mergeWithKey(fn, l, r) {\r\n var result = {};\r\n var k;\r\n l = l || {};\r\n r = r || {};\r\n\r\n for (k in l) {\r\n if (_has(k, l)) {\r\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\r\n }\r\n }\r\n\r\n for (k in r) {\r\n if (_has(k, r) \u0026\u0026 !_has(k, result)) {\r\n result[k] = r[k];\r\n }\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the two provided objects.\r\n * If a key exists in both objects:\r\n * - and both associated values are also objects then the values will be\r\n * recursively merged.\r\n * - otherwise the provided function is applied to the key and associated values\r\n * using the resulting value as the new value associated with the key.\r\n * If a key only exists in one object, the value will be associated with the key\r\n * of the resulting object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Object\r\n * @sig ((String, a, a) -\u003E a) -\u003E {a} -\u003E {a} -\u003E {a}\r\n * @param {Function} fn\r\n * @param {Object} lObj\r\n * @param {Object} rObj\r\n * @return {Object}\r\n * @see R.mergeWithKey, R.mergeDeepWith\r\n * @example\r\n *\r\n * let concatValues = (k, l, r) =\u003E k == \u0027values\u0027 ? R.concat(l, r) : r\r\n * R.mergeDeepWithKey(concatValues,\r\n * { a: true, c: { thing: \u0027foo\u0027, values: [10, 20] }},\r\n * { b: true, c: { thing: \u0027bar\u0027, values: [15, 35] }});\r\n * //=\u003E { a: true, b: true, c: { thing: \u0027bar\u0027, values: [10, 20, 15, 35] }}\r\n */\r\n\r\nvar mergeDeepWithKey = _curry3(function mergeDeepWithKey(fn, lObj, rObj) {\r\n return mergeWithKey(\r\n function (k, lVal, rVal) {\r\n if (_isObject(lVal) \u0026\u0026 _isObject(rVal)) {\r\n return mergeDeepWithKey(fn, lVal, rVal);\r\n } else {\r\n return fn(k, lVal, rVal);\r\n }\r\n },\r\n lObj,\r\n rObj\r\n );\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the first object merged with\r\n * the own properties of the second object. If a key exists in both objects:\r\n * - and both values are objects, the two values will be recursively merged\r\n * - otherwise the value from the first object will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Object\r\n * @sig {a} -\u003E {a} -\u003E {a}\r\n * @param {Object} lObj\r\n * @param {Object} rObj\r\n * @return {Object}\r\n * @see R.merge, R.mergeDeepRight, R.mergeDeepWith, R.mergeDeepWithKey\r\n * @example\r\n *\r\n * R.mergeDeepLeft({ name: \u0027fred\u0027, age: 10, contact: { email: \u0027moo@example.com\u0027 }},\r\n * { age: 40, contact: { email: \u0027baa@example.com\u0027 }});\r\n * //=\u003E { name: \u0027fred\u0027, age: 10, contact: { email: \u0027moo@example.com\u0027 }}\r\n */\r\n\r\nvar mergeDeepLeft = _curry2(function mergeDeepLeft(lObj, rObj) {\r\n return mergeDeepWithKey(\r\n function (k, lVal, rVal) {\r\n return lVal;\r\n },\r\n lObj,\r\n rObj\r\n );\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the first object merged with\r\n * the own properties of the second object. If a key exists in both objects:\r\n * - and both values are objects, the two values will be recursively merged\r\n * - otherwise the value from the second object will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Object\r\n * @sig {a} -\u003E {a} -\u003E {a}\r\n * @param {Object} lObj\r\n * @param {Object} rObj\r\n * @return {Object}\r\n * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey\r\n * @example\r\n *\r\n * R.mergeDeepRight({ name: \u0027fred\u0027, age: 10, contact: { email: \u0027moo@example.com\u0027 }},\r\n * { age: 40, contact: { email: \u0027baa@example.com\u0027 }});\r\n * //=\u003E { name: \u0027fred\u0027, age: 40, contact: { email: \u0027baa@example.com\u0027 }}\r\n */\r\n\r\nvar mergeDeepRight = _curry2(function mergeDeepRight(lObj, rObj) {\r\n return mergeDeepWithKey(\r\n function (k, lVal, rVal) {\r\n return rVal;\r\n },\r\n lObj,\r\n rObj\r\n );\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the two provided objects.\r\n * If a key exists in both objects:\r\n * - and both associated values are also objects then the values will be\r\n * recursively merged.\r\n * - otherwise the provided function is applied to associated values using the\r\n * resulting value as the new value associated with the key.\r\n * If a key only exists in one object, the value will be associated with the key\r\n * of the resulting object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Object\r\n * @sig ((a, a) -\u003E a) -\u003E {a} -\u003E {a} -\u003E {a}\r\n * @param {Function} fn\r\n * @param {Object} lObj\r\n * @param {Object} rObj\r\n * @return {Object}\r\n * @see R.mergeWith, R.mergeDeepWithKey\r\n * @example\r\n *\r\n * R.mergeDeepWith(R.concat,\r\n * { a: true, c: { values: [10, 20] }},\r\n * { b: true, c: { values: [15, 35] }});\r\n * //=\u003E { a: true, b: true, c: { values: [10, 20, 15, 35] }}\r\n */\r\n\r\nvar mergeDeepWith = _curry3(function mergeDeepWith(fn, lObj, rObj) {\r\n return mergeDeepWithKey(\r\n function (k, lVal, rVal) {\r\n return fn(lVal, rVal);\r\n },\r\n lObj,\r\n rObj\r\n );\r\n});\r\n\r\n/**\r\n * Create a new object with the own properties of the first object merged with\r\n * the own properties of the second object. If a key exists in both objects,\r\n * the value from the first object will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Object\r\n * @sig {k: v} -\u003E {k: v} -\u003E {k: v}\r\n * @param {Object} l\r\n * @param {Object} r\r\n * @return {Object}\r\n * @see R.mergeRight, R.mergeDeepLeft, R.mergeWith, R.mergeWithKey\r\n * @example\r\n *\r\n * R.mergeLeft({ \u0027age\u0027: 40 }, { \u0027name\u0027: \u0027fred\u0027, \u0027age\u0027: 10 });\r\n * //=\u003E { \u0027name\u0027: \u0027fred\u0027, \u0027age\u0027: 40 }\r\n *\r\n * const resetToDefault = R.mergeLeft({x: 0});\r\n * resetToDefault({x: 5, y: 2}); //=\u003E {x: 0, y: 2}\r\n * @symb R.mergeLeft(a, b) = {...b, ...a}\r\n */\r\n\r\nvar mergeLeft = _curry2(function mergeLeft(l, r) {\r\n return _objectAssign$1({}, r, l);\r\n});\r\n\r\n/**\r\n * Create a new object with the own properties of the first object merged with\r\n * the own properties of the second object. If a key exists in both objects,\r\n * the value from the second object will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Object\r\n * @sig {k: v} -\u003E {k: v} -\u003E {k: v}\r\n * @param {Object} l\r\n * @param {Object} r\r\n * @return {Object}\r\n * @see R.mergeLeft, R.mergeDeepRight, R.mergeWith, R.mergeWithKey\r\n * @example\r\n *\r\n * R.mergeRight({ \u0027name\u0027: \u0027fred\u0027, \u0027age\u0027: 10 }, { \u0027age\u0027: 40 });\r\n * //=\u003E { \u0027name\u0027: \u0027fred\u0027, \u0027age\u0027: 40 }\r\n *\r\n * const withDefaults = R.mergeRight({x: 0, y: 0});\r\n * withDefaults({y: 2}); //=\u003E {x: 0, y: 2}\r\n * @symb R.mergeRight(a, b) = {...a, ...b}\r\n */\r\n\r\nvar mergeRight = _curry2(function mergeRight(l, r) {\r\n return _objectAssign$1({}, l, r);\r\n});\r\n\r\n/**\r\n * Creates a new object with the own properties of the two provided objects. If\r\n * a key exists in both objects, the provided function is applied to the values\r\n * associated with the key in each object, with the result being used as the\r\n * value associated with the key in the returned object.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Object\r\n * @sig ((a, a) -\u003E a) -\u003E {a} -\u003E {a} -\u003E {a}\r\n * @param {Function} fn\r\n * @param {Object} l\r\n * @param {Object} r\r\n * @return {Object}\r\n * @see R.mergeDeepWith, R.merge, R.mergeWithKey\r\n * @example\r\n *\r\n * R.mergeWith(R.concat,\r\n * { a: true, values: [10, 20] },\r\n * { b: true, values: [15, 35] });\r\n * //=\u003E { a: true, b: true, values: [10, 20, 15, 35] }\r\n */\r\n\r\nvar mergeWith = _curry3(function mergeWith(fn, l, r) {\r\n return mergeWithKey(\r\n function (_, _l, _r) {\r\n return fn(_l, _r);\r\n },\r\n l,\r\n r\r\n );\r\n});\r\n\r\n/**\r\n * Returns the smaller of its two arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord a =\u003E a -\u003E a -\u003E a\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n * @see R.minBy, R.max\r\n * @example\r\n *\r\n * R.min(789, 123); //=\u003E 123\r\n * R.min(\u0027a\u0027, \u0027b\u0027); //=\u003E \u0027a\u0027\r\n */\r\n\r\nvar min = _curry2(function min(a, b) {\r\n if (a === b) {\r\n return a;\r\n }\r\n\r\n function safeMin(x, y) {\r\n if (x \u003C y !== y \u003C x) {\r\n return y \u003C x ? y : x;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n var minByValue = safeMin(a, b);\r\n\r\n if (minByValue !== undefined) {\r\n return minByValue;\r\n }\r\n\r\n var minByType = safeMin(_typeof(a), _typeof(b));\r\n\r\n if (minByType !== undefined) {\r\n return minByType === _typeof(a) ? a : b;\r\n }\r\n\r\n var stringA = toString$1(a);\r\n var minByStringValue = safeMin(stringA, toString$1(b));\r\n\r\n if (minByStringValue !== undefined) {\r\n return minByStringValue === stringA ? a : b;\r\n }\r\n\r\n return a;\r\n});\r\n\r\n/**\r\n * Takes a function and two values, and returns whichever value produces the\r\n * smaller result when passed to the provided function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Relation\r\n * @sig Ord b =\u003E (a -\u003E b) -\u003E a -\u003E a -\u003E a\r\n * @param {Function} f\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n * @see R.min, R.maxBy\r\n * @example\r\n *\r\n * // square :: Number -\u003E Number\r\n * const square = n =\u003E n * n;\r\n *\r\n * R.minBy(square, -3, 2); //=\u003E 2\r\n *\r\n * R.reduce(R.minBy(square), Infinity, [3, -5, 4, 1, -2]); //=\u003E 1\r\n * R.reduce(R.minBy(square), Infinity, []); //=\u003E Infinity\r\n */\r\n\r\nvar minBy = _curry3(function minBy(f, a, b) {\r\n var resultB = f(b);\r\n return min(f(a), resultB) === resultB ? b : a;\r\n});\r\n\r\n/**\r\n * Makes a shallow clone of an object, applying the given fn to the specified\r\n * property with the given value. Note that this copies and flattens prototype\r\n * properties onto the new object as well. All non-primitive properties are\r\n * copied by reference.\r\n *\r\n * @private\r\n * @param {String|Number} prop The property name to set\r\n * @param {Function} fn The function to apply to the property\r\n * @param {Object|Array} obj The object to clone\r\n * @return {Object|Array} A new object equivalent to the original except for the changed property.\r\n */\r\n\r\nfunction _modify(prop, fn, obj) {\r\n if (_isInteger(prop) \u0026\u0026 _isArray(obj)) {\r\n var arr = [].concat(obj);\r\n arr[prop] = fn(arr[prop]);\r\n return arr;\r\n }\r\n\r\n var result = {};\r\n\r\n for (var p in obj) {\r\n result[p] = obj[p];\r\n }\r\n\r\n result[prop] = fn(result[prop]);\r\n return result;\r\n}\r\n\r\n/**\r\n * Creates a shallow clone of the passed object by applying an \u0060fn\u0060 function\r\n * to the value at the given path.\r\n *\r\n * The function will not be invoked, and the object will not change\r\n * if its corresponding path does not exist in the object.\r\n * All non-primitive properties are copied to the new object by reference.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Object\r\n * @sig [Idx] -\u003E (v -\u003E v) -\u003E {k: v} -\u003E {k: v}\r\n * @param {Array} path The path to be modified.\r\n * @param {Function} fn The function to apply to the path.\r\n * @param {Object} object The object to be transformed.\r\n * @return {Object} The transformed object.\r\n * @example\r\n *\r\n * const person = {name: \u0027James\u0027, address: { zipCode: \u002790216\u0027 }};\r\n * R.modifyPath([\u0027address\u0027, \u0027zipCode\u0027], R.reverse, person); //=\u003E {name: \u0027James\u0027, address: { zipCode: \u002761209\u0027 }}\r\n *\r\n * // Can handle arrays too\r\n * const person = {name: \u0027James\u0027, addresses: [{ zipCode: \u002790216\u0027 }]};\r\n * R.modifyPath([\u0027addresses\u0027, 0, \u0027zipCode\u0027], R.reverse, person); //=\u003E {name: \u0027James\u0027, addresses: [{ zipCode: \u002761209\u0027 }]}\r\n */\r\n\r\nvar modifyPath = _curry3(function modifyPath(path, fn, object) {\r\n if ((!_isObject(object) \u0026\u0026 !_isArray(object)) || path.length === 0) {\r\n return object;\r\n }\r\n\r\n var idx = path[0];\r\n\r\n if (!_has(idx, object)) {\r\n return object;\r\n }\r\n\r\n if (path.length === 1) {\r\n return _modify(idx, fn, object);\r\n }\r\n\r\n var val = modifyPath(Array.prototype.slice.call(path, 1), fn, object[idx]);\r\n\r\n if (val === object[idx]) {\r\n return object;\r\n }\r\n\r\n return _assoc(idx, val, object);\r\n});\r\n\r\n/**\r\n * Creates a copy of the passed object by applying an \u0060fn\u0060 function to the given \u0060prop\u0060 property.\r\n *\r\n * The function will not be invoked, and the object will not change\r\n * if its corresponding property does not exist in the object.\r\n * All non-primitive properties are copied to the new object by reference.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Object\r\n * @sig Idx -\u003E (v -\u003E v) -\u003E {k: v} -\u003E {k: v}\r\n * @param {String|Number} prop The property to be modified.\r\n * @param {Function} fn The function to apply to the property.\r\n * @param {Object} object The object to be transformed.\r\n * @return {Object} The transformed object.\r\n * @example\r\n *\r\n * const person = {name: \u0027James\u0027, age: 20, pets: [\u0027dog\u0027, \u0027cat\u0027]};\r\n * R.modify(\u0027age\u0027, R.add(1), person); //=\u003E {name: \u0027James\u0027, age: 21, pets: [\u0027dog\u0027, \u0027cat\u0027]}\r\n * R.modify(\u0027pets\u0027, R.append(\u0027turtle\u0027), person); //=\u003E {name: \u0027James\u0027, age: 20, pets: [\u0027dog\u0027, \u0027cat\u0027, \u0027turtle\u0027]}\r\n */\r\n\r\nvar modify = _curry3(function modify(prop, fn, object) {\r\n return modifyPath([prop], fn, object);\r\n});\r\n\r\n/**\r\n * Divides the first parameter by the second and returns the remainder. Note\r\n * that this function preserves the JavaScript-style behavior for modulo. For\r\n * mathematical modulo see [\u0060mathMod\u0060](#mathMod).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} a The value to the divide.\r\n * @param {Number} b The pseudo-modulus\r\n * @return {Number} The result of \u0060b % a\u0060.\r\n * @see R.mathMod\r\n * @example\r\n *\r\n * R.modulo(17, 3); //=\u003E 2\r\n * // JS behavior:\r\n * R.modulo(-17, 3); //=\u003E -2\r\n * R.modulo(17, -3); //=\u003E 2\r\n *\r\n * const isOdd = R.modulo(R.__, 2);\r\n * isOdd(42); //=\u003E 0\r\n * isOdd(21); //=\u003E 1\r\n */\r\n\r\nvar modulo = _curry2(function modulo(a, b) {\r\n return a % b;\r\n});\r\n\r\n/**\r\n * Move an item, at index \u0060from\u0060, to index \u0060to\u0060, in a list of elements.\r\n * A new list will be created containing the new elements order.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.27.1\r\n * @category List\r\n * @sig Number -\u003E Number -\u003E [a] -\u003E [a]\r\n * @param {Number} from The source index\r\n * @param {Number} to The destination index\r\n * @param {Array} list The list which will serve to realise the move\r\n * @return {Array} The new list reordered\r\n * @example\r\n *\r\n * R.move(0, 2, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]); //=\u003E [\u0027b\u0027, \u0027c\u0027, \u0027a\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]\r\n * R.move(-1, 0, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]); //=\u003E [\u0027f\u0027, \u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027] list rotation\r\n */\r\n\r\nvar move = _curry3(function (from, to, list) {\r\n var length = list.length;\r\n var result = list.slice();\r\n var positiveFrom = from \u003C 0 ? length \u002B from : from;\r\n var positiveTo = to \u003C 0 ? length \u002B to : to;\r\n var item = result.splice(positiveFrom, 1);\r\n return positiveFrom \u003C 0 ||\r\n positiveFrom \u003E= list.length ||\r\n positiveTo \u003C 0 ||\r\n positiveTo \u003E= list.length\r\n ? list\r\n : []\r\n .concat(result.slice(0, positiveTo))\r\n .concat(item)\r\n .concat(result.slice(positiveTo, list.length));\r\n});\r\n\r\n/**\r\n * Multiplies two numbers. Equivalent to \u0060a * b\u0060 but curried.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} a The first value.\r\n * @param {Number} b The second value.\r\n * @return {Number} The result of \u0060a * b\u0060.\r\n * @see R.divide\r\n * @example\r\n *\r\n * const double = R.multiply(2);\r\n * const triple = R.multiply(3);\r\n * double(3); //=\u003E 6\r\n * triple(4); //=\u003E 12\r\n * R.multiply(2, 5); //=\u003E 10\r\n */\r\n\r\nvar multiply = _curry2(function multiply(a, b) {\r\n return a * b;\r\n});\r\n\r\nvar _this = undefined;\r\n/**\r\n * Takes a function \u0060f\u0060 and an object, and returns a function \u0060g\u0060.\r\n * When applied, \u0060g\u0060 returns the result of applying \u0060f\u0060 to the object\r\n * provided initially merged deeply (right) with the object provided as an argument to \u0060g\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Function\r\n * @sig (({ a, b, c, ..., n }) -\u003E x) -\u003E { a, b, c, ...} -\u003E ({ d, e, f, ..., n } -\u003E x)\r\n * @param {Function} f\r\n * @param {Object} props\r\n * @return {Function}\r\n * @see R.partial, R.partialRight, R.curry, R.mergeDeepRight\r\n * @example\r\n *\r\n * const multiply2 = ({ a, b }) =\u003E a * b;\r\n * const double = R.partialObject(multiply2, { a: 2 });\r\n * double({ b: 2 }); //=\u003E 4\r\n *\r\n * const greet = ({ salutation, title, firstName, lastName }) =\u003E\r\n * salutation \u002B \u0027, \u0027 \u002B title \u002B \u0027 \u0027 \u002B firstName \u002B \u0027 \u0027 \u002B lastName \u002B \u0027!\u0027;\r\n *\r\n * const sayHello = R.partialObject(greet, { salutation: \u0027Hello\u0027 });\r\n * const sayHelloToMs = R.partialObject(sayHello, { title: \u0027Ms.\u0027 });\r\n * sayHelloToMs({ firstName: \u0027Jane\u0027, lastName: \u0027Jones\u0027 }); //=\u003E \u0027Hello, Ms. Jane Jones!\u0027\r\n * @symb R.partialObject(f, { a, b })({ c, d }) = f({ a, b, c, d })\r\n */\r\n\r\nvar partialObject = _curry2(function (f, o) {\r\n return function (props) {\r\n return f.call(_this, mergeDeepRight(o, props));\r\n };\r\n});\r\n\r\n/**\r\n * Negates its argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Math\r\n * @sig Number -\u003E Number\r\n * @param {Number} n\r\n * @return {Number}\r\n * @example\r\n *\r\n * R.negate(42); //=\u003E -42\r\n */\r\n\r\nvar negate = _curry1(function negate(n) {\r\n return -n;\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if no elements of the list match the predicate, \u0060false\u0060\r\n * otherwise.\r\n *\r\n * Dispatches to the \u0060all\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E Boolean\r\n * @param {Function} fn The predicate function.\r\n * @param {Array} list The array to consider.\r\n * @return {Boolean} \u0060true\u0060 if the predicate is not satisfied by every element, \u0060false\u0060 otherwise.\r\n * @see R.all, R.any\r\n * @example\r\n *\r\n * const isEven = n =\u003E n % 2 === 0;\r\n * const isOdd = n =\u003E n % 2 !== 0;\r\n *\r\n * R.none(isEven, [1, 3, 5, 7, 9, 11]); //=\u003E true\r\n * R.none(isOdd, [1, 3, 5, 7, 8, 11]); //=\u003E false\r\n */\r\n\r\nvar none = _curry2(function none(fn, input) {\r\n return all(_complement(fn), input);\r\n});\r\n\r\n/**\r\n * Returns a function which returns its nth argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category Function\r\n * @sig Number -\u003E *... -\u003E *\r\n * @param {Number} n\r\n * @return {Function}\r\n * @example\r\n *\r\n * R.nthArg(1)(\u0027a\u0027, \u0027b\u0027, \u0027c\u0027); //=\u003E \u0027b\u0027\r\n * R.nthArg(-1)(\u0027a\u0027, \u0027b\u0027, \u0027c\u0027); //=\u003E \u0027c\u0027\r\n * @symb R.nthArg(-1)(a, b, c) = c\r\n * @symb R.nthArg(0)(a, b, c) = a\r\n * @symb R.nthArg(1)(a, b, c) = b\r\n */\r\n\r\nvar nthArg = _curry1(function nthArg(n) {\r\n var arity = n \u003C 0 ? 1 : n \u002B 1;\r\n return curryN(arity, function () {\r\n return nth(n, arguments);\r\n });\r\n});\r\n\r\n/**\r\n * \u0060o\u0060 is a curried composition function that returns a unary function.\r\n * Like [\u0060compose\u0060](#compose), \u0060o\u0060 performs right-to-left function composition.\r\n * Unlike [\u0060compose\u0060](#compose), the rightmost function passed to \u0060o\u0060 will be\r\n * invoked with only one argument. Also, unlike [\u0060compose\u0060](#compose), \u0060o\u0060 is\r\n * limited to accepting only 2 unary functions. The name o was chosen because\r\n * of its similarity to the mathematical composition operator \u2218.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category Function\r\n * @sig (b -\u003E c) -\u003E (a -\u003E b) -\u003E a -\u003E c\r\n * @param {Function} f\r\n * @param {Function} g\r\n * @return {Function}\r\n * @see R.compose, R.pipe\r\n * @example\r\n *\r\n * const classyGreeting = name =\u003E \u0022The name\u0027s \u0022 \u002B name.last \u002B \u0022, \u0022 \u002B name.first \u002B \u0022 \u0022 \u002B name.last\r\n * const yellGreeting = R.o(R.toUpper, classyGreeting);\r\n * yellGreeting({first: \u0027James\u0027, last: \u0027Bond\u0027}); //=\u003E \u0022THE NAME\u0027S BOND, JAMES BOND\u0022\r\n *\r\n * R.o(R.multiply(10), R.add(10))(-4) //=\u003E 60\r\n *\r\n * @symb R.o(f, g, x) = f(g(x))\r\n */\r\n\r\nvar o = _curry3(function o(f, g, x) {\r\n return f(g(x));\r\n});\r\n\r\n/**\r\n * Given a constructor and a value, returns a new instance of that constructor\r\n * containing the value.\r\n *\r\n * Dispatches to the \u0060fantasy-land/of\u0060 method of the constructor first (if present)\r\n * or to the \u0060of\u0060 method last (if present). When neither are present, wraps the\r\n * value in an array.\r\n *\r\n * Note this \u0060of\u0060 is different from the ES6 \u0060of\u0060; See\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category Function\r\n * @sig (* -\u003E {*}) -\u003E a -\u003E {a}\r\n * @param {Object} Ctor A constructor\r\n * @param {*} val any value\r\n * @return {*} An instance of the \u0060Ctor\u0060 wrapping \u0060val\u0060.\r\n * @example\r\n *\r\n * R.of(Array, 42); //=\u003E [42]\r\n * R.of(Array, [42]); //=\u003E [[42]]\r\n * R.of(Maybe, 42); //=\u003E Maybe.Just(42)\r\n */\r\n\r\nvar of = _curry2(function of(Ctor, val) {\r\n return typeof Ctor[\u0022fantasy-land/of\u0022] === \u0022function\u0022\r\n ? Ctor[\u0022fantasy-land/of\u0022](val)\r\n : typeof Ctor.of === \u0022function\u0022\r\n ? Ctor.of(val)\r\n : [val];\r\n});\r\n\r\n/**\r\n * Returns a partial copy of an object omitting the keys specified.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig [String] -\u003E {String: *} -\u003E {String: *}\r\n * @param {Array} names an array of String property names to omit from the new object\r\n * @param {Object} obj The object to copy from\r\n * @return {Object} A new object with properties from \u0060names\u0060 not on it.\r\n * @see R.pick\r\n * @example\r\n *\r\n * R.omit([\u0027a\u0027, \u0027d\u0027], {a: 1, b: 2, c: 3, d: 4}); //=\u003E {b: 2, c: 3}\r\n */\r\n\r\nvar omit = _curry2(function omit(names, obj) {\r\n var result = {};\r\n var index = {};\r\n var idx = 0;\r\n var len = names.length;\r\n\r\n while (idx \u003C len) {\r\n index[names[idx]] = 1;\r\n idx \u002B= 1;\r\n }\r\n\r\n for (var prop in obj) {\r\n if (!index.hasOwnProperty(prop)) {\r\n result[prop] = obj[prop];\r\n }\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Takes a binary function \u0060f\u0060, a unary function \u0060g\u0060, and two values.\r\n * Applies \u0060g\u0060 to each value, then applies the result of each to \u0060f\u0060.\r\n *\r\n * Also known as the P combinator.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Function\r\n * @sig ((a, a) -\u003E b) -\u003E (c -\u003E a) -\u003E c -\u003E c -\u003E b\r\n * @param {Function} f a binary function\r\n * @param {Function} g a unary function\r\n * @param {any} a any value\r\n * @param {any} b any value\r\n * @return {any} The result of \u0060f\u0060\r\n * @example\r\n *\r\n * const eqBy = R.on((a, b) =\u003E a === b);\r\n * eqBy(R.prop(\u0027a\u0027), {b:0, a:1}, {a:1}) //=\u003E true;\r\n *\r\n * const containsInsensitive = R.on(R.includes, R.toLower);\r\n * containsInsensitive(\u0027o\u0027, \u0027FOO\u0027); //=\u003E true\r\n * @symb R.on(f, g, a, b) = f(g(a), g(b))\r\n */\r\n\r\nvar on = _curryN(4, [], function on(f, g, a, b) {\r\n return f(g(a), g(b));\r\n});\r\n\r\n/**\r\n * Accepts a function \u0060fn\u0060 and returns a function that guards invocation of\r\n * \u0060fn\u0060 such that \u0060fn\u0060 can only ever be called once, no matter how many times\r\n * the returned function is invoked. The first value calculated is returned in\r\n * subsequent invocations.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig (a... -\u003E b) -\u003E (a... -\u003E b)\r\n * @param {Function} fn The function to wrap in a call-only-once wrapper.\r\n * @return {Function} The wrapped function.\r\n * @example\r\n *\r\n * const addOneOnce = R.once(x =\u003E x \u002B 1);\r\n * addOneOnce(10); //=\u003E 11\r\n * addOneOnce(addOneOnce(50)); //=\u003E 11\r\n */\r\n\r\nvar once = _curry1(function once(fn) {\r\n var called = false;\r\n var result;\r\n return _arity(fn.length, function () {\r\n if (called) {\r\n return result;\r\n }\r\n\r\n called = true;\r\n result = fn.apply(this, arguments);\r\n return result;\r\n });\r\n});\r\n\r\nfunction _assertPromise(name, p) {\r\n if (p == null || !_isFunction(p.then)) {\r\n throw new TypeError(\r\n \u0022\u0060\u0022 \u002B name \u002B \u0022\u0060 expected a Promise, received \u0022 \u002B _toString(p, [])\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Returns the result of applying the onFailure function to the value inside\r\n * a failed promise. This is useful for handling rejected promises\r\n * inside function compositions.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Function\r\n * @sig (e -\u003E b) -\u003E (Promise e a) -\u003E (Promise e b)\r\n * @sig (e -\u003E (Promise f b)) -\u003E (Promise e a) -\u003E (Promise f b)\r\n * @param {Function} onFailure The function to apply. Can return a value or a promise of a value.\r\n * @param {Promise} p\r\n * @return {Promise} The result of calling \u0060p.then(null, onFailure)\u0060\r\n * @see R.andThen\r\n * @example\r\n *\r\n * const failedFetch = id =\u003E Promise.reject(\u0027bad ID\u0027);\r\n * const useDefault = () =\u003E ({ firstName: \u0027Bob\u0027, lastName: \u0027Loblaw\u0027 });\r\n *\r\n * //recoverFromFailure :: String -\u003E Promise ({ firstName, lastName })\r\n * const recoverFromFailure = R.pipe(\r\n * failedFetch,\r\n * R.otherwise(useDefault),\r\n * R.andThen(R.pick([\u0027firstName\u0027, \u0027lastName\u0027])),\r\n * );\r\n * recoverFromFailure(12345).then(console.log);\r\n */\r\n\r\nvar otherwise = _curry2(function otherwise(f, p) {\r\n _assertPromise(\u0022otherwise\u0022, p);\r\n\r\n return p.then(null, f);\r\n});\r\n\r\n// transforms the held value with the provided function.\r\n\r\nvar Identity = function Identity(x) {\r\n return {\r\n value: x,\r\n map: function map(f) {\r\n return Identity(f(x));\r\n },\r\n };\r\n};\r\n/**\r\n * Returns the result of \u0022setting\u0022 the portion of the given data structure\r\n * focused by the given lens to the result of applying the given function to\r\n * the focused value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig Lens s a -\u003E (a -\u003E a) -\u003E s -\u003E s\r\n * @param {Lens} lens\r\n * @param {*} v\r\n * @param {*} x\r\n * @return {*}\r\n * @see R.view, R.set, R.lens, R.lensIndex, R.lensProp, R.lensPath\r\n * @example\r\n *\r\n * const headLens = R.lensIndex(0);\r\n *\r\n * R.over(headLens, R.toUpper, [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]); //=\u003E [\u0027FOO\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n */\r\n\r\nvar over = _curry3(function over(lens, f, x) {\r\n // The value returned by the getter function is first transformed with \u0060f\u0060,\r\n // then set as the value of an \u0060Identity\u0060. This is then mapped over with the\r\n // setter function of the lens.\r\n return lens(function (y) {\r\n return Identity(f(y));\r\n })(x).value;\r\n});\r\n\r\n/**\r\n * Takes two arguments, \u0060fst\u0060 and \u0060snd\u0060, and returns \u0060[fst, snd]\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category List\r\n * @sig a -\u003E b -\u003E (a,b)\r\n * @param {*} fst\r\n * @param {*} snd\r\n * @return {Array}\r\n * @see R.objOf, R.of\r\n * @example\r\n *\r\n * R.pair(\u0027foo\u0027, \u0027bar\u0027); //=\u003E [\u0027foo\u0027, \u0027bar\u0027]\r\n */\r\n\r\nvar pair = _curry2(function pair(fst, snd) {\r\n return [fst, snd];\r\n});\r\n\r\nfunction _createPartialApplicator(concat) {\r\n return _curry2(function (fn, args) {\r\n return _arity(Math.max(0, fn.length - args.length), function () {\r\n return fn.apply(this, concat(args, arguments));\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Takes a function \u0060f\u0060 and a list of arguments, and returns a function \u0060g\u0060.\r\n * When applied, \u0060g\u0060 returns the result of applying \u0060f\u0060 to the arguments\r\n * provided initially followed by the arguments provided to \u0060g\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category Function\r\n * @sig ((a, b, c, ..., n) -\u003E x) -\u003E [a, b, c, ...] -\u003E ((d, e, f, ..., n) -\u003E x)\r\n * @param {Function} f\r\n * @param {Array} args\r\n * @return {Function}\r\n * @see R.partialRight, R.curry\r\n * @example\r\n *\r\n * const multiply2 = (a, b) =\u003E a * b;\r\n * const double = R.partial(multiply2, [2]);\r\n * double(3); //=\u003E 6\r\n *\r\n * const greet = (salutation, title, firstName, lastName) =\u003E\r\n * salutation \u002B \u0027, \u0027 \u002B title \u002B \u0027 \u0027 \u002B firstName \u002B \u0027 \u0027 \u002B lastName \u002B \u0027!\u0027;\r\n *\r\n * const sayHello = R.partial(greet, [\u0027Hello\u0027]);\r\n * const sayHelloToMs = R.partial(sayHello, [\u0027Ms.\u0027]);\r\n * sayHelloToMs(\u0027Jane\u0027, \u0027Jones\u0027); //=\u003E \u0027Hello, Ms. Jane Jones!\u0027\r\n * @symb R.partial(f, [a, b])(c, d) = f(a, b, c, d)\r\n */\r\n\r\nvar partial = _createPartialApplicator(_concat);\r\n\r\n/**\r\n * Takes a function \u0060f\u0060 and a list of arguments, and returns a function \u0060g\u0060.\r\n * When applied, \u0060g\u0060 returns the result of applying \u0060f\u0060 to the arguments\r\n * provided to \u0060g\u0060 followed by the arguments provided initially.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category Function\r\n * @sig ((a, b, c, ..., n) -\u003E x) -\u003E [d, e, f, ..., n] -\u003E ((a, b, c, ...) -\u003E x)\r\n * @param {Function} f\r\n * @param {Array} args\r\n * @return {Function}\r\n * @see R.partial\r\n * @example\r\n *\r\n * const greet = (salutation, title, firstName, lastName) =\u003E\r\n * salutation \u002B \u0027, \u0027 \u002B title \u002B \u0027 \u0027 \u002B firstName \u002B \u0027 \u0027 \u002B lastName \u002B \u0027!\u0027;\r\n *\r\n * const greetMsJaneJones = R.partialRight(greet, [\u0027Ms.\u0027, \u0027Jane\u0027, \u0027Jones\u0027]);\r\n *\r\n * greetMsJaneJones(\u0027Hello\u0027); //=\u003E \u0027Hello, Ms. Jane Jones!\u0027\r\n * @symb R.partialRight(f, [a, b])(c, d) = f(c, d, a, b)\r\n */\r\n\r\nvar partialRight = _createPartialApplicator(flip(_concat));\r\n\r\n/**\r\n * Takes a predicate and a list or other \u0060Filterable\u0060 object and returns the\r\n * pair of filterable objects of the same type of elements which do and do not\r\n * satisfy, the predicate, respectively. Filterable objects include plain objects or any object\r\n * that has a filter method such as \u0060Array\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.4\r\n * @category List\r\n * @sig Filterable f =\u003E (a -\u003E Boolean) -\u003E f a -\u003E [f a, f a]\r\n * @param {Function} pred A predicate to determine which side the element belongs to.\r\n * @param {Array} filterable the list (or other filterable) to partition.\r\n * @return {Array} An array, containing first the subset of elements that satisfy the\r\n * predicate, and second the subset of elements that do not satisfy.\r\n * @see R.filter, R.reject\r\n * @example\r\n *\r\n * R.partition(R.includes(\u0027s\u0027), [\u0027sss\u0027, \u0027ttt\u0027, \u0027foo\u0027, \u0027bars\u0027]);\r\n * // =\u003E [ [ \u0027sss\u0027, \u0027bars\u0027 ], [ \u0027ttt\u0027, \u0027foo\u0027 ] ]\r\n *\r\n * R.partition(R.includes(\u0027s\u0027), { a: \u0027sss\u0027, b: \u0027ttt\u0027, foo: \u0027bars\u0027 });\r\n * // =\u003E [ { a: \u0027sss\u0027, foo: \u0027bars\u0027 }, { b: \u0027ttt\u0027 } ]\r\n */\r\n\r\nvar partition = juxt([filter, reject]);\r\n\r\n/**\r\n * Determines whether a nested path on an object has a specific value, in\r\n * [\u0060R.equals\u0060](#equals) terms. Most likely used to filter a list.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category Relation\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig a -\u003E [Idx] -\u003E {a} -\u003E Boolean\r\n * @param {*} val The value to compare the nested property with\r\n * @param {Array} path The path of the nested property to use\r\n * @param {Object} obj The object to check the nested property in\r\n * @return {Boolean} \u0060true\u0060 if the value equals the nested object property,\r\n * \u0060false\u0060 otherwise.\r\n * @see R.whereEq, R.propEq, R.pathSatisfies, R.equals\r\n * @example\r\n *\r\n * const user1 = { address: { zipCode: 90210 } };\r\n * const user2 = { address: { zipCode: 55555 } };\r\n * const user3 = { name: \u0027Bob\u0027 };\r\n * const users = [ user1, user2, user3 ];\r\n * const isFamous = R.pathEq(90210, [\u0027address\u0027, \u0027zipCode\u0027]);\r\n * R.filter(isFamous, users); //=\u003E [ user1 ]\r\n */\r\n\r\nvar pathEq = _curry3(function pathEq(val, _path, obj) {\r\n return equals(path(_path, obj), val);\r\n});\r\n\r\n/**\r\n * If the given, non-null object has a value at the given path, returns the\r\n * value at that path. Otherwise returns the provided default value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category Object\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig a -\u003E [Idx] -\u003E {a} -\u003E a\r\n * @param {*} d The default value.\r\n * @param {Array} p The path to use.\r\n * @param {Object} obj The object to retrieve the nested property from.\r\n * @return {*} The data at \u0060path\u0060 of the supplied object or the default value.\r\n * @example\r\n *\r\n * R.pathOr(\u0027N/A\u0027, [\u0027a\u0027, \u0027b\u0027], {a: {b: 2}}); //=\u003E 2\r\n * R.pathOr(\u0027N/A\u0027, [\u0027a\u0027, \u0027b\u0027], {c: {b: 2}}); //=\u003E \u0022N/A\u0022\r\n */\r\n\r\nvar pathOr = _curry3(function pathOr(d, p, obj) {\r\n return defaultTo(d, path(p, obj));\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the specified object property at given path satisfies the\r\n * given predicate; \u0060false\u0060 otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Logic\r\n * @typedefn Idx = String | Int | Symbol\r\n * @sig (a -\u003E Boolean) -\u003E [Idx] -\u003E {a} -\u003E Boolean\r\n * @param {Function} pred\r\n * @param {Array} propPath\r\n * @param {*} obj\r\n * @return {Boolean}\r\n * @see R.propSatisfies, R.path\r\n * @example\r\n *\r\n * R.pathSatisfies(y =\u003E y \u003E 0, [\u0027x\u0027, \u0027y\u0027], {x: {y: 2}}); //=\u003E true\r\n * R.pathSatisfies(R.is(Object), [], {x: {y: 2}}); //=\u003E true\r\n */\r\n\r\nvar pathSatisfies = _curry3(function pathSatisfies(pred, propPath, obj) {\r\n return pred(path(propPath, obj));\r\n});\r\n\r\n/**\r\n * Returns a partial copy of an object containing only the keys specified. If\r\n * the key does not exist, the property is ignored.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig [k] -\u003E {k: v} -\u003E {k: v}\r\n * @param {Array} names an array of String property names to copy onto a new object\r\n * @param {Object} obj The object to copy from\r\n * @return {Object} A new object with only properties from \u0060names\u0060 on it.\r\n * @see R.omit, R.props\r\n * @example\r\n *\r\n * R.pick([\u0027a\u0027, \u0027d\u0027], {a: 1, b: 2, c: 3, d: 4}); //=\u003E {a: 1, d: 4}\r\n * R.pick([\u0027a\u0027, \u0027e\u0027, \u0027f\u0027], {a: 1, b: 2, c: 3, d: 4}); //=\u003E {a: 1}\r\n */\r\n\r\nvar pick = _curry2(function pick(names, obj) {\r\n var result = {};\r\n var idx = 0;\r\n\r\n while (idx \u003C names.length) {\r\n if (names[idx] in obj) {\r\n result[names[idx]] = obj[names[idx]];\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Similar to \u0060pick\u0060 except that this one includes a \u0060key: undefined\u0060 pair for\r\n * properties that don\u0027t exist.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig [k] -\u003E {k: v} -\u003E {k: v}\r\n * @param {Array} names an array of String property names to copy onto a new object\r\n * @param {Object} obj The object to copy from\r\n * @return {Object} A new object with only properties from \u0060names\u0060 on it.\r\n * @see R.pick\r\n * @example\r\n *\r\n * R.pickAll([\u0027a\u0027, \u0027d\u0027], {a: 1, b: 2, c: 3, d: 4}); //=\u003E {a: 1, d: 4}\r\n * R.pickAll([\u0027a\u0027, \u0027e\u0027, \u0027f\u0027], {a: 1, b: 2, c: 3, d: 4}); //=\u003E {a: 1, e: undefined, f: undefined}\r\n */\r\n\r\nvar pickAll = _curry2(function pickAll(names, obj) {\r\n var result = {};\r\n var idx = 0;\r\n var len = names.length;\r\n\r\n while (idx \u003C len) {\r\n var name = names[idx];\r\n result[name] = obj[name];\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Returns a partial copy of an object containing only the keys that satisfy\r\n * the supplied predicate.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Object\r\n * @sig ((v, k) -\u003E Boolean) -\u003E {k: v} -\u003E {k: v}\r\n * @param {Function} pred A predicate to determine whether or not a key\r\n * should be included on the output object.\r\n * @param {Object} obj The object to copy from\r\n * @return {Object} A new object with only properties that satisfy \u0060pred\u0060\r\n * on it.\r\n * @see R.pick, R.filter\r\n * @example\r\n *\r\n * const isUpperCase = (val, key) =\u003E key.toUpperCase() === key;\r\n * R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=\u003E {A: 3, B: 4}\r\n */\r\n\r\nvar pickBy = _curry2(function pickBy(test, obj) {\r\n var result = {};\r\n\r\n for (var prop in obj) {\r\n if (test(obj[prop], prop, obj)) {\r\n result[prop] = obj[prop];\r\n }\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Returns a new list with the given element at the front, followed by the\r\n * contents of the list.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig a -\u003E [a] -\u003E [a]\r\n * @param {*} el The item to add to the head of the output list.\r\n * @param {Array} list The array to add to the tail of the output list.\r\n * @return {Array} A new array.\r\n * @see R.append\r\n * @example\r\n *\r\n * R.prepend(\u0027fee\u0027, [\u0027fi\u0027, \u0027fo\u0027, \u0027fum\u0027]); //=\u003E [\u0027fee\u0027, \u0027fi\u0027, \u0027fo\u0027, \u0027fum\u0027]\r\n */\r\n\r\nvar prepend = _curry2(function prepend(el, list) {\r\n return _concat([el], list);\r\n});\r\n\r\n/**\r\n * Multiplies together all the elements of a list.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig [Number] -\u003E Number\r\n * @param {Array} list An array of numbers\r\n * @return {Number} The product of all the numbers in the list.\r\n * @see R.reduce\r\n * @example\r\n *\r\n * R.product([2,4,6,8,100,1]); //=\u003E 38400\r\n */\r\n\r\nvar product = reduce(multiply, 1);\r\n\r\n/**\r\n * Accepts a function \u0060fn\u0060 and a list of transformer functions and returns a\r\n * new curried function. When the new function is invoked, it calls the\r\n * function \u0060fn\u0060 with parameters consisting of the result of calling each\r\n * supplied handler on successive arguments to the new function.\r\n *\r\n * If more arguments are passed to the returned function than transformer\r\n * functions, those arguments are passed directly to \u0060fn\u0060 as additional\r\n * parameters. If you expect additional arguments that don\u0027t need to be\r\n * transformed, although you can ignore them, it\u0027s best to pass an identity\r\n * function so that the new function reports the correct arity.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig ((x1, x2, ...) -\u003E z) -\u003E [(a -\u003E x1), (b -\u003E x2), ...] -\u003E (a -\u003E b -\u003E ... -\u003E z)\r\n * @param {Function} fn The function to wrap.\r\n * @param {Array} transformers A list of transformer functions\r\n * @return {Function} The wrapped function.\r\n * @see R.converge\r\n * @example\r\n *\r\n * R.useWith(Math.pow, [R.identity, R.identity])(3, 4); //=\u003E 81\r\n * R.useWith(Math.pow, [R.identity, R.identity])(3)(4); //=\u003E 81\r\n * R.useWith(Math.pow, [R.dec, R.inc])(3, 4); //=\u003E 32\r\n * R.useWith(Math.pow, [R.dec, R.inc])(3)(4); //=\u003E 32\r\n * @symb R.useWith(f, [g, h])(a, b) = f(g(a), h(b))\r\n */\r\n\r\nvar useWith = _curry2(function useWith(fn, transformers) {\r\n return curryN(transformers.length, function () {\r\n var args = [];\r\n var idx = 0;\r\n\r\n while (idx \u003C transformers.length) {\r\n args.push(transformers[idx].call(this, arguments[idx]));\r\n idx \u002B= 1;\r\n }\r\n\r\n return fn.apply(\r\n this,\r\n args.concat(Array.prototype.slice.call(arguments, transformers.length))\r\n );\r\n });\r\n});\r\n\r\n/**\r\n * Reasonable analog to SQL \u0060select\u0060 statement.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @category Relation\r\n * @sig [k] -\u003E [{k: v}] -\u003E [{k: v}]\r\n * @param {Array} props The property names to project\r\n * @param {Array} objs The objects to query\r\n * @return {Array} An array of objects with just the \u0060props\u0060 properties.\r\n * @see R.pluck, R.props, R.prop\r\n * @example\r\n *\r\n * const abby = {name: \u0027Abby\u0027, age: 7, hair: \u0027blond\u0027, grade: 2};\r\n * const fred = {name: \u0027Fred\u0027, age: 12, hair: \u0027brown\u0027, grade: 7};\r\n * const kids = [abby, fred];\r\n * R.project([\u0027name\u0027, \u0027grade\u0027], kids); //=\u003E [{name: \u0027Abby\u0027, grade: 2}, {name: \u0027Fred\u0027, grade: 7}]\r\n */\r\n\r\nvar project = useWith(_map, [pickAll, identity]); // passing \u0060identity\u0060 gives correct arity\r\n\r\nfunction _promap(f, g, profunctor) {\r\n return function (x) {\r\n return g(profunctor(f(x)));\r\n };\r\n}\r\n\r\nfunction XPromap(f, g, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n this.g = g;\r\n}\r\n\r\nXPromap.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXPromap.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXPromap.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.xf[\u0022@@transducer/step\u0022](result, _promap(this.f, this.g, input));\r\n};\r\n\r\nfunction _xpromap(f, g) {\r\n return function (xf) {\r\n return new XPromap(f, g, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Takes two functions as pre- and post- processors respectively for a third function,\r\n * i.e. \u0060promap(f, g, h)(x) === g(h(f(x)))\u0060.\r\n *\r\n * Dispatches to the \u0060promap\u0060 method of the third argument, if present,\r\n * according to the [FantasyLand Profunctor spec](https://github.com/fantasyland/fantasy-land#profunctor).\r\n *\r\n * Acts as a transducer if a transformer is given in profunctor position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Function\r\n * @sig (a -\u003E b) -\u003E (c -\u003E d) -\u003E (b -\u003E c) -\u003E (a -\u003E d)\r\n * @sig Profunctor p =\u003E (a -\u003E b) -\u003E (c -\u003E d) -\u003E p b c -\u003E p a d\r\n * @param {Function} f The preprocessor function, a -\u003E b\r\n * @param {Function} g The postprocessor function, c -\u003E d\r\n * @param {Profunctor} profunctor The profunctor instance to be promapped, e.g. b -\u003E c\r\n * @return {Profunctor} The new profunctor instance, e.g. a -\u003E d\r\n * @see R.transduce\r\n * @example\r\n *\r\n * const decodeChar = R.promap(s =\u003E s.charCodeAt(), String.fromCharCode, R.add(-8))\r\n * const decodeString = R.promap(R.split(\u0027\u0027), R.join(\u0027\u0027), R.map(decodeChar))\r\n * decodeString(\u0022ziuli\u0022) //=\u003E \u0022ramda\u0022\r\n *\r\n * @symb R.promap(f, g, h) = x =\u003E g(h(f(x)))\r\n * @symb R.promap(f, g, profunctor) = profunctor.promap(f, g)\r\n */\r\n\r\nvar promap = _curry3(\r\n _dispatchable([\u0022fantasy-land/promap\u0022, \u0022promap\u0022], _xpromap, _promap)\r\n);\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the specified object property is equal, in\r\n * [\u0060R.equals\u0060](#equals) terms, to the given value; \u0060false\u0060 otherwise.\r\n * You can test multiple properties with [\u0060R.whereEq\u0060](#whereEq),\r\n * and test nested path property with [\u0060R.pathEq\u0060](#pathEq).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig a -\u003E String -\u003E Object -\u003E Boolean\r\n * @param {*} val The value to compare the property with\r\n * @param {String} name the specified object property\u0027s key\r\n * @param {*} obj The object to check the property in\r\n * @return {Boolean} \u0060true\u0060 if the value equals the specified object property,\r\n * \u0060false\u0060 otherwise.\r\n * @see R.whereEq, R.pathEq, R.propSatisfies, R.equals\r\n * @example\r\n *\r\n * const abby = {name: \u0027Abby\u0027, age: 7, hair: \u0027blond\u0027};\r\n * const fred = {name: \u0027Fred\u0027, age: 12, hair: \u0027brown\u0027};\r\n * const rusty = {name: \u0027Rusty\u0027, age: 10, hair: \u0027brown\u0027};\r\n * const alois = {name: \u0027Alois\u0027, age: 15, disposition: \u0027surly\u0027};\r\n * const kids = [abby, fred, rusty, alois];\r\n * const hasBrownHair = R.propEq(\u0027brown\u0027, \u0027hair\u0027);\r\n * R.filter(hasBrownHair, kids); //=\u003E [fred, rusty]\r\n */\r\n\r\nvar propEq = _curry3(function propEq(val, name, obj) {\r\n return equals(val, prop(name, obj));\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the specified object property is of the given type;\r\n * \u0060false\u0060 otherwise.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category Type\r\n * @sig Type -\u003E String -\u003E Object -\u003E Boolean\r\n * @param {Function} type\r\n * @param {String} name\r\n * @param {*} obj\r\n * @return {Boolean}\r\n * @see R.is, R.propSatisfies\r\n * @example\r\n *\r\n * R.propIs(Number, \u0027x\u0027, {x: 1, y: 2}); //=\u003E true\r\n * R.propIs(Number, \u0027x\u0027, {x: \u0027foo\u0027}); //=\u003E false\r\n * R.propIs(Number, \u0027x\u0027, {}); //=\u003E false\r\n */\r\n\r\nvar propIs = _curry3(function propIs(type, name, obj) {\r\n return is(type, prop(name, obj));\r\n});\r\n\r\n/**\r\n * Return the specified property of the given non-null object if the property\r\n * is present and it\u0027s value is not \u0060null\u0060, \u0060undefined\u0060 or \u0060NaN\u0060.\r\n *\r\n * Otherwise the first argument is returned.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.6.0\r\n * @category Object\r\n * @sig a -\u003E String -\u003E Object -\u003E a\r\n * @param {*} val The default value.\r\n * @param {String} p The name of the property to return.\r\n * @param {Object} obj The object to query.\r\n * @return {*} The value of given property of the supplied object or the default value.\r\n * @example\r\n *\r\n * const alice = {\r\n * name: \u0027ALICE\u0027,\r\n * age: 101\r\n * };\r\n * const favorite = R.prop(\u0027favoriteLibrary\u0027);\r\n * const favoriteWithDefault = R.propOr(\u0027Ramda\u0027, \u0027favoriteLibrary\u0027);\r\n *\r\n * favorite(alice); //=\u003E undefined\r\n * favoriteWithDefault(alice); //=\u003E \u0027Ramda\u0027\r\n */\r\n\r\nvar propOr = _curry3(function propOr(val, p, obj) {\r\n return defaultTo(val, prop(p, obj));\r\n});\r\n\r\n/**\r\n * Returns \u0060true\u0060 if the specified object property satisfies the given\r\n * predicate; \u0060false\u0060 otherwise. You can test multiple properties with\r\n * [\u0060R.where\u0060](#where).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category Logic\r\n * @sig (a -\u003E Boolean) -\u003E String -\u003E {String: a} -\u003E Boolean\r\n * @param {Function} pred\r\n * @param {String} name\r\n * @param {*} obj\r\n * @return {Boolean}\r\n * @see R.where, R.propEq, R.propIs\r\n * @example\r\n *\r\n * R.propSatisfies(x =\u003E x \u003E 0, \u0027x\u0027, {x: 1, y: 2}); //=\u003E true\r\n */\r\n\r\nvar propSatisfies = _curry3(function propSatisfies(pred, name, obj) {\r\n return pred(prop(name, obj));\r\n});\r\n\r\n/**\r\n * Acts as multiple \u0060prop\u0060: array of keys in, array of values out. Preserves\r\n * order.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Object\r\n * @sig [k] -\u003E {k: v} -\u003E [v]\r\n * @param {Array} ps The property names to fetch\r\n * @param {Object} obj The object to query\r\n * @return {Array} The corresponding values or partially applied function.\r\n * @see R.prop, R.pluck, R.project\r\n * @example\r\n *\r\n * R.props([\u0027x\u0027, \u0027y\u0027], {x: 1, y: 2}); //=\u003E [1, 2]\r\n * R.props([\u0027c\u0027, \u0027a\u0027, \u0027b\u0027], {b: 2, a: 1}); //=\u003E [undefined, 1, 2]\r\n *\r\n * const fullName = R.compose(R.join(\u0027 \u0027), R.props([\u0027first\u0027, \u0027last\u0027]));\r\n * fullName({last: \u0027Bullet-Tooth\u0027, age: 33, first: \u0027Tony\u0027}); //=\u003E \u0027Tony Bullet-Tooth\u0027\r\n */\r\n\r\nvar props = _curry2(function props(ps, obj) {\r\n return ps.map(function (p) {\r\n return path([p], obj);\r\n });\r\n});\r\n\r\n/**\r\n * Returns a list of numbers from \u0060from\u0060 (inclusive) to \u0060to\u0060 (exclusive).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig Number -\u003E Number -\u003E [Number]\r\n * @param {Number} from The first number in the list.\r\n * @param {Number} to One more than the last number in the list.\r\n * @return {Array} The list of numbers in the set \u0060[a, b)\u0060.\r\n * @example\r\n *\r\n * R.range(1, 5); //=\u003E [1, 2, 3, 4]\r\n * R.range(50, 53); //=\u003E [50, 51, 52]\r\n */\r\n\r\nvar range = _curry2(function range(from, to) {\r\n if (!(_isNumber(from) \u0026\u0026 _isNumber(to))) {\r\n throw new TypeError(\u0022Both arguments to range must be numbers\u0022);\r\n }\r\n\r\n var result = [];\r\n var n = from;\r\n\r\n while (n \u003C to) {\r\n result.push(n);\r\n n \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Returns a single item by iterating through the list, successively calling\r\n * the iterator function and passing it an accumulator value and the current\r\n * value from the array, and then passing the result to the next call.\r\n *\r\n * Similar to [\u0060reduce\u0060](#reduce), except moves through the input list from the\r\n * right to the left.\r\n *\r\n * The iterator function receives two values: *(value, acc)*, while the arguments\u0027\r\n * order of \u0060reduce\u0060\u0027s iterator function is *(acc, value)*. \u0060reduceRight\u0060 may use [\u0060reduced\u0060](#reduced)\r\n * to short circuit the iteration.\r\n *\r\n * Note: \u0060R.reduceRight\u0060 does not skip deleted or unassigned indices (sparse\r\n * arrays), unlike the native \u0060Array.prototype.reduceRight\u0060 method. For more details\r\n * on this behavior, see:\r\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight#Description\r\n *\r\n * Be cautious of mutating and returning the accumulator. If you reuse it across\r\n * invocations, it will continue to accumulate onto the same value. The general\r\n * recommendation is to always return a new value. If you can\u0027t do so for\r\n * performance reasons, then be sure to reinitialize the accumulator on each\r\n * invocation.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig ((a, b) -\u003E b) -\u003E b -\u003E [a] -\u003E b\r\n * @param {Function} fn The iterator function. Receives two values, the current element from the array\r\n * and the accumulator.\r\n * @param {*} acc The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.reduce, R.addIndex, R.reduced\r\n * @example\r\n *\r\n * R.reduceRight(R.subtract, 0, [1, 2, 3, 4]) // =\u003E (1 - (2 - (3 - (4 - 0)))) = -2\r\n * // - -2\r\n * // / \\ / \\\r\n * // 1 - 1 3\r\n * // / \\ / \\\r\n * // 2 - ==\u003E 2 -1\r\n * // / \\ / \\\r\n * // 3 - 3 4\r\n * // / \\ / \\\r\n * // 4 0 4 0\r\n *\r\n * @symb R.reduceRight(f, a, [b, c, d]) = f(b, f(c, f(d, a)))\r\n */\r\n\r\nvar reduceRight = _curry3(function reduceRight(fn, acc, list) {\r\n var idx = list.length - 1;\r\n\r\n while (idx \u003E= 0) {\r\n acc = fn(list[idx], acc);\r\n\r\n if (acc \u0026\u0026 acc[\u0022@@transducer/reduced\u0022]) {\r\n acc = acc[\u0022@@transducer/value\u0022];\r\n break;\r\n }\r\n\r\n idx -= 1;\r\n }\r\n\r\n return acc;\r\n});\r\n\r\n/**\r\n * Like [\u0060reduce\u0060](#reduce), \u0060reduceWhile\u0060 returns a single item by iterating\r\n * through the list, successively calling the iterator function. \u0060reduceWhile\u0060\r\n * also takes a predicate that is evaluated before each step. If the predicate\r\n * returns \u0060false\u0060, it \u0022short-circuits\u0022 the iteration and returns the current\r\n * value of the accumulator. \u0060reduceWhile\u0060 may alternatively be short-circuited\r\n * via [\u0060reduced\u0060](#reduced).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.22.0\r\n * @category List\r\n * @sig ((a, b) -\u003E Boolean) -\u003E ((a, b) -\u003E a) -\u003E a -\u003E [b] -\u003E a\r\n * @param {Function} pred The predicate. It is passed the accumulator and the\r\n * current element.\r\n * @param {Function} fn The iterator function. Receives two values, the\r\n * accumulator and the current element.\r\n * @param {*} a The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.reduce, R.reduced\r\n * @example\r\n *\r\n * const isOdd = (acc, x) =\u003E x % 2 !== 0;\r\n * const xs = [1, 3, 5, 60, 777, 800];\r\n * R.reduceWhile(isOdd, R.add, 0, xs); //=\u003E 9\r\n *\r\n * const ys = [2, 4, 6]\r\n * R.reduceWhile(isOdd, R.add, 111, ys); //=\u003E 111\r\n */\r\n\r\nvar reduceWhile = _curryN(4, [], function _reduceWhile(pred, fn, a, list) {\r\n var xf = _xwrap(function (acc, x) {\r\n return pred(acc, x) ? fn(acc, x) : _reduced(acc);\r\n });\r\n\r\n return _xReduce(xf, a, list);\r\n});\r\n\r\n/**\r\n * Returns a value wrapped to indicate that it is the final value of the reduce\r\n * and transduce functions. The returned value should be considered a black\r\n * box: the internal structure is not guaranteed to be stable.\r\n *\r\n * This optimization is available to the below functions:\r\n * - [\u0060reduce\u0060](#reduce)\r\n * - [\u0060reduceWhile\u0060](#reduceWhile)\r\n * - [\u0060reduceBy\u0060](#reduceBy)\r\n * - [\u0060reduceRight\u0060](#reduceRight)\r\n * - [\u0060transduce\u0060](#transduce)\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.15.0\r\n * @category List\r\n * @sig a -\u003E *\r\n * @param {*} x The final value of the reduce.\r\n * @return {*} The wrapped value.\r\n * @see R.reduce, R.reduceWhile, R.reduceBy, R.reduceRight, R.transduce\r\n * @example\r\n *\r\n * R.reduce(\r\n * (acc, item) =\u003E item \u003E 3 ? R.reduced(acc) : acc.concat(item),\r\n * [],\r\n * [1, 2, 3, 4, 5]) // [1, 2, 3]\r\n */\r\n\r\nvar reduced = _curry1(_reduced);\r\n\r\n/**\r\n * Calls an input function \u0060n\u0060 times, returning an array containing the results\r\n * of those function calls.\r\n *\r\n * \u0060fn\u0060 is passed one argument: The current value of \u0060n\u0060, which begins at \u00600\u0060\r\n * and is gradually incremented to \u0060n - 1\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.3\r\n * @category List\r\n * @sig (Number -\u003E a) -\u003E Number -\u003E [a]\r\n * @param {Function} fn The function to invoke. Passed one argument, the current value of \u0060n\u0060.\r\n * @param {Number} n A value between \u00600\u0060 and \u0060n - 1\u0060. Increments after each function call.\r\n * @return {Array} An array containing the return values of all calls to \u0060fn\u0060.\r\n * @see R.repeat\r\n * @example\r\n *\r\n * R.times(R.identity, 5); //=\u003E [0, 1, 2, 3, 4]\r\n * @symb R.times(f, 0) = []\r\n * @symb R.times(f, 1) = [f(0)]\r\n * @symb R.times(f, 2) = [f(0), f(1)]\r\n */\r\n\r\nvar times = _curry2(function times(fn, n) {\r\n var len = Number(n);\r\n var idx = 0;\r\n var list;\r\n\r\n if (len \u003C 0 || isNaN(len)) {\r\n throw new RangeError(\u0022n must be a non-negative number\u0022);\r\n }\r\n\r\n list = [];\r\n\r\n while (idx \u003C len) {\r\n list.push(fn(idx));\r\n idx \u002B= 1;\r\n }\r\n\r\n return list;\r\n});\r\n\r\n/**\r\n * Returns a fixed list of size \u0060n\u0060 containing a specified identical value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category List\r\n * @sig a -\u003E n -\u003E [a]\r\n * @param {*} value The value to repeat.\r\n * @param {Number} n The desired size of the output list.\r\n * @return {Array} A new array containing \u0060n\u0060 \u0060value\u0060s.\r\n * @see R.times\r\n * @example\r\n *\r\n * R.repeat(\u0027hi\u0027, 5); //=\u003E [\u0027hi\u0027, \u0027hi\u0027, \u0027hi\u0027, \u0027hi\u0027, \u0027hi\u0027]\r\n *\r\n * const obj = {};\r\n * const repeatedObjs = R.repeat(obj, 5); //=\u003E [{}, {}, {}, {}, {}]\r\n * repeatedObjs[0] === repeatedObjs[1]; //=\u003E true\r\n * @symb R.repeat(a, 0) = []\r\n * @symb R.repeat(a, 1) = [a]\r\n * @symb R.repeat(a, 2) = [a, a]\r\n */\r\n\r\nvar repeat = _curry2(function repeat(value, n) {\r\n return times(always(value), n);\r\n});\r\n\r\n/**\r\n * Replace a substring or regex match in a string with a replacement.\r\n *\r\n * The first two parameters correspond to the parameters of the\r\n * \u0060String.prototype.replace()\u0060 function, so the second parameter can also be a\r\n * function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.7.0\r\n * @category String\r\n * @sig RegExp|String -\u003E String -\u003E String -\u003E String\r\n * @param {RegExp|String} pattern A regular expression or a substring to match.\r\n * @param {String} replacement The string to replace the matches with.\r\n * @param {String} str The String to do the search and replacement in.\r\n * @return {String} The result.\r\n * @example\r\n *\r\n * R.replace(\u0027foo\u0027, \u0027bar\u0027, \u0027foo foo foo\u0027); //=\u003E \u0027bar foo foo\u0027\r\n * R.replace(/foo/, \u0027bar\u0027, \u0027foo foo foo\u0027); //=\u003E \u0027bar foo foo\u0027\r\n *\r\n * // Use the \u0022g\u0022 (global) flag to replace all occurrences:\r\n * R.replace(/foo/g, \u0027bar\u0027, \u0027foo foo foo\u0027); //=\u003E \u0027bar bar bar\u0027\r\n */\r\n\r\nvar replace = _curry3(function replace(regex, replacement, str) {\r\n return str.replace(regex, replacement);\r\n});\r\n\r\nvar tInit$1 = \u0022@@transducer/init\u0022;\r\nvar tStep$1 = \u0022@@transducer/step\u0022;\r\n\r\nfunction XScan(reducer, acc, xf) {\r\n this.xf = xf;\r\n this.f = reducer;\r\n this.acc = acc;\r\n}\r\n\r\nXScan.prototype[tInit$1] = function () {\r\n return this.xf[tStep$1](this.xf[tInit$1](), this.acc);\r\n};\r\n\r\nXScan.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXScan.prototype[tStep$1] = function (result, input) {\r\n if (result[\u0022@@transducer/reduced\u0022]) {\r\n return result;\r\n }\r\n\r\n this.acc = this.f(this.acc, input);\r\n return this.xf[tStep$1](result, this.acc);\r\n};\r\n\r\nvar _xscan = _curry3(function _xscan(reducer, acc, xf) {\r\n return new XScan(reducer, acc, xf);\r\n});\r\n\r\n/**\r\n * Scan is similar to [\u0060reduce\u0060](#reduce), but returns a list of successively\r\n * reduced values from the left.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category List\r\n * @sig ((a, b) -\u003E a) -\u003E a -\u003E [b] -\u003E [a]\r\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\r\n * current element from the array\r\n * @param {*} acc The accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {Array} A list of all intermediately reduced values.\r\n * @see R.reduce, R.mapAccum\r\n * @example\r\n *\r\n * const numbers = [1, 2, 3, 4];\r\n * const factorials = R.scan(R.multiply, 1, numbers); //=\u003E [1, 1, 2, 6, 24]\r\n * @symb R.scan(f, a, [b, c]) = [a, f(a, b), f(f(a, b), c)]\r\n */\r\n\r\nvar scan = _curry3(\r\n _dispatchable([], _xscan, function scan(fn, acc, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n var result = [acc];\r\n\r\n while (idx \u003C len) {\r\n acc = fn(acc, list[idx]);\r\n result[idx \u002B 1] = acc;\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n })\r\n);\r\n\r\n/**\r\n * Transforms a [Traversable](https://github.com/fantasyland/fantasy-land#traversable)\r\n * of [Applicative](https://github.com/fantasyland/fantasy-land#applicative) into an\r\n * Applicative of Traversable.\r\n *\r\n * Dispatches to the \u0060\u0022fantasy-land/traverse\u0022\u0060 or the \u0060traverse\u0060 method of the second argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig fantasy-land/of :: TypeRep f =\u003E f ~\u003E a -\u003E f a\r\n * @sig (Applicative f, Traversable t) =\u003E TypeRep f -\u003E t (f a) -\u003E f (t a)\r\n * @sig (Applicative f, Traversable t) =\u003E (a -\u003E f a) -\u003E t (f a) -\u003E f (t a)\r\n * @param {Object|Function} TypeRepresentative with an \u0060of\u0060 or \u0060fantasy-land/of\u0060 method\r\n * @param {*} traversable\r\n * @return {*}\r\n * @see R.traverse\r\n * @example\r\n *\r\n * R.sequence(Maybe.of, [Just(1), Just(2), Just(3)]); //=\u003E Just([1, 2, 3])\r\n * R.sequence(Maybe.of, [Just(1), Just(2), Nothing()]); //=\u003E Nothing()\r\n *\r\n * R.sequence(R.of(Array), Just([1, 2, 3])); //=\u003E [Just(1), Just(2), Just(3)]\r\n * R.sequence(R.of(Array), Nothing()); //=\u003E [Nothing()]\r\n */\r\n\r\nvar sequence = _curry2(function sequence(F, traversable) {\r\n var of =\r\n typeof F[\u0022fantasy-land/of\u0022] === \u0022function\u0022\r\n ? F[\u0022fantasy-land/of\u0022]\r\n : typeof F.of === \u0022function\u0022\r\n ? F.of\r\n : F;\r\n var TypeRep = {\r\n \u0022fantasy-land/of\u0022: of,\r\n };\r\n return typeof traversable[\u0022fantasy-land/traverse\u0022] === \u0022function\u0022\r\n ? traversable[\u0022fantasy-land/traverse\u0022](TypeRep, _identity)\r\n : typeof traversable.traverse === \u0022function\u0022\r\n ? traversable.traverse(TypeRep, _identity)\r\n : reduceRight(\r\n function (x, acc) {\r\n return ap(map(prepend, x), acc);\r\n },\r\n of([]),\r\n traversable\r\n );\r\n});\r\n\r\n/**\r\n * Returns the result of \u0022setting\u0022 the portion of the given data structure\r\n * focused by the given lens to the given value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig Lens s a -\u003E a -\u003E s -\u003E s\r\n * @param {Lens} lens\r\n * @param {*} v\r\n * @param {*} x\r\n * @return {*}\r\n * @see R.view, R.over, R.lens, R.lensIndex, R.lensProp, R.lensPath\r\n * @example\r\n *\r\n * const xLens = R.lensProp(\u0027x\u0027);\r\n *\r\n * R.set(xLens, 4, {x: 1, y: 2}); //=\u003E {x: 4, y: 2}\r\n * R.set(xLens, 8, {x: 1, y: 2}); //=\u003E {x: 8, y: 2}\r\n */\r\n\r\nvar set = _curry3(function set(lens, v, x) {\r\n return over(lens, always(v), x);\r\n});\r\n\r\n/**\r\n * Returns a copy of the list, sorted according to the comparator function,\r\n * which should accept two values at a time and return a negative number if the\r\n * first value is smaller, a positive number if it\u0027s larger, and zero if they\r\n * are equal. Please note that this is a **copy** of the list. It does not\r\n * modify the original.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig ((a, a) -\u003E Number) -\u003E [a] -\u003E [a]\r\n * @param {Function} comparator A sorting function :: a -\u003E b -\u003E Int\r\n * @param {Array} list The list to sort\r\n * @return {Array} a new array with its elements sorted by the comparator function.\r\n * @see R.ascend, R.descend\r\n * @example\r\n *\r\n * const diff = function(a, b) { return a - b; };\r\n * R.sort(diff, [4,2,7,5]); //=\u003E [2, 4, 5, 7]\r\n */\r\n\r\nvar sort = _curry2(function sort(comparator, list) {\r\n return Array.prototype.slice.call(list, 0).sort(comparator);\r\n});\r\n\r\n/**\r\n * Sorts the list according to the supplied function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig Ord b =\u003E (a -\u003E b) -\u003E [a] -\u003E [a]\r\n * @param {Function} fn\r\n * @param {Array} list The list to sort.\r\n * @return {Array} A new list sorted by the keys generated by \u0060fn\u0060.\r\n * @example\r\n *\r\n * const sortByFirstItem = R.sortBy(R.prop(0));\r\n * const pairs = [[-1, 1], [-2, 2], [-3, 3]];\r\n * sortByFirstItem(pairs); //=\u003E [[-3, 3], [-2, 2], [-1, 1]]\r\n *\r\n * const sortByNameCaseInsensitive = R.sortBy(R.compose(R.toLower, R.prop(\u0027name\u0027)));\r\n * const alice = {\r\n * name: \u0027ALICE\u0027,\r\n * age: 101\r\n * };\r\n * const bob = {\r\n * name: \u0027Bob\u0027,\r\n * age: -10\r\n * };\r\n * const clara = {\r\n * name: \u0027clara\u0027,\r\n * age: 314.159\r\n * };\r\n * const people = [clara, bob, alice];\r\n * sortByNameCaseInsensitive(people); //=\u003E [alice, bob, clara]\r\n */\r\n\r\nvar sortBy = _curry2(function sortBy(fn, list) {\r\n return Array.prototype.slice.call(list, 0).sort(function (a, b) {\r\n var aa = fn(a);\r\n var bb = fn(b);\r\n return aa \u003C bb ? -1 : aa \u003E bb ? 1 : 0;\r\n });\r\n});\r\n\r\n/**\r\n * Sorts a list according to a list of comparators.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.23.0\r\n * @category Relation\r\n * @sig [(a, a) -\u003E Number] -\u003E [a] -\u003E [a]\r\n * @param {Array} functions A list of comparator functions.\r\n * @param {Array} list The list to sort.\r\n * @return {Array} A new list sorted according to the comarator functions.\r\n * @see R.ascend, R.descend\r\n * @example\r\n *\r\n * const alice = {\r\n * name: \u0027alice\u0027,\r\n * age: 40\r\n * };\r\n * const bob = {\r\n * name: \u0027bob\u0027,\r\n * age: 30\r\n * };\r\n * const clara = {\r\n * name: \u0027clara\u0027,\r\n * age: 40\r\n * };\r\n * const people = [clara, bob, alice];\r\n * const ageNameSort = R.sortWith([\r\n * R.descend(R.prop(\u0027age\u0027)),\r\n * R.ascend(R.prop(\u0027name\u0027))\r\n * ]);\r\n * ageNameSort(people); //=\u003E [alice, clara, bob]\r\n */\r\n\r\nvar sortWith = _curry2(function sortWith(fns, list) {\r\n return Array.prototype.slice.call(list, 0).sort(function (a, b) {\r\n var result = 0;\r\n var i = 0;\r\n\r\n while (result === 0 \u0026\u0026 i \u003C fns.length) {\r\n result = fns[i](a, b);\r\n i \u002B= 1;\r\n }\r\n\r\n return result;\r\n });\r\n});\r\n\r\n/**\r\n * Splits a string into an array of strings based on the given\r\n * separator.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category String\r\n * @sig (String | RegExp) -\u003E String -\u003E [String]\r\n * @param {String|RegExp} sep The pattern.\r\n * @param {String} str The string to separate into an array.\r\n * @return {Array} The array of strings from \u0060str\u0060 separated by \u0060sep\u0060.\r\n * @see R.join\r\n * @example\r\n *\r\n * const pathComponents = R.split(\u0027/\u0027);\r\n * R.tail(pathComponents(\u0027/usr/local/bin/node\u0027)); //=\u003E [\u0027usr\u0027, \u0027local\u0027, \u0027bin\u0027, \u0027node\u0027]\r\n *\r\n * R.split(\u0027.\u0027, \u0027a.b.c.xyz.d\u0027); //=\u003E [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027xyz\u0027, \u0027d\u0027]\r\n */\r\n\r\nvar split = invoker(1, \u0022split\u0022);\r\n\r\n/**\r\n * Splits a given list or string at a given index.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [[a], [a]]\r\n * @sig Number -\u003E String -\u003E [String, String]\r\n * @param {Number} index The index where the array/string is split.\r\n * @param {Array|String} array The array/string to be split.\r\n * @return {Array}\r\n * @example\r\n *\r\n * R.splitAt(1, [1, 2, 3]); //=\u003E [[1], [2, 3]]\r\n * R.splitAt(5, \u0027hello world\u0027); //=\u003E [\u0027hello\u0027, \u0027 world\u0027]\r\n * R.splitAt(-1, \u0027foobar\u0027); //=\u003E [\u0027fooba\u0027, \u0027r\u0027]\r\n */\r\n\r\nvar splitAt = _curry2(function splitAt(index, array) {\r\n return [slice(0, index, array), slice(index, length(array), array)];\r\n});\r\n\r\n/**\r\n * Splits a collection into slices of the specified length.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig Number -\u003E [a] -\u003E [[a]]\r\n * @sig Number -\u003E String -\u003E [String]\r\n * @param {Number} n\r\n * @param {Array} list\r\n * @return {Array}\r\n * @example\r\n *\r\n * R.splitEvery(3, [1, 2, 3, 4, 5, 6, 7]); //=\u003E [[1, 2, 3], [4, 5, 6], [7]]\r\n * R.splitEvery(3, \u0027foobarbaz\u0027); //=\u003E [\u0027foo\u0027, \u0027bar\u0027, \u0027baz\u0027]\r\n */\r\n\r\nvar splitEvery = _curry2(function splitEvery(n, list) {\r\n if (n \u003C= 0) {\r\n throw new Error(\u0022First argument to splitEvery must be a positive integer\u0022);\r\n }\r\n\r\n var result = [];\r\n var idx = 0;\r\n\r\n while (idx \u003C list.length) {\r\n result.push(slice(idx, (idx \u002B= n), list));\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Takes a list and a predicate and returns a pair of lists with the following properties:\r\n *\r\n * - the result of concatenating the two output lists is equivalent to the input list;\r\n * - none of the elements of the first output list satisfies the predicate; and\r\n * - if the second output list is non-empty, its first element satisfies the predicate.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [[a], [a]]\r\n * @param {Function} pred The predicate that determines where the array is split.\r\n * @param {Array} list The array to be split.\r\n * @return {Array}\r\n * @example\r\n *\r\n * R.splitWhen(R.equals(2), [1, 2, 3, 1, 2, 3]); //=\u003E [[1], [2, 3, 1, 2, 3]]\r\n */\r\n\r\nvar splitWhen = _curry2(function splitWhen(pred, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n var prefix = [];\r\n\r\n while (idx \u003C len \u0026\u0026 !pred(list[idx])) {\r\n prefix.push(list[idx]);\r\n idx \u002B= 1;\r\n }\r\n\r\n return [prefix, Array.prototype.slice.call(list, idx)];\r\n});\r\n\r\n/**\r\n * Splits an array into slices on every occurrence of a value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.1\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [[a]]\r\n * @param {Function} pred The predicate that determines where the array is split.\r\n * @param {Array} list The array to be split.\r\n * @return {Array}\r\n * @example\r\n *\r\n * R.splitWhenever(R.equals(2), [1, 2, 3, 2, 4, 5, 2, 6, 7]); //=\u003E [[1], [3], [4, 5], [6, 7]]\r\n */\r\n\r\nvar splitWhenever = _curryN(2, [], function splitWhenever(pred, list) {\r\n var acc = [];\r\n var curr = [];\r\n\r\n for (var i = 0; i \u003C list.length; i = i \u002B 1) {\r\n if (!pred(list[i])) {\r\n curr.push(list[i]);\r\n }\r\n\r\n if (\r\n ((i \u003C list.length - 1 \u0026\u0026 pred(list[i \u002B 1])) || i === list.length - 1) \u0026\u0026\r\n curr.length \u003E 0\r\n ) {\r\n acc.push(curr);\r\n curr = [];\r\n }\r\n }\r\n\r\n return acc;\r\n});\r\n\r\n/**\r\n * Checks if a list starts with the provided sublist.\r\n *\r\n * Similarly, checks if a string starts with the provided substring.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.24.0\r\n * @category List\r\n * @sig [a] -\u003E [a] -\u003E Boolean\r\n * @sig String -\u003E String -\u003E Boolean\r\n * @param {*} prefix\r\n * @param {*} list\r\n * @return {Boolean}\r\n * @see R.endsWith\r\n * @example\r\n *\r\n * R.startsWith(\u0027a\u0027, \u0027abc\u0027) //=\u003E true\r\n * R.startsWith(\u0027b\u0027, \u0027abc\u0027) //=\u003E false\r\n * R.startsWith([\u0027a\u0027], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]) //=\u003E true\r\n * R.startsWith([\u0027b\u0027], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]) //=\u003E false\r\n */\r\n\r\nvar startsWith = _curry2(function (prefix, list) {\r\n return equals(take(prefix.length, list), prefix);\r\n});\r\n\r\n/**\r\n * Subtracts its second argument from its first argument.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Math\r\n * @sig Number -\u003E Number -\u003E Number\r\n * @param {Number} a The first value.\r\n * @param {Number} b The second value.\r\n * @return {Number} The result of \u0060a - b\u0060.\r\n * @see R.add\r\n * @example\r\n *\r\n * R.subtract(10, 8); //=\u003E 2\r\n *\r\n * const minus5 = R.subtract(R.__, 5);\r\n * minus5(17); //=\u003E 12\r\n *\r\n * const complementaryAngle = R.subtract(90);\r\n * complementaryAngle(30); //=\u003E 60\r\n * complementaryAngle(72); //=\u003E 18\r\n */\r\n\r\nvar subtract = _curry2(function subtract(a, b) {\r\n return Number(a) - Number(b);\r\n});\r\n\r\nvar swapObject = function swapObject(indexA, indexB, o) {\r\n var copy = clone(o);\r\n var properties = Object.getOwnPropertyNames(copy);\r\n\r\n if (properties.includes(indexA) \u0026\u0026 properties.includes(indexB)) {\r\n var tmp = copy[indexA];\r\n copy[indexA] = copy[indexB];\r\n copy[indexB] = tmp;\r\n }\r\n\r\n return copy;\r\n};\r\n\r\nvar swapList = function swapList(indexA, indexB, list) {\r\n var length = list.length;\r\n var result = list.slice();\r\n var positiveIndexA = indexA \u003C 0 ? length \u002B indexA : indexA;\r\n var positiveIndexB = indexB \u003C 0 ? length \u002B indexB : indexB;\r\n var positiveMin = Math.min(positiveIndexA, positiveIndexB);\r\n var positiveMax = Math.max(positiveIndexA, positiveIndexB);\r\n\r\n if (positiveIndexA \u003C 0 || positiveIndexA \u003E length) {\r\n return result;\r\n }\r\n\r\n if (positiveIndexB \u003C 0 || positiveIndexB \u003E length) {\r\n return result;\r\n }\r\n\r\n if (positiveIndexA === positiveIndexB) {\r\n return result;\r\n }\r\n\r\n result = []\r\n .concat(result.slice(0, positiveMin))\r\n .concat(result[positiveMax])\r\n .concat(result.slice(positiveMin \u002B 1, positiveMax))\r\n .concat(result[positiveMin])\r\n .concat(result.slice(positiveMax \u002B 1, length));\r\n return result;\r\n};\r\n\r\nvar swapString = function swapString(indexA, indexB, s) {\r\n var result = swapList(indexA, indexB, s);\r\n return _isArray(result) ? result.join(\u0022\u0022) : result;\r\n};\r\n/**\r\n * Swap an item, at index \u0060indexA\u0060 with another item, at index \u0060indexB\u0060, in an object or a list of elements.\r\n * A new result will be created containing the new elements order.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.29.0\r\n * @category List\r\n * @sig Number -\u003E Number -\u003E [a] -\u003E [a]\r\n * @param {Number|string|Object} indexA The first index\r\n * @param {Number|string|Object} indexB The second index\r\n * @param {Array|Object} o Either the object or list which will serve to realise the swap\r\n * @return {Array|Object} The new object or list reordered\r\n * @example\r\n *\r\n * R.swap(0, 2, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]); //=\u003E [\u0027c\u0027, \u0027b\u0027, \u0027a\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]\r\n * R.swap(-1, 0, [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027f\u0027]); //=\u003E [\u0027f\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027, \u0027e\u0027, \u0027a\u0027] list rotation\r\n * R.swap(\u0027a\u0027, \u0027b\u0027, {a: 1, b: 2}); //=\u003E {a: 2, b: 2}\r\n * R.swap(0, 2, \u0027foo\u0027); //=\u003E \u0027oof\u0027\r\n */\r\n\r\nvar swap = _curry3(function (indexA, indexB, o) {\r\n if (_isArray(o)) {\r\n return swapList(indexA, indexB, o);\r\n } else if (_isString(o)) {\r\n return swapString(indexA, indexB, o);\r\n } else {\r\n return swapObject(indexA, indexB, o);\r\n }\r\n});\r\n\r\n/**\r\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\r\n * second list, but not both.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Relation\r\n * @sig [*] -\u003E [*] -\u003E [*]\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The elements in \u0060list1\u0060 or \u0060list2\u0060, but not both.\r\n * @see R.symmetricDifferenceWith, R.difference, R.differenceWith\r\n * @example\r\n *\r\n * R.symmetricDifference([1,2,3,4], [7,6,5,4,3]); //=\u003E [1,2,7,6,5]\r\n * R.symmetricDifference([7,6,5,4,3], [1,2,3,4]); //=\u003E [7,6,5,1,2]\r\n */\r\n\r\nvar symmetricDifference = _curry2(function symmetricDifference(list1, list2) {\r\n return concat(difference(list1, list2), difference(list2, list1));\r\n});\r\n\r\n/**\r\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\r\n * second list, but not both. Duplication is determined according to the value\r\n * returned by applying the supplied predicate to two list elements.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category Relation\r\n * @sig ((a, a) -\u003E Boolean) -\u003E [a] -\u003E [a] -\u003E [a]\r\n * @param {Function} pred A predicate used to test whether two items are equal.\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The elements in \u0060list1\u0060 or \u0060list2\u0060, but not both.\r\n * @see R.symmetricDifference, R.difference, R.differenceWith\r\n * @example\r\n *\r\n * const eqA = R.eqBy(R.prop(\u0027a\u0027));\r\n * const l1 = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];\r\n * const l2 = [{a: 3}, {a: 4}, {a: 5}, {a: 6}];\r\n * R.symmetricDifferenceWith(eqA, l1, l2); //=\u003E [{a: 1}, {a: 2}, {a: 5}, {a: 6}]\r\n */\r\n\r\nvar symmetricDifferenceWith = _curry3(function symmetricDifferenceWith(\r\n pred,\r\n list1,\r\n list2\r\n) {\r\n return concat(\r\n differenceWith(pred, list1, list2),\r\n differenceWith(pred, list2, list1)\r\n );\r\n});\r\n\r\n/**\r\n * Returns a new list containing the last \u0060n\u0060 elements of a given list, passing\r\n * each value to the supplied predicate function, and terminating when the\r\n * predicate function returns \u0060false\u0060. Excludes the element that caused the\r\n * predicate function to fail. The predicate function is passed one argument:\r\n * *(value)*.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @sig (a -\u003E Boolean) -\u003E String -\u003E String\r\n * @param {Function} fn The function called per iteration.\r\n * @param {Array} xs The collection to iterate over.\r\n * @return {Array} A new array.\r\n * @see R.dropLastWhile, R.addIndex\r\n * @example\r\n *\r\n * const isNotOne = x =\u003E x !== 1;\r\n *\r\n * R.takeLastWhile(isNotOne, [1, 2, 3, 4]); //=\u003E [2, 3, 4]\r\n *\r\n * R.takeLastWhile(x =\u003E x !== \u0027R\u0027 , \u0027Ramda\u0027); //=\u003E \u0027amda\u0027\r\n */\r\n\r\nvar takeLastWhile = _curry2(function takeLastWhile(fn, xs) {\r\n var idx = xs.length - 1;\r\n\r\n while (idx \u003E= 0 \u0026\u0026 fn(xs[idx])) {\r\n idx -= 1;\r\n }\r\n\r\n return slice(idx \u002B 1, Infinity, xs);\r\n});\r\n\r\nfunction XTakeWhile(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXTakeWhile.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXTakeWhile.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXTakeWhile.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n return this.f(input)\r\n ? this.xf[\u0022@@transducer/step\u0022](result, input)\r\n : _reduced(result);\r\n};\r\n\r\nfunction _xtakeWhile(f) {\r\n return function (xf) {\r\n return new XTakeWhile(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list containing the first \u0060n\u0060 elements of a given list,\r\n * passing each value to the supplied predicate function, and terminating when\r\n * the predicate function returns \u0060false\u0060. Excludes the element that caused the\r\n * predicate function to fail. The predicate function is passed one argument:\r\n * *(value)*.\r\n *\r\n * Dispatches to the \u0060takeWhile\u0060 method of the second argument, if present.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig (a -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @sig (a -\u003E Boolean) -\u003E String -\u003E String\r\n * @param {Function} fn The function called per iteration.\r\n * @param {Array} xs The collection to iterate over.\r\n * @return {Array} A new array.\r\n * @see R.dropWhile, R.transduce, R.addIndex\r\n * @example\r\n *\r\n * const isNotFour = x =\u003E x !== 4;\r\n *\r\n * R.takeWhile(isNotFour, [1, 2, 3, 4, 3, 2, 1]); //=\u003E [1, 2, 3]\r\n *\r\n * R.takeWhile(x =\u003E x !== \u0027d\u0027 , \u0027Ramda\u0027); //=\u003E \u0027Ram\u0027\r\n */\r\n\r\nvar takeWhile = _curry2(\r\n _dispatchable([\u0022takeWhile\u0022], _xtakeWhile, function takeWhile(fn, xs) {\r\n var idx = 0;\r\n var len = xs.length;\r\n\r\n while (idx \u003C len \u0026\u0026 fn(xs[idx])) {\r\n idx \u002B= 1;\r\n }\r\n\r\n return slice(0, idx, xs);\r\n })\r\n);\r\n\r\nfunction XTap(f, xf) {\r\n this.xf = xf;\r\n this.f = f;\r\n}\r\n\r\nXTap.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXTap.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXTap.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n this.f(input);\r\n return this.xf[\u0022@@transducer/step\u0022](result, input);\r\n};\r\n\r\nfunction _xtap(f) {\r\n return function (xf) {\r\n return new XTap(f, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Runs the given function with the supplied object, then returns the object.\r\n *\r\n * Acts as a transducer if a transformer is given as second parameter.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Function\r\n * @sig (a -\u003E *) -\u003E a -\u003E a\r\n * @param {Function} fn The function to call with \u0060x\u0060. The return value of \u0060fn\u0060 will be thrown away.\r\n * @param {*} x\r\n * @return {*} \u0060x\u0060.\r\n * @example\r\n *\r\n * const sayX = x =\u003E console.log(\u0027x is \u0027 \u002B x);\r\n * R.tap(sayX, 100); //=\u003E 100\r\n * // logs \u0027x is 100\u0027\r\n * @symb R.tap(f, a) = (f(a), a)\r\n */\r\n\r\nvar tap = _curry2(\r\n _dispatchable([], _xtap, function tap(fn, x) {\r\n fn(x);\r\n return x;\r\n })\r\n);\r\n\r\nfunction _isRegExp(x) {\r\n return Object.prototype.toString.call(x) === \u0022[object RegExp]\u0022;\r\n}\r\n\r\n/**\r\n * Determines whether a given string matches a given regular expression.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category String\r\n * @sig RegExp -\u003E String -\u003E Boolean\r\n * @param {RegExp} pattern\r\n * @param {String} str\r\n * @return {Boolean}\r\n * @see R.match\r\n * @example\r\n *\r\n * R.test(/^x/, \u0027xyz\u0027); //=\u003E true\r\n * R.test(/^y/, \u0027xyz\u0027); //=\u003E false\r\n */\r\n\r\nvar test = _curry2(function test(pattern, str) {\r\n if (!_isRegExp(pattern)) {\r\n throw new TypeError(\r\n \u0022\u2018test\u2019 requires a value of type RegExp as its first argument; received \u0022 \u002B\r\n toString$1(pattern)\r\n );\r\n }\r\n\r\n return _cloneRegExp(pattern).test(str);\r\n});\r\n\r\n/**\r\n * Returns the result of applying the onSuccess function to the value inside\r\n * a successfully resolved promise. This is useful for working with promises\r\n * inside function compositions.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.27.1\r\n * @category Function\r\n * @sig (a -\u003E b) -\u003E (Promise e a) -\u003E (Promise e b)\r\n * @sig (a -\u003E (Promise e b)) -\u003E (Promise e a) -\u003E (Promise e b)\r\n * @param {Function} onSuccess The function to apply. Can return a value or a promise of a value.\r\n * @param {Promise} p\r\n * @return {Promise} The result of calling \u0060p.then(onSuccess)\u0060\r\n * @see R.otherwise\r\n * @example\r\n *\r\n * const makeQuery = email =\u003E ({ query: { email }});\r\n * const fetchMember = request =\u003E\r\n * Promise.resolve({ firstName: \u0027Bob\u0027, lastName: \u0027Loblaw\u0027, id: 42 });\r\n *\r\n * //getMemberName :: String -\u003E Promise ({ firstName, lastName })\r\n * const getMemberName = R.pipe(\r\n * makeQuery,\r\n * fetchMember,\r\n * R.andThen(R.pick([\u0027firstName\u0027, \u0027lastName\u0027]))\r\n * );\r\n *\r\n * getMemberName(\u0027bob@gmail.com\u0027).then(console.log);\r\n */\r\n\r\nvar andThen = _curry2(function andThen(f, p) {\r\n _assertPromise(\u0022andThen\u0022, p);\r\n\r\n return p.then(f);\r\n});\r\n\r\n/**\r\n * The lower case version of a string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category String\r\n * @sig String -\u003E String\r\n * @param {String} str The string to lower case.\r\n * @return {String} The lower case version of \u0060str\u0060.\r\n * @see R.toUpper\r\n * @example\r\n *\r\n * R.toLower(\u0027XYZ\u0027); //=\u003E \u0027xyz\u0027\r\n */\r\n\r\nvar toLower = invoker(0, \u0022toLowerCase\u0022);\r\n\r\n/**\r\n * Converts an object into an array of key, value arrays. Only the object\u0027s\r\n * own properties are used.\r\n * Note that the order of the output array is not guaranteed to be consistent\r\n * across different JS platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.4.0\r\n * @category Object\r\n * @sig {String: *} -\u003E [[String,*]]\r\n * @param {Object} obj The object to extract from\r\n * @return {Array} An array of key, value arrays from the object\u0027s own properties.\r\n * @see R.fromPairs, R.keys, R.values\r\n * @example\r\n *\r\n * R.toPairs({a: 1, b: 2, c: 3}); //=\u003E [[\u0027a\u0027, 1], [\u0027b\u0027, 2], [\u0027c\u0027, 3]]\r\n */\r\n\r\nvar toPairs = _curry1(function toPairs(obj) {\r\n var pairs = [];\r\n\r\n for (var prop in obj) {\r\n if (_has(prop, obj)) {\r\n pairs[pairs.length] = [prop, obj[prop]];\r\n }\r\n }\r\n\r\n return pairs;\r\n});\r\n\r\n/**\r\n * Converts an object into an array of key, value arrays. The object\u0027s own\r\n * properties and prototype properties are used. Note that the order of the\r\n * output array is not guaranteed to be consistent across different JS\r\n * platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.4.0\r\n * @category Object\r\n * @sig {String: *} -\u003E [[String,*]]\r\n * @param {Object} obj The object to extract from\r\n * @return {Array} An array of key, value arrays from the object\u0027s own\r\n * and prototype properties.\r\n * @example\r\n *\r\n * const F = function() { this.x = \u0027X\u0027; };\r\n * F.prototype.y = \u0027Y\u0027;\r\n * const f = new F();\r\n * R.toPairsIn(f); //=\u003E [[\u0027x\u0027,\u0027X\u0027], [\u0027y\u0027,\u0027Y\u0027]]\r\n */\r\n\r\nvar toPairsIn = _curry1(function toPairsIn(obj) {\r\n var pairs = [];\r\n\r\n for (var prop in obj) {\r\n pairs[pairs.length] = [prop, obj[prop]];\r\n }\r\n\r\n return pairs;\r\n});\r\n\r\n/**\r\n * The upper case version of a string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.9.0\r\n * @category String\r\n * @sig String -\u003E String\r\n * @param {String} str The string to upper case.\r\n * @return {String} The upper case version of \u0060str\u0060.\r\n * @see R.toLower\r\n * @example\r\n *\r\n * R.toUpper(\u0027abc\u0027); //=\u003E \u0027ABC\u0027\r\n */\r\n\r\nvar toUpper = invoker(0, \u0022toUpperCase\u0022);\r\n\r\n/**\r\n * Initializes a transducer using supplied iterator function. Returns a single\r\n * item by iterating through the list, successively calling the transformed\r\n * iterator function and passing it an accumulator value and the current value\r\n * from the array, and then passing the result to the next call.\r\n *\r\n * The iterator function receives two values: *(acc, value)*. It will be\r\n * wrapped as a transformer to initialize the transducer. A transformer can be\r\n * passed directly in place of an iterator function. In both cases, iteration\r\n * may be stopped early with the [\u0060R.reduced\u0060](#reduced) function.\r\n *\r\n * A transducer is a function that accepts a transformer and returns a\r\n * transformer and can be composed directly.\r\n *\r\n * A transformer is an object that provides a 2-arity reducing iterator\r\n * function, step, 0-arity initial value function, init, and 1-arity result\r\n * extraction function, result. The step function is used as the iterator\r\n * function in reduce. The result function is used to convert the final\r\n * accumulator into the return type and in most cases is\r\n * [\u0060R.identity\u0060](#identity). The init function can be used to provide an\r\n * initial accumulator, but is ignored by transduce.\r\n *\r\n * The iteration is performed with [\u0060R.reduce\u0060](#reduce) after initializing the transducer.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.12.0\r\n * @category List\r\n * @sig (c -\u003E c) -\u003E ((a, b) -\u003E a) -\u003E a -\u003E [b] -\u003E a\r\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\r\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\r\n * current element from the array. Wrapped as transformer, if necessary, and used to\r\n * initialize the transducer\r\n * @param {*} acc The initial accumulator value.\r\n * @param {Array} list The list to iterate over.\r\n * @return {*} The final, accumulated value.\r\n * @see R.reduce, R.reduced, R.into\r\n * @example\r\n *\r\n * const numbers = [1, 2, 3, 4];\r\n * const transducer = R.compose(R.map(R.add(1)), R.take(2));\r\n * R.transduce(transducer, R.flip(R.append), [], numbers); //=\u003E [2, 3]\r\n *\r\n * const isOdd = (x) =\u003E x % 2 !== 0;\r\n * const firstOddTransducer = R.compose(R.filter(isOdd), R.take(1));\r\n * R.transduce(firstOddTransducer, R.flip(R.append), [], R.range(0, 100)); //=\u003E [1]\r\n */\r\n\r\nvar transduce = curryN(4, function transduce(xf, fn, acc, list) {\r\n return _xReduce(xf(typeof fn === \u0022function\u0022 ? _xwrap(fn) : fn), acc, list);\r\n});\r\n\r\n/**\r\n * Transposes the rows and columns of a 2D list.\r\n * When passed a list of \u0060n\u0060 lists of length \u0060x\u0060,\r\n * returns a list of \u0060x\u0060 lists of length \u0060n\u0060.\r\n *\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig [[a]] -\u003E [[a]]\r\n * @param {Array} list A 2D list\r\n * @return {Array} A 2D list\r\n * @example\r\n *\r\n * R.transpose([[1, \u0027a\u0027], [2, \u0027b\u0027], [3, \u0027c\u0027]]) //=\u003E [[1, 2, 3], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]]\r\n * R.transpose([[1, 2, 3], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]]) //=\u003E [[1, \u0027a\u0027], [2, \u0027b\u0027], [3, \u0027c\u0027]]\r\n *\r\n * // If some of the rows are shorter than the following rows, their elements are skipped:\r\n * R.transpose([[10, 11], [20], [], [30, 31, 32]]) //=\u003E [[10, 20, 30], [11, 31], [32]]\r\n * @symb R.transpose([[a], [b], [c]]) = [a, b, c]\r\n * @symb R.transpose([[a, b], [c, d]]) = [[a, c], [b, d]]\r\n * @symb R.transpose([[a, b], [c]]) = [[a, c], [b]]\r\n */\r\n\r\nvar transpose = _curry1(function transpose(outerlist) {\r\n var i = 0;\r\n var result = [];\r\n\r\n while (i \u003C outerlist.length) {\r\n var innerlist = outerlist[i];\r\n var j = 0;\r\n\r\n while (j \u003C innerlist.length) {\r\n if (typeof result[j] === \u0022undefined\u0022) {\r\n result[j] = [];\r\n }\r\n\r\n result[j].push(innerlist[j]);\r\n j \u002B= 1;\r\n }\r\n\r\n i \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Maps an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning\r\n * function over a [Traversable](https://github.com/fantasyland/fantasy-land#traversable),\r\n * then uses [\u0060sequence\u0060](#sequence) to transform the resulting Traversable of Applicative\r\n * into an Applicative of Traversable.\r\n *\r\n * Dispatches to the \u0060traverse\u0060 method of the third argument, if present.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig fantasy-land/of :: TypeRep f =\u003E f ~\u003E a -\u003E f a\r\n * @sig (Applicative f, Traversable t) =\u003E TypeRep f -\u003E (a -\u003E f b) -\u003E t a -\u003E f (t b)\r\n * @sig (Applicative f, Traversable t) =\u003E (b -\u003E f b) -\u003E (a -\u003E f b) -\u003E t a -\u003E f (t b)\r\n * @param {Object|Function} TypeRepresentative with an \u0060of\u0060 or \u0060fantasy-land/of\u0060 method\r\n * @param {Function} f\r\n * @param {*} traversable\r\n * @return {*}\r\n * @see R.sequence\r\n * @example\r\n *\r\n * // Returns \u0060Maybe.Nothing\u0060 if the given divisor is \u00600\u0060\r\n * const safeDiv = n =\u003E d =\u003E d === 0 ? Maybe.Nothing() : Maybe.Just(n / d)\r\n *\r\n * R.traverse(Maybe.of, safeDiv(10), [2, 4, 5]); //=\u003E Maybe.Just([5, 2.5, 2])\r\n * R.traverse(Maybe.of, safeDiv(10), [2, 0, 5]); //=\u003E Maybe.Nothing\r\n *\r\n * // Using a Type Representative\r\n * R.traverse(Maybe, safeDiv(10), Right(4)); //=\u003E Just(Right(2.5))\r\n * R.traverse(Maybe, safeDiv(10), Right(0)); //=\u003E Nothing\r\n * R.traverse(Maybe, safeDiv(10), Left(\u0022X\u0022)); //=\u003E Just(Left(\u0022X\u0022))\r\n */\r\n\r\nvar traverse = _curry3(function traverse(F, f, traversable) {\r\n var of =\r\n typeof F[\u0022fantasy-land/of\u0022] === \u0022function\u0022\r\n ? F[\u0022fantasy-land/of\u0022]\r\n : typeof F.of === \u0022function\u0022\r\n ? F.of\r\n : F;\r\n var TypeRep = {\r\n \u0022fantasy-land/of\u0022: of,\r\n };\r\n return typeof traversable[\u0022fantasy-land/traverse\u0022] === \u0022function\u0022\r\n ? traversable[\u0022fantasy-land/traverse\u0022](TypeRep, f)\r\n : typeof traversable.traverse === \u0022function\u0022\r\n ? traversable.traverse(TypeRep, f)\r\n : sequence(TypeRep, map(f, traversable));\r\n});\r\n\r\nvar ws =\r\n \u0022\\t\\n\\x0B\\f\\r \\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\u0022 \u002B\r\n \u0022\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\u0022 \u002B\r\n \u0022\\u2029\\uFEFF\u0022;\r\nvar zeroWidth = \u0022\\u200B\u0022;\r\nvar hasProtoTrim = typeof String.prototype.trim === \u0022function\u0022;\r\n/**\r\n * Removes (strips) whitespace from both ends of the string.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.6.0\r\n * @category String\r\n * @sig String -\u003E String\r\n * @param {String} str The string to trim.\r\n * @return {String} Trimmed version of \u0060str\u0060.\r\n * @example\r\n *\r\n * R.trim(\u0027 xyz \u0027); //=\u003E \u0027xyz\u0027\r\n * R.map(R.trim, R.split(\u0027,\u0027, \u0027x, y, z\u0027)); //=\u003E [\u0027x\u0027, \u0027y\u0027, \u0027z\u0027]\r\n */\r\n\r\nvar trim =\r\n !hasProtoTrim || ws.trim() || !zeroWidth.trim()\r\n ? _curry1(function trim(str) {\r\n var beginRx = new RegExp(\u0022^[\u0022 \u002B ws \u002B \u0022][\u0022 \u002B ws \u002B \u0022]*\u0022);\r\n var endRx = new RegExp(\u0022[\u0022 \u002B ws \u002B \u0022][\u0022 \u002B ws \u002B \u0022]*$\u0022);\r\n return str.replace(beginRx, \u0022\u0022).replace(endRx, \u0022\u0022);\r\n })\r\n : _curry1(function trim(str) {\r\n return str.trim();\r\n });\r\n\r\n/**\r\n * \u0060tryCatch\u0060 takes two functions, a \u0060tryer\u0060 and a \u0060catcher\u0060. The returned\r\n * function evaluates the \u0060tryer\u0060; if it does not throw, it simply returns the\r\n * result. If the \u0060tryer\u0060 *does* throw, the returned function evaluates the\r\n * \u0060catcher\u0060 function and returns its result. Note that for effective\r\n * composition with this function, both the \u0060tryer\u0060 and \u0060catcher\u0060 functions\r\n * must return the same type of results.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.20.0\r\n * @category Function\r\n * @sig (...x -\u003E a) -\u003E ((e, ...x) -\u003E a) -\u003E (...x -\u003E a)\r\n * @param {Function} tryer The function that may throw.\r\n * @param {Function} catcher The function that will be evaluated if \u0060tryer\u0060 throws.\r\n * @return {Function} A new function that will catch exceptions and send them to the catcher.\r\n * @example\r\n *\r\n * R.tryCatch(R.prop(\u0027x\u0027), R.F)({x: true}); //=\u003E true\r\n * R.tryCatch(() =\u003E { throw \u0027foo\u0027}, R.always(\u0027caught\u0027))(\u0027bar\u0027) // =\u003E\r\n * \u0027caught\u0027\r\n * R.tryCatch(R.times(R.identity), R.always([]))(\u0027s\u0027) // =\u003E []\r\n * R.tryCatch(() =\u003E { throw \u0027this is not a valid value\u0027}, (err, value)=\u003E({error : err, value }))(\u0027bar\u0027) // =\u003E {\u0027error\u0027: \u0027this is not a valid value\u0027, \u0027value\u0027: \u0027bar\u0027}\r\n */\r\n\r\nvar tryCatch = _curry2(function _tryCatch(tryer, catcher) {\r\n return _arity(tryer.length, function () {\r\n try {\r\n return tryer.apply(this, arguments);\r\n } catch (e) {\r\n return catcher.apply(this, _concat([e], arguments));\r\n }\r\n });\r\n});\r\n\r\n/**\r\n * Takes a function \u0060fn\u0060, which takes a single array argument, and returns a\r\n * function which:\r\n *\r\n * - takes any number of positional arguments;\r\n * - passes these arguments to \u0060fn\u0060 as an array; and\r\n * - returns the result.\r\n *\r\n * In other words, \u0060R.unapply\u0060 derives a variadic function from a function which\r\n * takes an array. \u0060R.unapply\u0060 is the inverse of [\u0060R.apply\u0060](#apply).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.8.0\r\n * @category Function\r\n * @sig ([*...] -\u003E a) -\u003E (*... -\u003E a)\r\n * @param {Function} fn\r\n * @return {Function}\r\n * @see R.apply\r\n * @example\r\n *\r\n * R.unapply(JSON.stringify)(1, 2, 3); //=\u003E \u0027[1,2,3]\u0027\r\n * @symb R.unapply(f)(a, b) = f([a, b])\r\n */\r\n\r\nvar unapply = _curry1(function unapply(fn) {\r\n return function () {\r\n return fn(Array.prototype.slice.call(arguments, 0));\r\n };\r\n});\r\n\r\n/**\r\n * Wraps a function of any arity (including nullary) in a function that accepts\r\n * exactly 1 parameter. Any extraneous parameters will not be passed to the\r\n * supplied function.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category Function\r\n * @sig (a -\u003E b -\u003E c -\u003E ... -\u003E z) -\u003E (a -\u003E z)\r\n * @param {Function} fn The function to wrap.\r\n * @return {Function} A new function wrapping \u0060fn\u0060. The new function is guaranteed to be of\r\n * arity 1.\r\n * @see R.binary, R.nAry\r\n * @example\r\n *\r\n * const takesTwoArgs = function(a, b) {\r\n * return [a, b];\r\n * };\r\n * takesTwoArgs.length; //=\u003E 2\r\n * takesTwoArgs(1, 2); //=\u003E [1, 2]\r\n *\r\n * const takesOneArg = R.unary(takesTwoArgs);\r\n * takesOneArg.length; //=\u003E 1\r\n * // Only 1 argument is passed to the wrapped function\r\n * takesOneArg(1, 2); //=\u003E [1, undefined]\r\n * @symb R.unary(f)(a, b, c) = f(a)\r\n */\r\n\r\nvar unary = _curry1(function unary(fn) {\r\n return nAry(1, fn);\r\n});\r\n\r\n/**\r\n * Returns a function of arity \u0060n\u0060 from a (manually) curried function.\r\n * Note that, the returned function is actually a ramda style\r\n * curryied function, which can accept one or more arguments in each\r\n * function calling.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Function\r\n * @sig Number -\u003E (a -\u003E b -\u003E c ... -\u003E z) -\u003E ((a -\u003E b -\u003E c ...) -\u003E z)\r\n * @param {Number} length The arity for the returned function.\r\n * @param {Function} fn The function to uncurry.\r\n * @return {Function} A new function.\r\n * @see R.curry, R.curryN\r\n * @example\r\n *\r\n * const addFour = a =\u003E b =\u003E c =\u003E d =\u003E a \u002B b \u002B c \u002B d;\r\n *\r\n * const uncurriedAddFour = R.uncurryN(4, addFour);\r\n * uncurriedAddFour(1, 2, 3, 4); //=\u003E 10\r\n */\r\n\r\nvar uncurryN = _curry2(function uncurryN(depth, fn) {\r\n return curryN(depth, function () {\r\n var currentDepth = 1;\r\n var value = fn;\r\n var idx = 0;\r\n var endIdx;\r\n\r\n while (currentDepth \u003C= depth \u0026\u0026 typeof value === \u0022function\u0022) {\r\n endIdx = currentDepth === depth ? arguments.length : idx \u002B value.length;\r\n value = value.apply(\r\n this,\r\n Array.prototype.slice.call(arguments, idx, endIdx)\r\n );\r\n currentDepth \u002B= 1;\r\n idx = endIdx;\r\n }\r\n\r\n return value;\r\n });\r\n});\r\n\r\n/**\r\n * Builds a list from a seed value. Accepts an iterator function, which returns\r\n * either false to stop iteration or an array of length 2 containing the value\r\n * to add to the resulting list and the seed to be used in the next call to the\r\n * iterator function.\r\n *\r\n * The iterator function receives one argument: *(seed)*.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.10.0\r\n * @category List\r\n * @sig (a -\u003E [b]) -\u003E * -\u003E [b]\r\n * @param {Function} fn The iterator function. receives one argument, \u0060seed\u0060, and returns\r\n * either false to quit iteration or an array of length two to proceed. The element\r\n * at index 0 of this array will be added to the resulting array, and the element\r\n * at index 1 will be passed to the next call to \u0060fn\u0060.\r\n * @param {*} seed The seed value.\r\n * @return {Array} The final list.\r\n * @example\r\n *\r\n * const f = n =\u003E n \u003E 50 ? false : [-n, n \u002B 10];\r\n * R.unfold(f, 10); //=\u003E [-10, -20, -30, -40, -50]\r\n * @symb R.unfold(f, x) = [f(x)[0], f(f(x)[1])[0], f(f(f(x)[1])[1])[0], ...]\r\n */\r\n\r\nvar unfold = _curry2(function unfold(fn, seed) {\r\n var pair = fn(seed);\r\n var result = [];\r\n\r\n while (pair \u0026\u0026 pair.length) {\r\n result[result.length] = pair[0];\r\n pair = fn(pair[1]);\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\r\n * of each list.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig [*] -\u003E [*] -\u003E [*]\r\n * @param {Array} as The first list.\r\n * @param {Array} bs The second list.\r\n * @return {Array} The first and second lists concatenated, with\r\n * duplicates removed.\r\n * @example\r\n *\r\n * R.union([1, 2, 3], [2, 3, 4]); //=\u003E [1, 2, 3, 4]\r\n */\r\n\r\nvar union = _curry2(compose(uniq, _concat));\r\n\r\nfunction XUniqWith(pred, xf) {\r\n this.xf = xf;\r\n this.pred = pred;\r\n this.items = [];\r\n}\r\n\r\nXUniqWith.prototype[\u0022@@transducer/init\u0022] = _xfBase.init;\r\nXUniqWith.prototype[\u0022@@transducer/result\u0022] = _xfBase.result;\r\n\r\nXUniqWith.prototype[\u0022@@transducer/step\u0022] = function (result, input) {\r\n if (_includesWith(this.pred, input, this.items)) {\r\n return result;\r\n } else {\r\n this.items.push(input);\r\n return this.xf[\u0022@@transducer/step\u0022](result, input);\r\n }\r\n};\r\n\r\nfunction _xuniqWith(pred) {\r\n return function (xf) {\r\n return new XUniqWith(pred, xf);\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new list containing only one copy of each element in the original\r\n * list, based upon the value returned by applying the supplied predicate to\r\n * two list elements. Prefers the first item if two items compare equal based\r\n * on the predicate.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category List\r\n * @sig ((a, a) -\u003E Boolean) -\u003E [a] -\u003E [a]\r\n * @param {Function} pred A predicate used to test whether two items are equal.\r\n * @param {Array} list The array to consider.\r\n * @return {Array} The list of unique items.\r\n * @example\r\n *\r\n * const strEq = R.eqBy(String);\r\n * R.uniqWith(strEq)([1, \u00271\u0027, 2, 1]); //=\u003E [1, 2]\r\n * R.uniqWith(strEq)([{}, {}]); //=\u003E [{}]\r\n * R.uniqWith(strEq)([1, \u00271\u0027, 1]); //=\u003E [1]\r\n * R.uniqWith(strEq)([\u00271\u0027, 1, 1]); //=\u003E [\u00271\u0027]\r\n */\r\n\r\nvar uniqWith = _curry2(\r\n _dispatchable([], _xuniqWith, function (pred, list) {\r\n var idx = 0;\r\n var len = list.length;\r\n var result = [];\r\n var item;\r\n\r\n while (idx \u003C len) {\r\n item = list[idx];\r\n\r\n if (!_includesWith(pred, item, result)) {\r\n result[result.length] = item;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n })\r\n);\r\n\r\n/**\r\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\r\n * of each list. Duplication is determined according to the value returned by\r\n * applying the supplied predicate to two list elements. If an element exists\r\n * in both lists, the first element from the first list will be used.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category Relation\r\n * @sig ((a, a) -\u003E Boolean) -\u003E [*] -\u003E [*] -\u003E [*]\r\n * @param {Function} pred A predicate used to test whether two items are equal.\r\n * @param {Array} list1 The first list.\r\n * @param {Array} list2 The second list.\r\n * @return {Array} The first and second lists concatenated, with\r\n * duplicates removed.\r\n * @see R.union\r\n * @example\r\n *\r\n * const l1 = [{a: 1}, {a: 2}];\r\n * const l2 = [{a: 1}, {a: 4}];\r\n * R.unionWith(R.eqBy(R.prop(\u0027a\u0027)), l1, l2); //=\u003E [{a: 1}, {a: 2}, {a: 4}]\r\n */\r\n\r\nvar unionWith = _curry3(function unionWith(pred, list1, list2) {\r\n return uniqWith(pred, _concat(list1, list2));\r\n});\r\n\r\n/**\r\n * Tests the final argument by passing it to the given predicate function. If\r\n * the predicate is not satisfied, the function will return the result of\r\n * calling the \u0060whenFalseFn\u0060 function with the same argument. If the predicate\r\n * is satisfied, the argument is returned as is.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category Logic\r\n * @sig (a -\u003E Boolean) -\u003E (a -\u003E b) -\u003E a -\u003E a | b\r\n * @param {Function} pred A predicate function\r\n * @param {Function} whenFalseFn A function to invoke when the \u0060pred\u0060 evaluates\r\n * to a falsy value.\r\n * @param {*} x An object to test with the \u0060pred\u0060 function and\r\n * pass to \u0060whenFalseFn\u0060 if necessary.\r\n * @return {*} Either \u0060x\u0060 or the result of applying \u0060x\u0060 to \u0060whenFalseFn\u0060.\r\n * @see R.ifElse, R.when, R.cond\r\n * @example\r\n *\r\n * let safeInc = R.unless(R.isNil, R.inc);\r\n * safeInc(null); //=\u003E null\r\n * safeInc(1); //=\u003E 2\r\n */\r\n\r\nvar unless = _curry3(function unless(pred, whenFalseFn, x) {\r\n return pred(x) ? x : whenFalseFn(x);\r\n});\r\n\r\n/**\r\n * Shorthand for \u0060R.chain(R.identity)\u0060, which removes one level of nesting from\r\n * any [Chain](https://github.com/fantasyland/fantasy-land#chain).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category List\r\n * @sig Chain c =\u003E c (c a) -\u003E c a\r\n * @param {*} list\r\n * @return {*}\r\n * @see R.flatten, R.chain\r\n * @example\r\n *\r\n * R.unnest([1, [2], [[3]]]); //=\u003E [1, 2, [3]]\r\n * R.unnest([[1, 2], [3, 4], [5, 6]]); //=\u003E [1, 2, 3, 4, 5, 6]\r\n */\r\n\r\nvar unnest = chain(_identity);\r\n\r\n/**\r\n * Takes a predicate, a transformation function, and an initial value,\r\n * and returns a value of the same type as the initial value.\r\n * It does so by applying the transformation until the predicate is satisfied,\r\n * at which point it returns the satisfactory value.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.20.0\r\n * @category Logic\r\n * @sig (a -\u003E Boolean) -\u003E (a -\u003E a) -\u003E a -\u003E a\r\n * @param {Function} pred A predicate function\r\n * @param {Function} fn The iterator function\r\n * @param {*} init Initial value\r\n * @return {*} Final value that satisfies predicate\r\n * @example\r\n *\r\n * R.until(R.gt(R.__, 100), R.multiply(2))(1) // =\u003E 128\r\n */\r\n\r\nvar until = _curry3(function until(pred, fn, init) {\r\n var val = init;\r\n\r\n while (!pred(val)) {\r\n val = fn(val);\r\n }\r\n\r\n return val;\r\n});\r\n\r\n/**\r\n *\r\n * Deconstructs an array field from the input documents to output a document for each element.\r\n * Each output document is the input document with the value of the array field replaced by the element.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Object\r\n * @sig String -\u003E {k: [v]} -\u003E [{k: v}]\r\n * @param {String} key The key to determine which property of the object should be unwind\r\n * @param {Object} object The object containing list under property named as key which is to unwind\r\n * @return {List} A new list of object containing the value of input key having list replaced by each element in the object.\r\n * @example\r\n *\r\n * R.unwind(\u0027hobbies\u0027, {\r\n * name: \u0027alice\u0027,\r\n * hobbies: [\u0027Golf\u0027, \u0027Hacking\u0027],\r\n * colors: [\u0027red\u0027, \u0027green\u0027],\r\n * });\r\n * // [\r\n * // { name: \u0027alice\u0027, hobbies: \u0027Golf\u0027, colors: [\u0027red\u0027, \u0027green\u0027] },\r\n * // { name: \u0027alice\u0027, hobbies: \u0027Hacking\u0027, colors: [\u0027red\u0027, \u0027green\u0027] }\r\n * // ]\r\n */\r\n\r\nvar unwind = _curry2(function (key, object) {\r\n // If key is not in object or key is not as a list in object\r\n if (!(key in object \u0026\u0026 _isArray(object[key]))) {\r\n return [object];\r\n } // Map over object[key] which is a list and assoc each element with key\r\n\r\n return _map(function (item) {\r\n return _assoc(key, item, object);\r\n }, object[key]);\r\n});\r\n\r\n/**\r\n * Returns a list of all the properties, including prototype properties, of the\r\n * supplied object.\r\n * Note that the order of the output array is not guaranteed to be consistent\r\n * across different JS platforms.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.2.0\r\n * @category Object\r\n * @sig {k: v} -\u003E [v]\r\n * @param {Object} obj The object to extract values from\r\n * @return {Array} An array of the values of the object\u0027s own and prototype properties.\r\n * @see R.values, R.keysIn\r\n * @example\r\n *\r\n * const F = function() { this.x = \u0027X\u0027; };\r\n * F.prototype.y = \u0027Y\u0027;\r\n * const f = new F();\r\n * R.valuesIn(f); //=\u003E [\u0027X\u0027, \u0027Y\u0027]\r\n */\r\n\r\nvar valuesIn = _curry1(function valuesIn(obj) {\r\n var prop;\r\n var vs = [];\r\n\r\n for (prop in obj) {\r\n vs[vs.length] = obj[prop];\r\n }\r\n\r\n return vs;\r\n});\r\n\r\nvar Const = function Const(x) {\r\n return {\r\n value: x,\r\n \u0022fantasy-land/map\u0022: function fantasyLandMap() {\r\n return this;\r\n },\r\n };\r\n};\r\n/**\r\n * Returns a \u0022view\u0022 of the given data structure, determined by the given lens.\r\n * The lens\u0027s focus determines which portion of the data structure is visible.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.16.0\r\n * @category Object\r\n * @typedefn Lens s a = Functor f =\u003E (a -\u003E f a) -\u003E s -\u003E f s\r\n * @sig Lens s a -\u003E s -\u003E a\r\n * @param {Lens} lens\r\n * @param {*} x\r\n * @return {*}\r\n * @see R.set, R.over, R.lens, R.lensIndex, R.lensProp, R.lensPath\r\n * @example\r\n *\r\n * const xLens = R.lensProp(\u0027x\u0027);\r\n *\r\n * R.view(xLens, {x: 1, y: 2}); //=\u003E 1\r\n * R.view(xLens, {x: 4, y: 2}); //=\u003E 4\r\n */\r\n\r\nvar view = _curry2(function view(lens, x) {\r\n // Using \u0060Const\u0060 effectively ignores the setter function of the \u0060lens\u0060,\r\n // leaving the value returned by the getter function unmodified.\r\n return lens(Const)(x).value;\r\n});\r\n\r\n/**\r\n * Tests the final argument by passing it to the given predicate function. If\r\n * the predicate is satisfied, the function will return the result of calling\r\n * the \u0060whenTrueFn\u0060 function with the same argument. If the predicate is not\r\n * satisfied, the argument is returned as is.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.18.0\r\n * @category Logic\r\n * @sig (a -\u003E Boolean) -\u003E (a -\u003E b) -\u003E a -\u003E a | b\r\n * @param {Function} pred A predicate function\r\n * @param {Function} whenTrueFn A function to invoke when the \u0060condition\u0060\r\n * evaluates to a truthy value.\r\n * @param {*} x An object to test with the \u0060pred\u0060 function and\r\n * pass to \u0060whenTrueFn\u0060 if necessary.\r\n * @return {*} Either \u0060x\u0060 or the result of applying \u0060x\u0060 to \u0060whenTrueFn\u0060.\r\n * @see R.ifElse, R.unless, R.cond\r\n * @example\r\n *\r\n * // truncate :: String -\u003E String\r\n * const truncate = R.when(\r\n * R.propSatisfies(R.gt(R.__, 10), \u0027length\u0027),\r\n * R.pipe(R.take(10), R.append(\u0027\u2026\u0027), R.join(\u0027\u0027))\r\n * );\r\n * truncate(\u002712345\u0027); //=\u003E \u002712345\u0027\r\n * truncate(\u00270123456789ABC\u0027); //=\u003E \u00270123456789\u2026\u0027\r\n */\r\n\r\nvar when = _curry3(function when(pred, whenTrueFn, x) {\r\n return pred(x) ? whenTrueFn(x) : x;\r\n});\r\n\r\n/**\r\n * Takes a spec object and a test object; returns true if the test satisfies\r\n * the spec. Each of the spec\u0027s own properties must be a predicate function.\r\n * Each predicate is applied to the value of the corresponding property of the\r\n * test object. \u0060where\u0060 returns true if all the predicates return true, false\r\n * otherwise.\r\n *\r\n * \u0060where\u0060 is well suited to declaratively expressing constraints for other\r\n * functions such as [\u0060filter\u0060](#filter) and [\u0060find\u0060](#find).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.1\r\n * @category Object\r\n * @sig {String: (* -\u003E Boolean)} -\u003E {String: *} -\u003E Boolean\r\n * @param {Object} spec\r\n * @param {Object} testObj\r\n * @return {Boolean}\r\n * @see R.propSatisfies, R.whereEq\r\n * @example\r\n *\r\n * // pred :: Object -\u003E Boolean\r\n * const pred = R.where({\r\n * a: R.equals(\u0027foo\u0027),\r\n * b: R.complement(R.equals(\u0027bar\u0027)),\r\n * x: R.gt(R.__, 10),\r\n * y: R.lt(R.__, 20)\r\n * });\r\n *\r\n * pred({a: \u0027foo\u0027, b: \u0027xxx\u0027, x: 11, y: 19}); //=\u003E true\r\n * pred({a: \u0027xxx\u0027, b: \u0027xxx\u0027, x: 11, y: 19}); //=\u003E false\r\n * pred({a: \u0027foo\u0027, b: \u0027bar\u0027, x: 11, y: 19}); //=\u003E false\r\n * pred({a: \u0027foo\u0027, b: \u0027xxx\u0027, x: 10, y: 19}); //=\u003E false\r\n * pred({a: \u0027foo\u0027, b: \u0027xxx\u0027, x: 11, y: 20}); //=\u003E false\r\n */\r\n\r\nvar where = _curry2(function where(spec, testObj) {\r\n for (var prop in spec) {\r\n if (_has(prop, spec) \u0026\u0026 !spec[prop](testObj[prop])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n});\r\n\r\n/**\r\n * Takes a spec object and a test object; each of the spec\u0027s own properties must be a predicate function.\r\n * Each predicate is applied to the value of the corresponding property of the\r\n * test object. \u0060whereAny\u0060 returns true if at least one of the predicates return true,\r\n * false otherwise.\r\n *\r\n * \u0060whereAny\u0060 is well suited to declaratively expressing constraints for other\r\n * functions such as [\u0060filter\u0060](#filter) and [\u0060find\u0060](#find).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.28.0\r\n * @category Object\r\n * @sig {String: (* -\u003E Boolean)} -\u003E {String: *} -\u003E Boolean\r\n * @param {Object} spec\r\n * @param {Object} testObj\r\n * @return {Boolean}\r\n * @see R.propSatisfies, R.where\r\n * @example\r\n *\r\n * // pred :: Object -\u003E Boolean\r\n * const pred = R.whereAny({\r\n * a: R.equals(\u0027foo\u0027),\r\n * b: R.complement(R.equals(\u0027xxx\u0027)),\r\n * x: R.gt(R.__, 10),\r\n * y: R.lt(R.__, 20)\r\n * });\r\n *\r\n * pred({a: \u0027foo\u0027, b: \u0027xxx\u0027, x: 8, y: 34}); //=\u003E true\r\n * pred({a: \u0027xxx\u0027, b: \u0027xxx\u0027, x: 9, y: 21}); //=\u003E false\r\n * pred({a: \u0027bar\u0027, b: \u0027xxx\u0027, x: 10, y: 20}); //=\u003E false\r\n * pred({a: \u0027foo\u0027, b: \u0027bar\u0027, x: 10, y: 20}); //=\u003E true\r\n * pred({a: \u0027foo\u0027, b: \u0027xxx\u0027, x: 11, y: 20}); //=\u003E true\r\n */\r\n\r\nvar whereAny = _curry2(function whereAny(spec, testObj) {\r\n for (var prop in spec) {\r\n if (_has(prop, spec) \u0026\u0026 spec[prop](testObj[prop])) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n});\r\n\r\n/**\r\n * Takes a spec object and a test object; returns true if the test satisfies\r\n * the spec, false otherwise. An object satisfies the spec if, for each of the\r\n * spec\u0027s own properties, accessing that property of the object gives the same\r\n * value (in [\u0060R.equals\u0060](#equals) terms) as accessing that property of the\r\n * spec.\r\n *\r\n * \u0060whereEq\u0060 is a specialization of [\u0060where\u0060](#where).\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.14.0\r\n * @category Object\r\n * @sig {String: *} -\u003E {String: *} -\u003E Boolean\r\n * @param {Object} spec\r\n * @param {Object} testObj\r\n * @return {Boolean}\r\n * @see R.propEq, R.where\r\n * @example\r\n *\r\n * // pred :: Object -\u003E Boolean\r\n * const pred = R.whereEq({a: 1, b: 2});\r\n *\r\n * pred({a: 1}); //=\u003E false\r\n * pred({a: 1, b: 2}); //=\u003E true\r\n * pred({a: 1, b: 2, c: 3}); //=\u003E true\r\n * pred({a: 1, b: 1}); //=\u003E false\r\n */\r\n\r\nvar whereEq = _curry2(function whereEq(spec, testObj) {\r\n return where(map(equals, spec), testObj);\r\n});\r\n\r\n/**\r\n * Returns a new list without values in the first argument.\r\n * [\u0060R.equals\u0060](#equals) is used to determine equality.\r\n *\r\n * Acts as a transducer if a transformer is given in list position.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.19.0\r\n * @category List\r\n * @sig [a] -\u003E [a] -\u003E [a]\r\n * @param {Array} list1 The values to be removed from \u0060list2\u0060.\r\n * @param {Array} list2 The array to remove values from.\r\n * @return {Array} The new array without values in \u0060list1\u0060.\r\n * @see R.transduce, R.difference, R.remove\r\n * @example\r\n *\r\n * R.without([1, 2], [1, 2, 1, 3, 4]); //=\u003E [3, 4]\r\n */\r\n\r\nvar without = _curry2(function without(xs, list) {\r\n var toRemove = new _Set();\r\n\r\n for (var i = 0; i \u003C xs.length; i \u002B= 1) {\r\n toRemove.add(xs[i]);\r\n }\r\n\r\n return reject(toRemove.has.bind(toRemove), list);\r\n});\r\n\r\n/**\r\n * Exclusive disjunction logical operation.\r\n * Returns \u0060true\u0060 if one of the arguments is truthy and the other is falsy.\r\n * Otherwise, it returns \u0060false\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.27.1\r\n * @category Logic\r\n * @sig a -\u003E b -\u003E Boolean\r\n * @param {Any} a\r\n * @param {Any} b\r\n * @return {Boolean} true if one of the arguments is truthy and the other is falsy\r\n * @see R.or, R.and\r\n * @example\r\n *\r\n * R.xor(true, true); //=\u003E false\r\n * R.xor(true, false); //=\u003E true\r\n * R.xor(false, true); //=\u003E true\r\n * R.xor(false, false); //=\u003E false\r\n */\r\n\r\nvar xor = _curry2(function xor(a, b) {\r\n return Boolean(!a ^ !b);\r\n});\r\n\r\n/**\r\n * Creates a new list out of the two supplied by creating each possible pair\r\n * from the lists.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [b] -\u003E [[a,b]]\r\n * @param {Array} as The first list.\r\n * @param {Array} bs The second list.\r\n * @return {Array} The list made by combining each possible pair from\r\n * \u0060as\u0060 and \u0060bs\u0060 into pairs (\u0060[a, b]\u0060).\r\n * @example\r\n *\r\n * R.xprod([1, 2], [\u0027a\u0027, \u0027b\u0027]); //=\u003E [[1, \u0027a\u0027], [1, \u0027b\u0027], [2, \u0027a\u0027], [2, \u0027b\u0027]]\r\n * @symb R.xprod([a, b], [c, d]) = [[a, c], [a, d], [b, c], [b, d]]\r\n */\r\n\r\nvar xprod = _curry2(function xprod(a, b) {\r\n // = xprodWith(prepend); (takes about 3 times as long...)\r\n var idx = 0;\r\n var ilen = a.length;\r\n var j;\r\n var jlen = b.length;\r\n var result = [];\r\n\r\n while (idx \u003C ilen) {\r\n j = 0;\r\n\r\n while (j \u003C jlen) {\r\n result[result.length] = [a[idx], b[j]];\r\n j \u002B= 1;\r\n }\r\n\r\n idx \u002B= 1;\r\n }\r\n\r\n return result;\r\n});\r\n\r\n/**\r\n * Creates a new list out of the two supplied by pairing up equally-positioned\r\n * items from both lists. The returned list is truncated to the length of the\r\n * shorter of the two input lists.\r\n * Note: \u0060zip\u0060 is equivalent to \u0060zipWith(function(a, b) { return [a, b] })\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig [a] -\u003E [b] -\u003E [[a,b]]\r\n * @param {Array} list1 The first array to consider.\r\n * @param {Array} list2 The second array to consider.\r\n * @return {Array} The list made by pairing up same-indexed elements of \u0060list1\u0060 and \u0060list2\u0060.\r\n * @example\r\n *\r\n * R.zip([1, 2, 3], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]); //=\u003E [[1, \u0027a\u0027], [2, \u0027b\u0027], [3, \u0027c\u0027]]\r\n * @symb R.zip([a, b, c], [d, e, f]) = [[a, d], [b, e], [c, f]]\r\n */\r\n\r\nvar zip = _curry2(function zip(a, b) {\r\n var rv = [];\r\n var idx = 0;\r\n var len = Math.min(a.length, b.length);\r\n\r\n while (idx \u003C len) {\r\n rv[idx] = [a[idx], b[idx]];\r\n idx \u002B= 1;\r\n }\r\n\r\n return rv;\r\n});\r\n\r\n/**\r\n * Creates a new object out of a list of keys and a list of values.\r\n * Key/value pairing is truncated to the length of the shorter of the two lists.\r\n * Note: \u0060zipObj\u0060 is equivalent to \u0060pipe(zip, fromPairs)\u0060.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.3.0\r\n * @category List\r\n * @sig [String] -\u003E [*] -\u003E {String: *}\r\n * @param {Array} keys The array that will be properties on the output object.\r\n * @param {Array} values The list of values on the output object.\r\n * @return {Object} The object made by pairing up same-indexed elements of \u0060keys\u0060 and \u0060values\u0060.\r\n * @example\r\n *\r\n * R.zipObj([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027], [1, 2, 3]); //=\u003E {a: 1, b: 2, c: 3}\r\n */\r\n\r\nvar zipObj = _curry2(function zipObj(keys, values) {\r\n var idx = 0;\r\n var len = Math.min(keys.length, values.length);\r\n var out = {};\r\n\r\n while (idx \u003C len) {\r\n out[keys[idx]] = values[idx];\r\n idx \u002B= 1;\r\n }\r\n\r\n return out;\r\n});\r\n\r\n/**\r\n * Creates a new list out of the two supplied by applying the function to each\r\n * equally-positioned pair in the lists. The returned list is truncated to the\r\n * length of the shorter of the two input lists.\r\n *\r\n * @function\r\n * @memberOf R\r\n * @since v0.1.0\r\n * @category List\r\n * @sig ((a, b) -\u003E c) -\u003E [a] -\u003E [b] -\u003E [c]\r\n * @param {Function} fn The function used to combine the two elements into one value.\r\n * @param {Array} list1 The first array to consider.\r\n * @param {Array} list2 The second array to consider.\r\n * @return {Array} The list made by combining same-indexed elements of \u0060list1\u0060 and \u0060list2\u0060\r\n * using \u0060fn\u0060.\r\n * @example\r\n *\r\n * const f = (x, y) =\u003E {\r\n * // ...\r\n * };\r\n * R.zipWith(f, [1, 2, 3], [\u0027a\u0027, \u0027b\u0027, \u0027c\u0027]);\r\n * //=\u003E [f(1, \u0027a\u0027), f(2, \u0027b\u0027), f(3, \u0027c\u0027)]\r\n * @symb R.zipWith(fn, [a, b, c], [d, e, f]) = [fn(a, d), fn(b, e), fn(c, f)]\r\n */\r\n\r\nvar zipWith = _curry3(function zipWith(fn, a, b) {\r\n var rv = [];\r\n var idx = 0;\r\n var len = Math.min(a.length, b.length);\r\n\r\n while (idx \u003C len) {\r\n rv[idx] = fn(a[idx], b[idx]);\r\n idx \u002B= 1;\r\n }\r\n\r\n return rv;\r\n});\r\n\r\n/**\r\n * Creates a thunk out of a function. A thunk delays a calculation until\r\n * its result is needed, providing lazy evaluation of arguments.\r\n *\r\n * @func\r\n * @memberOf R\r\n * @since v0.26.0\r\n * @category Function\r\n * @sig ((a, b, ..., j) -\u003E k) -\u003E (a, b, ..., j) -\u003E (() -\u003E k)\r\n * @param {Function} fn A function to wrap in a thunk\r\n * @return {Function} Expects arguments for \u0060fn\u0060 and returns a new function\r\n * that, when called, applies those arguments to \u0060fn\u0060.\r\n * @see R.partial, R.partialRight\r\n * @example\r\n *\r\n * R.thunkify(R.identity)(42)(); //=\u003E 42\r\n * R.thunkify((a, b) =\u003E a \u002B b)(25, 17)(); //=\u003E 42\r\n */\r\n\r\nvar thunkify = _curry1(function thunkify(fn) {\r\n return curryN(fn.length, function createThunk() {\r\n var fnArgs = arguments;\r\n return function invokeThunk() {\r\n return fn.apply(this, fnArgs);\r\n };\r\n });\r\n});\r\n\r\n// test prep\r\n\r\nvar SCHEDULE_WEEKDAYS = [\r\n \u0027MO\u0027,\r\n \u0027TU\u0027,\r\n \u0027WED\u0027,\r\n \u0027THU\u0027,\r\n \u0027FRY\u0027,\r\n \u0027SAT\u0027,\r\n \u0027SUN\u0027,\r\n];\r\n\r\nvar toIndexedDays = days =\u003E days.map(day =\u003E SCHEDULE_WEEKDAYS.indexOf(day));\r\nvar sortAscDays = sort(subtract);\r\n\r\nvar daysSelected = [\u0027WED\u0027, \u0027MO\u0027, \u0027SUN\u0027];\r\n\r\n\r\n","TestCases":[{"Name":"Ramda","Code":"sortAscDays(toIndexedDays(daysSelected))","IsDeferred":false},{"Name":"Reduce","Code":"SCHEDULE_WEEKDAYS.reduce(\r\n (acc, day, idx) =\u003E \r\n daysSelected.includes(day) ? [...acc, idx] : acc\r\n , []\r\n);","IsDeferred":false}]}