import { jsxs as n, jsx as r } from "react/jsx-runtime";
import { useMemo as f } from "react";
import u from "../../utils/formatDateValue.js";
import i from "../../../box/Box.js";
import e from "../../../text/Text.js";
import g from "../../../jtl-dropdown/JTLDropdown.js";
import { operatorTextObject as x } from "../../deprecated/advanced-filter/types/FilterConditionOperator.js";
import s from "../../../icon/Icon.js";
import { FilterValueType as b } from "../../types/FilterValueType.js";
const P = ({
  ref: p,
  getOperatorOptions: c,
  selectedOperator: l,
  selectedValue: a,
  columnTitle: m,
  valueType: d
}) => {
  const o = d === b.DATE, v = f(() => o ? u(a) : a[0], [o, a]);
  return /* @__PURE__ */ n(
    "div",
    {
      ref: p,
      className: "flex max-w-[var(--spacing-80)] items-center gap-[var(--spacing-2)] rounded-[var(--border-radius-default)] border border-[var(--base-info-border)] bg-[var(--base-info-background)] px-[var(--spacing-3)] py-[var(--spacing-2)] h-[var(--spacing-9)] hover:cursor-pointer",
      children: [
        /* @__PURE__ */ r(i, { className: "max-w-[var(--spacing-16)]", children: /* @__PURE__ */ r(e, { type: "small", color: "info", truncate: !0, children: m }) }),
        /* @__PURE__ */ r("div", { onClick: (t) => t.stopPropagation(), onPointerDown: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(g, { menuItems: c(), width: "292px", position: "left", children: /* @__PURE__ */ n("div", { className: "flex max-w-[var(--spacing-24)] items-center gap-[var(--spacing-1)] rounded-[var(--border-radius-default)] bg-[var(--base-background)] px-[var(--spacing-1)] py-[var(--spacing-0-5)] text-[var(--base-info-text)] hover:outline hover:outline-[var(--base-border)]", children: [
          /* @__PURE__ */ r(e, { type: "small", color: "info", truncate: !0, children: x[l] }),
          /* @__PURE__ */ r(s, { name: "ChevronDown", size: 16 })
        ] }) }) }),
        /* @__PURE__ */ r(e, { type: "small", color: "info", truncate: !0, children: v }),
        !o && a.length > 1 && /* @__PURE__ */ r(i, { className: "flex items-center gap-[var(--spacing-1)] rounded-[var(--border-radius-default)] bg-[var(--base-info-border)] px-[var(--spacing-1)] py-[var(--spacing-0-5)] text-[var(--base-info-text)]", children: /* @__PURE__ */ n(e, { type: "small", color: "info", children: [
          "+",
          Math.max(0, a.length - 1)
        ] }) }),
        /* @__PURE__ */ r(i, { className: "flex items-center text-[var(--base-info-text)]", children: /* @__PURE__ */ r(s, { name: "ChevronDown", size: 16, className: "transition-transform duration-200 [button[aria-expanded=true]_&]:rotate-180" }) })
      ]
    }
  );
};
export {
  P as default
};
//# sourceMappingURL=DataTableFilterDisplay.js.map
