"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { PaginationProvider } from "./use-pagination-context.js";
import { usePagination } from "./use-pagination.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/pagination/pagination-root.tsx
var splitRootProps = createSplitProps();
var PaginationRoot = forwardRef((props, ref) => {
	const [paginationProps, localProps] = splitRootProps(props, [
		"boundaryCount",
		"count",
		"defaultPage",
		"defaultPageSize",
		"getPageUrl",
		"id",
		"ids",
		"onPageChange",
		"onPageSizeChange",
		"page",
		"pageSize",
		"siblingCount",
		"translations",
		"type"
	]);
	const pagination = usePagination(paginationProps);
	const mergedProps = mergeProps(pagination.getRootProps(), localProps);
	return /* @__PURE__ */ jsx(PaginationProvider, {
		value: pagination,
		children: /* @__PURE__ */ jsx(ark.nav, {
			...mergedProps,
			ref
		})
	});
});
PaginationRoot.displayName = "PaginationRoot";
//#endregion
export { PaginationRoot };
