"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../icon/index.js");
const collapseItem = require("./collapse-item.js");
const index$1 = require("../../collapse-transition/index.js");
const useCollapseItem = require("./use-collapse-item.js");
const Vue = require("vue");
const _hoisted_1 = [
  "id",
  "aria-expanded",
  "aria-controls",
  "aria-describedby",
  "tabindex",
  "aria-disabled"
];
const _hoisted_2 = [
  "id",
  "aria-hidden",
  "aria-labelledby"
];
var collapse_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  name: "ElCollapseItem",
  __name: "collapse-item",
  props: collapseItem.collapseItemProps,
  setup(__props, { expose: __expose }) {
    const props = __props;
    const { focusing, id, isActive, handleFocus, handleHeaderClick, handleEnterClick } = useCollapseItem.useCollapseItem(props);
    const { arrowKls, headKls, rootKls, itemTitleKls, itemWrapperKls, itemContentKls, scopedContentId, scopedHeadId } = useCollapseItem.useCollapseItemDOM(props, {
      focusing,
      isActive,
      id
    });
    __expose({ isActive });
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", { class: Vue.normalizeClass(Vue.unref(rootKls)) }, [Vue.createElementVNode("div", {
        id: Vue.unref(scopedHeadId),
        class: Vue.normalizeClass(Vue.unref(headKls)),
        "aria-expanded": Vue.unref(isActive),
        "aria-controls": Vue.unref(scopedContentId),
        "aria-describedby": Vue.unref(scopedContentId),
        tabindex: __props.disabled ? void 0 : 0,
        "aria-disabled": __props.disabled,
        role: "button",
        onClick: _cache[0] || (_cache[0] = (...args) => Vue.unref(handleHeaderClick) && Vue.unref(handleHeaderClick)(...args)),
        onKeydown: _cache[1] || (_cache[1] = Vue.withKeys(Vue.withModifiers((...args) => Vue.unref(handleEnterClick) && Vue.unref(handleEnterClick)(...args), ["stop"]), ["space", "enter"])),
        onFocus: _cache[2] || (_cache[2] = (...args) => Vue.unref(handleFocus) && Vue.unref(handleFocus)(...args)),
        onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
      }, [Vue.createElementVNode("span", { class: Vue.normalizeClass(Vue.unref(itemTitleKls)) }, [Vue.renderSlot(_ctx.$slots, "title", { isActive: Vue.unref(isActive) }, () => [Vue.createTextVNode(Vue.toDisplayString(__props.title), 1)])], 2), Vue.renderSlot(_ctx.$slots, "icon", { isActive: Vue.unref(isActive) }, () => [Vue.createVNode(Vue.unref(index.ElIcon), { class: Vue.normalizeClass(Vue.unref(arrowKls)) }, {
        default: Vue.withCtx(() => [(Vue.openBlock(), Vue.createBlock(Vue.resolveDynamicComponent(__props.icon)))]),
        _: 1
      }, 8, ["class"])])], 42, _hoisted_1), Vue.createVNode(Vue.unref(index$1.ElCollapseTransition), null, {
        default: Vue.withCtx(() => [Vue.withDirectives(Vue.createElementVNode("div", {
          id: Vue.unref(scopedContentId),
          role: "region",
          class: Vue.normalizeClass(Vue.unref(itemWrapperKls)),
          "aria-hidden": !Vue.unref(isActive),
          "aria-labelledby": Vue.unref(scopedHeadId)
        }, [Vue.createElementVNode("div", { class: Vue.normalizeClass(Vue.unref(itemContentKls)) }, [Vue.renderSlot(_ctx.$slots, "default")], 2)], 10, _hoisted_2), [[Vue.vShow, Vue.unref(isActive)]])]),
        _: 3
      })], 2);
    };
  }
});
exports.default = collapse_item_vue_vue_type_script_setup_true_lang_default;
