function getAnchorByViewport(scrollerDOM) {
  var _scrollerDOM$querySel;
  var anchorsDOM = scrollerDOM === null || scrollerDOM === void 0 || (_scrollerDOM$querySel = scrollerDOM.querySelectorAll) === null || _scrollerDOM$querySel === void 0 ? void 0 : _scrollerDOM$querySel.call(scrollerDOM, '[data-indexbar-anchor]');
  for (var i = 0, anchorDOM; anchorDOM = anchorsDOM[i++];) {
    var rect = anchorDOM.getBoundingClientRect();
    if (rect.top >= 0) {
      return anchorDOM.getAttribute('data-indexbar-anchor');
    }
  }
  return '';
}
export default getAnchorByViewport;