"use strict";var e=require("react");exports.useScrollPercentage=t=>{let[r,n]=e.useState(0),c=e.useCallback(t=>{let r=document.documentElement.scrollHeight-document.documentElement.clientHeight,c=t.currentTarget.scrollY;try{e.startTransition(()=>{n(Math.ceil(c/r*100))})}catch{e.startTransition(()=>{n(0)})}},[t]);return e.useEffect(()=>(window.addEventListener("scroll",c),()=>{window.removeEventListener("scroll",c)}),[c]),r};
