"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 get_add_buttons_exports = {};
__export(get_add_buttons_exports, {
  getAddButtons: () => getAddButtons,
  toolbarsToAddIn: () => toolbarsToAddIn
});
module.exports = __toCommonJS(get_add_buttons_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_button_defaults_json = __toESM(require("./../ricos-schema/legacy/statics/button.defaults.json.js"));
var import_ricos_types = require("./../ricos-types/index.js");
var import_get_initial_link_data = require("./../_shared/link/get-initial-link-data.js");
var import_editor_common = require("./../editor-common/index.js");
var import_constants = require("./constants.js");
var import_data_hooks = require("./data-hooks.js");
const toolbarsToAddIn = [
  import_editor_common.TOOLBARS.FOOTER,
  import_editor_common.TOOLBARS.SIDE,
  import_editor_common.TOOLBARS.MOBILE
];
const getAddButtons = (config, _services, type) => {
  return [
    {
      id: import_ricos_types.Node_Type.BUTTON,
      label: import_editor_common.INSERT_PLUGIN_BUTTONS.BUTTON,
      dataHook: import_data_hooks.INSERT_BUTTON_BUTTON,
      icon: import_wix_ui_icons_common.ButtonPill,
      // @ts-ignore TODO: (plugins-no-any) remove insertButtonTooltip when we make sure it's not used anymore
      tooltip: config?.insertButtonTooltip || "ButtonPlugin_InsertButton_Tooltip",
      toolbars: toolbarsToAddIn,
      command: ({ publicCommands }) => {
        const initialLinkOptions = (0, import_get_initial_link_data.getInitialLinkData)(
          _services.editorProps.generalLinkSettings?.initialLinkOptions
        );
        publicCommands.insertBlockWithBlankLines(type, {
          ...import_button_defaults_json.default,
          link: initialLinkOptions,
          type: import_constants.BUTTONS_TYPE_TO_TIPTAP_ATTR[type]
        });
        return true;
      },
      menuConfig: {
        tags: "Button_plugin_search_tags",
        group: "advanced"
      }
    }
  ];
};
//# sourceMappingURL=get-add-buttons.js.map
