import { jsxs as c, jsx as I } from "react/jsx-runtime";
import { useBreadcrumbItem as N } from "@react-aria/breadcrumbs";
import { useFocusRing as T } from "@react-aria/focus";
import { mergeProps as B } from "@react-aria/utils";
import { useRef as E } from "react";
import { Badge as P } from "../Badge/Badge.es.js";
import { getItemElementType as C } from "../../utilities/elements.es.js";
import { FOCUS_STYLE_NO_OFFSET as O } from "../../utilities/focusStyle.es.js";
import { merge as a } from "../../utilities/merge.es.js";
const S = ({
  label: r,
  badges: e,
  bold: u,
  decorator: d,
  link: m,
  onClick: o,
  activeInline: s,
  "data-test-id": l = "breadcrumb"
}) => {
  const n = E(null), t = C(m, o), i = t !== "span", { itemProps: w } = N(
    {
      isCurrent: !0,
      children: r,
      elementType: t
    },
    n
  ), p = {
    a: { href: m },
    button: { onClick: o, type: "button" },
    span: { tabIndex: -1 }
  }, { isFocusVisible: f, focusProps: x } = T(), b = i ? B(w, x, p[t]) : p[t], h = a([
    "tw-flex tw-gap-x-1 tw-items-center tw-leading-4 tw-h-6 tw-whitespace-pre-wrap tw-font-medium tw-rounded",
    u && "tw-font-bold",
    s && "tw-text-xs",
    i && f && O
  ]);
  return /* @__PURE__ */ c(
    "li",
    {
      className: a([
        "tw-align-middle tw-gap-x-1 tw-text-m tw-text-text tw-items-center",
        s ? "tw-flex tw-items-center" : "tw-w-full tw-inline-flex"
      ]),
      "data-test-id": `${l}-item`,
      children: [
        /* @__PURE__ */ c(t, { ref: n, ...b, className: h, children: [
          d,
          r
        ] }),
        e == null ? void 0 : e.map(({ children: g, ...F }, y) => /* @__PURE__ */ I(P, { ...F, children: g }, `breadcrumb-badge-${y}`))
      ]
    }
  );
};
S.displayName = "FondueCurrentBreadcrumbItem";
export {
  S as CurrentBreadcrumbItem
};
//# sourceMappingURL=CurrentBreadcrumbItem.es.js.map
