import lodash from "lodash";
import { audio } from "./audio.builder.js";
import { button } from "./button.builder.js";
import { caption } from "./caption.builder.js";
import { card } from "./card.builder.js";
import { codeBlock } from "./code-block.builder.js";
import {
  collapsibleList,
  collapsibleListItem,
  collapsibleListItemBody,
  collapsibleListItemTitle
} from "./collapsible-list.builder.js";
import {
  blockquote,
  fontSize,
  italic,
  li,
  link,
  ol,
  p,
  text,
  textColor,
  ul
} from "./common-plugins.builder.js";
import { dangerousError } from "./dangerous-error.builder.js";
import { divider } from "./divider.builder.js";
import { file } from "./file.builder.js";
import { gallery } from "./gallery.builder.js";
import { gif } from "./gif.builder.js";
import { heading } from "./heading.builder.js";
import { html } from "./html.builder.js";
import { image } from "./image.builder.js";
import { layoutCell } from "./layout-cell.builder.js";
import { layout } from "./layout.builder.js";
import { linkPreview } from "./link-preview.builder.js";
import { poll } from "./poll.builder.js";
import { shape } from "./shape.builder.js";
import { smartBlock, smartBlockCell } from "./smart-block.builder.js";
import { spoiler } from "./spoiler.builder.js";
import { table, tableCell, tableRow } from "./table.builder.js";
import { toc } from "./toc.builder.js";
import { verticalEmbed } from "./vertical-embed.builder.js";
import { video } from "./video.builder.js";
const noIds = (nodes) => {
  return nodes?.map((node) => {
    const n = node.nodes ? noIds(node.nodes) : void 0;
    return {
      ...lodash.omit(node, ["id"]),
      ...n ? { nodes: n } : {}
    };
  }) ?? [];
};
const doc = (...args) => {
  const getId = /* @__PURE__ */ (() => {
    let index = 0;
    return () => {
      index++;
      return `foo${index}`;
    };
  })();
  const nodes = args.filter((arg) => arg.type === "block_node").map((arg) => arg.node(getId));
  const documentStyle2 = args.find(
    (arg) => arg.type === "document_styles"
  )?.styles;
  return {
    type: "ok",
    data: {
      nodes,
      metadata: {
        version: 1,
        createdTimestamp: /* @__PURE__ */ new Date("2022-12-19T17:56:18.279Z"),
        updatedTimestamp: /* @__PURE__ */ new Date("2022-12-19T17:56:18.279Z"),
        id: "00c7fed7-27c1-4633-a0b5-159d32dd41fc"
      },
      documentStyle: documentStyle2
    }
  };
};
const documentStyle = (styles) => {
  return {
    type: "document_styles",
    styles
  };
};
const plugin = {
  card,
  cl: {
    list: collapsibleList,
    item: collapsibleListItem,
    title: collapsibleListItemTitle,
    body: collapsibleListItemBody
  },
  de: dangerousError,
  table: {
    body: table,
    row: tableRow,
    cell: tableCell
  },
  image,
  shape,
  divider,
  html,
  video,
  audio,
  gif,
  file,
  heading,
  button,
  gallery,
  caption,
  codeBlock,
  layout: {
    body: layout,
    cell: layoutCell
  },
  smartBlock: {
    body: smartBlock,
    cell: smartBlockCell
  },
  poll,
  verticalEmbed,
  linkPreview,
  toc
};
const N = { doc, p, text, blockquote, documentStyle, ul, ol, li, plugin };
const D = { fontSize, italic, link, textColor, spoiler };
const builders = {
  N,
  D,
  documentStyle,
  noIds,
  doc
};
export {
  D,
  N,
  builders,
  doc,
  documentStyle,
  noIds
};
//# sourceMappingURL=index.js.map
