/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
const require_styles_styler = require("../../../styles/styler.cjs");
const require_components_client_Pagination_paginationContext = require("./paginationContext.cjs");
const require_components_client_Pagination_paginationStyles = require("./paginationStyles.cjs");
const require_components_client_Pagination_PaginationEllipsis = require("./PaginationEllipsis.cjs");
const require_components_client_Pagination_PaginationItem = require("./PaginationItem.cjs");
const require_components_client_Pagination_PaginationLink = require("./PaginationLink.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Pagination/PaginationNumbers.tsx
const PaginationNumbers = (0, react.forwardRef)(function PaginationNumbers({ renderItem, className }, ref) {
	const { activePage, getPageHref, size } = require_components_client_Pagination_paginationContext.usePaginationContext();
	const visiblePages = require_components_client_Pagination_paginationContext.useVisiblePages();
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
		ref,
		className: require_styles_styler.cx("m-0 inline-flex list-none items-center self-center p-0", require_components_client_Pagination_paginationStyles.usePaginationGapClassName(size), className),
		children: visiblePages.map((item, index) => {
			const key = item === "ellipsis" ? `ellipsis-${index}` : `page-${item}`;
			if (item === "ellipsis") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
				className: "inline-flex items-center",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Pagination_PaginationEllipsis.PaginationEllipsis, {})
			}, key);
			const isActive = item === activePage;
			const href = getPageHref?.(item);
			if (renderItem) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
				className: "inline-flex items-center",
				children: renderItem(item, { isActive })
			}, key);
			if (href && !isActive) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
				className: "inline-flex items-center",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Pagination_PaginationLink.PaginationLink, {
					page: item,
					href,
					children: item
				})
			}, key);
			return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
				className: "inline-flex items-center",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Pagination_PaginationItem.PaginationItem, {
					page: item,
					children: item
				})
			}, key);
		})
	});
});
PaginationNumbers.displayName = "PaginationNumbers";
//#endregion
exports.PaginationNumbers = PaginationNumbers;
