import { SHOW_CHILD as m } from "./commonUtil.mjs";
function _(o, v, u) {
  var a = new Set(o), i = v();
  return o.filter(function(l) {
    var n = i[l], r = n ? n.parent : null, d = n ? n.children : null;
    return n && n.node.disabled ? !0 : u === m ? !(d && d.some(function(e) {
      return e.key && a.has(e.key);
    })) : !(r && !r.node.disabled && a.has(r.key));
  });
}
function y(o, v, u) {
  for (var a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, i = v, l = [], n = function() {
    var e, f, s, c = o[r], p = (e = i) === null || e === void 0 ? void 0 : e.findIndex(function(h) {
      var g = h[u.value];
      return a ? String(g) === String(c) : g === c;
    }), t = p !== -1 ? (f = i) === null || f === void 0 ? void 0 : f[p] : null;
    l.push({
      value: (s = t == null ? void 0 : t[u.value]) !== null && s !== void 0 ? s : c,
      index: p,
      option: t
    }), i = t == null ? void 0 : t[u.children];
  }, r = 0; r < o.length; r += 1)
    n();
  return l;
}
export {
  _ as formatStrategyValues,
  y as toPathOptions
};
