import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,u as g,v as ee,y as _}from"./VDataTable-72LFa1b9.js";import{Cr as v,Gn as y,Kn as b,Qn as x,Qt as S,Un as C,an as w,cn as T,in as E,j as te,jn as ne,rr as D,ur as O,wr as k}from"./index-DUEFNqm3.js";var A=T({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=E()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:d,slots:_}){let{groupBy:T}=r(e),{initialSortOrder:E,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=ee(e),{disableSort:F}=k(e),I=y(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:T,showSelect:v(()=>e.showSelect),showExpand:v(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:E,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:T,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=g(z,T,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:ae,toggleSelect:oe,someSelected:se,allSelected:ce}=u(e,{allItems:z,currentPage:z}),{isExpanded:Z,toggleExpand:le}=h(e),Q=y(()=>U(z.value));m({page:N,itemsPerPage:P,sortBy:A,groupBy:T,search:v(()=>e.search)}),O(`v-data-table`,{toggleSort:B,sortBy:A}),w({VDataTableRows:{hideNoData:v(()=>e.hideNoData),noDataText:v(()=>e.noDataText),loading:v(()=>e.loading),loadingText:v(()=>e.loadingText)}});let $=y(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:se.value,allSelected:ce.value,isSelected:X,select:ie,selectAll:ae,toggleSelect:oe,isExpanded:Z,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));S(()=>{let n=o.filterProps(e),r=i.filterProps(ne(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return x(t,D({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):b(C,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&b(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[x(i,D(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&b(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):x(f,D(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&b(C,null,[x(te,null,null),x(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};