import { c as ve, a as te } from "./_commonjsHelpers-ba3f0406-b96e6d6a.mjs";
var se = ve(function(z) {
  ((J, T) => {
    z.exports ? z.exports = T() : J.fuzzysort = T();
  })(te, (J) => {
    var T = (a, e) => {
      if (a == "farzher")
        return { target: "farzher was here (^-^*)/", score: 0, _indexes: [0] };
      if (!a || !e)
        return g;
      var n = Q(a);
      k(e) || (e = m(e));
      var i = n.bitflags;
      return (i & e._bitflags) !== i ? g : C(n, e);
    }, Z = (a, e, n) => {
      if (a == "farzher")
        return [{ target: "farzher was here (^-^*)/", score: 0, _indexes: [0], obj: e ? e[0] : g }];
      if (!a)
        return n && n.all ? j(a, e, n) : E;
      var i = Q(a), f = i.bitflags, v = n && n.threshold || y, t = n && n.limit || D, r = 0, s = 0, l = e.length;
      if (n && n.key)
        for (var o = n.key, u = 0; u < l; ++u) {
          var _ = e[u], c = M(_, o);
          if (c && (k(c) || (c = m(c)), (f & c._bitflags) === f)) {
            var x = C(i, c);
            x !== g && (x.score < v || (x = { target: x.target, _targetLower: "", _targetLowerCodes: g, _nextBeginningIndexes: g, _bitflags: 0, score: x.score, _indexes: x._indexes, obj: _ }, r < t ? (w.add(x), ++r) : (++s, x.score > w.peek().score && w.replaceTop(x))));
          }
        }
      else if (n && n.keys)
        for (var S = n.scoreFn || ne, B = n.keys, P = B.length, u = 0; u < l; ++u) {
          for (var _ = e[u], h = new Array(P), L = 0; L < P; ++L) {
            var o = B[L], c = M(_, o);
            if (!c) {
              h[L] = g;
              continue;
            }
            k(c) || (c = m(c)), (f & c._bitflags) !== f ? h[L] = g : h[L] = C(i, c);
          }
          h.obj = _;
          var d = S(h);
          d !== g && (d < v || (h.score = d, r < t ? (w.add(h), ++r) : (++s, d > w.peek().score && w.replaceTop(h))));
        }
      else
        for (var u = 0; u < l; ++u) {
          var c = e[u];
          if (c && (k(c) || (c = m(c)), (f & c._bitflags) === f)) {
            var x = C(i, c);
            x !== g && (x.score < v || (r < t ? (w.add(x), ++r) : (++s, x.score > w.peek().score && w.replaceTop(x))));
          }
        }
      if (r === 0)
        return E;
      for (var A = new Array(r), u = r - 1; u >= 0; --u)
        A[u] = w.poll();
      return A.total = r + s, A;
    }, $ = (a, e, n) => {
      if (typeof e == "function")
        return U(a, e);
      if (a === g)
        return g;
      e === void 0 && (e = "<b>"), n === void 0 && (n = "</b>");
      var i = "", f = 0, v = !1, t = a.target, r = t.length, s = a._indexes;
      s = s.slice(0, s.len).sort((u, _) => u - _);
      for (var l = 0; l < r; ++l) {
        var o = t[l];
        if (s[f] === l) {
          if (++f, v || (v = !0, i += e), f === s.length) {
            i += o + n + t.substr(l + 1);
            break;
          }
        } else
          v && (v = !1, i += n);
        i += o;
      }
      return i;
    }, U = (l, e) => {
      if (l === g)
        return g;
      var n = l.target, i = n.length, f = l._indexes;
      f = f.slice(0, f.len).sort((_, c) => _ - c);
      for (var v = "", t = 0, r = 0, s = !1, l = [], o = 0; o < i; ++o) {
        var u = n[o];
        if (f[r] === o) {
          if (++r, s || (s = !0, l.push(v), v = ""), r === f.length) {
            v += u, l.push(e(v, t++)), v = "", l.push(n.substr(o + 1));
            break;
          }
        } else
          s && (s = !1, l.push(e(v, t++)), v = "");
        v += u;
      }
      return l;
    }, O = (a) => a._indexes.slice(0, a._indexes.len).sort((e, n) => e - n), F = (a) => {
      typeof a != "string" && (a = "");
      var e = V(a);
      return { target: a, _targetLower: e._lower, _targetLowerCodes: e.lowerCodes, _nextBeginningIndexes: g, _bitflags: e.bitflags, score: g, _indexes: [0], obj: g };
    }, K = (a) => {
      typeof a != "string" && (a = ""), a = a.trim();
      var e = V(a), n = [];
      if (e.containsSpace) {
        var i = a.split(/\s+/);
        i = [...new Set(i)];
        for (var f = 0; f < i.length; f++)
          if (i[f] !== "") {
            var v = V(i[f]);
            n.push({ lowerCodes: v.lowerCodes, _lower: i[f].toLowerCase(), containsSpace: !1 });
          }
      }
      return { lowerCodes: e.lowerCodes, bitflags: e.bitflags, containsSpace: e.containsSpace, _lower: e._lower, spaceSearches: n };
    }, m = (a) => {
      if (a.length > 999)
        return F(a);
      var e = X.get(a);
      return e !== void 0 || (e = F(a), X.set(a, e)), e;
    }, Q = (a) => {
      if (a.length > 999)
        return K(a);
      var e = q.get(a);
      return e !== void 0 || (e = K(a), q.set(a, e)), e;
    }, j = (a, e, n) => {
      var i = [];
      i.total = e.length;
      var f = n && n.limit || D;
      if (n && n.key)
        for (var v = 0; v < e.length; v++) {
          var t = e[v], r = M(t, n.key);
          if (r) {
            k(r) || (r = m(r)), r.score = y, r._indexes.len = 0;
            var s = r;
            if (s = { target: s.target, _targetLower: "", _targetLowerCodes: g, _nextBeginningIndexes: g, _bitflags: 0, score: r.score, _indexes: g, obj: t }, i.push(s), i.length >= f)
              return i;
          }
        }
      else if (n && n.keys)
        for (var v = 0; v < e.length; v++) {
          for (var t = e[v], l = new Array(n.keys.length), o = n.keys.length - 1; o >= 0; --o) {
            var r = M(t, n.keys[o]);
            if (!r) {
              l[o] = g;
              continue;
            }
            k(r) || (r = m(r)), r.score = y, r._indexes.len = 0, l[o] = r;
          }
          if (l.obj = t, l.score = y, i.push(l), i.length >= f)
            return i;
        }
      else
        for (var v = 0; v < e.length; v++) {
          var r = e[v];
          if (r && (k(r) || (r = m(r)), r.score = y, r._indexes.len = 0, i.push(r), i.length >= f))
            return i;
        }
      return i;
    }, C = (a, e, n = !1) => {
      if (n === !1 && a.containsSpace)
        return R(a, e);
      for (var i = a._lower, f = a.lowerCodes, v = f[0], t = e._targetLowerCodes, r = f.length, s = t.length, _ = 0, l = 0, o = 0; ; ) {
        var u = v === t[l];
        if (u) {
          if (p[o++] = l, ++_, _ === r)
            break;
          v = f[_];
        }
        if (++l, l >= s)
          return g;
      }
      var _ = 0, c = !1, x = 0, S = e._nextBeginningIndexes;
      S === g && (S = e._nextBeginningIndexes = re(e.target)), l = p[0] === 0 ? 0 : S[p[0] - 1];
      var B = 0;
      if (l !== s)
        for (; ; )
          if (l >= s) {
            if (_ <= 0 || (++B, B > 200))
              break;
            --_;
            var P = N[--x];
            l = S[P];
          } else {
            var u = f[_] === t[l];
            if (u) {
              if (N[x++] = l, ++_, _ === r) {
                c = !0;
                break;
              }
              ++l;
            } else
              l = S[l];
          }
      var h = e._targetLower.indexOf(i, p[0]), L = ~h;
      if (L && !c)
        for (var d = 0; d < o; ++d)
          p[d] = h + d;
      var A = !1;
      L && (A = e._nextBeginningIndexes[h - 1] === h);
      {
        if (c)
          var b = N, G = x;
        else
          var b = p, G = o;
        for (var I = 0, W = 0, d = 1; d < r; ++d)
          b[d] - b[d - 1] !== 1 && (I -= b[d], ++W);
        var fe = b[r - 1] - b[0] - (r - 1);
        if (I -= (12 + fe) * W, b[0] !== 0 && (I -= b[0] * b[0] * 0.2), !c)
          I *= 1e3;
        else {
          for (var H = 1, d = S[0]; d < s; d = S[d])
            ++H;
          H > 24 && (I *= (H - 24) * 10);
        }
        L && (I /= 1 + r * r * 1), A && (I /= 1 + r * r * 1), I -= s - r, e.score = I;
        for (var d = 0; d < G; ++d)
          e._indexes[d] = b[d];
        return e._indexes.len = G, e;
      }
    }, R = (a, e) => {
      for (var n = /* @__PURE__ */ new Set(), i = 0, f = g, v = 0, t = a.spaceSearches, o = 0; o < t.length; ++o) {
        var r = t[o];
        if (f = C(r, e), f === g)
          return g;
        i += f.score, f._indexes[0] < v && (i -= v - f._indexes[0]), v = f._indexes[0];
        for (var s = 0; s < f._indexes.len; ++s)
          n.add(f._indexes[s]);
      }
      var l = C(
        a,
        e,
        /*allowSpaces=*/
        !0
      );
      if (l !== g && l.score > i)
        return l;
      f.score = i;
      var o = 0;
      for (let u of n)
        f._indexes[o++] = u;
      return f._indexes.len = o, f;
    }, V = (a) => {
      for (var e = a.length, n = a.toLowerCase(), i = [], f = 0, v = !1, t = 0; t < e; ++t) {
        var r = i[t] = n.charCodeAt(t);
        if (r === 32) {
          v = !0;
          continue;
        }
        var s = r >= 97 && r <= 122 ? r - 97 : r >= 48 && r <= 57 ? 26 : r <= 127 ? 30 : 31;
        f |= 1 << s;
      }
      return { lowerCodes: i, bitflags: f, containsSpace: v, _lower: n };
    }, ee = (a) => {
      for (var e = a.length, n = [], i = 0, f = !1, v = !1, t = 0; t < e; ++t) {
        var r = a.charCodeAt(t), s = r >= 65 && r <= 90, l = s || r >= 97 && r <= 122 || r >= 48 && r <= 57, o = s && !f || !v || !l;
        f = s, v = l, o && (n[i++] = t);
      }
      return n;
    }, re = (a) => {
      for (var e = a.length, n = ee(a), i = [], f = n[0], v = 0, t = 0; t < e; ++t)
        f > t ? i[t] = f : (f = n[++v], i[t] = f === void 0 ? e : f);
      return i;
    }, ae = () => {
      X.clear(), q.clear(), p = [], N = [];
    }, X = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), p = [], N = [], ne = (a) => {
      for (var e = y, n = a.length, i = 0; i < n; ++i) {
        var f = a[i];
        if (f !== g) {
          var v = f.score;
          v > e && (e = v);
        }
      }
      return e === y ? g : e;
    }, M = (a, e) => {
      var n = a[e];
      if (n !== void 0)
        return n;
      var i = e;
      Array.isArray(e) || (i = e.split("."));
      for (var f = i.length, v = -1; a && ++v < f; )
        a = a[i[v]];
      return a;
    }, k = (a) => typeof a == "object", D = 1 / 0, y = -D, E = [];
    E.total = 0;
    var g = null, ie = (a) => {
      var e = [], n = 0, i = {}, f = (v) => {
        for (var t = 0, r = e[t], s = 1; s < n; ) {
          var l = s + 1;
          t = s, l < n && e[l].score < e[s].score && (t = l), e[t - 1 >> 1] = e[t], s = 1 + (t << 1);
        }
        for (var o = t - 1 >> 1; t > 0 && r.score < e[o].score; o = (t = o) - 1 >> 1)
          e[t] = e[o];
        e[t] = r;
      };
      return i.add = (v) => {
        var t = n;
        e[n++] = v;
        for (var r = t - 1 >> 1; t > 0 && v.score < e[r].score; r = (t = r) - 1 >> 1)
          e[t] = e[r];
        e[t] = v;
      }, i.poll = (v) => {
        if (n !== 0) {
          var t = e[0];
          return e[0] = e[--n], f(), t;
        }
      }, i.peek = (v) => {
        if (n !== 0)
          return e[0];
      }, i.replaceTop = (v) => {
        e[0] = v, f();
      }, i;
    }, w = ie();
    return { single: T, go: Z, highlight: $, prepare: F, indexes: O, cleanup: ae };
  });
}), Y;
(function(z) {
  z.Asc = "asc", z.Desc = "desc";
})(Y || (Y = {}));
export {
  Y as S,
  se as f
};
//# sourceMappingURL=sort-order.enum-64ce8998-b75ac596.mjs.map
