var e=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`];function t(t,n=1){let r=0;for(;Number.parseInt(t,10)>=1024&&r<e.length-1;)t/=1024,++r;return`${t.toFixed(n)}${e[r]}`}function n(e,t,n){return n<=t?t:Math.min(n,Math.max(t,e))}function r(e,t,n){if(n<=t)return t;let r=n-t+1,i=t+(e-t)%r;return i<t&&(i=r+i),i===0?0:i}function i(e,t=2,n=`0`){return e==null?e:String(e).padStart(t,n)}export{i,t as n,r,n as t};