import { j as h } from "./jsx-runtime-BbD0H88J.js";
import { useMemo as T, useCallback as y, useState as D, useEffect as N, useRef as L, useSyncExternalStore as oe, memo as _e } from "react";
import { g as U, O as Be, e as K, p as He, C as w, d as F, b as Me } from "./css-BkBrZtKZ.js";
import { D as Ge } from "./Dialog-BspO7uo8.js";
import { u as ae } from "./Animated-C4xrEVd-.js";
import { B as Oe } from "./Button-DLtxKGH5.js";
import { c as Z, G as Ke, z as We, S as Ze, L as Xe, E as Ye, q as G } from "./Text-XeD58Fq8.js";
import { d as Je, u as ie, F as Qe, a as et, I as tt } from "./Items-CX11yLMf.js";
import { c as A, T as C, f as st, d as rt, b as nt } from "./Editable-DjQORuR1.js";
import { C as O, c as ot } from "./types-B5-Tni3G.js";
import { c as at, C as it } from "./Provider-BkxUzTWS.js";
import { a as X, E as lt } from "./Box-DLO7l9hM.js";
import { m as ct, n as ut, A as dt, o as ft } from "./provider-D0K9E52u.js";
import "react-dom";
import { u as mt, b as re } from "./hooks-BeSuo_di.js";
const [ht, pt] = Z({
  defaultValue: [],
  displayName: "Status.Context"
}), [gt, le] = Z({
  defaultValue: () => {
  },
  displayName: "Status.AdderContext"
}), $t = 0.9, ts = ({ children: e, maxHistory: n = 500 }) => {
  const [{ path: s }, { statuses: r }, u] = at({
    type: dt.TYPE,
    schema: ut,
    initialState: { statuses: [] }
  });
  if (r.length > n) {
    const l = Math.floor(n * $t);
    u((i) => ({ ...i, statuses: r.slice(0, l) }));
  }
  const c = y(
    (l) => {
      const i = { time: K.now(), key: Be.create(), ...l };
      u((m) => ({
        ...m,
        statuses: [i, ...m.statuses.filter((p) => p.key != i.key)]
      }));
    },
    [u]
  );
  return /* @__PURE__ */ h.jsx(ht, { value: r, children: /* @__PURE__ */ h.jsx(gt, { value: c, children: /* @__PURE__ */ h.jsx(it, { path: s, children: e }) }) });
}, ss = () => {
  const e = le();
  return T(() => ct(e), [e]);
}, rs = () => {
  const e = le();
  return T(() => ft(e), [e]);
}, xt = U.seconds(7), vt = U.seconds(1), ns = ({
  expiration: e = xt,
  poll: n = vt
} = {}) => {
  const s = pt(), [r, u] = D(/* @__PURE__ */ new Set()), [c, l] = D(() => K.now());
  N(() => {
    const $ = setInterval(() => l(K.now()), n.milliseconds);
    return () => clearInterval($);
  }, [n.milliseconds]);
  const i = T(() => {
    const $ = c.sub(e), v = s.filter(
      ({ key: d, time: o }) => o.afterEq($) && !r.has(d)
    ).reduce((d, o) => {
      const t = `${o.variant}:${o.message}`;
      if (!d.has(t))
        return d.set(t, { ...o, count: 1 }), d;
      const a = d.get(t);
      return d.set(t, {
        ...a,
        count: a.count + 1,
        time: o.time.after(a.time) ? o.time : a.time
      }), d;
    }, /* @__PURE__ */ new Map());
    return Array.from(v.values());
  }, [s, e, r, c]), m = A(s), p = y(($) => {
    u((g) => {
      const v = /* @__PURE__ */ new Set(), d = m.current.find(({ key: o }) => o === $);
      return g.has($) || v.add($), d != null && m.current.filter(
        ({ message: t, variant: a }) => t === d.message && a === d.variant
      ).forEach((t) => v.add(t.key)), v.size == 0 ? g : /* @__PURE__ */ new Set([...v, ...g]);
    });
  }, []);
  return { statuses: i, silence: p };
}, os = Ke(Ze, { topRight: We }), W = ({
  level: e = "p",
  variant: n,
  description: s,
  hideIcon: r = !1,
  status: u,
  className: c,
  children: l,
  message: i,
  color: m,
  ...p
}) => {
  let $;
  if (u != null) {
    const { key: o, ...t } = u;
    return /* @__PURE__ */ h.jsx(W, { ...p, ...t });
  }
  r || ($ = n === "loading" ? /* @__PURE__ */ h.jsx(Xe, {}) : /* @__PURE__ */ h.jsx(Ye, {}));
  const g = He.isNonZero(s);
  l ??= i;
  const v = /* @__PURE__ */ h.jsxs(
    C,
    {
      className: w(c, !g && w.BE("status", "text")),
      level: e,
      status: n,
      ...s == null ? p : {},
      children: [
        $,
        l
      ]
    }
  );
  if (!g) return v;
  const d = /* @__PURE__ */ h.jsx(C, { level: "small", color: 8, children: s });
  return /* @__PURE__ */ h.jsxs(X, { y: !0, align: "start", gap: "small", center: !0, ...p, children: [
    v,
    d
  ] });
}, bt = ({
  size: e = "medium",
  ref: n,
  value: s,
  onChange: r,
  className: u,
  onFocus: c,
  onKeyDown: l,
  selectOnFocus: i = !1,
  centerPlaceholder: m = !1,
  placeholder: p,
  variant: $ = "outlined",
  level: g,
  onBlur: v,
  disabled: d,
  resetOnBlurIfEmpty: o = !1,
  status: t,
  weight: a,
  style: f,
  contrast: x,
  color: b,
  sharp: S,
  onlyChangeOnBlur: R = !1,
  endContent: k,
  full: I,
  children: z,
  grow: P,
  shrink: j,
  borderColor: _,
  borderWidth: ge,
  bordered: $e,
  rounded: xe,
  tabIndex: B,
  trigger: ve,
  triggerIndicator: be,
  textColor: Re,
  textVariant: ye,
  preventClick: Se,
  onClickDelay: Ee,
  startContent: J,
  tooltip: we,
  tooltipDelay: je,
  tooltipLocation: Ie,
  hideTooltip: Ae,
  ghost: Te,
  area: Pe,
  propagateClick: Le,
  ...Ce
}) => {
  const Q = L(s), [q, H] = D(null), ee = L(null), M = L(!1), ke = (E) => {
    M.current = !1, o && E.target.value === "" ? r?.(Q.current) : R && q != null && r?.(q), H(null), v?.(E);
  }, ze = (E) => {
    d || (R ? H(E.target.value) : r?.(E.target.value));
  }, Ne = (E) => {
    R && H(s), c?.(E), Q.current = E.target.value;
  }, qe = () => {
    !i || M.current || (M.current = !0, ee.current?.select());
  }, Ve = (E) => {
    R && E.key === "Enter" ? E.currentTarget.blur() : E.key === "Escape" && (E.currentTarget.blur(), E.stopPropagation()), l?.(E);
  }, De = st(n, ee), Fe = (s == null || s.length === 0) && q == null && p != null && typeof p != "string";
  B ??= $ === "preview" ? -1 : void 0;
  const te = {
    style: f,
    full: I,
    grow: P,
    shrink: j
  }, Ue = z != null ? {} : te, se = /* @__PURE__ */ h.jsxs(
    Oe,
    {
      el: "div",
      x: !0,
      empty: !0,
      align: "center",
      className: w(
        w.B("input"),
        w.disabled(d),
        t != null && w.M(t),
        u
      ),
      size: e,
      level: g,
      color: b,
      contrast: x,
      sharp: S,
      status: t,
      bordered: $e,
      borderColor: _,
      borderWidth: ge,
      pack: !0,
      variant: $,
      rounded: xe,
      tabIndex: B,
      trigger: ve,
      triggerIndicator: be,
      textColor: Re,
      textVariant: ye,
      preventClick: Se,
      onClickDelay: Ee,
      tooltip: we,
      tooltipDelay: je,
      tooltipLocation: Ie,
      hideTooltip: Ae,
      ghost: Te,
      propagateClick: Le,
      ...Ue,
      children: [
        Fe && /* @__PURE__ */ h.jsx(
          C,
          {
            className: w(
              w.visible(!1),
              w.BE("input", "placeholder"),
              m && w.M("centered")
            ),
            level: g ?? O[e],
            children: p
          }
        ),
        J != null && /* @__PURE__ */ h.jsx(
          C,
          {
            className: w.BE("input", "start-content"),
            level: g ?? O[e],
            children: J
          }
        ),
        /* @__PURE__ */ h.jsx(
          lt,
          {
            el: Pe ? "textarea" : "input",
            ref: De,
            value: q ?? s,
            role: "textbox",
            onChange: ze,
            autoCapitalize: "off",
            autoComplete: "off",
            autoCorrect: "off",
            onFocus: Ne,
            onKeyDown: Ve,
            tabIndex: B,
            onMouseUp: qe,
            onBlur: ke,
            disabled: d,
            placeholder: typeof p == "string" ? p : void 0,
            style: { fontWeight: a },
            ...Ce
          }
        ),
        k != null && /* @__PURE__ */ h.jsx(
          C,
          {
            className: w.BE("input", "end-content"),
            level: g ?? O[e],
            children: k
          }
        )
      ]
    }
  );
  return z == null ? se : /* @__PURE__ */ h.jsxs(X, { x: !0, pack: !0, className: w.BE("input", "container"), ...te, children: [
    se,
    z
  ] });
}, ce = ["ArrowUp"], ue = ["ArrowDown"], de = ["Enter"], Rt = [ce, ue, de], yt = U.milliseconds(200).milliseconds, St = U.milliseconds(100).milliseconds, fe = ({
  data: e,
  initialHover: n = -1,
  onSelect: s
}) => {
  const r = A(e), [u, c, l] = rt(n), { visible: i } = ae(), m = A(i), { scrollToIndex: p } = Je(), $ = y(
    (d) => {
      const o = l.current, t = ot(d, o);
      c(t), p(t, o > t ? "bottom" : "top");
    },
    [p]
  );
  N(() => {
    l.current >= e.length && $(0);
  }, [e.length]);
  const g = L(null), v = y(
    ({ triggers: d, stage: o }) => {
      if (!m.current || (g.current != null && (clearInterval(g.current), g.current = null), o !== "start")) return;
      const t = r.current;
      if (G(d, [de])) {
        if (l.current === -1) return;
        s?.(t[l.current]);
        return;
      }
      const a = () => {
        const f = r.current;
        G(d, [ce], { loose: !0 }) ? $((x) => x <= 0 ? f.length - 1 : x - 1) : G(d, [ue], { loose: !0 }) && $((x) => x >= f.length - 1 ? 0 : x + 1);
      };
      a(), g.current = setTimeout(() => {
        g.current = setInterval(a, St);
      }, yt);
    },
    [s]
  );
  return mt({
    triggers: Rt,
    callback: v,
    loose: !0
  }), { hover: e[u] };
}, Et = ({
  allowNone: e = !1,
  onChange: n,
  value: s,
  closeDialogOnSelect: r = !1,
  initialHover: u,
  autoSelectOnNone: c = !1
}) => {
  const l = A(s), { data: i } = ie(), { close: m } = ae(), p = A(i);
  N(() => {
    const o = s != null && i.includes(s);
    c && i.length > 0 && !o && n(i[0], { clicked: i[0], clickedIndex: 0 });
  }, [c, n, s, i.length, i]);
  const $ = y(
    (o) => {
      if (l.current === o) {
        e && n(null, { clicked: null, clickedIndex: null }), r && m();
        return;
      }
      const t = p.current.findIndex((a) => a === o);
      n(o, { clicked: o, clickedIndex: t }), r && m();
    },
    [p, n, m]
  ), g = y(() => {
    e && n(null, { clicked: null, clickedIndex: null });
  }, [n, e]), v = y(
    (o) => n(o[0], { clicked: null, clickedIndex: null }),
    [n]
  ), d = fe({ data: i, onSelect: $, initialHover: u });
  return { onSelect: $, setSelected: v, clear: g, ...d };
}, wt = ({
  value: e = [],
  replaceOnSingle: n = !1,
  onChange: s,
  initialHover: r,
  allowNone: u = !0,
  closeDialogOnSelect: c = !1,
  autoSelectOnNone: l = !1
}) => {
  const { data: i } = ie(), m = L(null), p = re({ triggers: [["Shift"]], loose: !0 }), $ = re({ triggers: [["Control"]], loose: !0 }), g = A(e), v = A(i);
  N(() => {
    const f = i.some((x) => e.includes(x));
    l && i.length > 0 && !f && s([i[0]], { clicked: i[0], clickedIndex: 0 });
  }, [l, s, e, i.length, i]);
  const d = y(
    (f) => {
      const x = m.current, b = v.current;
      let S = [];
      const R = F.toArray(g.current).filter((I) => I != null);
      if ($.current.held && n)
        R.includes(f) ? S = R.filter((I) => I !== f) : S = [...R, f];
      else if (p.current.held && x !== null) {
        const [I, z] = [
          b.findIndex((j) => j === f),
          b.findIndex((j) => j === x)
        ].sort((j, _) => j - _), P = b.slice(I, z + 1).map((j) => j);
        P.slice(1, P.length - 1).every((j) => R.includes(j)) && R.includes(f) ? S = R.filter((j) => !P.includes(j)) : S = [...R, ...P], m.current = null;
      } else
        m.current = f, n ? S = R.includes(f) && R.length === 1 ? [] : [f] : R.includes(f) ? S = R.filter((I) => I !== f) : S = [...R, f];
      const k = Me.unique(S);
      if (k.length === 0) {
        if (!u) return;
        m.current = null;
      }
      s(k, {
        clicked: f,
        clickedIndex: b.findIndex((I) => I === f)
      }), c && close();
    },
    [g, v, s]
  ), o = y(
    () => s([], { clicked: null, clickedIndex: 0 }),
    [s]
  ), t = y(
    (f) => s(f, { clicked: null, clickedIndex: 0 }),
    [s]
  ), a = fe({ data: i, onSelect: d, initialHover: r });
  return { onSelect: d, setSelected: t, clear: o, ...a };
}, jt = () => {
  const e = nt(() => /* @__PURE__ */ new Map()), n = y((r) => {
    e.current.forEach((u, c) => {
      (u == null || r.includes(u)) && c();
    });
  }, []), s = y((r, u) => {
    if (e.current.has(r)) {
      const c = e.current.get(r);
      console.warn(
        `[store] attempted to subscribe listener with key ${c} to key ${u} without being unsubscribed first`
      );
    }
    return e.current.set(r, u), () => e.current.delete(r);
  }, []);
  return { notifyListeners: n, subscribe: s };
}, [It, At] = Z({
  defaultValue: {
    clear: () => {
    },
    getState: () => ({ value: void 0, hover: void 0 }),
    onSelect: () => {
    },
    setSelected: () => {
    },
    subscribe: () => () => {
    }
  },
  displayName: "Select.Context"
}), Tt = (e, n) => e == null ? !1 : Array.isArray(e) ? e.includes(n) : e === n, Pt = ({
  children: e,
  ...n
}) => {
  const { value: s } = n, r = wt(n);
  return /* @__PURE__ */ h.jsx(me, { value: s, ...r, children: e });
}, Lt = ({
  children: e,
  ...n
}) => {
  const { value: s } = n, r = Et(n);
  return /* @__PURE__ */ h.jsx(me, { value: s, ...r, children: e });
}, me = ({
  value: e,
  onSelect: n,
  clear: s,
  setSelected: r,
  children: u,
  hover: c
}) => {
  const l = L(F.toArray(e)), i = A(c), { notifyListeners: m, subscribe: p } = jt(), $ = y(
    () => ({ value: l.current, hover: i.current }),
    []
  ), g = T(
    () => ({
      onSelect: n,
      setSelected: r,
      clear: s,
      hover: c,
      subscribe: p,
      getState: $
    }),
    [$, n, r, s, c, p]
  );
  return N(() => {
    const v = l.current, d = F.toArray(e), o = [...v, ...d];
    l.current = d, m(o);
  }, [e, m]), /* @__PURE__ */ h.jsx(It, { value: g, children: u });
}, Y = () => At(), Ct = (e) => {
  const { getState: n, onSelect: s, subscribe: r } = Y(), u = y(() => s(e), [e, s]), c = oe(
    y((l) => r(l, e), [e, r]),
    y(() => {
      const l = n(), i = Tt(l.value, e), m = l.hover === e;
      return i && m ? "selected-hovered" : i ? "selected" : m ? "hovered" : "none";
    }, [e, n]),
    y(() => "none", [])
  );
  return T(
    () => ({
      selected: c === "selected" || c === "selected-hovered",
      hovered: c === "hovered" || c === "selected-hovered",
      onSelect: u
    }),
    [c, u]
  );
}, as = () => {
  const { getState: e, subscribe: n } = Y(), s = oe(
    n,
    () => e().value,
    () => null
  );
  return T(() => s == null ? [] : F.toArray(s), [s]);
}, is = () => Y().clear, kt = ({
  data: e,
  getItem: n,
  subscribe: s,
  itemHeight: r,
  multiple: u,
  onFetchMore: c,
  virtual: l = !1,
  value: i,
  onChange: m,
  ...p
}) => /* @__PURE__ */ h.jsx(
  Qe,
  {
    data: e,
    getItem: n,
    subscribe: s,
    onFetchMore: c,
    itemHeight: r,
    virtual: l,
    children: u ? /* @__PURE__ */ h.jsx(Pt, { value: i, onChange: m, ...p }) : /* @__PURE__ */ h.jsx(Lt, { value: i, onChange: m, ...p })
  }
);
kt.displayName = "Select.Frame";
function zt(e) {
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var V = { exports: {} }, Nt = V.exports, ne;
function qt() {
  return ne || (ne = 1, (function(e, n) {
    (function(s, r) {
      typeof zt == "function" ? e.exports = r() : s.pluralize = r();
    })(Nt, function() {
      var s = [], r = [], u = {}, c = {}, l = {};
      function i(t) {
        return typeof t == "string" ? new RegExp("^" + t + "$", "i") : t;
      }
      function m(t, a) {
        return t === a ? a : t === t.toLowerCase() ? a.toLowerCase() : t === t.toUpperCase() ? a.toUpperCase() : t[0] === t[0].toUpperCase() ? a.charAt(0).toUpperCase() + a.substr(1).toLowerCase() : a.toLowerCase();
      }
      function p(t, a) {
        return t.replace(/\$(\d{1,2})/g, function(f, x) {
          return a[x] || "";
        });
      }
      function $(t, a) {
        return t.replace(a[0], function(f, x) {
          var b = p(a[1], arguments);
          return m(f === "" ? t[x - 1] : f, b);
        });
      }
      function g(t, a, f) {
        if (!t.length || u.hasOwnProperty(t))
          return a;
        for (var x = f.length; x--; ) {
          var b = f[x];
          if (b[0].test(a)) return $(a, b);
        }
        return a;
      }
      function v(t, a, f) {
        return function(x) {
          var b = x.toLowerCase();
          return a.hasOwnProperty(b) ? m(x, b) : t.hasOwnProperty(b) ? m(x, t[b]) : g(b, x, f);
        };
      }
      function d(t, a, f, x) {
        return function(b) {
          var S = b.toLowerCase();
          return a.hasOwnProperty(S) ? !0 : t.hasOwnProperty(S) ? !1 : g(S, S, f) === S;
        };
      }
      function o(t, a, f) {
        var x = a === 1 ? o.singular(t) : o.plural(t);
        return (f ? a + " " : "") + x;
      }
      return o.plural = v(
        l,
        c,
        s
      ), o.isPlural = d(
        l,
        c,
        s
      ), o.singular = v(
        c,
        l,
        r
      ), o.isSingular = d(
        c,
        l,
        r
      ), o.addPluralRule = function(t, a) {
        s.push([i(t), a]);
      }, o.addSingularRule = function(t, a) {
        r.push([i(t), a]);
      }, o.addUncountableRule = function(t) {
        if (typeof t == "string") {
          u[t.toLowerCase()] = !0;
          return;
        }
        o.addPluralRule(t, "$0"), o.addSingularRule(t, "$0");
      }, o.addIrregularRule = function(t, a) {
        a = a.toLowerCase(), t = t.toLowerCase(), l[t] = a, c[a] = t;
      }, [
        // Pronouns.
        ["I", "we"],
        ["me", "us"],
        ["he", "they"],
        ["she", "they"],
        ["them", "them"],
        ["myself", "ourselves"],
        ["yourself", "yourselves"],
        ["itself", "themselves"],
        ["herself", "themselves"],
        ["himself", "themselves"],
        ["themself", "themselves"],
        ["is", "are"],
        ["was", "were"],
        ["has", "have"],
        ["this", "these"],
        ["that", "those"],
        // Words ending in with a consonant and `o`.
        ["echo", "echoes"],
        ["dingo", "dingoes"],
        ["volcano", "volcanoes"],
        ["tornado", "tornadoes"],
        ["torpedo", "torpedoes"],
        // Ends with `us`.
        ["genus", "genera"],
        ["viscus", "viscera"],
        // Ends with `ma`.
        ["stigma", "stigmata"],
        ["stoma", "stomata"],
        ["dogma", "dogmata"],
        ["lemma", "lemmata"],
        ["schema", "schemata"],
        ["anathema", "anathemata"],
        // Other irregular rules.
        ["ox", "oxen"],
        ["axe", "axes"],
        ["die", "dice"],
        ["yes", "yeses"],
        ["foot", "feet"],
        ["eave", "eaves"],
        ["goose", "geese"],
        ["tooth", "teeth"],
        ["quiz", "quizzes"],
        ["human", "humans"],
        ["proof", "proofs"],
        ["carve", "carves"],
        ["valve", "valves"],
        ["looey", "looies"],
        ["thief", "thieves"],
        ["groove", "grooves"],
        ["pickaxe", "pickaxes"],
        ["passerby", "passersby"]
      ].forEach(function(t) {
        return o.addIrregularRule(t[0], t[1]);
      }), [
        [/s?$/i, "s"],
        [/[^\u0000-\u007F]$/i, "$0"],
        [/([^aeiou]ese)$/i, "$1"],
        [/(ax|test)is$/i, "$1es"],
        [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
        [/(e[mn]u)s?$/i, "$1s"],
        [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
        [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
        [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
        [/(seraph|cherub)(?:im)?$/i, "$1im"],
        [/(her|at|gr)o$/i, "$1oes"],
        [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
        [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
        [/sis$/i, "ses"],
        [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
        [/([^aeiouy]|qu)y$/i, "$1ies"],
        [/([^ch][ieo][ln])ey$/i, "$1ies"],
        [/(x|ch|ss|sh|zz)$/i, "$1es"],
        [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
        [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
        [/(pe)(?:rson|ople)$/i, "$1ople"],
        [/(child)(?:ren)?$/i, "$1ren"],
        [/eaux$/i, "$0"],
        [/m[ae]n$/i, "men"],
        ["thou", "you"]
      ].forEach(function(t) {
        return o.addPluralRule(t[0], t[1]);
      }), [
        [/s$/i, ""],
        [/(ss)$/i, "$1"],
        [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
        [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
        [/ies$/i, "y"],
        [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
        [/\b(mon|smil)ies$/i, "$1ey"],
        [/\b((?:tit)?m|l)ice$/i, "$1ouse"],
        [/(seraph|cherub)im$/i, "$1"],
        [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
        [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
        [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
        [/(test)(?:is|es)$/i, "$1is"],
        [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
        [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
        [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
        [/(alumn|alg|vertebr)ae$/i, "$1a"],
        [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
        [/(matr|append)ices$/i, "$1ix"],
        [/(pe)(rson|ople)$/i, "$1rson"],
        [/(child)ren$/i, "$1"],
        [/(eau)x?$/i, "$1"],
        [/men$/i, "man"]
      ].forEach(function(t) {
        return o.addSingularRule(t[0], t[1]);
      }), [
        // Singular words with no plurals.
        "adulthood",
        "advice",
        "agenda",
        "aid",
        "aircraft",
        "alcohol",
        "ammo",
        "analytics",
        "anime",
        "athletics",
        "audio",
        "bison",
        "blood",
        "bream",
        "buffalo",
        "butter",
        "carp",
        "cash",
        "chassis",
        "chess",
        "clothing",
        "cod",
        "commerce",
        "cooperation",
        "corps",
        "debris",
        "diabetes",
        "digestion",
        "elk",
        "energy",
        "equipment",
        "excretion",
        "expertise",
        "firmware",
        "flounder",
        "fun",
        "gallows",
        "garbage",
        "graffiti",
        "hardware",
        "headquarters",
        "health",
        "herpes",
        "highjinks",
        "homework",
        "housework",
        "information",
        "jeans",
        "justice",
        "kudos",
        "labour",
        "literature",
        "machinery",
        "mackerel",
        "mail",
        "media",
        "mews",
        "moose",
        "music",
        "mud",
        "manga",
        "news",
        "only",
        "personnel",
        "pike",
        "plankton",
        "pliers",
        "police",
        "pollution",
        "premises",
        "rain",
        "research",
        "rice",
        "salmon",
        "scissors",
        "series",
        "sewage",
        "shambles",
        "shrimp",
        "software",
        "species",
        "staff",
        "swine",
        "tennis",
        "traffic",
        "transportation",
        "trout",
        "tuna",
        "wealth",
        "welfare",
        "whiting",
        "wildebeest",
        "wildlife",
        "you",
        /pok[eé]mon$/i,
        // Regexes.
        /[^aeiou]ese$/i,
        // "chinese", "japanese"
        /deer$/i,
        // "deer", "reindeer"
        /fish$/i,
        // "fish", "blowfish", "angelfish"
        /measles$/i,
        /o[iu]s$/i,
        // "carnivorous"
        /pox$/i,
        // "chickpox", "smallpox"
        /sheep$/i
      ].forEach(o.addUncountableRule), o;
    });
  })(V)), V.exports;
}
var he = qt();
const Vt = ({
  searchPlaceholder: e = "Search...",
  onSearch: n,
  actions: s,
  dialogVariant: r = "floating"
}) => {
  const [u, c] = D(""), l = /* @__PURE__ */ h.jsx(
    bt,
    {
      value: u,
      autoFocus: !0,
      placeholder: e,
      size: r === "modal" ? "large" : "medium",
      contrast: 3,
      rounded: !0,
      grow: !0,
      full: "x",
      onChange: (i) => {
        c(i), n?.(i);
      }
    }
  );
  return s == null ? l : /* @__PURE__ */ h.jsxs(X, { pack: !0, x: !0, children: [
    l,
    s
  ] });
}, Dt = ({ resourceName: e }) => /* @__PURE__ */ h.jsxs(C, { center: !0, status: "disabled", children: [
  "No ",
  he.plural(e),
  " found"
] }), pe = _e(
  ({
    onSearch: e,
    children: n,
    emptyContent: s,
    status: r,
    resourceName: u,
    actions: c,
    ...l
  }) => (s = T(() => r != null && r.variant !== "success" ? /* @__PURE__ */ h.jsx(
    W,
    {
      center: !0,
      variant: r?.variant,
      description: r?.description,
      children: r?.message
    }
  ) : typeof s == "string" ? /* @__PURE__ */ h.jsx(W, { center: !0, variant: "disabled", children: s }) : s ?? /* @__PURE__ */ h.jsx(Dt, { resourceName: u }), [r?.key, s]), /* @__PURE__ */ h.jsxs(
    Ge,
    {
      ...l,
      className: w.BE("select", "dialog"),
      bordered: !1,
      children: [
        e != null && /* @__PURE__ */ h.jsx(
          Vt,
          {
            dialogVariant: "floating",
            onSearch: e,
            searchPlaceholder: `Search ${he.plural(u)}...`,
            actions: c
          }
        ),
        /* @__PURE__ */ h.jsx(
          et,
          {
            emptyContent: s,
            bordered: !0,
            borderColor: 6,
            grow: !0,
            rounded: !0,
            full: "x",
            children: n
          }
        )
      ]
    }
  ))
);
pe.displayName = "Select.Dialog";
const ls = pe, cs = (e) => {
  const { itemKey: n } = e, s = Ct(n);
  return /* @__PURE__ */ h.jsx(tt, { ...s, ...e });
};
export {
  ts as A,
  os as C,
  ls as D,
  kt as F,
  cs as L,
  W as S,
  bt as T,
  ss as a,
  rs as b,
  Ct as c,
  as as d,
  Y as e,
  is as f,
  fe as g,
  wt as h,
  Et as i,
  ns as j,
  he as p,
  le as u
};
