"use client";
import { jsxs as d, jsx as r } from "react/jsx-runtime";
import { cn as m } from "../../utils/cn/cn.es.js";
import t from "../../components/ProductGalleryCard/productGalleryCard.module.css";
import { EAnalyticsEventType as p, EAnalyticsEvent as u } from "../../types/analytics/analytics.es.js";
import { Typography as y } from "../Typography/Typography.es.js";
import { Button as h } from "../Button/Button.es.js";
const k = ({
  name: l,
  price: v,
  image: C,
  zenpatientId: o,
  link: c,
  buttons: n,
  isHoverable: i = !0
}) => {
  const b = () => {
    var a;
    const e = {
      event: u.productGalleryCardClicked,
      type: p.interaction,
      component: "ProductGalleryCard",
      element: "card",
      payload: {
        zenpatientId: o,
        link: c,
        productName: l
      }
    };
    (a = window.eventBus) == null || a.emit("analytics", e), window.location.pathname = c;
  }, s = (e, a) => ({
    event: u.ctaClicked,
    type: p.interaction,
    component: "ProductGalleryCard",
    element: `button_${a}`,
    payload: {
      ctaLabel: e.label,
      productId: o,
      productName: l
    }
  });
  return /* @__PURE__ */ d("div", { rel: "noopener noreferrer", className: t.root, onClick: b, children: [
    /* @__PURE__ */ d("div", { className: t.productInfo, children: [
      /* @__PURE__ */ r(y, { defaultVariant: "labelXl", mobileVariant: "labelLg", className: t.title, children: l }),
      /* @__PURE__ */ r(y, { defaultVariant: "labelXl", mobileVariant: "labelLg", className: t.price, children: v })
    ] }),
    /* @__PURE__ */ r("img", { src: C, alt: "product image", className: t.productImage }),
    /* @__PURE__ */ r("div", { className: m(t.buttonContainerDesktop, i && t.hoverableButtons), children: n.map((e, a) => /* @__PURE__ */ r(h, { size: "sm", ...e, analyticsProps: s(e, a), children: e.label }, a)) }),
    /* @__PURE__ */ r("div", { className: m(t.buttonContainerMobile, i && t.hoverableButtons), children: n.map((e, a) => /* @__PURE__ */ r(h, { size: "xs", ...e, analyticsProps: s(e, a), children: e.label }, a)) })
  ] });
};
export {
  k as ProductGalleryCard
};
