"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const index$1 = require("../../tooltip/index.js");
const popover = require("./popover.js");
const pluginVue_exportHelper = require("../../../_virtual/plugin-vue_export-helper.js");
const index = require("../../../hooks/use-namespace/index.js");
const style = require("../../../utils/dom/style.js");
const D = "onUpdate:visible", K = Vue.defineComponent({
  name: "ElPopover"
}), O = /* @__PURE__ */ Vue.defineComponent({
  ...K,
  props: popover.popoverProps,
  emits: popover.popoverEmits,
  setup(u, { expose: v, emit: r }) {
    const t = u, m = Vue.computed(() => t[D]), p = index.useNamespace("popover"), s = Vue.ref(), b = Vue.computed(() => {
      var e;
      return (e = Vue.unref(s)) == null ? void 0 : e.popperRef;
    }), h = Vue.computed(() => [
      {
        width: style.addUnit(t.width)
      },
      t.popperStyle
    ]), w = Vue.computed(() => [p.b(), t.popperClass, { [p.m("plain")]: !!t.content }]), g = Vue.computed(() => t.transition === `${p.namespace.value}-fade-in-linear`), y = () => {
      var e;
      (e = s.value) == null || e.hide();
    }, k = () => {
      r("before-enter");
    }, E = () => {
      r("before-leave");
    }, C = () => {
      r("after-enter");
    }, B = () => {
      r("update:visible", false), r("after-leave");
    };
    return v({
      popperRef: b,
      hide: y
    }), (e, j) => (Vue.openBlock(), Vue.createBlock(Vue.unref(index$1.ElTooltip), Vue.mergeProps({
      ref_key: "tooltipRef",
      ref: s
    }, e.$attrs, {
      trigger: e.trigger,
      placement: e.placement,
      disabled: e.disabled,
      visible: e.visible,
      transition: e.transition,
      "popper-options": e.popperOptions,
      tabindex: e.tabindex,
      content: e.content,
      offset: e.offset,
      "show-after": e.showAfter,
      "hide-after": e.hideAfter,
      "auto-close": e.autoClose,
      "show-arrow": e.showArrow,
      "aria-label": e.title,
      effect: e.effect,
      enterable: e.enterable,
      "popper-class": Vue.unref(w),
      "popper-style": Vue.unref(h),
      teleported: e.teleported,
      persistent: e.persistent,
      "gpu-acceleration": Vue.unref(g),
      "onUpdate:visible": Vue.unref(m),
      onBeforeShow: k,
      onBeforeHide: E,
      onShow: C,
      onHide: B
    }), {
      content: Vue.withCtx(() => [
        e.title ? (Vue.openBlock(), Vue.createElementBlock("div", {
          key: 0,
          class: Vue.normalizeClass(Vue.unref(p).e("title")),
          role: "title"
        }, Vue.toDisplayString(e.title), 3)) : Vue.createCommentVNode("v-if", true),
        Vue.renderSlot(e.$slots, "default", {}, () => [
          Vue.createTextVNode(Vue.toDisplayString(e.content), 1)
        ])
      ]),
      default: Vue.withCtx(() => [
        e.$slots.reference ? Vue.renderSlot(e.$slots, "reference", { key: 0 }) : Vue.createCommentVNode("v-if", true)
      ]),
      _: 3
    }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
  }
});
var Q = /* @__PURE__ */ pluginVue_exportHelper.default(O, [["__file", "popover.vue"]]);
exports.default = Q;
