/**
 * DevExtreme (esm/__internal/core/utils/scroll.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
export function getMemoizeScrollTo(getScrollableInstance) {
    var instance = getScrollableInstance();
    var lastParams = {};
    return function(params) {
        var force = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false;
        var normalizedParams = {
            top: void 0 !== params.top ? Math.ceil(params.top) : void 0,
            left: void 0 !== params.left ? Math.ceil(params.left) : void 0
        };
        var isSameParams = normalizedParams.top === lastParams.top && normalizedParams.left === lastParams.left;
        if (!force && isSameParams) {
            return
        }
        lastParams = normalizedParams;
        instance.scrollTo(params)
    }
}
