"use client";
import { __exports as f } from "../../../../../_virtual/orderBy.js";
import { __require as d } from "../_internal/compareValues.js";
import { __require as o } from "../_internal/isKey.js";
import { __require as B } from "../util/toPath.js";
var m;
function v() {
  return m ? f : (m = 1, (function(y) {
    Object.defineProperty(y, Symbol.toStringTag, { value: "Module" });
    const g = /* @__PURE__ */ d(), A = /* @__PURE__ */ o(), h = /* @__PURE__ */ B();
    function _(l, n, a, i) {
      if (l == null)
        return [];
      a = i ? void 0 : a, Array.isArray(l) || (l = Object.values(l)), Array.isArray(n) || (n = n == null ? [null] : [n]), n.length === 0 && (n = [null]), Array.isArray(a) || (a = a == null ? [] : [a]), a = a.map((r) => String(r));
      const p = (r, e) => {
        let u = r;
        for (let t = 0; t < e.length && u != null; ++t)
          u = u[e[t]];
        return u;
      }, q = (r, e) => e == null || r == null ? e : typeof r == "object" && "key" in r ? Object.hasOwn(e, r.key) ? e[r.key] : p(e, r.path) : typeof r == "function" ? r(e) : Array.isArray(r) ? p(e, r) : typeof e == "object" ? e[r] : e, s = n.map((r) => (Array.isArray(r) && r.length === 1 && (r = r[0]), r == null || typeof r == "function" || Array.isArray(r) || A.isKey(r) ? r : { key: r, path: h.toPath(r) }));
      return l.map((r) => ({
        original: r,
        criteria: s.map((e) => q(e, r))
      })).slice().sort((r, e) => {
        for (let u = 0; u < s.length; u++) {
          const t = g.compareValues(r.criteria[u], e.criteria[u], a[u]);
          if (t !== 0)
            return t;
        }
        return 0;
      }).map((r) => r.original);
    }
    y.orderBy = _;
  })(f), f);
}
export {
  v as __require
};
