import { shallowRef, watchEffect } from 'vue';
import { conductCheck } from '../../../vc-tree/src/utils/conductUtil.mjs';

var useCheckedKeys = (rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities, maxLevel, levelEntities) => {
  const newRawCheckedValues = shallowRef([]);
  const newRawHalfCheckedValues = shallowRef([]);
  watchEffect(() => {
    let checkedKeys = rawLabeledValues.value.map(({ value }) => value);
    let halfCheckedKeys = rawHalfCheckedValues.value.map(({ value }) => value);
    const missingValues = checkedKeys.filter((key) => !keyEntities.value[key]);
    if (treeConduction.value) {
      ({ checkedKeys, halfCheckedKeys } = conductCheck(
        checkedKeys,
        true,
        keyEntities.value,
        maxLevel.value,
        levelEntities.value
      ));
    }
    newRawCheckedValues.value = Array.from(/* @__PURE__ */ new Set([...missingValues, ...checkedKeys]));
    newRawHalfCheckedValues.value = halfCheckedKeys;
  });
  return [newRawCheckedValues, newRawHalfCheckedValues];
};

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