"use client";
const require_keys = require("../../../../core/utils/keys/keys.cjs");
const require_rem = require("../../../../core/utils/units-converters/rem.cjs");
const require_get_breakpoint_value = require("../../../../core/utils/get-breakpoint-value/get-breakpoint-value.cjs");
const require_get_base_size = require("../get-base-size/get-base-size.cjs");
const require_is_primitive_size = require("../is-primitive-size/is-primitive-size.cjs");
const require_is_responsive_size = require("../is-responsive-size/is-responsive-size.cjs");
//#region packages/@mantine/core/src/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.ts
function assignNavbarVariables({ baseStyles, minMediaStyles, maxMediaStyles, navbar, theme, mode }) {
	const navbarWidth = navbar?.width;
	const collapsedNavbarTransform = "translateX(calc(var(--app-shell-navbar-width) * -1))";
	const collapsedNavbarTransformRtl = "translateX(var(--app-shell-navbar-width))";
	if (navbar?.breakpoint && !navbar?.collapsed?.mobile) {
		maxMediaStyles[navbar?.breakpoint] = maxMediaStyles[navbar?.breakpoint] || {};
		maxMediaStyles[navbar?.breakpoint]["--app-shell-navbar-offset"] = "0px";
		maxMediaStyles[navbar?.breakpoint]["--app-shell-navbar-width"] = "100%";
		if (mode === "static") maxMediaStyles[navbar?.breakpoint]["--app-shell-navbar-grid-width"] = "0px";
	}
	if (require_is_primitive_size.isPrimitiveSize(navbarWidth)) {
		const baseSize = require_rem.rem(require_get_base_size.getBaseSize(navbarWidth));
		baseStyles["--app-shell-navbar-width"] = baseSize;
		baseStyles["--app-shell-navbar-offset"] = baseSize;
		if (mode === "static") baseStyles["--app-shell-navbar-grid-width"] = baseSize;
	}
	if (require_is_responsive_size.isResponsiveSize(navbarWidth)) {
		if (typeof navbarWidth.base !== "undefined") {
			baseStyles["--app-shell-navbar-width"] = require_rem.rem(navbarWidth.base);
			baseStyles["--app-shell-navbar-offset"] = require_rem.rem(navbarWidth.base);
			if (mode === "static") baseStyles["--app-shell-navbar-grid-width"] = require_rem.rem(navbarWidth.base);
		}
		require_keys.keys(navbarWidth).forEach((key) => {
			if (key !== "base") {
				minMediaStyles[key] = minMediaStyles[key] || {};
				minMediaStyles[key]["--app-shell-navbar-width"] = require_rem.rem(navbarWidth[key]);
				minMediaStyles[key]["--app-shell-navbar-offset"] = require_rem.rem(navbarWidth[key]);
				if (mode === "static") minMediaStyles[key]["--app-shell-navbar-grid-width"] = require_rem.rem(navbarWidth[key]);
			}
		});
	}
	if (navbar?.breakpoint && mode === "static") {
		minMediaStyles[navbar.breakpoint] = minMediaStyles[navbar.breakpoint] || {};
		minMediaStyles[navbar.breakpoint]["--app-shell-navbar-position"] = "sticky";
		minMediaStyles[navbar.breakpoint]["--app-shell-navbar-grid-row"] = "2";
		minMediaStyles[navbar.breakpoint]["--app-shell-navbar-grid-column"] = "1";
		minMediaStyles[navbar.breakpoint]["--app-shell-main-column-start"] = "2";
	}
	if (navbar?.collapsed?.desktop) {
		const breakpointValue = navbar.breakpoint;
		minMediaStyles[breakpointValue] = minMediaStyles[breakpointValue] || {};
		minMediaStyles[breakpointValue]["--app-shell-navbar-transform"] = collapsedNavbarTransform;
		minMediaStyles[breakpointValue]["--app-shell-navbar-transform-rtl"] = collapsedNavbarTransformRtl;
		if (mode === "fixed") minMediaStyles[breakpointValue]["--app-shell-navbar-offset"] = "0px !important";
		else {
			minMediaStyles[breakpointValue]["--app-shell-navbar-width"] = "0px";
			minMediaStyles[breakpointValue]["--app-shell-navbar-display"] = "none";
			minMediaStyles[breakpointValue]["--app-shell-main-column-start"] = "1";
		}
	}
	if (navbar?.collapsed?.mobile) {
		const breakpointValue = require_get_breakpoint_value.getBreakpointValue(navbar.breakpoint, theme.breakpoints) - .1;
		maxMediaStyles[breakpointValue] = maxMediaStyles[breakpointValue] || {};
		maxMediaStyles[breakpointValue]["--app-shell-navbar-width"] = "100%";
		maxMediaStyles[breakpointValue]["--app-shell-navbar-offset"] = "0px";
		if (mode === "static") maxMediaStyles[breakpointValue]["--app-shell-navbar-grid-width"] = "0px";
		maxMediaStyles[breakpointValue]["--app-shell-navbar-transform"] = collapsedNavbarTransform;
		maxMediaStyles[breakpointValue]["--app-shell-navbar-transform-rtl"] = collapsedNavbarTransformRtl;
	}
}
//#endregion
exports.assignNavbarVariables = assignNavbarVariables;

//# sourceMappingURL=assign-navbar-variables.cjs.map