import { b as m, a as b, c as l, d, i as h } from "./_baseUniq-_8gvFwlz.js";
import { al as g, am as o, an as p } from "./mermaid.core-BOWAkRH_.js";
function M(a) {
  var n = a == null ? 0 : a.length;
  return n ? m(a) : [];
}
function v(a, n) {
  var s = -1, t = g(a) ? Array(a.length) : [];
  return b(a, function(f, i, e) {
    t[++s] = n(f, i, e);
  }), t;
}
function k(a, n) {
  var s = o(a) ? d : v;
  return s(a, l(n));
}
function x(a, n) {
  return a < n;
}
function A(a, n, s) {
  for (var t = -1, f = a.length; ++t < f; ) {
    var i = a[t], e = n(i);
    if (e != null && (r === void 0 ? e === e && !h(e) : s(e, r)))
      var r = e, u = i;
  }
  return u;
}
function w(a) {
  return a && a.length ? A(a, p, x) : void 0;
}
export {
  x as a,
  A as b,
  v as c,
  w as d,
  M as f,
  k as m
};
