"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const keys = require("../../../../core/utils/keys/keys.cjs");
const rem = require("../../../../core/utils/units-converters/rem.cjs");
require("react");
require("react/jsx-runtime");
require("clsx");
const getBaseSize = require("../get-base-size/get-base-size.cjs");
const isPrimitiveSize = require("../is-primitive-size/is-primitive-size.cjs");
const isResponsiveSize = require("../is-responsive-size/is-responsive-size.cjs");
function assignHeaderVariables({
  baseStyles,
  minMediaStyles,
  header
}) {
  const headerHeight = header == null ? void 0 : header.height;
  const collapsedHeaderTransform = "translateY(calc(var(--app-shell-header-height) * -1))";
  const shouldOffset = (header == null ? void 0 : header.offset) ?? true;
  if (isPrimitiveSize.isPrimitiveSize(headerHeight)) {
    const baseSize = rem.rem(getBaseSize.getBaseSize(headerHeight));
    baseStyles["--app-shell-header-height"] = baseSize;
    if (shouldOffset) {
      baseStyles["--app-shell-header-offset"] = baseSize;
    }
  }
  if (isResponsiveSize.isResponsiveSize(headerHeight)) {
    if (typeof headerHeight.base !== "undefined") {
      baseStyles["--app-shell-header-height"] = rem.rem(headerHeight.base);
      if (shouldOffset) {
        baseStyles["--app-shell-header-offset"] = rem.rem(headerHeight.base);
      }
    }
    keys.keys(headerHeight).forEach((key) => {
      if (key !== "base") {
        minMediaStyles[key] = minMediaStyles[key] || {};
        minMediaStyles[key]["--app-shell-header-height"] = rem.rem(headerHeight[key]);
        if (shouldOffset) {
          minMediaStyles[key]["--app-shell-header-offset"] = rem.rem(headerHeight[key]);
        }
      }
    });
  }
  if (header == null ? void 0 : header.collapsed) {
    baseStyles["--app-shell-header-transform"] = collapsedHeaderTransform;
    baseStyles["--app-shell-header-offset"] = "0px !important";
  }
}
exports.assignHeaderVariables = assignHeaderVariables;
