"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 converters_exports = {};
__export(converters_exports, {
  createConverters: () => createConverters,
  getAllPmConverters: () => getAllPmConverters
});
module.exports = __toCommonJS(converters_exports);
var import_lodash = __toESM(require("lodash"));
var import_collect = require("./../pm-converters/collect.js");
var import_ricos_common_plugins = require("./../ricos-common-plugins/index.js");
var import_editor = require("./../plugin-audio/editor.js");
var import_editor2 = require("./../plugin-button/editor.js");
var import_editor3 = require("./../plugin-code-block/editor.js");
var import_editor4 = require("./../plugin-collapsible-list/editor.js");
var import_editor5 = require("./../plugin-divider/editor.js");
var import_editor6 = require("./../plugin-emoji/editor.js");
var import_editor7 = require("./../plugin-file-upload/editor.js");
var import_editor8 = require("./../plugin-gallery/editor.js");
var import_editor9 = require("./../plugin-giphy/editor.js");
var import_editor10 = require("./../plugin-hashtag/editor.js");
var import_editor11 = require("./../plugin-headings/editor.js");
var import_editor12 = require("./../plugin-html/editor.js");
var import_editor13 = require("./../plugin-image/editor.js");
var import_editor14 = require("./../plugin-indent/editor.js");
var import_editor15 = require("./../plugin-line-spacing/editor.js");
var import_editor16 = require("./../plugin-link-preview/editor.js");
var import_editor17 = require("./../plugin-link/editor.js");
var import_editor18 = require("./../plugin-mentions/editor.js");
var import_editor19 = require("./../plugin-shape/editor.js");
var import_editor20 = require("./../plugin-smart-block/editor.js");
var import_editor21 = require("./../plugin-social-polls/editor.js");
var import_editor22 = require("./../plugin-spoiler/editor.js");
var import_editor23 = require("./../plugin-table/editor.js");
var import_editor24 = require("./../plugin-text-color/editor.js");
var import_editor25 = require("./../plugin-toc/editor.js");
var import_editor26 = require("./../plugin-vertical-embed/editor.js");
var import_editor27 = require("./../plugin-video/editor.js");
const createConverters = (plugins) => {
  const allPlugins = collectPluginsWithDependencies([...(0, import_ricos_common_plugins.commonPlugins)({}, []), ...plugins]);
  return (0, import_collect.collectPmConverters)(import_lodash.default.uniq(allPlugins));
};
const collectPluginsWithDependencies = (plugins) => plugins.flatMap((plugin) => [
  plugin,
  ...plugin.dependencies ? collectPluginsWithDependencies(plugin.dependencies) : []
]);
const collectAllRicosPlugins = () => {
  const allPlugins = collectPluginsWithDependencies([
    ...(0, import_ricos_common_plugins.commonPlugins)({}, []),
    (0, import_editor.pluginAudio)(),
    (0, import_editor2.pluginActionButton)(),
    (0, import_editor2.pluginLinkButton)(),
    (0, import_editor3.pluginCodeBlock)(),
    (0, import_editor4.pluginCollapsibleList)(),
    (0, import_editor5.pluginDivider)(),
    (0, import_editor6.pluginEmoji)(),
    (0, import_editor7.pluginFileUpload)(),
    (0, import_editor8.pluginGallery)(),
    (0, import_editor9.pluginGiphy)(),
    (0, import_editor10.pluginHashtag)(),
    (0, import_editor11.pluginHeadings)(),
    (0, import_editor12.pluginHtml)(),
    (0, import_editor13.pluginImage)(),
    (0, import_editor19.pluginShape)(),
    (0, import_editor14.pluginIndent)(),
    (0, import_editor15.pluginLineSpacing)(),
    (0, import_editor17.pluginLink)(),
    (0, import_editor16.pluginLinkPreview)(),
    (0, import_editor18.pluginMentions)(),
    (0, import_editor21.pluginPoll)(),
    (0, import_editor22.pluginSpoiler)(),
    (0, import_editor23.pluginTable)(),
    (0, import_editor25.pluginToc)(),
    (0, import_editor24.pluginTextColor)(),
    (0, import_editor24.pluginTextHighlight)(),
    (0, import_editor26.pluginVerticalEmbed)(),
    (0, import_editor27.pluginVideo)(),
    (0, import_editor20.pluginSmartBlock)()
  ]);
  return import_lodash.default.uniq(allPlugins);
};
let allPmConverters;
const getAllPmConverters = () => {
  if (!allPmConverters) {
    allPmConverters = createConverters(collectAllRicosPlugins());
  }
  return allPmConverters;
};
//# sourceMappingURL=index.js.map
