import { j as n } from "../../../../_virtual/jsx-runtime.js";
import { Chip as d } from "../../../Chip/Chip.js";
import { DatePickerSelect as x } from "../datePickerSelect/index.js";
import { getIsSameDay as j, formatDate as f } from "../../dateUtils.js";
import { ChipBorder as h } from "../datePickerSelect/styles.js";
function I(t, e, r) {
  if (j(t.start, t.end))
    return f(t.start, e, r);
  {
    const s = f(t.start, e, r), o = f(t.end, e, r);
    return `${s} - ${o}`;
  }
}
function C({
  value: t,
  locale: e,
  variant: r,
  placeholder: s,
  handleClick: o,
  visible: u,
  disabled: p,
  hasError: c,
  leadingIcon: l,
  getInputLabel: m
}) {
  const i = t ? (typeof m == "function" ? m : I)(t, e, r) : s;
  switch (r) {
    case "select":
      return /* @__PURE__ */ n.jsx(
        x,
        {
          handleClick: o,
          visible: u,
          disabled: p,
          placeholder: i,
          hasError: c,
          leadingIcon: l
        }
      );
    case "chip":
    default:
      return /* @__PURE__ */ n.jsx(h, { hasError: c, children: /* @__PURE__ */ n.jsx(
        d,
        {
          label: i,
          onClick: o,
          disabled: p,
          selected: !1
        }
      ) });
  }
}
export {
  C as Input
};
