/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { elementInViewport, getWindowSize, scrollTo } from '../../utils/dom.js';
import '../../_chunks/dep-2e5d8948.js';
import 'lodash/isString';
import 'lodash/isFunction';
import 'lodash/isArray';
import '../../utils/easing.js';

function scrollToElm(elm) {
  var rect = elm.getBoundingClientRect();
  if (!elementInViewport(elm)) {
    var winHeight = getWindowSize().height;
    scrollTo(rect.top - (winHeight / 2 - rect.height / 2), {});
  }
}

export { scrollToElm as default };
//# sourceMappingURL=scrollToElm.js.map
