import { jsx as r, jsxs as j } from "react/jsx-runtime";
import { forwardRef as A } from "react";
import { cx as f } from "../../utils/classNames.js";
import { useArrowTheme as E } from "../../hooks/useArrowTheme.js";
const I = ({ a11yLabel: e }) => /* @__PURE__ */ j(
  "svg",
  {
    width: "128",
    height: "128",
    viewBox: "0 0 128 128",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-label": e || void 0,
    focusable: e ? void 0 : "false",
    role: e ? "img" : void 0,
    "aria-hidden": e ? void 0 : "true",
    children: [
      /* @__PURE__ */ r(
        "path",
        {
          d: "M100.018 105.567C90.3686 113.935 77.7757 119 64 119C49.7569 119 36.7784 113.586 27.01 104.704C27.3753 92.1699 37.6505 82.1215 50.2727 82.1215H76.7454C89.5986 82.1215 100.018 92.541 100.018 105.394V105.567Z",
          fill: "#CCCCCC"
        }
      ),
      /* @__PURE__ */ r(
        "path",
        {
          d: "M63.6536 22C50.1884 22 39.2727 32.9157 39.2727 46.381C39.2727 59.8462 50.1884 70.7619 63.6536 70.7619C77.1189 70.7619 88.0346 59.8462 88.0346 46.381C88.0346 32.9157 77.1189 22 63.6536 22Z",
          fill: "#CCCCCC"
        }
      )
    ]
  }
), M = A(
  ({
    inverse: e,
    initials: s,
    actionType: o,
    actionA11yLabel: v,
    href: p,
    image: a,
    a11yLabel: n,
    icon: d,
    size: h = "small",
    outline: C = "none",
    focused: w,
    className: u
  }, i) => {
    const x = E(), g = e ?? x.inverse, N = !a && !s && !d;
    let t;
    s ? t = s.slice(0, 2).toUpperCase() : a ? t = /* @__PURE__ */ r("img", { src: a, alt: n || "" }) : d ? t = d : t = /* @__PURE__ */ r(I, { a11yLabel: n });
    const l = /* @__PURE__ */ r(
      "div",
      {
        ref: o === void 0 ? i : void 0,
        className: f("tdds-avatar", {
          "tdds-avatar--empty": N
        }),
        ...g ? { "data-inverse": "true" } : {},
        "data-size": h,
        "data-outline": C !== "none" ? C : void 0,
        children: t
      }
    );
    if (o !== void 0) {
      const c = s ? `${s}, ${v}` : v, m = f(
        "tdds-avatar--wrapper",
        {
          "force-focus": !!w
        },
        u
      );
      return o === "anchor" ? /* @__PURE__ */ r(
        "a",
        {
          ref: i,
          href: p,
          className: m,
          "aria-label": c || void 0,
          children: l
        }
      ) : /* @__PURE__ */ r(
        "button",
        {
          ref: i,
          className: m,
          "aria-label": c || void 0,
          children: l
        }
      );
    }
    return l;
  }
);
M.displayName = "Avatar";
export {
  M as Avatar
};
//# sourceMappingURL=Avatar.js.map
