"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../../../hooks/use-locale/index.js");
const predefine = require("../props/predefine.js");
const usePredefine = require("../composables/use-predefine.js");
const Vue = require("vue");
const _hoisted_1 = [
  "disabled",
  "aria-label",
  "onClick"
];
var predefine_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  name: "ElColorPredefine",
  __name: "predefine",
  props: predefine.predefineProps,
  setup(__props) {
    const props = __props;
    const { rgbaColors, handleSelect } = usePredefine.usePredefine(props);
    const { rootKls, colorsKls, colorSelectorKls } = usePredefine.usePredefineDOM(props);
    const { t } = index.useLocale();
    const ariaLabel = (value) => {
      return t("el.colorpicker.predefineDescription", { value });
    };
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", { class: Vue.normalizeClass(Vue.unref(rootKls)) }, [Vue.createElementVNode("div", { class: Vue.normalizeClass(Vue.unref(colorsKls)) }, [(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(rgbaColors), (item, index2) => {
        return Vue.openBlock(), Vue.createElementBlock("button", {
          key: __props.colors[index2],
          type: "button",
          disabled: __props.disabled,
          "aria-label": ariaLabel(item.value),
          class: Vue.normalizeClass(Vue.unref(colorSelectorKls)(item)),
          onClick: ($event) => Vue.unref(handleSelect)(index2)
        }, [Vue.createElementVNode("div", { style: Vue.normalizeStyle({ backgroundColor: item.value }) }, null, 4)], 10, _hoisted_1);
      }), 128))], 2)], 2);
    };
  }
});
exports.default = predefine_vue_vue_type_script_setup_true_lang_default;
