import{useMemo as u}from"react";var s="...",l=(n,a)=>{let t=a-n+1;return Array.from({length:t},(r,f)=>f+n)},M=({totalCount:n,pageSize:a,siblingCount:t=1,currentPage:r})=>u(()=>{let e=Math.ceil(n/a);if(t+5>=e)return l(1,e);let h=Math.max(r-t,1),i=Math.min(r+t,e),g=h>2,c=i<e-2,m=1,R=e;if(!g&&c){let o=3+2*t;return[...l(1,o),s,e]}if(g&&!c){let o=3+2*t,d=l(e-o+1,e);return[m,s,...d]}if(g&&c){let o=l(h,i);return[m,s,...o,s,R]}},[n,a,t,r]);export{s as DOTS,M as usePagination};
