"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    getPaginationPageCount: ()=>getPaginationPageCount,
    shouldAutoEnableQuickJumper: ()=>shouldAutoEnableQuickJumper,
    withAutoQuickJumper: ()=>withAutoQuickJumper
});
const DEFAULT_PAGE_SIZE = 10;
const getPageBufferSize = (showLessItems)=>showLessItems ? 1 : 2;
const getQuickJumperAutoThreshold = (showLessItems)=>2 * getPageBufferSize(showLessItems) + 3;
const getPaginationPageCount = (pagination)=>{
    if (!pagination) return 0;
    const total = Number(pagination.total);
    const pageSize = Number(pagination.pageSize || pagination.defaultPageSize || DEFAULT_PAGE_SIZE);
    if (!Number.isFinite(total) || total <= 0 || !Number.isFinite(pageSize) || pageSize <= 0) return 0;
    return Math.ceil(total / pageSize);
};
const shouldAutoEnableQuickJumper = (pagination)=>{
    if (!pagination || void 0 !== pagination.showQuickJumper || pagination.simple) return false;
    return getPaginationPageCount(pagination) > getQuickJumperAutoThreshold(pagination.showLessItems);
};
const withAutoQuickJumper = (pagination)=>{
    if (!pagination || false === pagination || !shouldAutoEnableQuickJumper(pagination)) return pagination;
    return {
        ...pagination,
        showQuickJumper: true
    };
};
exports.getPaginationPageCount = __webpack_exports__.getPaginationPageCount;
exports.shouldAutoEnableQuickJumper = __webpack_exports__.shouldAutoEnableQuickJumper;
exports.withAutoQuickJumper = __webpack_exports__.withAutoQuickJumper;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
    "getPaginationPageCount",
    "shouldAutoEnableQuickJumper",
    "withAutoQuickJumper"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
    value: true
});
