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

var _chunkGWX33PUIjs = require('./chunk-GWX33PUI.js');


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


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

// src/FoldableWithIndex.ts
var FoldableWithIndex_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, FoldableWithIndex_exports, {
  foldMapWithIndex: () => foldMapWithIndex,
  getFoldableWithIndexComposition: () => getFoldableWithIndexComposition,
  reduceRightWithIndex: () => reduceRightWithIndex,
  reduceWithIndex: () => reduceWithIndex
});
function reduceWithIndex(F, G) {
  return (b, f) => (fga) => F.reduceWithIndex(fga, b, (i, b2, ga) => G.reduceWithIndex(ga, b2, (j, b3, a) => f([i, j], b3, a)));
}
function foldMapWithIndex(F, G) {
  return (M) => {
    const foldMapWithIndexF = F.foldMapWithIndex(M);
    const foldMapWithIndexG = G.foldMapWithIndex(M);
    return (f) => (fga) => foldMapWithIndexF(fga, (i, ga) => foldMapWithIndexG(ga, (j, a) => f([i, j], a)));
  };
}
function reduceRightWithIndex(F, G) {
  return (b, f) => (fga) => F.reduceRightWithIndex(fga, b, (i, ga, b2) => G.reduceRightWithIndex(ga, b2, (j, a, b3) => f([i, j], a, b3)));
}
function getFoldableWithIndexComposition(F, G) {
  const FC = _chunkGWX33PUIjs.getFoldableComposition.call(void 0, F, G);
  const _reduceWithIndex = reduceWithIndex(F, G);
  const _foldMapWithIndex = foldMapWithIndex(F, G);
  const _reduceRightWithIndex = reduceRightWithIndex(F, G);
  return {
    reduce: FC.reduce,
    foldMap: FC.foldMap,
    reduceRight: FC.reduceRight,
    reduceWithIndex: (fga, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _reduceWithIndex(b, f)),
    foldMapWithIndex: (M) => {
      const foldMapWithIndexM = _foldMapWithIndex(M);
      return (fga, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, foldMapWithIndexM(f));
    },
    reduceRightWithIndex: (fga, b, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fga, _reduceRightWithIndex(b, f))
  };
}







exports.reduceWithIndex = reduceWithIndex; exports.foldMapWithIndex = foldMapWithIndex; exports.reduceRightWithIndex = reduceRightWithIndex; exports.getFoldableWithIndexComposition = getFoldableWithIndexComposition; exports.FoldableWithIndex_exports = FoldableWithIndex_exports;
