import a from "../../../@babel/runtime/helpers/esm/toConsumableArray.mjs";
import { conductCheck as j } from "../../../rc-tree/es/utils/conductUtil.mjs";
import { toPathKey as m, toPathKeys as p } from "../utils/commonUtil.mjs";
import { formatStrategyValues as N } from "../utils/treeUtil.mjs";
function W(q, n, l, z, f, c, B, D) {
  return function(i) {
    if (!q)
      n(i);
    else {
      var r = m(i), v = p(l), F = p(z), t = v.includes(r), G = f.some(function(o) {
        return m(o) === r;
      }), S = l, b = f;
      if (G && !t)
        b = f.filter(function(o) {
          return m(o) !== r;
        });
      else {
        var A = t ? v.filter(function(o) {
          return o !== r;
        }) : [].concat(a(v), [r]), _ = c(), u;
        if (t) {
          var H = j(A, {
            checked: !1,
            halfCheckedKeys: F
          }, _);
          u = H.checkedKeys;
        } else {
          var J = j(A, !0, _);
          u = J.checkedKeys;
        }
        var L = N(u, c, D);
        S = B(L);
      }
      n([].concat(a(b), a(S)));
    }
  };
}
export {
  W as default
};
