"use client";
import { __exports as M } from "../../../../../_virtual/isMatchWith.js";
import { __require as O } from "./isMatch.js";
import { __require as S } from "./isObject.js";
import { __require as W } from "../../predicate/isPrimitive.js";
import { __require as v } from "../util/eq.js";
var m;
function B() {
  return m ? M : (m = 1, (function(o) {
    Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
    const _ = /* @__PURE__ */ O(), b = /* @__PURE__ */ S(), I = /* @__PURE__ */ W(), y = /* @__PURE__ */ v();
    function j(n, i, t) {
      return typeof t != "function" ? _.isMatch(n, i) : q(n, i, function e(r, u, f, s, l, a) {
        const h = t(r, u, f, s, l, a);
        return h !== void 0 ? !!h : q(r, u, e, a);
      }, /* @__PURE__ */ new Map());
    }
    function q(n, i, t, e) {
      if (i === n)
        return !0;
      switch (typeof i) {
        case "object":
          return p(n, i, t, e);
        case "function":
          return Object.keys(i).length > 0 ? q(n, { ...i }, t, e) : y.eq(n, i);
        default:
          return b.isObject(n) ? typeof i == "string" ? i === "" : !0 : y.eq(n, i);
      }
    }
    function p(n, i, t, e) {
      if (i == null)
        return !0;
      if (Array.isArray(i))
        return c(n, i, t, e);
      if (i instanceof Map)
        return E(n, i, t, e);
      if (i instanceof Set)
        return d(n, i, t, e);
      const r = Object.keys(i);
      if (n == null)
        return r.length === 0;
      if (r.length === 0)
        return !0;
      if (e && e.has(i))
        return e.get(i) === n;
      e && e.set(i, n);
      try {
        for (let u = 0; u < r.length; u++) {
          const f = r[u];
          if (!I.isPrimitive(n) && !(f in n) || i[f] === void 0 && n[f] !== void 0 || i[f] === null && n[f] !== null || !t(n[f], i[f], f, n, i, e))
            return !1;
        }
        return !0;
      } finally {
        e && e.delete(i);
      }
    }
    function E(n, i, t, e) {
      if (i.size === 0)
        return !0;
      if (!(n instanceof Map))
        return !1;
      for (const [r, u] of i.entries()) {
        const f = n.get(r);
        if (t(f, u, r, n, i, e) === !1)
          return !1;
      }
      return !0;
    }
    function c(n, i, t, e) {
      if (i.length === 0)
        return !0;
      if (!Array.isArray(n))
        return !1;
      const r = /* @__PURE__ */ new Set();
      for (let u = 0; u < i.length; u++) {
        const f = i[u];
        let s = !1;
        for (let l = 0; l < n.length; l++) {
          if (r.has(l))
            continue;
          const a = n[l];
          let h = !1;
          if (t(a, f, u, n, i, e) && (h = !0), h) {
            r.add(l), s = !0;
            break;
          }
        }
        if (!s)
          return !1;
      }
      return !0;
    }
    function d(n, i, t, e) {
      return i.size === 0 ? !0 : n instanceof Set ? c([...n], [...i], t, e) : !1;
    }
    o.isMatchWith = j, o.isSetMatch = d;
  })(M), M);
}
export {
  B as __require
};
