var NEIGHBOR_ITEM_COUNT_DESKTOP = 2;
var NEIGHBOR_ITEM_COUNT_MOBILE = 1;
var EDGE_ITEM_COUNT_DESKTOP = 4;
var EDGE_ITEM_COUNT_MOBILE = 2;
export function getItems(active, total, isMobile) {
  var result = [];
  var neighborItemCount = isMobile ? NEIGHBOR_ITEM_COUNT_MOBILE : NEIGHBOR_ITEM_COUNT_DESKTOP;
  var edgeItemCount = isMobile ? EDGE_ITEM_COUNT_MOBILE : EDGE_ITEM_COUNT_DESKTOP;

  // Group refers to a sequence of items in a row without dots
  var groupLeftmost = Math.max(Math.min(active - neighborItemCount, total - edgeItemCount), 1);
  var groupRightmost = Math.min(Math.max(1 + edgeItemCount, active + neighborItemCount), total);
  var hasLeftDots = groupLeftmost > 3;
  var hasRightDots = groupRightmost < total - 2;
  var groupStart = hasLeftDots ? groupLeftmost : 1;
  var groupEnd = hasRightDots ? groupRightmost : total;
  if (hasLeftDots) {
    result.push(1, '.');
  }
  for (var i = groupStart; i <= groupEnd; ++i) {
    result.push(i);
  }
  if (hasRightDots) {
    result.push('.');
  }
  if (hasRightDots && isFinite(total)) {
    result.push(total);
  }
  return result;
}