import { jsxs as d, jsx as t } from "react/jsx-runtime";
import { ab as g } from "./chunk-3RDGTRSB.DySNCMmQ.js";
import "@sinclair/typebox";
import { T as s } from "./TextContent.Bq7vg7V3.js";
import { _ as o, B as f } from "./twind.D7be0E5m.js";
import { b as u } from "./use-section-style.CihCUEtb.js";
import { u as x } from "./use-color-preset.BrT8DcA1.js";
import { B as P } from "./BrickRoot.C1PanknS.js";
function j({ brick: a, editable: r }) {
  var n, c;
  const e = a.props, m = u(a), l = x(a), p = Object.values(m), i = e.cardImage && e.imagePosition === "overlay";
  return /* @__PURE__ */ d(
    P,
    {
      manifest: g,
      className: o(
        "flex relative overflow-hidden",
        e.imagePosition === "side" ? "flex-row" : "flex-col",
        l.container,
        p,
        i && f({
          backgroundImage: `url(${(n = e.cardImage) == null ? void 0 : n.src})`,
          backgroundSize: "cover",
          backgroundPosition: "center",
          backgroundRepeat: "no-repeat"
        }),
        i && "justify-center"
      ),
      children: [
        i && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[inherit] opacity-20 -z-1" }),
        /* @__PURE__ */ d("div", { className: o("card-inner-wrapper", e.imagePosition === "top" ? "order-2" : "order-1"), children: [
          !e.noTitle && /* @__PURE__ */ t("div", { className: o("text-[120%] font-semibold z-auto my-4 mx-4"), children: /* @__PURE__ */ t(
            s,
            {
              propPath: "cardTitle.content",
              className: o("flex-1"),
              brickId: a.id,
              content: e.cardTitle,
              editable: r,
              inline: !0
            }
          ) }),
          e.imagePosition !== "middle" && /* @__PURE__ */ t("div", { className: o("z-auto p-4", !e.noTitle && "pt-0"), children: /* @__PURE__ */ t(
            s,
            {
              propPath: "cardBody.content",
              className: o("flex-grow"),
              brickId: a.id,
              content: e.cardBody,
              editable: r
            }
          ) })
        ] }),
        ((c = e.cardImage) == null ? void 0 : c.src) && e.imagePosition !== "overlay" && /* @__PURE__ */ t(
          "img",
          {
            className: o(
              " select-none pointer-events-none bg-transparent",
              e.cardImage.position ?? "object-center",
              e.cardImage.fit ?? "object-cover",
              e.imagePosition === "middle" && "order-2",
              e.imagePosition === "top" && "order-first",
              e.imagePosition === "bottom" && "order-last mt-auto",
              e.imagePosition === "side" ? "h-auto w-[clamp(100px,40%,400px)]" : "w-inherit h-[clamp(200px,50%,300px)]"
            ),
            src: e.cardImage.src,
            alt: e.cardImage.alt || "Card Image"
          }
        ),
        e.cardBody && e.imagePosition === "middle" && /* @__PURE__ */ t("div", { className: o("z-auto p-4 order-last"), children: /* @__PURE__ */ t(
          s,
          {
            propPath: "cardBody.content",
            className: o("flex-1"),
            brickId: a.id,
            content: e.cardBody,
            editable: r
          }
        ) })
      ]
    }
  );
}
export {
  j as default
};
//# sourceMappingURL=card.BgMZUjdM.js.map
