import { c as createComponent, m as maybeRenderHead, a as addAttribute, r as renderTemplate, b as createAstro, e as renderHead, d as renderComponent, f as renderSlot } from './astro/server_DrnzQWw3.mjs';
import 'kleur/colors';
import 'clsx';
import { r as readCms, b as getApprovedPosts, c as getPostBySlug, j as getPrimaryNav, e as getCategoryPath, k as getFooterPageLinks } from './cms_CRTVymfB.mjs';
/* empty css */
const $$Astro$2 = createAstro();
const $$Header = createComponent(async ($$result, $$props, $$slots) => {
const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
Astro2.self = $$Header;
const cms = await readCms();
const { breakingNews } = cms.settings;
const approvedPosts = getApprovedPosts(cms);
const breakingPosts = [
...(breakingNews.postSlugs ?? []).map((slug) => getPostBySlug(approvedPosts, slug)).filter(Boolean),
...approvedPosts.filter((post) => post.urgent)
].filter((post, index, list) => list.findIndex((item) => item.slug === post.slug) === index);
const primaryNav = getPrimaryNav();
const pathname = Astro2.url.pathname;
const normalizePath = (value) => decodeURIComponent(value.replace(/\/+$/, "") || "/");
const normalizedPathname = normalizePath(pathname);
const isActive = (href) => {
const target = normalizePath(href);
if (target === "/") {
return normalizedPathname === "/";
}
return normalizedPathname === target || normalizedPathname.startsWith(`${target}/`);
};
const categoryTabs = [
{ label: "\u0647\u0645\u0647", href: "/posts/" },
...cms.categories.map((category) => ({
label: category,
href: getCategoryPath(category)
}))
];
const breakingText = breakingPosts.length > 0 ? breakingPosts.map((post) => post.title).join(" \u2014 ") : breakingNews.items.join(" \u2014 ");
const breakingHref = breakingPosts[0] ? `/posts/${breakingPosts[0].slug}/` : breakingNews.href;
return renderTemplate`${maybeRenderHead()}
`;
}, "/Users/drfelfel/ruseemrooz/src/components/Header.astro", void 0);
const $$Astro$1 = createAstro();
const $$Footer = createComponent(async ($$result, $$props, $$slots) => {
const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
Astro2.self = $$Footer;
const cms = await readCms();
const footerPageLinks = getFooterPageLinks();
const pathname = Astro2.url.pathname;
const normalizePath = (value) => decodeURIComponent(value.replace(/\/+$/, "") || "/");
const normalizedPathname = normalizePath(pathname);
const isNavActive = (href) => {
const target = normalizePath(href);
if (target === "/") {
return normalizedPathname === "/";
}
return normalizedPathname === target || normalizedPathname.startsWith(`${target}/`);
};
const mobileNav = [
{ icon: "home", label: "\u062E\u0627\u0646\u0647", href: "/" },
{ icon: "article", label: "\u0627\u062E\u0628\u0627\u0631", href: "/posts/" },
{ icon: "insights", label: "\u0627\u0642\u062A\u0635\u0627\u062F", href: getCategoryPath("\u0627\u0642\u062A\u0635\u0627\u062F") },
{ icon: "explore", label: "\u062C\u0647\u0627\u0646", href: getCategoryPath("\u0628\u06CC\u0646\u200C\u0627\u0644\u0645\u0644\u0644") },
{ icon: "bolt", label: "\u0627\u0646\u0631\u0698\u06CC", href: getCategoryPath("\u0627\u0646\u0631\u0698\u06CC") }
].map((item) => ({ ...item, active: isNavActive(item.href) }));
return renderTemplate`${maybeRenderHead()} `;
}, "/Users/drfelfel/ruseemrooz/src/components/Footer.astro", void 0);
const $$Astro = createAstro();
const $$BaseLayout = createComponent(($$result, $$props, $$slots) => {
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
Astro2.self = $$BaseLayout;
const {
title = "\u0631\u0648\u0633 \u0627\u0645\u0631\u0648\u0632",
description = "\u062E\u0628\u0631\u06AF\u0632\u0627\u0631\u06CC \u062A\u062E\u0635\u0635\u06CC \u067E\u0648\u0634\u0634 \u0627\u062E\u0628\u0627\u0631 \u0631\u0648\u0633\u06CC\u0647\u060C \u0627\u0648\u0631\u0627\u0633\u06CC\u0627 \u0648 \u0631\u0648\u0627\u0628\u0637 \u0645\u0646\u0637\u0642\u0647\u200C\u0627\u06CC"
} = Astro2.props;
return renderTemplate` ${title}${renderHead()} ${renderComponent($$result, "Header", $$Header, {})} ${renderSlot($$result, $$slots["default"])} ${renderComponent($$result, "Footer", $$Footer, {})} `;
}, "/Users/drfelfel/ruseemrooz/src/layouts/BaseLayout.astro", void 0);
export { $$BaseLayout as $ };