"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var cell_testkit_exports = {};
__export(cell_testkit_exports, {
  createLayoutCellTestkit: () => createLayoutCellTestkit
});
module.exports = __toCommonJS(cell_testkit_exports);
var import_ricos_types = require("./../../ricos-types/index.js");
var import_data_hooks = require("./../../_shared/data-hooks.js");
var import_dropdown_modal_uni_driver = require("./../../_shared/dropdown-modal/dropdown-modal-uni-driver.js");
var import_wix_rich_content_common = require("./../../wix-rich-content-common/index.js");
var import_data_hooks2 = require("./data-hooks.js");
const createLayoutCellTestkit = (getBase) => {
  const addCellDropdown = (0, import_dropdown_modal_uni_driver.createDropdownModalUniDriver)(getBase);
  return {
    content: {},
    clickCellHandle: async (cellId) => {
      await (await getBase().get((0, import_wix_rich_content_common.dataHook)(`${import_data_hooks2.LAYOUT_CELL_HANDLE}-${cellId}`))).click();
    },
    toolbars: {
      createPluginToolbar: (getPluginToolbarBase) => ({
        clickAddCellDropdown: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT_CELL).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_CELL_TOOLBAR_ADD_CELL_DROPDOWN_BUTTON)
          )).click();
        },
        clickAddCellBefore: async () => {
          await (await addCellDropdown.optionAtIndex(0)).click();
        },
        clickAddCellAfter: async () => {
          await (await addCellDropdown.optionAtIndex(1)).click();
        },
        clickMoveLeft: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT_CELL).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_CELL_TOOLBAR_MOVE_LEFT_BUTTON)
          )).click();
        },
        clickMoveRight: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT_CELL).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_CELL_TOOLBAR_MOVE_RIGHT_BUTTON)
          )).click();
        },
        clickDelete: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT_CELL).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_DELETE_BUTTON)
          )).click();
        },
        exists: async () => {
          try {
            return getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT_CELL).exists();
          } catch {
            return false;
          }
        }
      })
    }
  };
};
//# sourceMappingURL=cell.testkit.js.map
