import { jsx as a, jsxs as s, Fragment as g } from "react/jsx-runtime";
import { cn as t } from "../../utils/cn/cn.es.js";
import u from "./assets/company-logo.svg.es.js";
import e from "../../modules/Comparison/comparison.module.css";
import { isHealthspan as c } from "./utils.es.js";
import { HighlightedTitle as y } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
import { Typography as m } from "../../components/Typography/Typography.es.js";
import { Icon as f } from "../../components/Icon/Icon.es.js";
import { EIconName as o } from "../../components/Icon/constants.es.js";
import { ComparisonMobileView as v } from "./components/ComparisonMobileView/ComparisonMobileView.es.js";
const $ = ({ title: h, description: n, comparison: r }) => /* @__PURE__ */ a("div", { className: e.root, children: /* @__PURE__ */ s("div", { className: e.container, children: [
  /* @__PURE__ */ s("div", { className: e.header, children: [
    /* @__PURE__ */ a(y, { title: h, defaultVariant: "displayMd", mobileVariant: "headingXl" }),
    n && /* @__PURE__ */ a(
      m,
      {
        as: "p",
        defaultVariant: "bodyLg",
        mobileVariant: "bodySm",
        className: e.description,
        children: n
      }
    )
  ] }),
  /* @__PURE__ */ s(
    "div",
    {
      className: e.table,
      style: {
        gridTemplateColumns: `minmax(220px, 1fr) repeat(${r.headers.length}, minmax(220px, 270px))`
      },
      children: [
        /* @__PURE__ */ a("div", { className: t(e.emptyCell, e.stickyCell) }),
        /* @__PURE__ */ a("div", { className: t(e.otherEmptyCells) }),
        /* @__PURE__ */ a(
          m,
          {
            defaultVariant: "bodyXl",
            as: "div",
            className: t(e.cell, e.cellFeature, e.stickyCell),
            weight: "medium",
            children: "Features"
          }
        ),
        r.headers.map((l) => /* @__PURE__ */ a(
          m,
          {
            as: "div",
            defaultVariant: r.headers.length > 2 ? "bodyXl" : "headingLg",
            className: t(e.cell, c(l) ? e.cellHighlighted : ""),
            weight: r.headers.length > 2 ? "medium" : "regular",
            children: c(l) ? /* @__PURE__ */ a(u, { className: e.companyLogo }) : l
          },
          l
        )),
        r.rows.map((l, p) => /* @__PURE__ */ s(g, { children: [
          /* @__PURE__ */ a(
            "div",
            {
              className: t(e.cell, e.cellFeature, e.stickyCell),
              children: /* @__PURE__ */ s("div", { className: e.featureContent, children: [
                /* @__PURE__ */ a(m, { defaultVariant: "bodyXl", weight: "medium", children: l.feature }),
                l.description && /* @__PURE__ */ a(m, { defaultVariant: "bodyXl", className: e.featureDescription, children: l.description })
              ] })
            },
            `feature-${l.feature}`
          ),
          r.headers.map((N, d) => {
            const i = l.values[d];
            return /* @__PURE__ */ s(
              "div",
              {
                className: t(e.cell, d ? "" : e.cellHighlighted),
                children: [
                  (i == null ? void 0 : i.type) === "boolean" && /* @__PURE__ */ a(
                    "div",
                    {
                      className: t(
                        e.booleanValue,
                        !d && i.value ? e.booleanValueHighlighted : ""
                      ),
                      children: /* @__PURE__ */ a(f, { name: i.value ? o.CHECK : o.CLOSE })
                    }
                  ),
                  (i == null ? void 0 : i.type) === "string" && /* @__PURE__ */ a(
                    m,
                    {
                      defaultVariant: "bodyXl",
                      weight: "medium",
                      className: e.stringValue,
                      children: i.value
                    }
                  )
                ]
              },
              `value-${p}-${i.value}`
            );
          })
        ] })),
        /* @__PURE__ */ a("div", { className: t(e.emptyCell, e.stickyCell) }),
        /* @__PURE__ */ a("div", { className: t(e.otherEmptyCells) }),
        /* @__PURE__ */ a("div", { className: e.gradientBackground })
      ]
    }
  ),
  /* @__PURE__ */ a(v, { comparison: r })
] }) });
export {
  $ as Comparison
};
