import { invariant } from './chunk-JBXZG2HJ.mjs';
import { isBrowser } from './chunk-AJMQPQGJ.mjs';

// src/calculateScrollPercentage/index.ts
function calculateScrollPercentage() {
  invariant(isBrowser());
  const scrollPosition = window.scrollY || window.scrollY || document.documentElement.scrollTop;
  const totalHeight = document.documentElement.scrollHeight - window.innerHeight;
  const scrollPercentage = scrollPosition / totalHeight * 100;
  return scrollPercentage;
}

export { calculateScrollPercentage };
