import{A as P,B as g,a4 as h,aM as z}from"./index.d8ce26ef.js";function A(){const{logout:o}=P();function r({code:u,message:n,handler:t}){const a=Number(u);a===0?t():a>=100&&a<=140?o():z.error(n)}return r}function N({initalData:o,initalPagination:r,isList:u=!1,success:n}={}){const t=g(o),a=g(!1),s=h(r||{}),d=A(),l=e=>t.value=e,f=e=>a.value=e;function p(){const{pageSize:e,currentPage:c}=s;return{size:e,page:c}}function m(e){return f(!0),e.then(c=>{f(!1);const{code:v,message:H,data:i}=c;d({code:v,message:H,handler:()=>{l(u?i.list:i),s&&(s.total=i.count),n&&n()}})})}return{run:m,data:t,loading:a,pagination:s,setData:l,getPaginationParams:p}}export{N as a,A as u};
