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