import { defineComponent, useSlots, ref, resolveComponent, createBlock, openBlock, mergeProps, toHandlers, unref, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
import '../../../../utils/index.mjs';
import { elTreeEmits, treeEmits, treeProps } from './tree.mjs';
import { getGmEvent } from '../../../../utils/src/elementPlus/event.mjs';
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmTree"
  },
  __name: "Tree",
  props: treeProps,
  emits: treeEmits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const slots = useSlots();
    const props = __props;
    const emit = __emit;
    const elEvents = getGmEvent(elTreeEmits, emit);
    const elRef = ref();
    const exposeEvents = [
      "filter",
      "updateKeyChildren",
      "getCheckedNodes",
      "setCheckedNodes",
      "getCheckedKeys",
      "setCheckedKeys",
      "setChecked",
      "getHalfCheckedNodes",
      "getHalfCheckedKeys",
      "getCurrentKey",
      "getCurrentNode",
      "setCurrentKey",
      "setCurrentNode",
      "getNode",
      "remove",
      "append",
      "insertBefore",
      "insertAfter"
    ];
    const { exposeFns } = getGmExports(elRef, exposeEvents);
    __expose({
      elRef,
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_tree = resolveComponent("el-tree");
      return openBlock(), createBlock(
        _component_el_tree,
        mergeProps({
          ref_key: "elRef",
          ref: elRef
        }, props, toHandlers(unref(elEvents))),
        createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          unref(slots).default ? {
            name: "default",
            fn: withCtx((slotValue) => [
              renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotValue)))
            ]),
            key: "0"
          } : void 0,
          unref(slots).empty ? {
            name: "empty",
            fn: withCtx((slotValue) => [
              renderSlot(_ctx.$slots, "empty", normalizeProps(guardReactiveProps(slotValue)))
            ]),
            key: "1"
          } : void 0
        ]),
        1040
        /* FULL_PROPS, DYNAMIC_SLOTS */
      );
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=Tree.vue2.mjs.map
