import { j as r } from "../../../../_virtual/jsx-runtime.js";
import { OptionItem as u } from "../../dropdown/styles.js";
import { NoResultsText as m, ItemValue as x } from "../styles.js";
import { getSlicedValue as j } from "../utils.js";
function v({
  searchOptions: l,
  noResultsText: d,
  value: s,
  focusElement: a,
  onClick: o,
  setFocusElement: t
}) {
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: l.length < 1 ? /* @__PURE__ */ r.jsx(m, { onMouseDown: (e) => e.preventDefault(), children: d }) : l.map((e, i) => {
    const n = j(e, s);
    return /* @__PURE__ */ r.jsx(
      u,
      {
        "data-testid": e.dataTestId,
        tabIndex: 0,
        role: "option",
        isDisabled: e.isDisabled,
        isHovered: a === i,
        isSelected: s === e.value,
        onClick: () => !e.isDisabled && o(e),
        onFocus: () => t(i),
        onMouseEnter: () => t(i),
        onMouseDown: (c) => c.preventDefault(),
        children: n ? /* @__PURE__ */ r.jsxs(x, { children: [
          /* @__PURE__ */ r.jsx("b", { children: n.bolded }),
          n.end
        ] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
          /* @__PURE__ */ r.jsx("div", { children: e.label }),
          e.altText && /* @__PURE__ */ r.jsx("div", { children: e.altText })
        ] })
      },
      String(e.value)
    );
  }) });
}
export {
  v as SearchOptions
};
