"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 text_align_testkit_exports = {};
__export(text_align_testkit_exports, {
  createTextAlignTestkit: () => createTextAlignTestkit
});
module.exports = __toCommonJS(text_align_testkit_exports);
var import_data_hooks = require("./../../_shared/dropdown-modal/data-hooks.js");
var import_wix_rich_content_common = require("./../../wix-rich-content-common/index.js");
var import_data_hooks2 = require("./dropdown/data-hooks.js");
const createTextAlignTestkit = (getBase) => {
  const options = {
    LEFT: import_data_hooks2.TEXT_ALIGNMENT_DROPDOWN_OPTION_LEFT,
    CENTER: import_data_hooks2.TEXT_ALIGNMENT_DROPDOWN_OPTION_CENTER,
    RIGHT: import_data_hooks2.TEXT_ALIGNMENT_DROPDOWN_OPTION_RIGHT,
    JUSTIFY: import_data_hooks2.TEXT_ALIGNMENT_DROPDOWN_OPTION_JUSTIFY
  };
  return {
    content: {},
    toolbars: {
      createTextButtonToolbars: (getTextButtonToolbarBase) => {
        const getButton = async () => getTextButtonToolbarBase().get((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.TEXT_ALIGNMENT_DROPDOWN_BUTTON));
        const getModal = async () => getBase().get((0, import_wix_rich_content_common.dataHook)(import_data_hooks.TOOLBAR_DROPDOWN_PANEL));
        return {
          getButton,
          getModal,
          click: async () => {
            const button = await getButton();
            await button.click();
          },
          clickModalValue: async (value) => {
            const modal = await getModal();
            const button = await modal.get((0, import_wix_rich_content_common.dataHook)(options[value]));
            await button.click();
          },
          getSelectedModalValue: async () => {
            const modal = await getModal();
            const button = await modal.get('[aria-selected="true"]');
            const allHooks = await button.attr("data-hook");
            return Object.entries(options).find(
              ([_, value]) => allHooks?.includes(value)
            )?.[0];
          }
        };
      }
    }
  };
};
//# sourceMappingURL=text-align.testkit.js.map
