import { defineComponent, provide, computed, inject, shallowRef } from 'vue';

const TreeContextKey = Symbol("TreeContextKey");
const TreeContext = defineComponent({
  compatConfig: { MODE: 3 },
  name: "TreeContext",
  props: {
    value: { type: Object }
  },
  setup(props, { slots }) {
    provide(
      TreeContextKey,
      computed(() => props.value)
    );
    return () => {
      var _a;
      return (_a = slots.default) == null ? void 0 : _a.call(slots);
    };
  }
});
function useInjectTreeContext() {
  return inject(
    TreeContextKey,
    computed(() => ({}))
  );
}
const KeysStateKey = Symbol("KeysStateKey");
function useProvideKeysState(state) {
  provide(KeysStateKey, state);
}
function useInjectKeysState() {
  return inject(KeysStateKey, {
    expandedKeys: shallowRef([]),
    selectedKeys: shallowRef([]),
    loadedKeys: shallowRef([]),
    loadingKeys: shallowRef([]),
    checkedKeys: shallowRef([]),
    halfCheckedKeys: shallowRef([]),
    expandedKeysSet: computed(() => /* @__PURE__ */ new Set()),
    selectedKeysSet: computed(() => /* @__PURE__ */ new Set()),
    loadedKeysSet: computed(() => /* @__PURE__ */ new Set()),
    loadingKeysSet: computed(() => /* @__PURE__ */ new Set()),
    checkedKeysSet: computed(() => /* @__PURE__ */ new Set()),
    halfCheckedKeysSet: computed(() => /* @__PURE__ */ new Set()),
    flattenNodes: shallowRef([])
  });
}

export { TreeContext, useInjectKeysState, useInjectTreeContext, useProvideKeysState };
//# sourceMappingURL=contextTypes.mjs.map
