"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "SmartPaginationDots", {
    enumerable: true,
    get: function() {
        return SmartPaginationDots;
    }
});
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _usePaginationDots = require("./usePaginationDots");
const _PaginationDots = require("./PaginationDots");
const _PaginationDot = require("./PaginationDot");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const SmartPaginationDots = ({ items, index, visibleItems, onIndexChange, ...rest })=>{
    const { sliced, activeId } = (0, _usePaginationDots.usePaginationDots)({
        items,
        index,
        visibleItems
    });
    return /*#__PURE__*/ _react.default.createElement(_PaginationDots.PaginationDots, rest, sliced.map(({ id }, i)=>/*#__PURE__*/ _react.default.createElement(_PaginationDot.PaginationDot, {
            key: `item:${i}`,
            isActive: id === activeId,
            onClick: ()=>onIndexChange?.(i)
        })));
};
