"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var builders_exports = {};
__export(builders_exports, {
  D: () => D,
  N: () => N,
  builders: () => builders,
  doc: () => doc,
  documentStyle: () => documentStyle,
  noIds: () => noIds
});
module.exports = __toCommonJS(builders_exports);
var import_lodash = __toESM(require("lodash"));
var import_audio_builder = require("./audio.builder.js");
var import_button_builder = require("./button.builder.js");
var import_caption_builder = require("./caption.builder.js");
var import_card_builder = require("./card.builder.js");
var import_code_block_builder = require("./code-block.builder.js");
var import_collapsible_list_builder = require("./collapsible-list.builder.js");
var import_common_plugins_builder = require("./common-plugins.builder.js");
var import_dangerous_error_builder = require("./dangerous-error.builder.js");
var import_divider_builder = require("./divider.builder.js");
var import_file_builder = require("./file.builder.js");
var import_gallery_builder = require("./gallery.builder.js");
var import_gif_builder = require("./gif.builder.js");
var import_heading_builder = require("./heading.builder.js");
var import_html_builder = require("./html.builder.js");
var import_image_builder = require("./image.builder.js");
var import_layout_cell_builder = require("./layout-cell.builder.js");
var import_layout_builder = require("./layout.builder.js");
var import_link_preview_builder = require("./link-preview.builder.js");
var import_poll_builder = require("./poll.builder.js");
var import_shape_builder = require("./shape.builder.js");
var import_smart_block_builder = require("./smart-block.builder.js");
var import_spoiler_builder = require("./spoiler.builder.js");
var import_table_builder = require("./table.builder.js");
var import_toc_builder = require("./toc.builder.js");
var import_vertical_embed_builder = require("./vertical-embed.builder.js");
var import_video_builder = require("./video.builder.js");
const noIds = (nodes) => {
  return nodes?.map((node) => {
    const n = node.nodes ? noIds(node.nodes) : void 0;
    return {
      ...import_lodash.default.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: import_card_builder.card,
  cl: {
    list: import_collapsible_list_builder.collapsibleList,
    item: import_collapsible_list_builder.collapsibleListItem,
    title: import_collapsible_list_builder.collapsibleListItemTitle,
    body: import_collapsible_list_builder.collapsibleListItemBody
  },
  de: import_dangerous_error_builder.dangerousError,
  table: {
    body: import_table_builder.table,
    row: import_table_builder.tableRow,
    cell: import_table_builder.tableCell
  },
  image: import_image_builder.image,
  shape: import_shape_builder.shape,
  divider: import_divider_builder.divider,
  html: import_html_builder.html,
  video: import_video_builder.video,
  audio: import_audio_builder.audio,
  gif: import_gif_builder.gif,
  file: import_file_builder.file,
  heading: import_heading_builder.heading,
  button: import_button_builder.button,
  gallery: import_gallery_builder.gallery,
  caption: import_caption_builder.caption,
  codeBlock: import_code_block_builder.codeBlock,
  layout: {
    body: import_layout_builder.layout,
    cell: import_layout_cell_builder.layoutCell
  },
  smartBlock: {
    body: import_smart_block_builder.smartBlock,
    cell: import_smart_block_builder.smartBlockCell
  },
  poll: import_poll_builder.poll,
  verticalEmbed: import_vertical_embed_builder.verticalEmbed,
  linkPreview: import_link_preview_builder.linkPreview,
  toc: import_toc_builder.toc
};
const N = { doc, p: import_common_plugins_builder.p, text: import_common_plugins_builder.text, blockquote: import_common_plugins_builder.blockquote, documentStyle, ul: import_common_plugins_builder.ul, ol: import_common_plugins_builder.ol, li: import_common_plugins_builder.li, plugin };
const D = { fontSize: import_common_plugins_builder.fontSize, italic: import_common_plugins_builder.italic, link: import_common_plugins_builder.link, textColor: import_common_plugins_builder.textColor, spoiler: import_spoiler_builder.spoiler };
const builders = {
  N,
  D,
  documentStyle,
  noIds,
  doc
};
//# sourceMappingURL=index.js.map
