(function () {
  const e = React.createElement;

  function mountWhenReady(render) {
    if (window.Header && window.SiteFooter && window.ConsultationCard && window.blogPosts) {
      render();
      return;
    }
    setTimeout(() => mountWhenReady(render), 40);
  }

  const admin = window.CSLAdmin || {};
  const pageHero = (admin.heroes && admin.heroes.blog) || {};
  const pageCta = (admin.ctas && admin.ctas.blog && (admin.ctas.blog.main || admin.ctas.blog["start-call"])) || {};

  function titleNode(tag, text) {
    return e(window.CSLRichDotTitle, { as: tag, text });
  }

  function StartCallBlock() {
    if (!pageCta.heading && !pageCta.subheading) return null;
    return e("section", { className: "sec case-cta dark-theme" },
      e("div", { className: "wrap case-cta__grid" },
        e("div", { className: "sec-head reveal" },
          e("p", { className: "eyebrow" }, "Not Sure Where to Start?"),
          pageCta.heading ? titleNode("h2", pageCta.heading) : null,
          pageCta.subheading ? e("p", null, pageCta.subheading) : null
        ),
        e("div", { className: "reveal" },
          e(window.ConsultationCard, { slotId: "blog-consultation-card-avatar" })
        )
      )
    );
  }

  function BlogPage() {
    window.useReveal();
    React.useEffect(() => window.scrollTo(0, 0), []);
    return e("div", { className: "blog-page-shell" },
      e(window.Header),
      e("main", { className: "dark-theme" },
        e("section", { className: "blog-hero" },
          e("div", { className: "wrap blog-hero__inner reveal" },
            titleNode("h1", pageHero.heading || "Blog"),
            pageHero.subheading ? e("p", null, pageHero.subheading) : null
          )
        ),
        e("section", { className: "sec sec--sunken" },
          e("div", { className: "wrap blog-grid" },
            window.blogPosts.map((post) =>
              e("a", { className: "blog-card reveal", href: `blog-post?post=${post.slug}`, key: post.slug },
                e("span", { className: "blog-card__tag" }, post.category),
                e("h2", null, post.title),
                e("p", null, post.excerpt),
                e("span", { className: "blog-card__read", "aria-hidden": "true" }, e(window.Arrow))
              )
            )
          )
        ),
        e(StartCallBlock)
      ),
      e("div", { className: "dark-theme" }, e(window.SiteFooter))
    );
  }

  mountWhenReady(() => ReactDOM.createRoot(document.getElementById("root")).render(e(BlogPage)));
})();
