import { defineComponent, inject, ref, provide, computed, unref, openBlock, createElementBlock, normalizeStyle, normalizeClass, renderSlot } from 'vue';
import '../../../hooks/index.mjs';
import '../../../tokens/index.mjs';
import { usePopperContentProps } from './content.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { POPPER_INJECTION_KEY, POPPER_CONTENT_INJECTION_KEY } from '../../../tokens/popper.mjs';
import { useZIndex } from '../../../hooks/use-z-index/index.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';

const __default__ = {
  name: "PsPopperContent"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: usePopperContentProps,
  setup(__props, { expose }) {
    const props = __props;
    const { popperInstanceRef } = inject(POPPER_INJECTION_KEY, void 0);
    const { nextZIndex } = useZIndex();
    const ns = useNamespace("popper");
    const popperContentRef = ref();
    const arrowRef = ref();
    const arrowOffset = ref();
    provide(POPPER_CONTENT_INJECTION_KEY, {
      arrowRef,
      arrowOffset
    });
    const contentZIndex = ref(props.zIndex || nextZIndex());
    const contentStyle = computed(() => [{ zIndex: unref(contentZIndex) }, props.popperStyle]);
    const contentClass = computed(() => [
      ns.b(),
      ns.is("pure", props.pure),
      ns.is(props.effect),
      props.popperClass
    ]);
    expose({
      popperContentRef,
      popperInstanceRef,
      contentStyle
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "popperContentRef",
        ref: popperContentRef,
        style: normalizeStyle(unref(contentStyle)),
        class: normalizeClass(unref(contentClass)),
        role: "tooltip"
      }, [
        renderSlot(_ctx.$slots, "default")
      ], 6);
    };
  }
});
var content = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/popper/src/content.vue"]]);

export { content as default };
//# sourceMappingURL=content2.mjs.map
