;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7d71c654-ea31-40fe-91e4-e67f2e123c34", e._sentryDebugIdIdentifier = "sentry-dbid-7d71c654-ea31-40fe-91e4-e67f2e123c34");
  } catch (e) {
  }
}
;
import { jsx } from "preact/jsx-runtime";
import cx from "classnames";
import { r as Icon } from "./StoreProvider-CqQrndhS.js";
const avatar = "adyen-kyc-avatar";
const avatarLabel = "adyen-kyc-avatar-label";
const avatarPrimary = "adyen-kyc-avatar-primary";
const avatarSecondary = "adyen-kyc-avatar-secondary";
const avatarTertiary = "adyen-kyc-avatar-tertiary";
const avatarImage = "adyen-kyc-avatar-image";
const avatarDisabled = "adyen-kyc-avatar-disabled";
const avatarShapeSquare = "adyen-kyc-avatar-shape-square";
const avatarShapeCircle = "adyen-kyc-avatar-shape-circle";
const styles = {
  avatar,
  avatarLabel,
  avatarPrimary,
  avatarSecondary,
  avatarTertiary,
  avatarImage,
  avatarDisabled,
  avatarShapeSquare,
  avatarShapeCircle
};
const Avatar = ({
  circle = false,
  iconName,
  imageUrl,
  label,
  variant = "secondary"
}) => {
  const isImage = imageUrl !== void 0;
  const isIcon = iconName !== void 0;
  const variantStyles = {
    disabled: styles.avatarDisabled,
    primary: styles.avatarPrimary,
    secondary: styles.avatarSecondary,
    tertiary: styles.avatarTertiary
  };
  const className = cx(styles.avatar, variantStyles[variant], {
    [styles.avatarShapeCircle]: circle,
    [styles.avatarShapeSquare]: !circle,
    [styles.avatarImage]: isImage
  });
  const backgroundImageStyle = {
    backgroundImage: isImage ? `url(${imageUrl})` : "unset"
  };
  return /* @__PURE__ */ jsx("div", { "aria-label": label, className, style: backgroundImageStyle, role: "img", children: isIcon ? /* @__PURE__ */ jsx(Icon, { name: iconName }) : /* @__PURE__ */ jsx("span", { className: styles.avatarLabel, children: label }) });
};
export {
  Avatar as A
};
