"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkT4ZJ6CA2js = require('./chunk-T4ZJ6CA2.js');



var _chunkUNAIGMDHjs = require('./chunk-UNAIGMDH.js');


var _chunkO5GTF7RIjs = require('./chunk-O5GTF7RI.js');


var _chunk7K74W2G3js = require('./chunk-7K74W2G3.js');


var _chunkTGVEPLW2js = require('./chunk-TGVEPLW2.js');







var _chunkOTKMOSH2js = require('./chunk-OTKMOSH2.js');





var _chunkSQA7G4TEjs = require('./chunk-SQA7G4TE.js');


var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/ReadonlyRecord.ts
var ReadonlyRecord_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, ReadonlyRecord_exports, {
  Compactable: () => Compactable,
  Filterable: () => Filterable,
  FilterableWithIndex: () => FilterableWithIndex,
  Foldable: () => Foldable,
  FoldableWithIndex: () => FoldableWithIndex,
  Functor: () => Functor,
  FunctorWithIndex: () => FunctorWithIndex,
  Traversable: () => Traversable,
  TraversableWithIndex: () => TraversableWithIndex,
  URI: () => URI,
  Witherable: () => Witherable,
  _filter: () => _filter,
  _filterMap: () => _filterMap,
  _filterMapWithIndex: () => _filterMapWithIndex,
  _filterWithIndex: () => _filterWithIndex,
  _foldMap: () => _foldMap,
  _foldMapWithIndex: () => _foldMapWithIndex,
  _map: () => _map,
  _mapWithIndex: () => _mapWithIndex,
  _partition: () => _partition,
  _partitionMap: () => _partitionMap,
  _partitionMapWithIndex: () => _partitionMapWithIndex,
  _partitionWithIndex: () => _partitionWithIndex,
  _reduce: () => _reduce,
  _reduceRight: () => _reduceRight,
  _reduceRightWithIndex: () => _reduceRightWithIndex,
  _reduceWithIndex: () => _reduceWithIndex,
  _sequence: () => _sequence,
  _traverse: () => _traverse,
  collect: () => collect,
  compact: () => compact,
  deleteAt: () => deleteAt,
  difference: () => difference,
  elem: () => elem,
  empty: () => empty,
  every: () => every,
  filter: () => filter,
  filterMap: () => filterMap,
  filterMapWithIndex: () => filterMapWithIndex,
  filterWithIndex: () => filterWithIndex,
  flap: () => flap2,
  foldMap: () => foldMap,
  foldMapWithIndex: () => foldMapWithIndex,
  fromEntries: () => fromEntries,
  fromFoldable: () => fromFoldable,
  fromFoldableMap: () => fromFoldableMap,
  fromRecord: () => fromRecord,
  getDifferenceMagma: () => getDifferenceMagma,
  getEq: () => getEq,
  getFoldable: () => getFoldable,
  getFoldableWithIndex: () => getFoldableWithIndex,
  getIntersectionSemigroup: () => getIntersectionSemigroup,
  getMonoid: () => getMonoid,
  getShow: () => getShow,
  getTraversable: () => getTraversable,
  getTraversableWithIndex: () => getTraversableWithIndex,
  getUnionMonoid: () => getUnionMonoid,
  getUnionSemigroup: () => getUnionSemigroup,
  getWitherable: () => getWitherable,
  has: () => has2,
  hasOwnProperty: () => hasOwnProperty,
  insertAt: () => insertAt,
  intersection: () => intersection,
  isEmpty: () => isEmpty,
  isSubrecord: () => isSubrecord,
  keys: () => keys,
  lookup: () => lookup,
  map: () => map,
  mapWithIndex: () => mapWithIndex,
  modifyAt: () => modifyAt,
  partition: () => partition,
  partitionMap: () => partitionMap,
  partitionMapWithIndex: () => partitionMapWithIndex,
  partitionWithIndex: () => partitionWithIndex,
  pop: () => pop,
  readonlyRecord: () => readonlyRecord,
  reduce: () => reduce,
  reduceRight: () => reduceRight,
  reduceRightWithIndex: () => reduceRightWithIndex,
  reduceWithIndex: () => reduceWithIndex,
  separate: () => separate,
  sequence: () => sequence,
  singleton: () => singleton,
  size: () => size,
  some: () => some2,
  toEntries: () => toEntries,
  toReadonlyArray: () => toReadonlyArray,
  toRecord: () => toRecord,
  toUnfoldable: () => toUnfoldable,
  traverse: () => traverse,
  traverseWithIndex: () => traverseWithIndex,
  union: () => union,
  updateAt: () => updateAt,
  upsertAt: () => upsertAt,
  wilt: () => wilt,
  wither: () => wither
});
var fromRecord = (r) => Object.assign({}, r);
var toRecord = (r) => Object.assign({}, r);
var size = (r) => Object.keys(r).length;
var isEmpty = (r) => {
  for (const k in r) {
    if (_chunkOTKMOSH2js.has.call(r, k)) {
      return false;
    }
  }
  return true;
};
var keys_ = (O) => (r) => Object.keys(r).sort(O.compare);
var keys = /* @__PURE__ */ keys_(_chunkO5GTF7RIjs.Ord);
function collect(O) {
  if (typeof O === "function") {
    return collect((0, _chunkO5GTF7RIjs.Ord))(O);
  }
  const keysO = keys_(O);
  return (f) => (r) => {
    const out = [];
    for (const key of keysO(r)) {
      out.push(f(key, r[key]));
    }
    return out;
  };
}
var toReadonlyArray = /* @__PURE__ */ collect((0, _chunkO5GTF7RIjs.Ord))((k, a) => [k, a]);
function toUnfoldable(U) {
  return (r) => {
    const sas = toReadonlyArray(r);
    const len = sas.length;
    return U.unfold(0, (b) => b < len ? _chunkOTKMOSH2js.some.call(void 0, [sas[b], b + 1]) : _chunkOTKMOSH2js.none);
  };
}
var upsertAt = (k, a) => (r) => {
  if (_chunkOTKMOSH2js.has.call(r, k) && r[k] === a) {
    return r;
  }
  const out = Object.assign({}, r);
  out[k] = a;
  return out;
};
var has2 = (k, r) => _chunkOTKMOSH2js.has.call(r, k);
function deleteAt(k) {
  return (r) => {
    if (!_chunkOTKMOSH2js.has.call(r, k)) {
      return r;
    }
    const out = Object.assign({}, r);
    delete out[k];
    return out;
  };
}
var updateAt = (k, a) => (r) => {
  if (!has2(k, r)) {
    return _chunkOTKMOSH2js.none;
  }
  if (r[k] === a) {
    return _chunkOTKMOSH2js.some.call(void 0, r);
  }
  const out = Object.assign({}, r);
  out[k] = a;
  return _chunkOTKMOSH2js.some.call(void 0, out);
};
var modifyAt = (k, f) => (r) => {
  if (!has2(k, r)) {
    return _chunkOTKMOSH2js.none;
  }
  const next = f(r[k]);
  if (next === r[k]) {
    return _chunkOTKMOSH2js.some.call(void 0, r);
  }
  const out = Object.assign({}, r);
  out[k] = next;
  return _chunkOTKMOSH2js.some.call(void 0, out);
};
function pop(k) {
  const deleteAtk = deleteAt(k);
  return (r) => {
    const oa = lookup(k, r);
    return _chunkOTKMOSH2js.isNone.call(void 0, oa) ? _chunkOTKMOSH2js.none : _chunkOTKMOSH2js.some.call(void 0, [oa.value, deleteAtk(r)]);
  };
}
function isSubrecord(E) {
  return (me, that) => {
    if (that === void 0) {
      const isSubrecordE = isSubrecord(E);
      return (that2) => isSubrecordE(that2, me);
    }
    for (const k in me) {
      if (!_chunkOTKMOSH2js.has.call(that, k) || !E.equals(me[k], that[k])) {
        return false;
      }
    }
    return true;
  };
}
function lookup(k, r) {
  if (r === void 0) {
    return (r2) => lookup(k, r2);
  }
  return _chunkOTKMOSH2js.has.call(r, k) ? _chunkOTKMOSH2js.some.call(void 0, r[k]) : _chunkOTKMOSH2js.none;
}
var empty = {};
function mapWithIndex(f) {
  return (r) => {
    const out = {};
    for (const k in r) {
      if (_chunkOTKMOSH2js.has.call(r, k)) {
        out[k] = f(k, r[k]);
      }
    }
    return out;
  };
}
function map(f) {
  return mapWithIndex((_, a) => f(a));
}
function reduceWithIndex(...args) {
  if (args.length === 2) {
    return reduceWithIndex((0, _chunkO5GTF7RIjs.Ord))(...args);
  }
  const keysO = keys_(args[0]);
  return (b, f) => (fa) => {
    let out = b;
    const ks = keysO(fa);
    const len = ks.length;
    for (let i = 0; i < len; i++) {
      const k = ks[i];
      out = f(k, out, fa[k]);
    }
    return out;
  };
}
function foldMapWithIndex(O) {
  if ("compare" in O) {
    const keysO = keys_(O);
    return (M) => (f) => (fa) => {
      let out = M.empty;
      const ks = keysO(fa);
      const len = ks.length;
      for (let i = 0; i < len; i++) {
        const k = ks[i];
        out = M.concat(out, f(k, fa[k]));
      }
      return out;
    };
  }
  return foldMapWithIndex((0, _chunkO5GTF7RIjs.Ord))(O);
}
function reduceRightWithIndex(...args) {
  if (args.length === 2) {
    return reduceRightWithIndex((0, _chunkO5GTF7RIjs.Ord))(...args);
  }
  const keysO = keys_(args[0]);
  return (b, f) => (fa) => {
    let out = b;
    const ks = keysO(fa);
    const len = ks.length;
    for (let i = len - 1; i >= 0; i--) {
      const k = ks[i];
      out = f(k, fa[k], out);
    }
    return out;
  };
}
var singleton = (k, a) => ({ [k]: a });
function traverseWithIndex(F) {
  const traverseWithIndexOF = _traverseWithIndex((0, _chunkO5GTF7RIjs.Ord))(F);
  return (f) => (ta) => traverseWithIndexOF(ta, f);
}
function traverse(F) {
  const traverseOF = _traverse((0, _chunkO5GTF7RIjs.Ord))(F);
  return (f) => (ta) => traverseOF(ta, f);
}
function sequence(F) {
  return _sequence((0, _chunkO5GTF7RIjs.Ord))(F);
}
var wither = (F) => {
  const traverseF = traverse(F);
  return (f) => (fa) => F.map(_chunkSQA7G4TEjs.pipe.call(void 0, fa, traverseF(f)), compact);
};
var wilt = (F) => {
  const traverseF = traverse(F);
  return (f) => (fa) => F.map(_chunkSQA7G4TEjs.pipe.call(void 0, fa, traverseF(f)), separate);
};
function partitionMapWithIndex(f) {
  return (r) => {
    const left = {};
    const right = {};
    for (const k in r) {
      if (_chunkOTKMOSH2js.has.call(r, k)) {
        const e = f(k, r[k]);
        switch (e._tag) {
          case "Left":
            left[k] = e.left;
            break;
          case "Right":
            right[k] = e.right;
            break;
        }
      }
    }
    return _chunkT4ZJ6CA2js.separated.call(void 0, left, right);
  };
}
function partitionWithIndex(predicateWithIndex) {
  return (r) => {
    const left = {};
    const right = {};
    for (const k in r) {
      if (_chunkOTKMOSH2js.has.call(r, k)) {
        const a = r[k];
        if (predicateWithIndex(k, a)) {
          right[k] = a;
        } else {
          left[k] = a;
        }
      }
    }
    return _chunkT4ZJ6CA2js.separated.call(void 0, left, right);
  };
}
function filterMapWithIndex(f) {
  return (r) => {
    const out = {};
    for (const k in r) {
      if (_chunkOTKMOSH2js.has.call(r, k)) {
        const ob = f(k, r[k]);
        if (_chunkOTKMOSH2js.isSome.call(void 0, ob)) {
          out[k] = ob.value;
        }
      }
    }
    return out;
  };
}
function filterWithIndex(predicateWithIndex) {
  return (fa) => {
    const out = {};
    let changed = false;
    for (const key in fa) {
      if (_chunkOTKMOSH2js.has.call(fa, key)) {
        const a = fa[key];
        if (predicateWithIndex(key, a)) {
          out[key] = a;
        } else {
          changed = true;
        }
      }
    }
    return changed ? out : fa;
  };
}
function fromFoldable(M, F) {
  const fromFoldableMapM = fromFoldableMap(M, F);
  return (fka) => fromFoldableMapM(fka, _chunkSQA7G4TEjs.identity);
}
function fromFoldableMap(M, F) {
  return (ta, f) => {
    return F.reduce(ta, {}, (r, a) => {
      const [k, b] = f(a);
      r[k] = _chunkOTKMOSH2js.has.call(r, k) ? M.concat(r[k], b) : b;
      return r;
    });
  };
}
var toEntries = toReadonlyArray;
var fromEntries = (fa) => {
  const out = {};
  for (const a of fa) {
    out[a[0]] = a[1];
  }
  return out;
};
function every(predicate) {
  return (r) => {
    for (const k in r) {
      if (!predicate(r[k])) {
        return false;
      }
    }
    return true;
  };
}
function some2(predicate) {
  return (r) => {
    for (const k in r) {
      if (predicate(r[k])) {
        return true;
      }
    }
    return false;
  };
}
function elem(E) {
  return (a, fa) => {
    if (fa === void 0) {
      const elemE = elem(E);
      return (fa2) => elemE(a, fa2);
    }
    for (const k in fa) {
      if (E.equals(fa[k], a)) {
        return true;
      }
    }
    return false;
  };
}
var union = (M) => (second) => (first) => {
  if (isEmpty(first)) {
    return second;
  }
  if (isEmpty(second)) {
    return first;
  }
  const out = {};
  for (const k in first) {
    if (has2(k, second)) {
      out[k] = M.concat(first[k], second[k]);
    } else {
      out[k] = first[k];
    }
  }
  for (const k in second) {
    if (!has2(k, out)) {
      out[k] = second[k];
    }
  }
  return out;
};
var intersection = (M) => (second) => (first) => {
  if (isEmpty(first) || isEmpty(second)) {
    return empty;
  }
  const out = {};
  for (const k in first) {
    if (has2(k, second)) {
      out[k] = M.concat(first[k], second[k]);
    }
  }
  return out;
};
var difference = (second) => (first) => {
  if (isEmpty(first)) {
    return second;
  }
  if (isEmpty(second)) {
    return first;
  }
  const out = {};
  for (const k in first) {
    if (!has2(k, second)) {
      out[k] = first[k];
    }
  }
  for (const k in second) {
    if (!has2(k, first)) {
      out[k] = second[k];
    }
  }
  return out;
};
var _map = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map(f));
var _mapWithIndex = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, mapWithIndex(f));
var _reduce = (O) => {
  const reduceO = reduce(O);
  return (fa, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, reduceO(b, f));
};
var _foldMap = (O) => (M) => {
  const foldMapM = foldMap(O)(M);
  return (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, foldMapM(f));
};
var _reduceRight = (O) => {
  const reduceRightO = reduceRight(O);
  return (fa, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, reduceRightO(b, f));
};
var _filter = (fa, predicate) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filter(predicate));
var _filterMap = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filterMap(f));
var _partition = (fa, predicate) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partition(predicate));
var _partitionMap = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partitionMap(f));
var _reduceWithIndex = (O) => {
  const reduceWithIndexO = reduceWithIndex(O);
  return (fa, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, reduceWithIndexO(b, f));
};
var _foldMapWithIndex = (O) => {
  const foldMapWithIndexO = foldMapWithIndex(O);
  return (M) => {
    const foldMapWithIndexM = foldMapWithIndexO(M);
    return (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, foldMapWithIndexM(f));
  };
};
var _reduceRightWithIndex = (O) => {
  const reduceRightWithIndexO = reduceRightWithIndex(O);
  return (fa, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, reduceRightWithIndexO(b, f));
};
var _partitionMapWithIndex = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partitionMapWithIndex(f));
var _partitionWithIndex = (fa, predicateWithIndex) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partitionWithIndex(predicateWithIndex));
var _filterMapWithIndex = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filterMapWithIndex(f));
var _filterWithIndex = (fa, predicateWithIndex) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filterWithIndex(predicateWithIndex));
var _traverse = (O) => {
  const traverseWithIndexO = _traverseWithIndex(O);
  return (F) => {
    const traverseWithIndexOF = traverseWithIndexO(F);
    return (ta, f) => traverseWithIndexOF(ta, _chunkSQA7G4TEjs.flow.call(void 0, _chunkSQA7G4TEjs.SK, f));
  };
};
var _sequence = (O) => {
  const traverseO = _traverse(O);
  return (F) => {
    const traverseOF = traverseO(F);
    return (ta) => traverseOF(ta, _chunkSQA7G4TEjs.identity);
  };
};
var _traverseWithIndex = (O) => (F) => {
  const keysO = keys_(O);
  return (ta, f) => {
    const ks = keysO(ta);
    if (ks.length === 0) {
      return F.of(empty);
    }
    let fr = F.of({});
    for (const key of ks) {
      fr = F.ap(
        F.map(fr, (r) => (b) => Object.assign({}, r, { [key]: b })),
        f(key, ta[key])
      );
    }
    return fr;
  };
};
var filter = (predicate) => filterWithIndex((_, a) => predicate(a));
var filterMap = (f) => filterMapWithIndex((_, a) => f(a));
var partition = (predicate) => partitionWithIndex((_, a) => predicate(a));
var partitionMap = (f) => partitionMapWithIndex((_, a) => f(a));
function reduce(...args) {
  if (args.length === 1) {
    const reduceWithIndexO = reduceWithIndex(args[0]);
    return (b, f) => reduceWithIndexO(b, (_, b2, a) => f(b2, a));
  }
  return reduce((0, _chunkO5GTF7RIjs.Ord))(...args);
}
function foldMap(O) {
  if ("compare" in O) {
    const foldMapWithIndexO = foldMapWithIndex(O);
    return (M) => {
      const foldMapWithIndexM = foldMapWithIndexO(M);
      return (f) => foldMapWithIndexM((_, a) => f(a));
    };
  }
  return foldMap((0, _chunkO5GTF7RIjs.Ord))(O);
}
function reduceRight(...args) {
  if (args.length === 1) {
    const reduceRightWithIndexO = reduceRightWithIndex(args[0]);
    return (b, f) => reduceRightWithIndexO(b, (_, b2, a) => f(b2, a));
  }
  return reduceRight((0, _chunkO5GTF7RIjs.Ord))(...args);
}
var compact = (r) => {
  const out = {};
  for (const k in r) {
    if (_chunkOTKMOSH2js.has.call(r, k)) {
      const oa = r[k];
      if (_chunkOTKMOSH2js.isSome.call(void 0, oa)) {
        out[k] = oa.value;
      }
    }
  }
  return out;
};
var separate = (r) => {
  const left = {};
  const right = {};
  for (const k in r) {
    if (_chunkOTKMOSH2js.has.call(r, k)) {
      const e = r[k];
      if (_chunkOTKMOSH2js.isLeft.call(void 0, e)) {
        left[k] = e.left;
      } else {
        right[k] = e.right;
      }
    }
  }
  return _chunkT4ZJ6CA2js.separated.call(void 0, left, right);
};
var URI = "ReadonlyRecord";
function getShow(O) {
  if ("compare" in O) {
    return (S) => ({
      show: (r) => {
        const elements = collect(O)((k, a) => `${JSON.stringify(k)}: ${S.show(a)}`)(r).join(", ");
        return elements === "" ? "{}" : `{ ${elements} }`;
      }
    });
  }
  return getShow((0, _chunkO5GTF7RIjs.Ord))(O);
}
function getEq(E) {
  const isSubrecordE = isSubrecord(E);
  return _chunkTGVEPLW2js.fromEquals.call(void 0, (x, y) => isSubrecordE(x)(y) && isSubrecordE(y)(x));
}
function getMonoid(S) {
  return {
    concat: (first, second) => {
      if (isEmpty(first)) {
        return second;
      }
      if (isEmpty(second)) {
        return first;
      }
      const r = Object.assign({}, first);
      for (const k in second) {
        if (_chunkOTKMOSH2js.has.call(second, k)) {
          r[k] = _chunkOTKMOSH2js.has.call(first, k) ? S.concat(first[k], second[k]) : second[k];
        }
      }
      return r;
    },
    empty
  };
}
var Functor = {
  URI,
  map: _map
};
var flap2 = /* @__PURE__ */ _chunk7K74W2G3js.flap.call(void 0, Functor);
var FunctorWithIndex = {
  URI,
  map: _map,
  mapWithIndex: _mapWithIndex
};
var getFoldable = (O) => ({
  URI,
  reduce: _reduce(O),
  foldMap: _foldMap(O),
  reduceRight: _reduceRight(O)
});
var getFoldableWithIndex = (O) => ({
  URI,
  reduce: _reduce(O),
  foldMap: _foldMap(O),
  reduceRight: _reduceRight(O),
  reduceWithIndex: _reduceWithIndex(O),
  foldMapWithIndex: _foldMapWithIndex(O),
  reduceRightWithIndex: _reduceRightWithIndex(O)
});
var Compactable = {
  URI,
  compact,
  separate
};
var Filterable = {
  URI,
  map: _map,
  compact,
  separate,
  filter: _filter,
  filterMap: _filterMap,
  partition: _partition,
  partitionMap: _partitionMap
};
var FilterableWithIndex = {
  URI,
  map: _map,
  mapWithIndex: _mapWithIndex,
  compact,
  separate,
  filter: _filter,
  filterMap: _filterMap,
  partition: _partition,
  partitionMap: _partitionMap,
  filterMapWithIndex: _filterMapWithIndex,
  filterWithIndex: _filterWithIndex,
  partitionMapWithIndex: _partitionMapWithIndex,
  partitionWithIndex: _partitionWithIndex
};
var getTraversable = (O) => ({
  URI,
  map: _map,
  reduce: _reduce(O),
  foldMap: _foldMap(O),
  reduceRight: _reduceRight(O),
  traverse: _traverse(O),
  sequence: _sequence(O)
});
var getTraversableWithIndex = (O) => ({
  URI,
  map: _map,
  mapWithIndex: _mapWithIndex,
  reduce: _reduce(O),
  foldMap: _foldMap(O),
  reduceRight: _reduceRight(O),
  reduceWithIndex: _reduceWithIndex(O),
  foldMapWithIndex: _foldMapWithIndex(O),
  reduceRightWithIndex: _reduceRightWithIndex(O),
  traverse: _traverse(O),
  sequence: _sequence(O),
  traverseWithIndex: _traverseWithIndex(O)
});
var getWitherable = (O) => {
  const T = getTraversable(O);
  return {
    URI,
    map: _map,
    reduce: _reduce(O),
    foldMap: _foldMap(O),
    reduceRight: _reduceRight(O),
    traverse: T.traverse,
    sequence: T.sequence,
    compact,
    separate,
    filter: _filter,
    filterMap: _filterMap,
    partition: _partition,
    partitionMap: _partitionMap,
    wither: _chunkUNAIGMDHjs.witherDefault.call(void 0, T, Compactable),
    wilt: _chunkUNAIGMDHjs.wiltDefault.call(void 0, T, Compactable)
  };
};
var getUnionSemigroup = (S) => {
  const unionS = union(S);
  return {
    concat: (first, second) => unionS(second)(first)
  };
};
var getUnionMonoid = (S) => ({
  concat: getUnionSemigroup(S).concat,
  empty
});
var getIntersectionSemigroup = (S) => {
  const intersectionS = intersection(S);
  return {
    concat: (first, second) => intersectionS(second)(first)
  };
};
var getDifferenceMagma = () => ({
  concat: (first, second) => difference(second)(first)
});
var Foldable = {
  URI,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord)
};
var FoldableWithIndex = {
  URI,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord),
  reduceWithIndex: /* @__PURE__ */ _reduceWithIndex(_chunkO5GTF7RIjs.Ord),
  foldMapWithIndex: /* @__PURE__ */ _foldMapWithIndex(_chunkO5GTF7RIjs.Ord),
  reduceRightWithIndex: /* @__PURE__ */ _reduceRightWithIndex(_chunkO5GTF7RIjs.Ord)
};
var Traversable = {
  URI,
  map: _map,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord),
  traverse: /* @__PURE__ */ _traverse(_chunkO5GTF7RIjs.Ord),
  sequence
};
var TraversableWithIndex = {
  URI,
  map: _map,
  mapWithIndex: _mapWithIndex,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord),
  reduceWithIndex: /* @__PURE__ */ _reduceWithIndex(_chunkO5GTF7RIjs.Ord),
  foldMapWithIndex: /* @__PURE__ */ _foldMapWithIndex(_chunkO5GTF7RIjs.Ord),
  reduceRightWithIndex: /* @__PURE__ */ _reduceRightWithIndex(_chunkO5GTF7RIjs.Ord),
  traverse: /* @__PURE__ */ _traverse(_chunkO5GTF7RIjs.Ord),
  sequence,
  traverseWithIndex: /* @__PURE__ */ _traverseWithIndex(_chunkO5GTF7RIjs.Ord)
};
var _wither = /* @__PURE__ */ _chunkUNAIGMDHjs.witherDefault.call(void 0, Traversable, Compactable);
var _wilt = /* @__PURE__ */ _chunkUNAIGMDHjs.wiltDefault.call(void 0, Traversable, Compactable);
var Witherable = {
  URI,
  map: _map,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord),
  traverse: /* @__PURE__ */ _traverse(_chunkO5GTF7RIjs.Ord),
  sequence,
  compact,
  separate,
  filter: _filter,
  filterMap: _filterMap,
  partition: _partition,
  partitionMap: _partitionMap,
  wither: _wither,
  wilt: _wilt
};
var insertAt = upsertAt;
function hasOwnProperty(k, r) {
  return _chunkOTKMOSH2js.has.call(r === void 0 ? this : r, k);
}
var readonlyRecord = {
  URI,
  map: _map,
  reduce: /* @__PURE__ */ _reduce(_chunkO5GTF7RIjs.Ord),
  foldMap: /* @__PURE__ */ _foldMap(_chunkO5GTF7RIjs.Ord),
  reduceRight: /* @__PURE__ */ _reduceRight(_chunkO5GTF7RIjs.Ord),
  traverse: /* @__PURE__ */ _traverse(_chunkO5GTF7RIjs.Ord),
  sequence,
  compact,
  separate,
  filter: _filter,
  filterMap: _filterMap,
  partition: _partition,
  partitionMap: _partitionMap,
  mapWithIndex: _mapWithIndex,
  reduceWithIndex: /* @__PURE__ */ _reduceWithIndex(_chunkO5GTF7RIjs.Ord),
  foldMapWithIndex: /* @__PURE__ */ _foldMapWithIndex(_chunkO5GTF7RIjs.Ord),
  reduceRightWithIndex: /* @__PURE__ */ _reduceRightWithIndex(_chunkO5GTF7RIjs.Ord),
  filterMapWithIndex: _filterMapWithIndex,
  filterWithIndex: _filterWithIndex,
  partitionMapWithIndex: _partitionMapWithIndex,
  partitionWithIndex: _partitionWithIndex,
  traverseWithIndex: /* @__PURE__ */ _traverseWithIndex(_chunkO5GTF7RIjs.Ord),
  wither: _wither,
  wilt: _wilt
};



































































































exports.fromRecord = fromRecord; exports.toRecord = toRecord; exports.size = size; exports.isEmpty = isEmpty; exports.keys = keys; exports.collect = collect; exports.toReadonlyArray = toReadonlyArray; exports.toUnfoldable = toUnfoldable; exports.upsertAt = upsertAt; exports.has = has2; exports.deleteAt = deleteAt; exports.updateAt = updateAt; exports.modifyAt = modifyAt; exports.pop = pop; exports.isSubrecord = isSubrecord; exports.lookup = lookup; exports.empty = empty; exports.mapWithIndex = mapWithIndex; exports.map = map; exports.reduceWithIndex = reduceWithIndex; exports.foldMapWithIndex = foldMapWithIndex; exports.reduceRightWithIndex = reduceRightWithIndex; exports.singleton = singleton; exports.traverseWithIndex = traverseWithIndex; exports.traverse = traverse; exports.sequence = sequence; exports.wither = wither; exports.wilt = wilt; exports.partitionMapWithIndex = partitionMapWithIndex; exports.partitionWithIndex = partitionWithIndex; exports.filterMapWithIndex = filterMapWithIndex; exports.filterWithIndex = filterWithIndex; exports.fromFoldable = fromFoldable; exports.fromFoldableMap = fromFoldableMap; exports.toEntries = toEntries; exports.fromEntries = fromEntries; exports.every = every; exports.some = some2; exports.elem = elem; exports.union = union; exports.intersection = intersection; exports.difference = difference; exports._map = _map; exports._mapWithIndex = _mapWithIndex; exports._reduce = _reduce; exports._foldMap = _foldMap; exports._reduceRight = _reduceRight; exports._filter = _filter; exports._filterMap = _filterMap; exports._partition = _partition; exports._partitionMap = _partitionMap; exports._reduceWithIndex = _reduceWithIndex; exports._foldMapWithIndex = _foldMapWithIndex; exports._reduceRightWithIndex = _reduceRightWithIndex; exports._partitionMapWithIndex = _partitionMapWithIndex; exports._partitionWithIndex = _partitionWithIndex; exports._filterMapWithIndex = _filterMapWithIndex; exports._filterWithIndex = _filterWithIndex; exports._traverse = _traverse; exports._sequence = _sequence; exports.filter = filter; exports.filterMap = filterMap; exports.partition = partition; exports.partitionMap = partitionMap; exports.reduce = reduce; exports.foldMap = foldMap; exports.reduceRight = reduceRight; exports.compact = compact; exports.separate = separate; exports.URI = URI; exports.getShow = getShow; exports.getEq = getEq; exports.getMonoid = getMonoid; exports.Functor = Functor; exports.flap = flap2; exports.FunctorWithIndex = FunctorWithIndex; exports.getFoldable = getFoldable; exports.getFoldableWithIndex = getFoldableWithIndex; exports.Compactable = Compactable; exports.Filterable = Filterable; exports.FilterableWithIndex = FilterableWithIndex; exports.getTraversable = getTraversable; exports.getTraversableWithIndex = getTraversableWithIndex; exports.getWitherable = getWitherable; exports.getUnionSemigroup = getUnionSemigroup; exports.getUnionMonoid = getUnionMonoid; exports.getIntersectionSemigroup = getIntersectionSemigroup; exports.getDifferenceMagma = getDifferenceMagma; exports.Foldable = Foldable; exports.FoldableWithIndex = FoldableWithIndex; exports.Traversable = Traversable; exports.TraversableWithIndex = TraversableWithIndex; exports.Witherable = Witherable; exports.insertAt = insertAt; exports.hasOwnProperty = hasOwnProperty; exports.readonlyRecord = readonlyRecord; exports.ReadonlyRecord_exports = ReadonlyRecord_exports;
