// ets_tracing: off
import * as A from "@effect-ts/core/Collections/Immutable/Array";
import * as C from "@effect-ts/core/Collections/Immutable/Chunk";
import * as E from "@effect-ts/core/Either";
import { pipe } from "@effect-ts/core/Function";
import * as O from "@effect-ts/core/Option";
import { matchTag } from "@effect-ts/core/Utils";
import * as FullLayout from "../../FigHeader/FullLayout/index.mjs"; // -----------------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------------

export const EqualCharacter = {
  _tag: "EqualCharacter"
};
export const Underscore = {
  _tag: "Underscore"
};
export const Hierarchy = {
  _tag: "Hierarchy"
};
export const HorizontalLine = {
  _tag: "HorizontalLine"
};
export const VerticalLineSupersmushing = {
  _tag: "VerticalLineSupersmushing"
};
/**
 * Interprets the header settings and returns the selected `VerticalSmushingRule`s.
 *
 * @param header The `FigHeader` where the vertical layout is defined.
 * @returns A `FigletResult` containing a list of `VerticalSmushingRule`s, or
 * a list of `FigletException`s accumulated during parsing.
 */

export function fromHeader(header) {
  return E.right(O.getOrElse_(O.map_(header.fullLayout, settings => C.from(A.collect_(A.intersection_(FullLayout.equalFullLayout)(C.toArray(settings), C.toArray(FullLayout.verticalSmushingRules)), matchTag({
    EqualCharacterVerticalSmushing: () => O.some(EqualCharacter),
    UnderscoreVerticalSmushing: () => O.some(Underscore),
    HierarchyVerticalSmushing: () => O.some(Hierarchy),
    HorizontalLineVerticalSmushing: () => O.some(HorizontalLine),
    VerticalLineSupersmushing: () => O.some(VerticalLineSupersmushing)
  }, () => O.emptyOf())))), () => C.empty()));
}
//# sourceMappingURL=index.mjs.map