var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
import { ProProvider } from "@antdv/pro-provider";
import { classNames, objectType, omit, stringType } from "@antdv/pro-utils";
import { Popover } from "ant-design-vue";
import { popoverProps } from "ant-design-vue/es/popover";
import { useConfigContextInject } from "ant-design-vue/lib/config-provider/context";
import { computed, defineComponent } from "vue";
import { ProHelpContentPanel } from "./ProHelpContentPanel.mjs";
import { useStyle } from "./style.mjs";
const proHelpPopoverProps = __spreadProps(__spreadValues({}, omit(popoverProps(), ["content"])), {
  /**
   * 悬浮提示文字的 CSS 类名
   */
  textClassName: stringType(),
  /**
   * Popover 内容的 content 的 CSS 类名
   */
  popoverContextClassName: stringType(),
  /**
   * 悬浮提示文字的 CSS 样式对象
   */
  textStyle: objectType(),
  /**
   * 当前选中的帮助文档的 key 值
   */
  selectedKey: stringType().isRequired,
  /**
   * 可选的悬浮提示 Popover 组件的 Props，用于自定义悬浮提示的样式和行为。
   * 该属性可以传递 Ant Design Popover 组件的 props，如位置、大小、触发方式等等
   * @see 注意，content 属性已经被从 PopoverProps 中删除，因为这个属性由 ProHelpPopover 内部控制。
   */
  popoverProps: objectType()
});
const ProHelpPopover = defineComponent({
  name: "ProHelpPopover",
  props: proHelpPopoverProps,
  setup(props, {
    slots
  }) {
    const {
      getPrefixCls
    } = useConfigContextInject();
    const className = computed(() => getPrefixCls("pro-help"));
    const {
      hashId
    } = ProProvider.useContext();
    const {
      wrapSSR
    } = useStyle(className);
    return () => {
      return wrapSSR(_createVNode(Popover, _mergeProps({
        "overlayInnerStyle": {
          padding: 0
        },
        "content": _createVNode("div", {
          "class": classNames(`${className.value}-popover-content`, hashId, props.popoverContextClassName)
        }, [_createVNode(ProHelpContentPanel, {
          "selectedKey": props.selectedKey
        }, null)])
      }, props.popoverProps), {
        default: () => {
          var _a;
          return [_createVNode("span", {
            "class": classNames(`${className.value}-popover-text`, hashId, props.textClassName)
          }, [props.children || ((_a = slots.default) == null ? void 0 : _a.call(slots))])];
        }
      }));
    };
  }
});
export {
  ProHelpPopover,
  proHelpPopoverProps
};
