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O,SAAUiL,GAGf,IAFA,IAAIC,EAAO,GAEF7N,EAAI,EAAGA,EAAI4N,EAAGvP,OAAQ2B,IAE7B,GADA6N,EAAK7N,GAAK4N,EAAG5N,GACT2C,EAAUiL,EAAG5N,IACf,OAAO6N,EAGX,OAAOA,CACT,CACF,C","sources":["webpack://uk-b2c/./node_modules/fp-ts/es6/ReadonlyRecord.js","webpack://uk-b2c/./node_modules/fp-ts/es6/Record.js","webpack://uk-b2c/./node_modules/fp-ts/es6/pipeable.js","webpack://uk-b2c/./node_modules/fp-ts/es6/string.js","webpack://uk-b2c/./node_modules/io-ts-reporters/target/src/index.js","webpack://uk-b2c/./node_modules/io-ts-reporters/target/src/utils.js"],"sourcesContent":["import { fromEquals } from './Eq';\nimport { flow, identity, pipe, SK } from './function';\nimport { flap as flap_ } from './Functor';\nimport * as _ from './internal';\nimport { separated } from './Separated';\nimport * as S from './string';\nimport { wiltDefault, witherDefault } from './Witherable';\n/**\n * Builds a `ReadonlyRecord` by copying a `Record`.\n *\n * @example\n * import { ReadonlyRecord, fromRecord } from \"fp-ts/ReadonlyRecord\"\n *\n * const x: Record = { a: 1, b: 2 };\n * const y: ReadonlyRecord = fromRecord(x);\n * assert.deepStrictEqual(x,y);\n * // `y.a = 5` gives compiler error\n *\n * @category conversions\n * @since 2.5.0\n */\nexport var fromRecord = function (r) {\n return Object.assign({}, r);\n};\n/**\n * Builds a mutable `Record` from a `ReadonlyRecord`.\n *\n * @example\n * import { ReadonlyRecord, toRecord } from \"fp-ts/ReadonlyRecord\"\n *\n * const x: ReadonlyRecord = { a: 1, b: 2 };\n * const y: Record = toRecord(x);\n * assert.deepStrictEqual(x,y);\n * y.a = 5; // it's ok, y is mutable\n *\n * @category conversions\n * @since 2.5.0\n */\nexport var toRecord = function (r) {\n return Object.assign({}, r);\n};\n/**\n * Calculate the number of key/value pairs in a `ReadonlyRecord`,\n *\n * @example\n * import { size } from \"fp-ts/ReadonlyRecord\";\n *\n * assert.deepStrictEqual(size({ a: true, b: 2, c: \"three\" }), 3);\n *\n * @since 2.5.0\n */\nexport var size = function (r) {\n return Object.keys(r).length;\n};\n/**\n * Test whether a `ReadonlyRecord` is empty.\n *\n * @example\n * import { isEmpty } from \"fp-ts/ReadonlyRecord\"\n *\n * assert.deepStrictEqual(isEmpty({}), true);\n * assert.deepStrictEqual(isEmpty({ a: 3 }), false);\n * @since 2.5.0\n */\nexport var isEmpty = function (r) {\n for (var k in r) {\n if (_.has.call(r, k)) {\n return false;\n }\n }\n return true;\n};\nvar keys_ = function (O) {\n return function (r) {\n return Object.keys(r).sort(O.compare);\n };\n};\n/**\n * @since 2.5.0\n */\nexport var keys = /*#__PURE__*/keys_(S.Ord);\nexport function collect(O) {\n if (typeof O === 'function') {\n return collect(S.Ord)(O);\n }\n var keysO = keys_(O);\n return function (f) {\n return function (r) {\n var out = [];\n for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) {\n var key = _a[_i];\n out.push(f(key, r[key]));\n }\n return out;\n };\n };\n}\n/**\n * Get a sorted `ReadonlyArray` of the key/value pairs contained in a `ReadonlyRecord`.\n *\n * @example\n * import { toReadonlyArray } from 'fp-ts/ReadonlyRecord'\n *\n * const x = { c: 3, a: \"foo\", b: false };\n * assert.deepStrictEqual(toReadonlyArray(x), [\n * [\"a\", \"foo\"],\n * [\"b\", false],\n * [\"c\", 3],\n * ]);\n *\n * @category conversions\n * @since 2.5.0\n */\nexport var toReadonlyArray = /*#__PURE__*/collect(S.Ord)(function (k, a) {\n return [k, a];\n});\nexport function toUnfoldable(U) {\n return function (r) {\n var sas = toReadonlyArray(r);\n var len = sas.length;\n return U.unfold(0, function (b) {\n return b < len ? _.some([sas[b], b + 1]) : _.none;\n });\n };\n}\n/**\n * Insert or replace a key/value pair in a `ReadonlyRecord`.\n *\n * @example\n * import { upsertAt } from 'fp-ts/ReadonlyRecord'\n *\n * assert.deepStrictEqual(upsertAt(\"a\", 5)({ a: 1, b: 2 }), { a: 5, b: 2 });\n * assert.deepStrictEqual(upsertAt(\"c\", 5)({ a: 1, b: 2 }), { a: 1, b: 2, c: 5 });\n *\n * @since 2.10.0\n */\nexport var upsertAt = function (k, a) {\n return function (r) {\n if (_.has.call(r, k) && r[k] === a) {\n return r;\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return out;\n };\n};\n/**\n * Test whether or not a key exists in a `ReadonlyRecord`.\n *\n * Note. This function is not pipeable because is a `Refinement`.\n *\n * @example\n * import { has } from 'fp-ts/ReadonlyRecord'\n *\n * assert.deepStrictEqual(has(\"a\", { a: 1, b: 2 }), true);\n * assert.deepStrictEqual(has(\"c\", { a: 1, b: 2 }), false);\n *\n * @since 2.10.0\n */\nexport var has = function (k, r) {\n return _.has.call(r, k);\n};\nexport function deleteAt(k) {\n return function (r) {\n if (!_.has.call(r, k)) {\n return r;\n }\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\n/**\n * Replace a key/value pair in a `ReadonlyRecord`.\n *\n * @returns If the specified key exists it returns an `Option` containing a new `Record`\n * with the entry updated, otherwise it returns `None`\n *\n * @example\n * import { updateAt } from 'fp-ts/ReadonlyRecord'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(updateAt(\"a\", 3)({ a: 1, b: 2 }), option.some({ a: 3, b: 2 }));\n * assert.deepStrictEqual(updateAt(\"c\", 3)({ a: 1, b: 2 }), option.none);\n *\n * @since 2.5.0\n */\nexport var updateAt = function (k, a) {\n return function (r) {\n if (!has(k, r)) {\n return _.none;\n }\n if (r[k] === a) {\n return _.some(r);\n }\n var out = Object.assign({}, r);\n out[k] = a;\n return _.some(out);\n };\n};\n/**\n * Applies a mapping function to one specific key/value pair in a `ReadonlyRecord`.\n *\n * @returns If the specified key exists it returns an `Option` containing a new `Record`\n * with the entry updated, otherwise it returns `None`\n *\n * @example\n * import { modifyAt } from 'fp-ts/ReadonlyRecord'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(modifyAt(\"a\", (x: number) => x * 3)({ a: 1, b: 2 }), option.some({ a: 3, b: 2 }));\n * assert.deepStrictEqual(modifyAt(\"c\", (x: number) => x * 3)({ a: 1, b: 2 }), option.none);\n *\n * @since 2.5.0\n */\nexport var modifyAt = function (k, f) {\n return function (r) {\n if (!has(k, r)) {\n return _.none;\n }\n var next = f(r[k]);\n if (next === r[k]) {\n return _.some(r);\n }\n var out = Object.assign({}, r);\n out[k] = next;\n return _.some(out);\n };\n};\nexport function pop(k) {\n var deleteAtk = deleteAt(k);\n return function (r) {\n var oa = lookup(k, r);\n return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]);\n };\n}\nexport function isSubrecord(E) {\n return function (me, that) {\n if (that === undefined) {\n var isSubrecordE_1 = isSubrecord(E);\n return function (that) {\n return isSubrecordE_1(that, me);\n };\n }\n for (var k in me) {\n if (!_.has.call(that, k) || !E.equals(me[k], that[k])) {\n return false;\n }\n }\n return true;\n };\n}\nexport function lookup(k, r) {\n if (r === undefined) {\n return function (r) {\n return lookup(k, r);\n };\n }\n return _.has.call(r, k) ? _.some(r[k]) : _.none;\n}\n/**\n * @since 2.5.0\n */\nexport var empty = {};\nexport function mapWithIndex(f) {\n return function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n out[k] = f(k, r[k]);\n }\n }\n return out;\n };\n}\nexport function map(f) {\n return mapWithIndex(function (_, a) {\n return f(a);\n });\n}\nexport function reduceWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 2) {\n return reduceWithIndex(S.Ord).apply(void 0, args);\n }\n var keysO = keys_(args[0]);\n return function (b, f) {\n return function (fa) {\n var out = b;\n var ks = keysO(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = f(k, out, fa[k]);\n }\n return out;\n };\n };\n}\nexport function foldMapWithIndex(O) {\n if ('compare' in O) {\n var keysO_1 = keys_(O);\n return function (M) {\n return function (f) {\n return function (fa) {\n var out = M.empty;\n var ks = keysO_1(fa);\n var len = ks.length;\n for (var i = 0; i < len; i++) {\n var k = ks[i];\n out = M.concat(out, f(k, fa[k]));\n }\n return out;\n };\n };\n };\n }\n return foldMapWithIndex(S.Ord)(O);\n}\nexport function reduceRightWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 2) {\n return reduceRightWithIndex(S.Ord).apply(void 0, args);\n }\n var keysO = keys_(args[0]);\n return function (b, f) {\n return function (fa) {\n var out = b;\n var ks = keysO(fa);\n var len = ks.length;\n for (var i = len - 1; i >= 0; i--) {\n var k = ks[i];\n out = f(k, fa[k], out);\n }\n return out;\n };\n };\n}\n/**\n * Create a `ReadonlyRecord` with one key/value pair.\n *\n * @example\n * import { singleton } from \"fp-ts/ReadonlyRecord\";\n *\n * assert.deepStrictEqual(singleton(\"a\", 1), { a: 1 });\n *\n * @category constructors\n * @since 2.5.0\n */\nexport var singleton = function (k, a) {\n var _a;\n return _a = {}, _a[k] = a, _a;\n};\nexport function traverseWithIndex(F) {\n var traverseWithIndexOF = _traverseWithIndex(S.Ord)(F);\n return function (f) {\n return function (ta) {\n return traverseWithIndexOF(ta, f);\n };\n };\n}\nexport function traverse(F) {\n var traverseOF = _traverse(S.Ord)(F);\n return function (f) {\n return function (ta) {\n return traverseOF(ta, f);\n };\n };\n}\nexport function sequence(F) {\n return _sequence(S.Ord)(F);\n}\n/**\n * @category filtering\n * @since 2.6.5\n */\nexport var wither = function (F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(pipe(fa, traverseF(f)), compact);\n };\n };\n};\n/**\n * @category filtering\n * @since 2.6.5\n */\nexport var wilt = function (F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(pipe(fa, traverseF(f)), separate);\n };\n };\n};\nexport function partitionMapWithIndex(f) {\n return function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var e = f(k, r[k]);\n switch (e._tag) {\n case 'Left':\n left[k] = e.left;\n break;\n case 'Right':\n right[k] = e.right;\n break;\n }\n }\n }\n return separated(left, right);\n };\n}\nexport function partitionWithIndex(predicateWithIndex) {\n return function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var a = r[k];\n if (predicateWithIndex(k, a)) {\n right[k] = a;\n } else {\n left[k] = a;\n }\n }\n }\n return separated(left, right);\n };\n}\nexport function filterMapWithIndex(f) {\n return function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var ob = f(k, r[k]);\n if (_.isSome(ob)) {\n out[k] = ob.value;\n }\n }\n }\n return out;\n };\n}\nexport function filterWithIndex(predicateWithIndex) {\n return function (fa) {\n var out = {};\n var changed = false;\n for (var key in fa) {\n if (_.has.call(fa, key)) {\n var a = fa[key];\n if (predicateWithIndex(key, a)) {\n out[key] = a;\n } else {\n changed = true;\n }\n }\n }\n return changed ? out : fa;\n };\n}\nexport function fromFoldable(M, F) {\n var fromFoldableMapM = fromFoldableMap(M, F);\n return function (fka) {\n return fromFoldableMapM(fka, identity);\n };\n}\nexport function fromFoldableMap(M, F) {\n return function (ta, f) {\n return F.reduce(ta, {}, function (r, a) {\n var _a = f(a),\n k = _a[0],\n b = _a[1];\n r[k] = _.has.call(r, k) ? M.concat(r[k], b) : b;\n return r;\n });\n };\n}\n/**\n * Alias of [`toReadonlyArray`](#toreadonlyarray).\n *\n * @example\n * import { toEntries } from 'fp-ts/ReadonlyRecord'\n *\n * assert.deepStrictEqual(toEntries({ b: 2, a: 1 }), [['a', 1], ['b', 2]])\n *\n * @category conversions\n * @since 2.12.0\n */\nexport var toEntries = toReadonlyArray;\n/**\n * Converts a `ReadonlyArray` of `[key, value]` tuples into a `ReadonlyRecord`.\n *\n * @example\n * import { fromEntries } from 'fp-ts/ReadonlyRecord'\n *\n * assert.deepStrictEqual(fromEntries([['a', 1], ['b', 2], ['a', 3]]), { b: 2, a: 3 })\n *\n * @since 2.12.0\n * @category conversions\n */\nexport var fromEntries = function (fa) {\n var out = {};\n for (var _i = 0, fa_1 = fa; _i < fa_1.length; _i++) {\n var a = fa_1[_i];\n out[a[0]] = a[1];\n }\n return out;\n};\nexport function every(predicate) {\n return function (r) {\n for (var k in r) {\n if (!predicate(r[k])) {\n return false;\n }\n }\n return true;\n };\n}\n/**\n * Test if at least one value in a `ReadonlyRecord` satisfies the predicate.\n *\n * @example\n * import { some } from \"fp-ts/ReadonlyRecord\"\n *\n * assert.deepStrictEqual(some((n: number) => n >= 0)({ a: 1, b: -2 }), true);\n * assert.deepStrictEqual(some((n: number) => n >= 0)({ a: -1, b: -2 }), false);\n *\n * @since 2.5.0\n */\nexport function some(predicate) {\n return function (r) {\n for (var k in r) {\n if (predicate(r[k])) {\n return true;\n }\n }\n return false;\n };\n}\nexport function elem(E) {\n return function (a, fa) {\n if (fa === undefined) {\n var elemE_1 = elem(E);\n return function (fa) {\n return elemE_1(a, fa);\n };\n }\n for (var k in fa) {\n if (E.equals(fa[k], a)) {\n return true;\n }\n }\n return false;\n };\n}\n/**\n * Union of two `ReadonlyRecord`s.\n * Takes two `ReadonlyRecord`s and produces a `ReadonlyRecord` combining all the\n * entries of the two inputs.\n * It uses the `concat` function of the provided `Magma` to\n * combine the elements with the same key.\n *\n * @example\n * import { union } from \"fp-ts/ReadonlyRecord\";\n * import { Magma } from \"fp-ts/Magma\";\n *\n * const m1: Magma = { concat: (x: number, y: number) => x + y };\n * assert.deepStrictEqual(union(m1)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 4, b: 2, c: 3 });\n * const m2: Magma = { concat: (x: number) => x };\n * assert.deepStrictEqual(union(m2)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 1, b: 2, c: 3 });\n *\n * @since 2.11.0\n */\nexport var union = function (M) {\n return function (second) {\n return function (first) {\n if (isEmpty(first)) {\n return second;\n }\n if (isEmpty(second)) {\n return first;\n }\n var out = {};\n for (var k in first) {\n if (has(k, second)) {\n out[k] = M.concat(first[k], second[k]);\n } else {\n out[k] = first[k];\n }\n }\n for (var k in second) {\n if (!has(k, out)) {\n out[k] = second[k];\n }\n }\n return out;\n };\n };\n};\n/**\n * Intersection of two `ReadonlyRecord`s.\n * Takes two `ReadonlyRecord`s and produces a `ReadonlyRecord` combining only the\n * entries of the two inputswith the same key.\n * It uses the `concat` function of the provided `Magma` to\n * combine the elements.\n *\n * @example\n * import { intersection } from \"fp-ts/ReadonlyRecord\";\n * import { Magma } from \"fp-ts/Magma\";\n *\n * const m1: Magma = { concat: (x: number, y: number) => x + y };\n * assert.deepStrictEqual(intersection(m1)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 4});\n * const m2: Magma = { concat: (x: number) => x };\n * assert.deepStrictEqual(intersection(m2)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 1});\n *\n * @since 2.11.0\n */\nexport var intersection = function (M) {\n return function (second) {\n return function (first) {\n if (isEmpty(first) || isEmpty(second)) {\n return empty;\n }\n var out = {};\n for (var k in first) {\n if (has(k, second)) {\n out[k] = M.concat(first[k], second[k]);\n }\n }\n return out;\n };\n };\n};\n/**\n * Difference between two `ReadonlyRecord`s.\n * Takes two `ReadonlyRecord`s and produces a `ReadonlyRecord` composed by the\n * entries of the two inputs, removing the entries with the same\n * key in both inputs.\n *\n * @example\n * import { difference } from \"fp-ts/ReadonlyRecord\";\n *\n * assert.deepStrictEqual(difference({ a: 1 })({ a: 1, b: 2 }), { b: 2 });\n * assert.deepStrictEqual(difference({ a: 3 })({ a: 1, b: 2 }), { b: 2 });\n * assert.deepStrictEqual(difference({ a: 3, c: 3 })({ a: 1, b: 2 }), { b: 2, c: 3 });\n *\n * @since 2.11.0\n */\nexport var difference = function (second) {\n return function (first) {\n if (isEmpty(first)) {\n return second;\n }\n if (isEmpty(second)) {\n return first;\n }\n var out = {};\n for (var k in first) {\n if (!has(k, second)) {\n out[k] = first[k];\n }\n }\n for (var k in second) {\n if (!has(k, first)) {\n out[k] = second[k];\n }\n }\n return out;\n };\n};\n/** @internal */\nexport var _map = function (fa, f) {\n return pipe(fa, map(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _mapWithIndex = function (fa, f) {\n return pipe(fa, mapWithIndex(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _reduce = function (O) {\n var reduceO = reduce(O);\n return function (fa, b, f) {\n return pipe(fa, reduceO(b, f));\n };\n};\n/** @internal */\nexport var _foldMap = function (O) {\n return function (M) {\n var foldMapM = foldMap(O)(M);\n return function (fa, f) {\n return pipe(fa, foldMapM(f));\n };\n };\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _reduceRight = function (O) {\n var reduceRightO = reduceRight(O);\n return function (fa, b, f) {\n return pipe(fa, reduceRightO(b, f));\n };\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _filter = function (fa, predicate) {\n return pipe(fa, filter(predicate));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _filterMap = function (fa, f) {\n return pipe(fa, filterMap(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _partition = function (fa, predicate) {\n return pipe(fa, partition(predicate));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _partitionMap = function (fa, f) {\n return pipe(fa, partitionMap(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _reduceWithIndex = function (O) {\n var reduceWithIndexO = reduceWithIndex(O);\n return function (fa, b, f) {\n return pipe(fa, reduceWithIndexO(b, f));\n };\n};\n/** @internal */\nexport var _foldMapWithIndex = function (O) {\n var foldMapWithIndexO = foldMapWithIndex(O);\n return function (M) {\n var foldMapWithIndexM = foldMapWithIndexO(M);\n return function (fa, f) {\n return pipe(fa, foldMapWithIndexM(f));\n };\n };\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _reduceRightWithIndex = function (O) {\n var reduceRightWithIndexO = reduceRightWithIndex(O);\n return function (fa, b, f) {\n return pipe(fa, reduceRightWithIndexO(b, f));\n };\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _partitionMapWithIndex = function (fa, f) {\n return pipe(fa, partitionMapWithIndex(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _partitionWithIndex = function (fa, predicateWithIndex) {\n return pipe(fa, partitionWithIndex(predicateWithIndex));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _filterMapWithIndex = function (fa, f) {\n return pipe(fa, filterMapWithIndex(f));\n};\n/** @internal */\n/* istanbul ignore next */\nexport var _filterWithIndex = function (fa, predicateWithIndex) {\n return pipe(fa, filterWithIndex(predicateWithIndex));\n};\n/** @internal */\nexport var _traverse = function (O) {\n var traverseWithIndexO = _traverseWithIndex(O);\n return function (F) {\n var traverseWithIndexOF = traverseWithIndexO(F);\n return function (ta, f) {\n return traverseWithIndexOF(ta, flow(SK, f));\n };\n };\n};\n/** @internal */\nexport var _sequence = function (O) {\n var traverseO = _traverse(O);\n return function (F) {\n var traverseOF = traverseO(F);\n return function (ta) {\n return traverseOF(ta, identity);\n };\n };\n};\nvar _traverseWithIndex = function (O) {\n return function (F) {\n var keysO = keys_(O);\n return function (ta, f) {\n var ks = keysO(ta);\n if (ks.length === 0) {\n return F.of(empty);\n }\n var fr = F.of({});\n var _loop_1 = function (key) {\n fr = F.ap(F.map(fr, function (r) {\n return function (b) {\n var _a;\n return Object.assign({}, r, (_a = {}, _a[key] = b, _a));\n };\n }), f(key, ta[key]));\n };\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n _loop_1(key);\n }\n return fr;\n };\n };\n};\n/**\n * Given a `Predicate`, it produces a new `ReadonlyRecord` keeping only the entries with a\n * value that satisfies the provided predicate.\n *\n * @example\n * import { filter } from \"fp-ts/ReadonlyRecord\"\n *\n * assert.deepStrictEqual(filter((s: string) => s.length < 4)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * a: \"foo\",\n * b: \"bar\",\n * });\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var filter = function (predicate) {\n return filterWithIndex(function (_, a) {\n return predicate(a);\n });\n};\n/**\n * Maps a `ReadonlyRecord` with an iterating function that returns an `Option`\n * and it keeps only the `Some` values discarding the `None`s.\n *\n * @example\n * import { filterMap } from \"fp-ts/ReadonlyRecord\"\n * import { option } from \"fp-ts\"\n *\n * const f = (s: string) => s.length < 4 ? option.some(`${s} is short`): option.none\n * assert.deepStrictEqual(filterMap(f)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * a: \"foo is short\",\n * b: \"bar is short\",\n * });\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var filterMap = function (f) {\n return filterMapWithIndex(function (_, a) {\n return f(a);\n });\n};\n/**\n * Partition a `ReadonlyRecord` into two parts according to a `Predicate`.\n *\n * @example\n * import { partition } from \"fp-ts/ReadonlyRecord\"\n *\n * assert.deepStrictEqual(partition((s: string) => s.length < 4)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * left:{\n * c: \"verylong\"\n * },\n * right: {\n * a: \"foo\",\n * b: \"bar\",\n * },\n * });\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var partition = function (predicate) {\n return partitionWithIndex(function (_, a) {\n return predicate(a);\n });\n};\n/**\n * Maps a `ReadonlyRecord` with a function returning an `Either` and\n * partitions the resulting `ReadonlyRecord` into `Left`s and `Right`s.\n *\n * @example\n * import { partitionMap } from \"fp-ts/ReadonlyRecord\"\n * import { either } from \"fp-ts\"\n *\n * const f = (s: string) => (s.length < 4 ? either.right(`${s} is short`) : either.left(`${s} is not short`));\n * assert.deepStrictEqual(partitionMap(f)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * left: {\n * c: \"verylong is not short\",\n * },\n * right: {\n * a: \"foo is short\",\n * b: \"bar is short\",\n * },\n * });\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var partitionMap = function (f) {\n return partitionMapWithIndex(function (_, a) {\n return f(a);\n });\n};\nexport function reduce() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 1) {\n var reduceWithIndexO_1 = reduceWithIndex(args[0]);\n return function (b, f) {\n return reduceWithIndexO_1(b, function (_, b, a) {\n return f(b, a);\n });\n };\n }\n return reduce(S.Ord).apply(void 0, args);\n}\nexport function foldMap(O) {\n if ('compare' in O) {\n var foldMapWithIndexO_1 = foldMapWithIndex(O);\n return function (M) {\n var foldMapWithIndexM = foldMapWithIndexO_1(M);\n return function (f) {\n return foldMapWithIndexM(function (_, a) {\n return f(a);\n });\n };\n };\n }\n return foldMap(S.Ord)(O);\n}\nexport function reduceRight() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 1) {\n var reduceRightWithIndexO_1 = reduceRightWithIndex(args[0]);\n return function (b, f) {\n return reduceRightWithIndexO_1(b, function (_, b, a) {\n return f(b, a);\n });\n };\n }\n return reduceRight(S.Ord).apply(void 0, args);\n}\n/**\n * Compact a `ReadonlyRecord` of `Option`s discarding the `None` values and\n * keeping the `Some` values.\n *\n * @example\n * import { compact } from 'fp-ts/ReadonlyRecord'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(compact({ a: option.some(\"foo\"), b: option.none, c: option.some(\"bar\") }), {\n * a: \"foo\",\n * c: \"bar\",\n * });\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var compact = function (r) {\n var out = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var oa = r[k];\n if (_.isSome(oa)) {\n out[k] = oa.value;\n }\n }\n }\n return out;\n};\n/**\n * Separate a `ReadonlyRecord` of `Either`s into `Left`s and `Right`s.\n *\n * @example\n * import { separate } from 'fp-ts/ReadonlyRecord'\n * import { either } from 'fp-ts'\n *\n * assert.deepStrictEqual(\n * separate({ a: either.right(\"foo\"), b: either.left(\"bar\"), c: either.right(\"baz\") }),\n * {\n * right: {\n * a: \"foo\",\n * c: \"baz\",\n * },\n * left: {\n * b: \"bar\",\n * },\n * }\n * );\n *\n * @category filtering\n * @since 2.5.0\n */\nexport var separate = function (r) {\n var left = {};\n var right = {};\n for (var k in r) {\n if (_.has.call(r, k)) {\n var e = r[k];\n if (_.isLeft(e)) {\n left[k] = e.left;\n } else {\n right[k] = e.right;\n }\n }\n }\n return separated(left, right);\n};\n/**\n * @category type lambdas\n * @since 2.5.0\n */\nexport var URI = 'ReadonlyRecord';\nexport function getShow(O) {\n if ('compare' in O) {\n return function (S) {\n return {\n show: function (r) {\n var elements = collect(O)(function (k, a) {\n return \"\".concat(JSON.stringify(k), \": \").concat(S.show(a));\n })(r).join(', ');\n return elements === '' ? '{}' : \"{ \".concat(elements, \" }\");\n }\n };\n };\n }\n return getShow(S.Ord)(O);\n}\nexport function getEq(E) {\n var isSubrecordE = isSubrecord(E);\n return fromEquals(function (x, y) {\n return isSubrecordE(x)(y) && isSubrecordE(y)(x);\n });\n}\nexport function getMonoid(S) {\n return {\n concat: function (first, second) {\n if (isEmpty(first)) {\n return second;\n }\n if (isEmpty(second)) {\n return first;\n }\n var r = Object.assign({}, first);\n for (var k in second) {\n if (_.has.call(second, k)) {\n r[k] = _.has.call(first, k) ? S.concat(first[k], second[k]) : second[k];\n }\n }\n return r;\n },\n empty: empty\n };\n}\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Functor = {\n URI: URI,\n map: _map\n};\n/**\n * Takes a value and a `ReadonlyRecord` of functions and returns a\n * `ReadonlyRecord` by applying each function to the input value.\n *\n * @example\n * import { flap } from \"fp-ts/ReadonlyRecord\"\n *\n * const fab = { x: (n: number) => `${n} times 2`, y: (n: number) => `${n * 2}` };\n * assert.deepStrictEqual(flap(3)(fab), {\n * x: \"3 times 2\",\n * y: \"6\",\n * });\n *\n * @category mapping\n * @since 2.10.0\n */\nexport var flap = /*#__PURE__*/flap_(Functor);\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var FunctorWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * Produces a `Foldable` instance for a `ReadonlyRecord`, using the\n * provided `Ord` to sort the `ReadonlyRecord`'s entries by key.\n *\n * @category folding\n * @since 2.11.0\n */\nexport var getFoldable = function (O) {\n return {\n URI: URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O)\n };\n};\n/**\n * Produces a `FoldableWithIndex1` instance for a `ReadonlyRecord`, using the\n * provided `Ord` to sort the `ReadonlyRecord`'s entries by key.\n *\n * @category folding\n * @since 2.11.0\n */\nexport var getFoldableWithIndex = function (O) {\n return {\n URI: URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O)\n };\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Compactable = {\n URI: URI,\n compact: compact,\n separate: separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Filterable = {\n URI: URI,\n map: _map,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var FilterableWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex\n};\n/**\n * Produces a `Traversable` instance for a `ReadonlyRecord`, using the\n * provided `Ord` to sort the `ReadonlyRecord`'s entries by key.\n *\n * @category traversing\n * @since 2.11.0\n */\nexport var getTraversable = function (O) {\n return {\n URI: URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: _traverse(O),\n sequence: _sequence(O)\n };\n};\n/**\n * Produces a `TraversableWithIndex` instance for a `ReadonlyRecord`, using the\n * provided `Ord` to sort the `ReadonlyRecord`'s entries by key.\n *\n * @category traversing\n * @since 2.11.0\n */\nexport var getTraversableWithIndex = function (O) {\n return {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O),\n traverse: _traverse(O),\n sequence: _sequence(O),\n traverseWithIndex: _traverseWithIndex(O)\n };\n};\n/**\n * @category filtering\n * @since 2.11.0\n */\nexport var getWitherable = function (O) {\n var T = getTraversable(O);\n return {\n URI: URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: T.traverse,\n sequence: T.sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: witherDefault(T, Compactable),\n wilt: wiltDefault(T, Compactable)\n };\n};\n/**\n * Given a `Semigroup` in the base type, it produces a `Semigroup`\n * in the `ReadonlyRecord` of the base type.\n * The resulting `Semigroup` concatenates two `ReadonlyRecord`s by\n * `union`.\n *\n * @example\n * import { getUnionSemigroup, ReadonlyRecord } from \"fp-ts/ReadonlyRecord\"\n * import { Semigroup } from \"fp-ts/Semigroup\"\n *\n * const sNumber: Semigroup = { concat: (x, y) => x - y };\n * const sReadonlyRecord: Semigroup> = getUnionSemigroup(sNumber);\n * assert.deepStrictEqual(sReadonlyRecord.concat({ a: 1, b: 2 }, { b: 3, c: 4 }), { a: 1, b: -1, c: 4 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getUnionSemigroup = function (S) {\n var unionS = union(S);\n return {\n concat: function (first, second) {\n return unionS(second)(first);\n }\n };\n};\n/**\n * Same as `getMonoid`.\n * Returns a `Monoid` instance for `ReadonlyRecord`s given a `Semigroup`\n * instance for the base type.\n * The `Monoid` makes the union of two `ReadonlyRecord`s combining the\n * entries that have the same key with the provided `Semigroup`.\n *\n * @example\n * import { SemigroupSum } from 'fp-ts/number'\n * import { getUnionMonoid } from 'fp-ts/ReadonlyRecord'\n *\n * const M = getUnionMonoid(SemigroupSum);\n * assert.deepStrictEqual(M.concat({ foo: 123, bar: 234 }, { foo: 456, baz: 567 }), { foo: 579 , bar: 234, baz: 567 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getUnionMonoid = function (S) {\n return {\n concat: getUnionSemigroup(S).concat,\n empty: empty\n };\n};\n/**\n * Given a `Semigroup` in the base type, it produces a `Semigroup`\n * in the `ReadonlyRecord` of the base type.\n * The resulting `Semigroup` concatenates two `ReadonlyRecord`s by\n * `intersection`.\n *\n * @example\n * import { getIntersectionSemigroup, ReadonlyRecord } from \"fp-ts/ReadonlyRecord\"\n * import { Semigroup } from \"fp-ts/Semigroup\"\n *\n * const sNumber: Semigroup = { concat: (x, y) => x - y };\n * const sReadonlyRecord: Semigroup> = getIntersectionSemigroup(sNumber);\n * assert.deepStrictEqual(sReadonlyRecord.concat({ a: 1, b: 2 }, { b: 3, c: 4 }), { b: -1 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getIntersectionSemigroup = function (S) {\n var intersectionS = intersection(S);\n return {\n concat: function (first, second) {\n return intersectionS(second)(first);\n }\n };\n};\n/**\n * Produces a `Magma` with a `concat` function that combines\n * two `ReadonlyRecord`s by making the `difference`.\n *\n * @example\n * import { getDifferenceMagma, difference, ReadonlyRecord } from \"fp-ts/ReadonlyRecord\"\n * import { Magma } from \"fp-ts/Magma\"\n *\n * const r1 = { a: 3, c: 3 };\n * const r2 = { a: 1, b: 2 };\n * const m: Magma> = getDifferenceMagma();\n * assert.deepStrictEqual(m.concat(r1, r2), difference(r2)(r1));\n * assert.deepStrictEqual(m.concat(r1, r2), { c: 3, b: 2 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getDifferenceMagma = function () {\n return {\n concat: function (first, second) {\n return difference(second)(first);\n }\n };\n};\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * Use `getFoldable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Foldable = {\n URI: URI,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord)\n};\n/**\n * Use `getFoldableWithIndex` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var FoldableWithIndex = {\n URI: URI,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord)\n};\n/**\n * Use `getTraversable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Traversable = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence\n};\n/**\n * Use `getTraversableWithIndex` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var TraversableWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n traverseWithIndex: /*#__PURE__*/_traverseWithIndex(S.Ord)\n};\nvar _wither = /*#__PURE__*/witherDefault(Traversable, Compactable);\nvar _wilt = /*#__PURE__*/wiltDefault(Traversable, Compactable);\n/**\n * Use `getWitherable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Witherable = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * Use [`upsertAt`](#upsertat) instead.\n *\n * @category zone of death\n * @since 2.5.0\n * @deprecated\n */\nexport var insertAt = upsertAt;\nexport function hasOwnProperty(k, r) {\n return _.has.call(r === undefined ? this : r, k);\n}\n/**\n * This instance is deprecated, use small, specific instances instead.\n * For example if a function needs a `Functor` instance, pass `RR.Functor` instead of `RR.readonlyRecord`\n * (where `RR` is from `import RR from 'fp-ts/ReadonlyRecord'`)\n *\n * @category zone of death\n * @since 2.5.0\n * @deprecated\n */\nexport var readonlyRecord = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n mapWithIndex: _mapWithIndex,\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord),\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n traverseWithIndex: /*#__PURE__*/_traverseWithIndex(S.Ord),\n wither: _wither,\n wilt: _wilt\n};","var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as A from './Array';\nimport { pipe } from './function';\nimport { flap as flap_ } from './Functor';\nimport * as _ from './internal';\nimport * as RR from './ReadonlyRecord';\nimport * as Se from './Semigroup';\nimport * as S from './string';\nimport { wiltDefault, witherDefault } from './Witherable';\n// -------------------------------------------------------------------------------------\n// model\n// -------------------------------------------------------------------------------------\n/**\n * Calculate the number of key/value pairs in a `Record`.\n *\n * @example\n * import { size } from \"fp-ts/Record\";\n *\n * assert.deepStrictEqual(size({ a: true, b: 2, c: \"three\" }), 3);\n *\n * @since 2.0.0\n */\nexport var size = RR.size;\n/**\n * Test whether a `Record` is empty.\n *\n * @example\n * import { isEmpty } from \"fp-ts/Record\";\n *\n * assert.deepStrictEqual(isEmpty({}), true);\n * assert.deepStrictEqual(isEmpty({ a: 3 }), false);\n *\n * @since 2.0.0\n */\nexport var isEmpty = RR.isEmpty;\nvar keys_ = function (O) {\n return function (r) {\n return Object.keys(r).sort(O.compare);\n };\n};\n/**\n * The keys of a `Record`, sorted alphabetically.\n *\n * @example\n * import { keys } from \"fp-ts/Record\";\n *\n * assert.deepStrictEqual(keys({ c: 1, a: 2, b: 3 }), [\"a\", \"b\", \"c\"]);\n *\n * @since 2.0.0\n */\nexport var keys = /*#__PURE__*/keys_(S.Ord);\nexport function collect(O) {\n if (typeof O === 'function') {\n return collect(S.Ord)(O);\n }\n var keysO = keys_(O);\n return function (f) {\n return function (r) {\n var out = [];\n for (var _i = 0, _a = keysO(r); _i < _a.length; _i++) {\n var key = _a[_i];\n out.push(f(key, r[key]));\n }\n return out;\n };\n };\n}\n/**\n * Get a sorted `Array` of the key/value pairs contained in a `Record`.\n * Sorted alphabetically by key.\n *\n * @example\n * import { toArray } from 'fp-ts/Record'\n *\n * const x = { c: 3, a: \"foo\", b: false };\n * assert.deepStrictEqual(toArray(x), [\n * [\"a\", \"foo\"],\n * [\"b\", false],\n * [\"c\", 3],\n * ]);\n *\n * @category conversions\n * @since 2.0.0\n */\nexport var toArray = /*#__PURE__*/collect(S.Ord)(function (k, a) {\n return [k, a];\n});\nexport function toUnfoldable(U) {\n return function (r) {\n var sas = toArray(r);\n var len = sas.length;\n return U.unfold(0, function (b) {\n return b < len ? _.some([sas[b], b + 1]) : _.none;\n });\n };\n}\n/**\n * Insert or replace a key/value pair in a `Record`.\n *\n * @example\n * import { upsertAt } from 'fp-ts/Record'\n *\n * assert.deepStrictEqual(upsertAt(\"a\", 5)({ a: 1, b: 2 }), { a: 5, b: 2 });\n * assert.deepStrictEqual(upsertAt(\"c\", 5)({ a: 1, b: 2 }), { a: 1, b: 2, c: 5 });\n *\n * @since 2.10.0\n */\nexport var upsertAt = RR.upsertAt;\n/**\n * Test whether or not a key exists in a `Record`.\n *\n * Note. This function is not pipeable because is a `Refinement`.\n *\n * @example\n * import { has } from 'fp-ts/Record'\n *\n * assert.deepStrictEqual(has(\"a\", { a: 1, b: 2 }), true);\n * assert.deepStrictEqual(has(\"c\", { a: 1, b: 2 }), false);\n *\n * @since 2.10.0\n */\nexport var has = RR.has;\nexport function deleteAt(k) {\n return function (r) {\n if (!_.has.call(r, k)) {\n return r;\n }\n var out = Object.assign({}, r);\n delete out[k];\n return out;\n };\n}\n/**\n * Replace a key/value pair in a `Record`.\n *\n * @returns If the specified key exists it returns an `Option` containing a new `Record`\n * with the entry updated, otherwise it returns `None`\n *\n * @example\n * import { updateAt } from 'fp-ts/Record'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(updateAt(\"a\", 3)({ a: 1, b: 2 }), option.some({ a: 3, b: 2 }));\n * assert.deepStrictEqual(updateAt(\"c\", 3)({ a: 1, b: 2 }), option.none);\n *\n * @since 2.0.0\n */\nexport var updateAt = function (k, a) {\n return modifyAt(k, function () {\n return a;\n });\n};\n/**\n * Applies a mapping function to one spcific key/value pair in a `Record`.\n *\n * @returns If the specified key exists it returns an `Option` containing a new `Record`\n * with the entry updated, otherwise it returns `None`\n *\n * @example\n * import { modifyAt } from 'fp-ts/Record'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(modifyAt(\"a\", (x: number) => x * 3)({ a: 1, b: 2 }), option.some({ a: 3, b: 2 }));\n * assert.deepStrictEqual(modifyAt(\"c\", (x: number) => x * 3)({ a: 1, b: 2 }), option.none);\n *\n * @since 2.0.0\n */\nexport var modifyAt = function (k, f) {\n return function (r) {\n if (!has(k, r)) {\n return _.none;\n }\n var out = Object.assign({}, r);\n out[k] = f(r[k]);\n return _.some(out);\n };\n};\nexport function pop(k) {\n var deleteAtk = deleteAt(k);\n return function (r) {\n var oa = lookup(k, r);\n return _.isNone(oa) ? _.none : _.some([oa.value, deleteAtk(r)]);\n };\n}\n// TODO: remove non-curried overloading in v3\n/**\n * Test whether one `Record` contains all of the keys and values\n * contained in another `Record`.\n *\n * @example\n * import { isSubrecord } from 'fp-ts/Record'\n * import { string } from 'fp-ts'\n *\n * assert.deepStrictEqual(\n * isSubrecord(string.Eq)({ a: \"foo\", b: \"bar\", c: \"baz\" })({ a: \"foo\", b: \"bar\", c: \"baz\" }),\n * true\n * );\n * assert.deepStrictEqual(\n * isSubrecord(string.Eq)({ a: \"foo\", b: \"bar\", c: \"baz\" })({ a: \"foo\", c: \"baz\" }),\n * true\n * );\n * assert.deepStrictEqual(\n * isSubrecord(string.Eq)({ a: \"foo\", b: \"bar\", c: \"baz\" })({ a: \"foo\", b: \"not-bar\", c: \"baz\" }),\n * false\n * );\n * assert.deepStrictEqual(\n * isSubrecord(string.Eq)({ a: \"foo\", b: \"bar\" })({ a: \"foo\", b: \"bar\", c: \"baz\" }),\n * false\n * );\n *\n * @since 2.0.0\n */\nexport var isSubrecord = RR.isSubrecord;\n// TODO: remove non-curried overloading in v3\n/**\n * Lookup the value for a key in a `Record`.\n *\n * @returns If the specified key exists it returns an `Option` containing the value,\n * otherwise it returns `None`\n *\n * @example\n * import { lookup } from 'fp-ts/Record'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(lookup(\"b\")({ a: \"foo\", b: \"bar\" }), option.some(\"bar\"));\n * assert.deepStrictEqual(lookup(\"c\")({ a: \"foo\", b: \"bar\" }), option.none);\n *\n * @since 2.0.0\n */\nexport var lookup = RR.lookup;\n/**\n * Map a `Record` passing the key/value pairs to the iterating function.\n *\n * @example\n * import { mapWithIndex } from \"fp-ts/Record\";\n *\n * const f = (k: string, n: number) => `${k.toUpperCase()}-${n}`;\n * assert.deepStrictEqual(mapWithIndex(f)({ a: 3, b: 5 }), { a: \"A-3\", b: \"B-5\" });\n *\n * @since 2.0.0\n */\nexport var mapWithIndex = RR.mapWithIndex;\n/**\n * Map a `Record` passing the values to the iterating function.\n *\n * @example\n * import { map } from \"fp-ts/Record\";\n *\n * const f = (n: number) => `-${n}-`;\n * assert.deepStrictEqual(map(f)({ a: 3, b: 5 }), { a: \"-3-\", b: \"-5-\" });\n *\n * @category mapping\n * @since 2.0.0\n */\nexport var map = RR.map;\nexport function reduceWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceWithIndex(args[0]) : RR.reduceWithIndex(S.Ord).apply(void 0, args);\n}\nexport function foldMapWithIndex(O) {\n return 'compare' in O ? RR.foldMapWithIndex(O) : RR.foldMapWithIndex(S.Ord)(O);\n}\nexport function reduceRightWithIndex() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceRightWithIndex(args[0]) : RR.reduceRightWithIndex(S.Ord).apply(void 0, args);\n}\n/**\n * Create a `Record` with one key/value pair.\n *\n * @example\n * import { singleton } from \"fp-ts/Record\";\n *\n * assert.deepStrictEqual(singleton(\"a\", 1), { a: 1 });\n *\n * @since 2.0.0\n */\nexport var singleton = RR.singleton;\nexport function traverseWithIndex(F) {\n return RR.traverseWithIndex(F);\n}\nexport function traverse(F) {\n return RR.traverse(F);\n}\nexport function sequence(F) {\n return RR.sequence(F);\n}\n/**\n * @category filtering\n * @since 2.6.5\n */\nexport var wither = function (F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(pipe(fa, traverseF(f)), compact);\n };\n };\n};\n/**\n * @category filtering\n * @since 2.6.5\n */\nexport var wilt = function (F) {\n var traverseF = traverse(F);\n return function (f) {\n return function (fa) {\n return F.map(pipe(fa, traverseF(f)), separate);\n };\n };\n};\n/**\n * Maps a `Record` with a function returning an `Either` and\n * partitions the resulting `Record` into `Left`s and `Right`s.\n *\n * @example\n * import { partitionMapWithIndex } from \"fp-ts/Record\"\n * import { either } from \"fp-ts\"\n *\n * const f = (key: string, a: number) =>\n * a >= 0 ? either.right(`${key} is >= 0 (${a})`) : either.left(`${key} is < 0 (${a})`);\n * assert.deepStrictEqual(partitionMapWithIndex(f)({ a: -1, b: 2, c: 123 }), {\n * left: {\n * a: \"a is < 0 (-1)\",\n * },\n * right: {\n * b: \"b is >= 0 (2)\",\n * c: \"c is >= 0 (123)\",\n * },\n * });\n *\n * @since 2.0.0\n */\nexport var partitionMapWithIndex = RR.partitionMapWithIndex;\nexport function partitionWithIndex(predicateWithIndex) {\n return RR.partitionWithIndex(predicateWithIndex);\n}\n/**\n * Maps a `Record` with an iterating function that takes key and value and\n * returns an `Option`, keeping only the `Some` values and discarding `None`s.\n *\n * @example\n * import { filterMapWithIndex } from \"fp-ts/Record\"\n * import { option } from \"fp-ts\"\n *\n * const f = (key: string, a: number) => (a >= 0 ? option.some(`${key}${a}`) : option.none);\n * assert.deepStrictEqual(filterMapWithIndex(f)({ a: -1, b: 2, c: 3 }), {\n * b: \"b2\",\n * c: \"c3\",\n * });\n *\n * @since 2.0.0\n */\nexport var filterMapWithIndex = RR.filterMapWithIndex;\nexport function filterWithIndex(predicateWithIndex) {\n return RR.filterWithIndex(predicateWithIndex);\n}\nexport function fromFoldable(M, F) {\n return RR.fromFoldable(M, F);\n}\n/**\n * Alias of [`toArray`](#toArray).\n *\n * @example\n * import { toEntries } from 'fp-ts/Record'\n *\n * assert.deepStrictEqual(toEntries({ b: 2, a: 1 }), [['a', 1], ['b', 2]])\n *\n * @since 2.12.0\n * @category conversions\n */\nexport var toEntries = toArray;\n/**\n * Converts an `Array` of `[key, value]` tuples into a `Record`.\n *\n * @example\n * import { fromEntries } from 'fp-ts/Record'\n *\n * assert.deepStrictEqual(fromEntries([['a', 1], ['b', 2], ['a', 3]]), { b: 2, a: 3 })\n *\n * @since 2.12.0\n * @category conversions\n */\nexport var fromEntries = function (fa) {\n return fromFoldable(Se.last(), A.Foldable)(fa);\n};\nexport function fromFoldableMap(M, F) {\n return RR.fromFoldableMap(M, F);\n}\n/**\n * Test if every value in a `Record` satisfies the predicate.\n *\n * @example\n * import { every } from \"fp-ts/Record\"\n *\n * assert.deepStrictEqual(every((n: number) => n >= 0)({ a: 1, b: 2 }), true);\n * assert.deepStrictEqual(every((n: number) => n >= 0)({ a: 1, b: -1 }), false);\n *\n * @since 2.0.0\n */\nexport var every = RR.every;\n/**\n * Test if at least one value in a `Record` satisfies the predicate.\n *\n * @example\n * import { some } from \"fp-ts/Record\"\n *\n * assert.deepStrictEqual(some((n: number) => n >= 0)({ a: 1, b: -2 }), true);\n * assert.deepStrictEqual(some((n: number) => n >= 0)({ a: -1, b: -2 }), false);\n *\n * @since 2.0.0\n */\nexport var some = RR.some;\n// TODO: remove non-curried overloading in v3\n/**\n * Given an `Eq` checks if a `Record` contains an entry with\n * value equal to a provided value.\n *\n * @example\n * import { elem } from \"fp-ts/Record\"\n * import { number } from \"fp-ts\"\n *\n * assert.deepStrictEqual(elem(number.Eq)(123, { foo: 123, bar: 234 }), true);\n * assert.deepStrictEqual(elem(number.Eq)(-7, { foo: 123, bar: 234 }), false);\n *\n * @since 2.0.0\n */\nexport var elem = RR.elem;\n/**\n * Union of two `Record`s.\n * Takes two `Record`s and produces a `Record` combining all the\n * entries of the two inputs.\n * It uses the `concat` function of the provided `Magma` to\n * combine the elements with the same key.\n *\n * @example\n * import { union } from \"fp-ts/Record\";\n * import { Magma } from \"fp-ts/Magma\";\n *\n * const m1: Magma = { concat: (x: number, y: number) => x + y };\n * assert.deepStrictEqual(union(m1)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 4, b: 2, c: 3 });\n * const m2: Magma = { concat: (x: number) => x };\n * assert.deepStrictEqual(union(m2)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 1, b: 2, c: 3 });\n *\n * @since 2.11.0\n */\nexport var union = function (M) {\n var unionM = RR.union(M);\n return function (second) {\n return function (first) {\n if (isEmpty(first)) {\n return __assign({}, second);\n }\n if (isEmpty(second)) {\n return __assign({}, first);\n }\n return unionM(second)(first);\n };\n };\n};\n/**\n * Intersection of two `Record`s.\n * Takes two `Record`s and produces a `Record` combining only the\n * entries of the two inputswith the same key.\n * It uses the `concat` function of the provided `Magma` to\n * combine the elements.\n *\n * @example\n * import { intersection } from \"fp-ts/Record\";\n * import { Magma } from \"fp-ts/Magma\";\n *\n * const m1: Magma = { concat: (x: number, y: number) => x + y };\n * assert.deepStrictEqual(intersection(m1)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 4});\n * const m2: Magma = { concat: (x: number) => x };\n * assert.deepStrictEqual(intersection(m2)({ a: 3, c: 3 })({ a: 1, b: 2 }), { a: 1});\n *\n * @since 2.11.0\n */\nexport var intersection = function (M) {\n return function (second) {\n return function (first) {\n if (isEmpty(first) || isEmpty(second)) {\n return {};\n }\n return RR.intersection(M)(second)(first);\n };\n };\n};\n/**\n * Difference between two `Record`s.\n * Takes two `Record`s and produces a `Record` composed by the\n * entries of the two inputs, removing the entries with the same\n * key in both inputs.\n *\n * @example\n * import { difference } from \"fp-ts/Record\";\n *\n * assert.deepStrictEqual(difference({ a: 1 })({ a: 1, b: 2 }), { b: 2 });\n * assert.deepStrictEqual(difference({ a: 3 })({ a: 1, b: 2 }), { b: 2 });\n * assert.deepStrictEqual(difference({ a: 3, c: 3 })({ a: 1, b: 2 }), { b: 2, c: 3 });\n *\n * @since 2.11.0\n */\nexport var difference = function (second) {\n return function (first) {\n if (isEmpty(first)) {\n return __assign({}, second);\n }\n if (isEmpty(second)) {\n return __assign({}, first);\n }\n return RR.difference(second)(first);\n };\n};\nvar _map = RR._map;\nvar _mapWithIndex = RR._mapWithIndex;\nvar _reduce = RR._reduce;\nvar _foldMap = RR._foldMap;\nvar _reduceRight = RR._reduceRight;\nvar _filter = RR._filter;\nvar _filterMap = RR._filterMap;\nvar _partition = RR._partition;\nvar _partitionMap = RR._partitionMap;\nvar _reduceWithIndex = RR._reduceWithIndex;\nvar _foldMapWithIndex = RR._foldMapWithIndex;\nvar _reduceRightWithIndex = RR._reduceRightWithIndex;\nvar _partitionMapWithIndex = RR._partitionMapWithIndex;\nvar _partitionWithIndex = RR._partitionWithIndex;\nvar _filterMapWithIndex = RR._filterMapWithIndex;\nvar _filterWithIndex = RR._filterWithIndex;\nvar _traverse = RR._traverse;\nvar _sequence = RR._sequence;\nvar _traverseWithIndex = function (O) {\n return function (F) {\n var keysO = keys_(O);\n return function (ta, f) {\n var ks = keysO(ta);\n if (ks.length === 0) {\n return F.of({});\n }\n var fr = F.of({});\n var _loop_1 = function (key) {\n fr = F.ap(F.map(fr, function (r) {\n return function (b) {\n r[key] = b;\n return r;\n };\n }), f(key, ta[key]));\n };\n for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {\n var key = ks_1[_i];\n _loop_1(key);\n }\n return fr;\n };\n };\n};\n/**\n * Given a `Predicate`, it produces a new `Record` keeping only the entries with a\n * value that satisfies the provided predicate.\n *\n * @example\n * import { filter } from \"fp-ts/Record\"\n *\n * assert.deepStrictEqual(filter((s: string) => s.length < 4)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * a: \"foo\",\n * b: \"bar\",\n * });\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var filter = RR.filter;\n/**\n * Maps a `Record` with an iterating function that returns an `Option`\n * and it keeps only the `Some` values discarding the `None`s.\n *\n * @example\n * import { filterMap } from \"fp-ts/Record\"\n * import { option } from \"fp-ts\"\n *\n * const f = (s: string) => s.length < 4 ? option.some(`${s} is short`): option.none\n * assert.deepStrictEqual(filterMap(f)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * a: \"foo is short\",\n * b: \"bar is short\",\n * });\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var filterMap = RR.filterMap;\n/**\n * Partition a `Record` into two parts according to a `Predicate`.\n *\n * @example\n * import { partition } from \"fp-ts/Record\"\n *\n * assert.deepStrictEqual(partition((s: string) => s.length < 4)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * left:{\n * c: \"verylong\"\n * },\n * right: {\n * a: \"foo\",\n * b: \"bar\",\n * },\n * });\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var partition = RR.partition;\n/**\n * Maps a `Record` with a function returning an `Either` and\n * partitions the resulting `Record` into `Left`s and `Right`s.\n *\n * @example\n * import { partitionMap } from \"fp-ts/Record\"\n * import { either } from \"fp-ts\"\n *\n * const f = (s: string) => (s.length < 4 ? either.right(`${s} is short`) : either.left(`${s} is not short`));\n * assert.deepStrictEqual(partitionMap(f)({ a: \"foo\", b: \"bar\", c: \"verylong\" }), {\n * left: {\n * c: \"verylong is not short\",\n * },\n * right: {\n * a: \"foo is short\",\n * b: \"bar is short\",\n * },\n * });\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var partitionMap = RR.partitionMap;\nexport function reduce() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduce(args[0]) : RR.reduce(S.Ord).apply(void 0, args);\n}\nexport function foldMap(O) {\n return 'compare' in O ? RR.foldMap(O) : RR.foldMap(S.Ord)(O);\n}\nexport function reduceRight() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.length === 1 ? RR.reduceRight(args[0]) : RR.reduceRight(S.Ord).apply(void 0, args);\n}\n/**\n * Compact a `Record` of `Option`s discarding the `None` values and\n * keeping the `Some` values.\n *\n * @example\n * import { compact } from 'fp-ts/Record'\n * import { option } from 'fp-ts'\n *\n * assert.deepStrictEqual(compact({ a: option.some(\"foo\"), b: option.none, c: option.some(\"bar\") }), {\n * a: \"foo\",\n * c: \"bar\",\n * });\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var compact = RR.compact;\n/**\n * Separate a `Record` of `Either`s into `Left`s and `Right`s.\n *\n * @example\n * import { separate } from 'fp-ts/Record'\n * import { either } from 'fp-ts'\n *\n * assert.deepStrictEqual(\n * separate({ a: either.right(\"foo\"), b: either.left(\"bar\"), c: either.right(\"baz\") }),\n * {\n * right: {\n * a: \"foo\",\n * c: \"baz\",\n * },\n * left: {\n * b: \"bar\",\n * },\n * }\n * );\n *\n * @category filtering\n * @since 2.0.0\n */\nexport var separate = RR.separate;\n/**\n * @category type lambdas\n * @since 2.0.0\n */\nexport var URI = 'Record';\nexport function getShow(O) {\n return 'compare' in O ? RR.getShow(O) : RR.getShow(S.Ord)(O);\n}\n/**\n * Given an `Eq` for the base type, it produces an `Eq`\n * for a `Record` of that base type.\n *\n * @example\n * import { getEq } from \"fp-ts/Record\";\n * import { string } from \"fp-ts\";\n * import { Eq } from \"fp-ts/Eq\";\n *\n * const eq: Eq> = getEq(string.Eq);\n * assert.deepStrictEqual(eq.equals({ a: \"foo\" }, { b: \"bar\" }), false);\n * assert.deepStrictEqual(eq.equals({ a: \"foo\" }, { a: \"foo\" }), true);\n *\n * @category instances\n * @since 2.0.0\n */\nexport var getEq = RR.getEq;\n/**\n * Returns a `Monoid` instance for `Record`s, given a `Semigroup`\n * instance for the base type.\n * The `Monoid` makes the union of two `Record`s comining the\n * overlapping entries with the provided `Semigroup`.\n *\n * @example\n * import { SemigroupSum } from 'fp-ts/number'\n * import { getMonoid } from 'fp-ts/Record'\n *\n * const M = getMonoid(SemigroupSum);\n * assert.deepStrictEqual(M.concat({ foo: 123, bar: 234 }, { foo: 456, baz: 567 }), { foo: 579 , bar: 234, baz: 567 });\n *\n * @category instances\n * @since 2.0.0\n */\nexport var getMonoid = RR.getMonoid;\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Functor = {\n URI: URI,\n map: _map\n};\n/**\n * Takes a value and a `Record` of functions and returns a\n * `Record` by applying each function to the input value.\n *\n * @example\n * import { flap } from \"fp-ts/Record\"\n *\n * const fab = { x: (n: number) => `${n} times 2`, y: (n: number) => `${n * 2}` };\n * assert.deepStrictEqual(flap(3)(fab), {\n * x: \"3 times 2\",\n * y: \"6\",\n * });\n *\n * @category mapping\n * @since 2.10.0\n */\nexport var flap = /*#__PURE__*/flap_(Functor);\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var FunctorWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex\n};\n/**\n * Produces a `Foldable` instance for a `Record`, using the\n * provided `Ord` to sort the `Record`'s entries by key.\n *\n * @category folding\n * @since 2.11.0\n */\nexport var getFoldable = function (O) {\n return {\n URI: URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O)\n };\n};\n/**\n * Produces a `FoldableWithIndex1` instance for a `Record`, using the\n * provided `Ord` to sort the `Record`'s entries by key.\n *\n * @category folding\n * @since 2.11.0\n */\nexport var getFoldableWithIndex = function (O) {\n return {\n URI: URI,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O)\n };\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Compactable = {\n URI: URI,\n compact: compact,\n separate: separate\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var Filterable = {\n URI: URI,\n map: _map,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap\n};\n/**\n * @category instances\n * @since 2.7.0\n */\nexport var FilterableWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex\n};\n/**\n * Produces a `Traversable` instance for a `Record`, using the\n * provided `Ord` to sort the `Record`'s entries by key.\n *\n * @category traversing\n * @since 2.11.0\n */\nexport var getTraversable = function (O) {\n return {\n URI: URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: _traverse(O),\n sequence: _sequence(O)\n };\n};\n/**\n * Produces a `TraversableWithIndex` instance for a `Record`, using the\n * provided `Ord` to sort the `Record`'s entries by key.\n *\n * @category traversing\n * @since 2.11.0\n */\nexport var getTraversableWithIndex = function (O) {\n return {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n reduceWithIndex: _reduceWithIndex(O),\n foldMapWithIndex: _foldMapWithIndex(O),\n reduceRightWithIndex: _reduceRightWithIndex(O),\n traverse: _traverse(O),\n sequence: _sequence(O),\n traverseWithIndex: _traverseWithIndex(O)\n };\n};\n/**\n * @category filtering\n * @since 2.11.0\n */\nexport var getWitherable = function (O) {\n var T = getTraversable(O);\n return {\n URI: URI,\n map: _map,\n reduce: _reduce(O),\n foldMap: _foldMap(O),\n reduceRight: _reduceRight(O),\n traverse: T.traverse,\n sequence: T.sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: witherDefault(T, Compactable),\n wilt: wiltDefault(T, Compactable)\n };\n};\n/**\n * Given a `Semigroup` in the base type, it produces a `Semigroup`\n * in the `Record` of the base type.\n * The resulting `Semigroup` concatenates two `Record`s by\n * `union`.\n *\n * @example\n * import { getUnionSemigroup } from \"fp-ts/Record\"\n * import { Semigroup } from \"fp-ts/Semigroup\"\n *\n * const sNumber: Semigroup = { concat: (x, y) => x - y };\n * const sRecord: Semigroup> = getUnionSemigroup(sNumber);\n * assert.deepStrictEqual(sRecord.concat({ a: 1, b: 2 }, { b: 3, c: 4 }), { a: 1, b: -1, c: 4 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getUnionSemigroup = function (S) {\n var unionS = union(S);\n return {\n concat: function (first, second) {\n return unionS(second)(first);\n }\n };\n};\n/**\n * Same as `getMonoid`.\n * Returns a `Monoid` instance for `Record`s given a `Semigroup`\n * instance for the base type.\n * The `Monoid` makes the union of two `Record`s combining the\n * entries that have the same key with the provided `Semigroup`.\n *\n * @example\n * import { SemigroupSum } from 'fp-ts/number'\n * import { getUnionMonoid } from 'fp-ts/Record'\n *\n * const M = getUnionMonoid(SemigroupSum);\n * assert.deepStrictEqual(M.concat({ foo: 123, bar: 234 }, { foo: 456, baz: 567 }), { foo: 579 , bar: 234, baz: 567 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getUnionMonoid = function (S) {\n return {\n concat: getUnionSemigroup(S).concat,\n empty: {}\n };\n};\n/**\n * Given a `Semigroup` in the base type, it produces a `Semigroup`\n * in the `Record` of the base type.\n * The resulting `Semigroup` concatenates two `Record`s by\n * `intersection`.\n *\n * @example\n * import { getIntersectionSemigroup } from \"fp-ts/Record\"\n * import { Semigroup } from \"fp-ts/Semigroup\"\n *\n * const sNumber: Semigroup = { concat: (x, y) => x - y };\n * const sRecord: Semigroup> = getIntersectionSemigroup(sNumber);\n * assert.deepStrictEqual(sRecord.concat({ a: 1, b: 2 }, { b: 3, c: 4 }), { b: -1 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getIntersectionSemigroup = function (S) {\n var intersectionS = intersection(S);\n return {\n concat: function (first, second) {\n return intersectionS(second)(first);\n }\n };\n};\n/**\n * Produces a `Magma` with a `concat` function that combines\n * two `Record`s by making the `difference`.\n *\n * @example\n * import { getDifferenceMagma, difference } from \"fp-ts/Record\"\n * import { Magma } from \"fp-ts/Magma\"\n *\n * const r1 = { a: 3, c: 3 };\n * const r2 = { a: 1, b: 2 };\n * const m: Magma> = getDifferenceMagma();\n * assert.deepStrictEqual(m.concat(r1, r2), difference(r2)(r1));\n * assert.deepStrictEqual(m.concat(r1, r2), { c: 3, b: 2 });\n *\n * @category instances\n * @since 2.11.0\n */\nexport var getDifferenceMagma = function () {\n return {\n concat: function (first, second) {\n return difference(second)(first);\n }\n };\n};\n// -------------------------------------------------------------------------------------\n// deprecated\n// -------------------------------------------------------------------------------------\n/**\n * Use `getFoldable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Foldable = {\n URI: URI,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord)\n};\n/**\n * Use `getFoldableWithIndex` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var FoldableWithIndex = {\n URI: URI,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord)\n};\n/**\n * Use `getTraversable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Traversable = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence\n};\n/**\n * Use the `getTraversableWithIndex` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var TraversableWithIndex = {\n URI: URI,\n map: _map,\n mapWithIndex: _mapWithIndex,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n traverseWithIndex: /*#__PURE__*/_traverseWithIndex(S.Ord)\n};\nvar _wither = /*#__PURE__*/witherDefault(Traversable, Compactable);\nvar _wilt = /*#__PURE__*/wiltDefault(Traversable, Compactable);\n/**\n * Use `getWitherable` instead.\n *\n * @category zone of death\n * @since 2.7.0\n * @deprecated\n */\nexport var Witherable = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n wither: _wither,\n wilt: _wilt\n};\n/**\n * Use a new `{}` instead.\n *\n * @category zone of death\n * @since 2.0.0\n * @deprecated\n */\nexport var empty = {};\n/**\n * Use [`upsertAt`](#upsertat) instead.\n *\n * @category zone of death\n * @since 2.0.0\n * @deprecated\n */\nexport var insertAt = upsertAt;\n/**\n * Use [`has`](#has) instead.\n *\n * @category zone of death\n * @since 2.0.0\n * @deprecated\n */\nexport var hasOwnProperty = RR.hasOwnProperty;\n/**\n * This instance is deprecated, use small, specific instances instead.\n * For example if a function needs a `Functor` instance, pass `R.Functor` instead of `R.record`\n * (where `R` is from `import R from 'fp-ts/Record'`)\n *\n * @category zone of death\n * @since 2.0.0\n * @deprecated\n */\nexport var record = {\n URI: URI,\n map: _map,\n reduce: /*#__PURE__*/_reduce(S.Ord),\n foldMap: /*#__PURE__*/_foldMap(S.Ord),\n reduceRight: /*#__PURE__*/_reduceRight(S.Ord),\n traverse: /*#__PURE__*/_traverse(S.Ord),\n sequence: sequence,\n compact: compact,\n separate: separate,\n filter: _filter,\n filterMap: _filterMap,\n partition: _partition,\n partitionMap: _partitionMap,\n mapWithIndex: _mapWithIndex,\n reduceWithIndex: /*#__PURE__*/_reduceWithIndex(S.Ord),\n foldMapWithIndex: /*#__PURE__*/_foldMapWithIndex(S.Ord),\n reduceRightWithIndex: /*#__PURE__*/_reduceRightWithIndex(S.Ord),\n filterMapWithIndex: _filterMapWithIndex,\n filterWithIndex: _filterWithIndex,\n partitionMapWithIndex: _partitionMapWithIndex,\n partitionWithIndex: _partitionWithIndex,\n traverseWithIndex: /*#__PURE__*/_traverseWithIndex(S.Ord),\n wither: _wither,\n wilt: _wilt\n};","import { apFirst as apFirst_, apSecond as apSecond_ } from './Apply';\nimport { chainFirst as chainFirst_ } from './Chain';\nimport { identity, pipe as pipeFromFunctionModule } from './function';\nexport function map(F) {\n return function (f) {\n return function (fa) {\n return F.map(fa, f);\n };\n };\n}\nexport function contramap(F) {\n return function (f) {\n return function (fa) {\n return F.contramap(fa, f);\n };\n };\n}\nexport function mapWithIndex(F) {\n return function (f) {\n return function (fa) {\n return F.mapWithIndex(fa, f);\n };\n };\n}\nexport function ap(F) {\n return function (fa) {\n return function (fab) {\n return F.ap(fab, fa);\n };\n };\n}\nexport function chain(F) {\n return function (f) {\n return function (fa) {\n return F.chain(fa, f);\n };\n };\n}\nexport function bimap(F) {\n return function (f, g) {\n return function (fea) {\n return F.bimap(fea, f, g);\n };\n };\n}\nexport function mapLeft(F) {\n return function (f) {\n return function (fea) {\n return F.mapLeft(fea, f);\n };\n };\n}\nexport function extend(F) {\n return function (f) {\n return function (wa) {\n return F.extend(wa, f);\n };\n };\n}\nexport function reduce(F) {\n return function (b, f) {\n return function (fa) {\n return F.reduce(fa, b, f);\n };\n };\n}\nexport function foldMap(F) {\n return function (M) {\n var foldMapM = F.foldMap(M);\n return function (f) {\n return function (fa) {\n return foldMapM(fa, f);\n };\n };\n };\n}\nexport function reduceRight(F) {\n return function (b, f) {\n return function (fa) {\n return F.reduceRight(fa, b, f);\n };\n };\n}\nexport function reduceWithIndex(F) {\n return function (b, f) {\n return function (fa) {\n return F.reduceWithIndex(fa, b, f);\n };\n };\n}\nexport function foldMapWithIndex(F) {\n return function (M) {\n var foldMapWithIndexM = F.foldMapWithIndex(M);\n return function (f) {\n return function (fa) {\n return foldMapWithIndexM(fa, f);\n };\n };\n };\n}\nexport function reduceRightWithIndex(F) {\n return function (b, f) {\n return function (fa) {\n return F.reduceRightWithIndex(fa, b, f);\n };\n };\n}\nexport function alt(F) {\n return function (that) {\n return function (fa) {\n return F.alt(fa, that);\n };\n };\n}\nexport function filter(F) {\n return function (predicate) {\n return function (fa) {\n return F.filter(fa, predicate);\n };\n };\n}\nexport function filterMap(F) {\n return function (f) {\n return function (fa) {\n return F.filterMap(fa, f);\n };\n };\n}\nexport function partition(F) {\n return function (f) {\n return function (fa) {\n return F.partition(fa, f);\n };\n };\n}\nexport function partitionMap(F) {\n return function (f) {\n return function (fa) {\n return F.partitionMap(fa, f);\n };\n };\n}\nexport function filterWithIndex(F) {\n return function (predicate) {\n return function (fa) {\n return F.filterWithIndex(fa, predicate);\n };\n };\n}\nexport function filterMapWithIndex(F) {\n return function (f) {\n return function (fa) {\n return F.filterMapWithIndex(fa, f);\n };\n };\n}\nexport function partitionWithIndex(F) {\n return function (f) {\n return function (fa) {\n return F.partitionWithIndex(fa, f);\n };\n };\n}\nexport function partitionMapWithIndex(F) {\n return function (f) {\n return function (fa) {\n return F.partitionMapWithIndex(fa, f);\n };\n };\n}\nexport function promap(F) {\n return function (f, g) {\n return function (fbc) {\n return F.promap(fbc, f, g);\n };\n };\n}\nexport function compose(F) {\n return function (ea) {\n return function (ab) {\n return F.compose(ab, ea);\n };\n };\n}\nvar isFunctor = function (I) {\n return typeof I.map === 'function';\n};\nvar isContravariant = function (I) {\n return typeof I.contramap === 'function';\n};\nvar isFunctorWithIndex = function (I) {\n return typeof I.mapWithIndex === 'function';\n};\nvar isApply = function (I) {\n return typeof I.ap === 'function';\n};\nvar isChain = function (I) {\n return typeof I.chain === 'function';\n};\nvar isBifunctor = function (I) {\n return typeof I.bimap === 'function';\n};\nvar isExtend = function (I) {\n return typeof I.extend === 'function';\n};\nvar isFoldable = function (I) {\n return typeof I.reduce === 'function';\n};\nvar isFoldableWithIndex = function (I) {\n return typeof I.reduceWithIndex === 'function';\n};\nvar isAlt = function (I) {\n return typeof I.alt === 'function';\n};\nvar isCompactable = function (I) {\n return typeof I.compact === 'function';\n};\nvar isFilterable = function (I) {\n return typeof I.filter === 'function';\n};\nvar isFilterableWithIndex = function (I) {\n return typeof I.filterWithIndex === 'function';\n};\nvar isProfunctor = function (I) {\n return typeof I.promap === 'function';\n};\nvar isSemigroupoid = function (I) {\n return typeof I.compose === 'function';\n};\nvar isMonadThrow = function (I) {\n return typeof I.throwError === 'function';\n};\n/** @deprecated */\nexport function pipeable(I) {\n var r = {};\n if (isFunctor(I)) {\n r.map = map(I);\n }\n if (isContravariant(I)) {\n r.contramap = contramap(I);\n }\n if (isFunctorWithIndex(I)) {\n r.mapWithIndex = mapWithIndex(I);\n }\n if (isApply(I)) {\n r.ap = ap(I);\n r.apFirst = apFirst_(I);\n r.apSecond = apSecond_(I);\n }\n if (isChain(I)) {\n r.chain = chain(I);\n r.chainFirst = chainFirst_(I);\n r.flatten = r.chain(identity);\n }\n if (isBifunctor(I)) {\n r.bimap = bimap(I);\n r.mapLeft = mapLeft(I);\n }\n if (isExtend(I)) {\n r.extend = extend(I);\n r.duplicate = r.extend(identity);\n }\n if (isFoldable(I)) {\n r.reduce = reduce(I);\n r.foldMap = foldMap(I);\n r.reduceRight = reduceRight(I);\n }\n if (isFoldableWithIndex(I)) {\n r.reduceWithIndex = reduceWithIndex(I);\n r.foldMapWithIndex = foldMapWithIndex(I);\n r.reduceRightWithIndex = reduceRightWithIndex(I);\n }\n if (isAlt(I)) {\n r.alt = alt(I);\n }\n if (isCompactable(I)) {\n r.compact = I.compact;\n r.separate = I.separate;\n }\n if (isFilterable(I)) {\n r.filter = filter(I);\n r.filterMap = filterMap(I);\n r.partition = partition(I);\n r.partitionMap = partitionMap(I);\n }\n if (isFilterableWithIndex(I)) {\n r.filterWithIndex = filterWithIndex(I);\n r.filterMapWithIndex = filterMapWithIndex(I);\n r.partitionWithIndex = partitionWithIndex(I);\n r.partitionMapWithIndex = partitionMapWithIndex(I);\n }\n if (isProfunctor(I)) {\n r.promap = promap(I);\n }\n if (isSemigroupoid(I)) {\n r.compose = compose(I);\n }\n if (isMonadThrow(I)) {\n var fromOption = function (onNone) {\n return function (ma) {\n return ma._tag === 'None' ? I.throwError(onNone()) : I.of(ma.value);\n };\n };\n var fromEither = function (ma) {\n return ma._tag === 'Left' ? I.throwError(ma.left) : I.of(ma.right);\n };\n var fromPredicate = function (predicate, onFalse) {\n return function (a) {\n return predicate(a) ? I.of(a) : I.throwError(onFalse(a));\n };\n };\n var filterOrElse = function (predicate, onFalse) {\n return function (ma) {\n return I.chain(ma, function (a) {\n return predicate(a) ? I.of(a) : I.throwError(onFalse(a));\n });\n };\n };\n r.fromOption = fromOption;\n r.fromEither = fromEither;\n r.fromPredicate = fromPredicate;\n r.filterOrElse = filterOrElse;\n }\n return r;\n}\n/**\n * Use [`pipe`](https://gcanti.github.io/fp-ts/modules/function.ts.html#pipe) from `function` module instead.\n *\n * @since 2.0.0\n * @deprecated\n */\nexport var pipe = pipeFromFunctionModule;","import { isNonEmpty } from './ReadonlyNonEmptyArray';\n// -------------------------------------------------------------------------------------\n// instances\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Eq.equals('a', 'a'), true)\n * assert.deepStrictEqual(S.Eq.equals('a', 'b'), false)\n *\n * @category instances\n * @since 2.10.0\n */\nexport var Eq = {\n equals: function (first, second) {\n return first === second;\n }\n};\n/**\n * `string` semigroup under concatenation.\n *\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Semigroup.concat('a', 'b'), 'ab')\n *\n * @category instances\n * @since 2.10.0\n */\nexport var Semigroup = {\n concat: function (first, second) {\n return first + second;\n }\n};\n/**\n * An empty `string`.\n *\n * @since 2.10.0\n */\nexport var empty = '';\n/**\n * `string` monoid under concatenation.\n *\n * The `empty` value is `''`.\n *\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Monoid.concat('a', 'b'), 'ab')\n * assert.deepStrictEqual(S.Monoid.concat('a', S.Monoid.empty), 'a')\n *\n * @category instances\n * @since 2.10.0\n */\nexport var Monoid = {\n concat: Semigroup.concat,\n empty: empty\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Ord.compare('a', 'a'), 0)\n * assert.deepStrictEqual(S.Ord.compare('a', 'b'), -1)\n * assert.deepStrictEqual(S.Ord.compare('b', 'a'), 1)\n *\n * @category instances\n * @since 2.10.0\n */\nexport var Ord = {\n equals: Eq.equals,\n compare: function (first, second) {\n return first < second ? -1 : first > second ? 1 : 0;\n }\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.Show.show('a'), '\"a\"')\n *\n * @category instances\n * @since 2.10.0\n */\nexport var Show = {\n show: function (s) {\n return JSON.stringify(s);\n }\n};\n// -------------------------------------------------------------------------------------\n// refinements\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n *\n * assert.deepStrictEqual(S.isString('a'), true)\n * assert.deepStrictEqual(S.isString(1), false)\n *\n * @category refinements\n * @since 2.11.0\n */\nexport var isString = function (u) {\n return typeof u === 'string';\n};\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('a', S.toUpperCase), 'A')\n *\n * @since 2.11.0\n */\nexport var toUpperCase = function (s) {\n return s.toUpperCase();\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('A', S.toLowerCase), 'a')\n *\n * @since 2.11.0\n */\nexport var toLowerCase = function (s) {\n return s.toLowerCase();\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.replace('b', 'd')), 'adc')\n *\n * @since 2.11.0\n */\nexport var replace = function (searchValue, replaceValue) {\n return function (s) {\n return s.replace(searchValue, replaceValue);\n };\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trim), 'a')\n *\n * @since 2.11.0\n */\nexport var trim = function (s) {\n return s.trim();\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trimLeft), 'a ')\n *\n * @since 2.11.0\n */\nexport var trimLeft = function (s) {\n return s.trimLeft();\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe(' a ', S.trimRight), ' a')\n *\n * @since 2.11.0\n */\nexport var trimRight = function (s) {\n return s.trimRight();\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abcd', S.slice(1, 3)), 'bc')\n *\n * @since 2.11.0\n */\nexport var slice = function (start, end) {\n return function (s) {\n return s.slice(start, end);\n };\n};\n// -------------------------------------------------------------------------------------\n// utils\n// -------------------------------------------------------------------------------------\n/**\n * Test whether a `string` is empty.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('', S.isEmpty), true)\n * assert.deepStrictEqual(pipe('a', S.isEmpty), false)\n *\n * @since 2.10.0\n */\nexport var isEmpty = function (s) {\n return s.length === 0;\n};\n/**\n * Calculate the number of characters in a `string`.\n *\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.size), 3)\n *\n * @since 2.10.0\n */\nexport var size = function (s) {\n return s.length;\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.split('')), ['a', 'b', 'c'])\n * assert.deepStrictEqual(pipe('', S.split('')), [''])\n *\n * @since 2.11.0\n */\nexport var split = function (separator) {\n return function (s) {\n var out = s.split(separator);\n return isNonEmpty(out) ? out : [s];\n };\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.includes('b')), true)\n * assert.deepStrictEqual(pipe('abc', S.includes('d')), false)\n *\n * @since 2.11.0\n */\nexport var includes = function (searchString, position) {\n return function (s) {\n return s.includes(searchString, position);\n };\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.startsWith('a')), true)\n * assert.deepStrictEqual(pipe('bc', S.startsWith('a')), false)\n *\n * @since 2.11.0\n */\nexport var startsWith = function (searchString, position) {\n return function (s) {\n return s.startsWith(searchString, position);\n };\n};\n/**\n * @example\n * import * as S from 'fp-ts/string'\n * import { pipe } from 'fp-ts/function'\n *\n * assert.deepStrictEqual(pipe('abc', S.endsWith('c')), true)\n * assert.deepStrictEqual(pipe('ab', S.endsWith('c')), false)\n *\n * @since 2.11.0\n */\nexport var endsWith = function (searchString, position) {\n return function (s) {\n return s.endsWith(searchString, position);\n };\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.reporter = exports.formatValidationErrors = exports.formatValidationError = exports.TYPE_MAX_LEN = void 0;\n/**\n * An [io-ts Reporter](https://gcanti.github.io/io-ts/modules/Reporter.ts.html#reporter-interface).\n *\n * @example\n *\n * import * as t from 'io-ts';\n * import Reporter from 'io-ts-reporters';\n *\n * const User = t.interface({ name: t.string });\n *\n * assert.deepEqual(\n * Reporter.report(User.decode({ nam: 'Jane' })),\n * ['Expecting string at name but instead got: undefined'],\n * )\n * assert.deepEqual( Reporter.report(User.decode({ name: 'Jane' })), [])\n *\n * @since 1.2.0\n */\nvar A = require(\"fp-ts/Array\");\nvar E = require(\"fp-ts/Either\");\nvar NEA = require(\"fp-ts/NonEmptyArray\");\nvar O = require(\"fp-ts/Option\");\nvar R = require(\"fp-ts/Record\");\nvar pipeable_1 = require(\"fp-ts/pipeable\");\nvar t = require(\"io-ts\");\nvar utils_1 = require(\"./utils\");\nvar isUnionType = function (_a) {\n var type = _a.type;\n return type instanceof t.UnionType;\n};\nvar jsToString = function (value) {\n return value === undefined ? 'undefined' : JSON.stringify(value);\n};\nvar keyPath = function (ctx) {\n // The context entry with an empty key is the original\n // type (\"default context\"), not a type error.\n return ctx.map(function (c) {\n return c.key;\n }).filter(Boolean).join('.');\n};\n// The actual error is last in context\nvar getErrorFromCtx = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return A.last(validation.context);\n};\nvar getValidationContext = function (validation) {\n // https://github.com/gcanti/fp-ts/pull/544/files\n return validation.context;\n};\n/**\n * @category internals\n * @since 1.2.1\n */\nexports.TYPE_MAX_LEN = 160; // Two lines of 80-col text\nvar truncateType = function (type, options) {\n if (options === void 0) {\n options = {};\n }\n var _a = options.truncateLongTypes,\n truncateLongTypes = _a === void 0 ? true : _a;\n if (truncateLongTypes && type.length > exports.TYPE_MAX_LEN) {\n return type.slice(0, exports.TYPE_MAX_LEN - 3) + \"...\";\n }\n return type;\n};\nvar errorMessageSimple = function (expectedType, path, error, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return [\"Expecting \" + truncateType(expectedType, options), path === '' ? '' : \"at \" + path, \"but instead got: \" + jsToString(error.value), error.message ? \"(\" + error.message + \")\" : ''].filter(Boolean).join(' ');\n};\nvar errorMessageUnion = function (expectedTypes, path, value, options) {\n // https://github.com/elm-lang/core/blob/18c9e84e975ed22649888bfad15d1efdb0128ab2/src/Native/Json.js#L199\n return ['Expecting one of:\\n', expectedTypes.map(function (type) {\n return \" \" + truncateType(type, options);\n }).join('\\n'), path === '' ? '\\n' : \"\\nat \" + path + \" \", \"but instead got: \" + jsToString(value)].filter(Boolean).join('');\n};\n// Find the union type in the list of ContextEntry\n// The next ContextEntry should be the type of this branch of the union\nvar findExpectedType = function (ctx) {\n return pipeable_1.pipe(ctx, A.findIndex(isUnionType), O.chain(function (n) {\n return A.lookup(n + 1, ctx);\n }));\n};\nvar formatValidationErrorOfUnion = function (path, errors, options) {\n var expectedTypes = pipeable_1.pipe(errors, A.map(getValidationContext), A.map(findExpectedType), A.compact);\n var value = pipeable_1.pipe(expectedTypes, A.head, O.map(function (v) {\n return v.actual;\n }), O.getOrElse(function () {\n return undefined;\n }));\n var expected = expectedTypes.map(function (_a) {\n var type = _a.type;\n return type.name;\n });\n return expected.length > 0 ? O.some(errorMessageUnion(expected, path, value, options)) : O.none;\n};\nvar formatValidationCommonError = function (path, error, options) {\n return pipeable_1.pipe(error, getErrorFromCtx, O.map(function (errorContext) {\n return errorMessageSimple(errorContext.type.name, path, error, options);\n }));\n};\nvar groupByKey = NEA.groupBy(function (error) {\n return pipeable_1.pipe(error.context, utils_1.takeUntil(isUnionType), keyPath);\n});\nvar format = function (path, errors, options) {\n return NEA.tail(errors).length > 0 ? formatValidationErrorOfUnion(path, errors, options) : formatValidationCommonError(path, NEA.head(errors), options);\n};\n/**\n * Format a single validation error.\n *\n * @category formatters\n * @since 1.0.0\n */\nvar formatValidationError = function (error, options) {\n return formatValidationCommonError(keyPath(error.context), error, options);\n};\nexports.formatValidationError = formatValidationError;\n/**\n * Format validation errors (`t.Errors`).\n *\n * @example\n * import * as E from 'fp-ts/Either'\n * import * as t from 'io-ts'\n * import { formatValidationErrors } from 'io-ts-reporters'\n *\n * const result = t.string.decode(123)\n *\n * assert.deepEqual(\n * E.mapLeft(formatValidationErrors)(result),\n * E.left(['Expecting string but instead got: 123'])\n * )\n *\n * @category formatters\n * @since 1.2.0\n */\nvar formatValidationErrors = function (errors, options) {\n return pipeable_1.pipe(errors, groupByKey, R.mapWithIndex(function (path, errors) {\n return format(path, errors, options);\n }), R.compact, R.toArray, A.map(function (_a) {\n var _key = _a[0],\n error = _a[1];\n return error;\n }));\n};\nexports.formatValidationErrors = formatValidationErrors;\n/**\n * Deprecated, use the default export instead.\n *\n * @category deprecated\n * @deprecated\n * @since 1.0.0\n */\nvar reporter = function (validation, options) {\n return pipeable_1.pipe(validation, E.mapLeft(function (errors) {\n return exports.formatValidationErrors(errors, options);\n }), E.fold(function (errors) {\n return errors;\n }, function () {\n return [];\n }));\n};\nexports.reporter = reporter;\nvar prettyReporter = {\n report: exports.reporter\n};\nexports.default = prettyReporter;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.takeUntil = void 0;\n/**\n * @since 1.1.0\n */\n/* eslint-disable @typescript-eslint/array-type */\nvar takeUntil = function (predicate) {\n return function (as) {\n var init = [];\n // eslint-disable-next-line unicorn/no-for-loop\n for (var i = 0; i < as.length; i++) {\n init[i] = as[i];\n if (predicate(as[i])) {\n return init;\n }\n }\n return init;\n };\n};\nexports.takeUntil = takeUntil;\n/* eslint-enable @typescript-eslint/array-type */"],"names":["isEmpty","r","k","call","keys_","O","Object","keys","sort","compare","collect","keysO","f","out","_i","_a","length","key","push","upsertAt","a","assign","has","isSubrecord","E","me","that","undefined","isSubrecordE_1","equals","lookup","empty","mapWithIndex","map","_","reduceWithIndex","args","arguments","apply","b","fa","ks","len","i","foldMapWithIndex","keysO_1","M","concat","reduceRightWithIndex","traverse","F","traverseOF","_traverse","ta","sequence","_sequence","partitionMapWithIndex","left","right","e","_tag","partitionWithIndex","predicateWithIndex","filterMapWithIndex","ob","value","filterWithIndex","changed","fromFoldableMap","reduce","union","second","first","intersection","difference","_map","_mapWithIndex","_reduce","reduceO","_foldMap","foldMapM","foldMap","_reduceRight","reduceRightO","reduceRight","_filter","predicate","filter","_filterMap","filterMap","_partition","partition","_partitionMap","partitionMap","_reduceWithIndex","reduceWithIndexO","_foldMapWithIndex","foldMapWithIndexO","foldMapWithIndexM","_reduceRightWithIndex","reduceRightWithIndexO","_partitionMapWithIndex","_partitionWithIndex","_filterMapWithIndex","_filterWithIndex","traverseWithIndexO","_traverseWithIndex","traverseWithIndexOF","SK","traverseO","of","fr","_loop_1","ap","ks_1","reduceWithIndexO_1","foldMapWithIndexO_1","reduceRightWithIndexO_1","compact","oa","separate","URI","getShow","S","show","elements","JSON","stringify","join","__assign","t","s","n","p","prototype","hasOwnProperty","this","toArray","U","sas","unfold","deleteAtk","traverseF","fromFoldableMapM","fka","elem","elemE_1","unionM","isSubrecordE","x","y","traverseWithIndex","T","wither","wilt","unionS","intersectionS","record","contramap","fab","chain","bimap","g","fea","mapLeft","extend","wa","alt","promap","fbc","compose","ea","ab","isFunctor","I","isContravariant","isFunctorWithIndex","isApply","isChain","isBifunctor","isExtend","isFoldable","isFoldableWithIndex","isAlt","isCompactable","isFilterable","isFilterableWithIndex","isProfunctor","isSemigroupoid","isMonadThrow","throwError","pipeable","apFirst","apSecond","chainFirst","flatten","duplicate","fromOption","onNone","ma","fromEither","fromPredicate","onFalse","filterOrElse","pipe","Ord","defineProperty","exports","reporter","formatValidationErrors","formatValidationError","TYPE_MAX_LEN","A","NEA","R","pipeable_1","utils_1","isUnionType","type","UnionType","jsToString","keyPath","ctx","c","Boolean","getErrorFromCtx","validation","last","context","getValidationContext","truncateType","options","truncateLongTypes","slice","findExpectedType","findIndex","formatValidationErrorOfUnion","path","errors","expectedTypes","head","v","actual","getOrElse","expected","name","some","errorMessageUnion","none","formatValidationCommonError","error","errorContext","expectedType","message","errorMessageSimple","groupByKey","groupBy","takeUntil","tail","format","fold","prettyReporter","report","as","init"],"sourceRoot":""}