import { a as m } from "../../../../sdk/dist/shared/chunk-AI4GHU7R.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-SY6DZLTC.js";
import "../../../../sdk/dist/shared/chunk-7A2JNQX3.js";
import "../../../../sdk/dist/shared/chunk-3YVJ2ELD.js";
import "../../../../sdk/dist/shared/chunk-AFVJZPLS.js";
import "../../../../sdk/dist/shared/chunk-A3GF4PYW.js";
import "../../../../sdk/dist/shared/chunk-W33JMRRN.js";
import { tx as l, css as y } from "../../../../style-system/dist/twind.js";
import { getStyleProperties as h } from "../styles/style-props.js";
import { useSiteAttributes as g, usePageAttributes as b } from "../../../../../use-page-data.js";
import p from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js";
import { extractStylePath as x, pageStylesHelpersMap as S } from "../styles/helpers.js";
import { useFontWatcher as d } from "../../editor/hooks/use-font-watcher.js";
function T({ editable: t, showIntro: o } = {}) {
  const e = h(m), n = P(e), r = d();
  return l(
    "flex flex-col group/page mx-auto relative max-w-full w-full p-0 antialiased",
    t && "overflow-hidden min-h-[100cqh]",
    // pageAttributes.colorPreset?.color ?? siteAttributes.colorPreset?.color,
    Object.values(n),
    v(r),
    // Animate all bricks when the page is loading
    t && o && "[&>.brick-wrapper]:(opacity-0 animate-elastic-pop)"
  );
}
function P(t) {
  const o = g(), e = b();
  return Object.entries(t).reduce(
    (r, [s, u]) => {
      const a = S[u];
      if (!a)
        return r;
      const i = x(s);
      r[i] = r[i] ?? [];
      const c = p(e, s) ?? p(o, s), f = p(m.properties, s);
      return r[i].push(l(a?.(c, void 0, f))), r;
    },
    {}
  );
}
function v(t) {
  function o(e) {
    return e.type === "stack" ? `var(--font-${e.family})` : `"${e.family}"`;
  }
  return y({
    fontFamily: o(t.body),
    fontSize: `${t.base}px`,
    "& h1, & h2, & h3, & h4, & h5, & h6, & h7": {
      fontFamily: o(t.heading)
    }
  });
}
export {
  T as usePageStyle
};
//# sourceMappingURL=use-page-style.js.map
