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 ee,s as m,u as h,v as g,y as _}from"./VDataTable-C4LlmRzd.js";import{Jn as v,Kn as y,Or as b,Pn as te,Yn as x,cn as S,dn as C,j as w,kr as T,or as E,pr as ne,sn as D,tn as O,tr as k}from"./index-C2Rf-Lfy.js";var A=C({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=D()({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:C}=r(e),{initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=T(e),I=v(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:C,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:D,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:C,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,C,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=v(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:C,search:b(()=>e.search)}),ne(`v-data-table`,{toggleSort:B,sortBy:A}),S({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=v(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,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}));O(()=>{let n=o.filterProps(e),r=i.filterProps(te(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return k(t,E({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):x(y,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&x(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[k(i,E(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&x(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):k(f,E(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&x(y,null,[k(w,null,null),k(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};