export declare const docsNavigationTemplate = "\"use client\";\nimport { usePathname } from \"next/navigation\";\nimport Link from \"next/link\";\nimport styled, { css } from \"styled-components\";\nimport { useChat } from \"cherry-styled-components\";\nimport { Icon } from \"@/components/layout/Icon\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n focusModeColumn,\n interactiveStyles,\n sidePanelOffset,\n} from \"@/components/layout/SharedStyled\";\n\nconst StyledNavigationWrapper = styled.div<{\n $isChatOpen?: boolean;\n}>`\n transition: all 0.3s ease;\n padding: 0 20px 100px 20px;\n ${mq(\"lg\")} {\n padding: 0 300px 80px 300px;\n ${({ $isChatOpen }) =>\n $isChatOpen &&\n css`\n padding: 0 440px 80px 300px;\n `}\n }\n\n ${sidePanelOffset};\n ${({ $isChatOpen }) => !$isChatOpen && focusModeColumn};\n`;\n\nconst StyledNavigationInner = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 20px;\n max-width: 640px;\n margin: auto;\n`;\n\nconst StyledNavButton = styled(Link)<{ theme: Theme }>`\n ${interactiveStyles};\n display: flex;\n flex-direction: column;\n text-decoration: none;\n padding: 20px;\n flex: 50%;\n max-width: 50%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n border: solid 1px ${({ theme }) => theme.colors.grayLight};\n color: ${({ theme }) => theme.colors.dark};\n\n &:hover {\n border-color: ${({ theme }) => theme.colors.primary};\n }\n\n &[data-direction=\"prev\"] {\n align-items: flex-start;\n }\n\n &[data-direction=\"next\"] {\n align-items: flex-end;\n margin-left: auto;\n text-align: right;\n }\n`;\n\nconst StyledNavLabel = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.grayDark};\n display: flex;\n flex-direction: row;\n gap: 4px;\n\n & svg {\n margin: auto 0;\n }\n`;\n\nconst StyledNavTitle = styled.span<{ theme: Theme }>`\n color: ${({ theme }) => theme.colors.dark};\n font-weight: 600;\n margin: 0 0 4px 0;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 100%;\n`;\n\nconst StyledSpacer = styled.div`\n flex: 1;\n`;\n\ninterface Page {\n // Optional: nested group nodes may act as headers without their own page.\n // collectPages() only pushes nodes that actually have a slug.\n slug?: string;\n title: string;\n category?: string;\n links?: Page[];\n items?: Page[];\n [key: string]: unknown;\n}\n\ninterface NavigationItem {\n category?: string;\n slug?: string;\n title?: string;\n links?: Page[];\n items?: Page[];\n [key: string]: unknown;\n}\n\ninterface DocsNavigationProps {\n result: NavigationItem[];\n}\n\nfunction DocsNavigation({ result }: DocsNavigationProps) {\n const { isOpen } = useChat();\n const pathname = usePathname();\n // Walk categories and any nested link groups depth-first so prev/next spans\n // every real page (a node with a slug), in reading order.\n const collectPages = (nodes: unknown): Page[] => {\n if (!Array.isArray(nodes)) return [];\n const pages: Page[] = [];\n for (const node of nodes as Page[]) {\n if (node && node.slug !== undefined) {\n pages.push(node);\n }\n const children = node && ((node.links ?? node.items) as unknown);\n if (Array.isArray(children)) {\n pages.push(...collectPages(children));\n }\n }\n return pages;\n };\n const allPages: Page[] = result.flatMap((item) =>\n collectPages(\n item.links ??\n item.items ??\n (item.slug !== undefined ? [item as Page] : []),\n ),\n );\n const currentSlug = pathname.replace(/^\\//, \"\").replace(/\\/$/, \"\");\n const currentIndex = allPages.findIndex((page) => page.slug === currentSlug);\n const prevPage = currentIndex > 0 ? allPages[currentIndex - 1] : null;\n const nextPage =\n currentIndex < allPages.length - 1 ? allPages[currentIndex + 1] : null;\n if (currentIndex === -1 || allPages.length === 0) {\n return null;\n }\n if (!prevPage && !nextPage) {\n return null;\n }\n return (\n \n \n {prevPage ? (\n \n {prevPage.title}\n \n Previous\n \n \n ) : (\n \n )}\n {nextPage && (\n \n {nextPage.title}\n \n Next \n \n \n )}\n \n \n );\n}\n\nexport { DocsNavigation };\n";