(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D.TedirTable={},D.Vue))})(this,function(D,e){"use strict";function ee(l,a){return{getColumnProperties:e.computed(()=>l.value.map(i=>{if(typeof i=="object"&&"prop"in i||"property"in i)return i.prop||i.property})),getColumnData:i=>{const k=a.value.map(y=>y[i]);return Array.from(new Set(k))}}}function te(l,a,t){const r=e.computed(()=>{let y=[];return a.value.length>1?y=l.value.filter(d=>{for(const n of Object.keys(d)){if(isNaN(d[n])===!1&&Number(d[n])===Number(a.value))return!0;if(typeof d[n]=="string"&&String(d[n]).toLowerCase().includes(String(a.value).toLowerCase()))return!0}return!1}):y=l.value,y}),i=e.computed(()=>{const y={},d=new Set(["",0,null,void 0]);for(const n of Object.keys(t.value))d.has(t.value[n])||(y[n]=t.value[n]);return y}),k=e.computed(()=>{let y=r.value;for(const d of Object.keys(i.value))y=y.filter(n=>{if(d in n){if(isNaN(n[d])===!1&&Number(n[d])===Number(i.value[d]))return!0;if(typeof n[d]=="string"&&String(n[d]).toLowerCase().includes(String(i.value[d]).toLowerCase()))return!0}return!1});return y});return{searchedEntries:r,getCleanFilter:i,filteredEntries:k}}function le(l,a){return{sortedEntries:e.computed(()=>{let r=l.value;return"by"in a.value&&a.value.by!==""&&r.sort((i,k)=>{if(a.value.col in i&&a.value.col in k){if(isNaN(i[a.value.col])===!1&&isNaN(k[a.value.col])===!1)return a.value.by==="asc"?Number(i[a.value.col])-Number(k[a.value.col]):Number(k[a.value.col])-Number(i[a.value.col]);if(typeof i[a.value.col]=="string"&&typeof k[a.value.col]=="string")return a.value.by==="asc"?i[a.value.col].localeCompare(k[a.value.col]):k[a.value.col].localeCompare(i[a.value.col])}}),r})}}function ne(l,a,t,r){const i=e.computed(()=>a.value*t.value-(a.value-1)),k=e.computed(()=>{let p=Math.ceil(l.value.length/a.value);return p<1&&(p=1),p}),y=e.computed(()=>l.value.slice(i.value-1,a.value*t.value)),d=e.computed(()=>{const p=a.value*t.value;return{start:i.value,end:p{let p=[];const b=k.value1)for(let g=$;gNumber(g)>0).filter(g=>Number(g)<=k.value);return L1&&r.value!==0&&E.unshift("..."),E});return{getOffset:i,getPages:k,paginatedEntries:y,getPageInfo:d,getPagination:n,handleEllipsis:(p,b)=>{let S=b,L=Math.floor(Number(b)/2),$=b;return Number(b)%2===0&&($=Number(b)+1),Number(p)<=L?S=$-(Number(p)-1):S=L,S}}}typeof SuppressedError=="function"&&SuppressedError;var ae=function(l,a){a===void 0&&(a=10);var t=Array.isArray(l)?l.length:l,r=Number(t)/Number(a),i=Math.ceil(r);return i},oe=function(l,a,t){a===void 0&&(a=1),t===void 0&&(t=0);var r=[],i=Number(l)1)for(var n=d;n0}),p=w.filter(function(b){return Number(b)<=Number(l)});return y1&&Number(t)!==0&&p.unshift("..."),p};const re={class:"pagination dense"},se={class:"item"},ce={class:"item"},ie={key:0,class:"link"},de={key:1,class:"link"},me=["onClick"],he={class:"item"},ue={class:"item"},ke=e.defineComponent({__name:"PaginationBox",props:{modelValue:null,pages:null,items:null,ellipsis:null},emits:["update:modelValue","handler"],setup(l,{emit:a}){const t=l,r=e.ref((t==null?void 0:t.modelValue)||1);e.watch(()=>t.modelValue,()=>{r.value=t.modelValue});const i=e.computed(()=>{let y=[];if(t!=null&&t.items)y=(t==null?void 0:t.items)||[];else{const d=t.pages,n=(t==null?void 0:t.ellipsis)||2;y=oe(d,r.value,n)}return y}),k=y=>{r.value=y,a("update:modelValue",r.value),a("handler",r.value)};return(y,d)=>(e.openBlock(),e.createElementBlock("nav",null,[e.createElementVNode("ul",re,[e.createElementVNode("li",se,[e.createElementVNode("span",{class:"link",onClick:d[0]||(d[0]=n=>k(1))}," « ")]),e.createElementVNode("li",ce,[e.createElementVNode("span",{class:"link",onClick:d[1]||(d[1]=n=>k(Number(r.value)>1?Number(r.value)-1:1))}," ‹ ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),(n,w)=>(e.openBlock(),e.createElementBlock("li",{key:"item-"+w,class:e.normalizeClass(["item",Number(n)===Number(r.value)?"active":""])},[Number(n)===Number(r.value)?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(n),1)):n==="..."?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(n),1)):(e.openBlock(),e.createElementBlock("span",{key:2,onClick:p=>k(Number(n)),class:"link"},e.toDisplayString(n),9,me))],2))),128)),e.createElementVNode("li",he,[e.createElementVNode("span",{class:"link",onClick:d[2]||(d[2]=n=>k(Number(r.value)k(Number(l.pages)))}," » ")])])]))}}),Rt="",X=(l,a)=>{const t=l.__vccOpts||l;for(const[r,i]of a)t[r]=i;return t},Y=X(ke,[["__scopeId","data-v-3a47d1ad"]]),A=l=>(e.pushScopeId("data-v-4b215064"),l=l(),e.popScopeId(),l),pe={class:"card cardBody dataTable"},fe={class:"dataTableHeader"},ye={class:"group"},ge=A(()=>e.createElementVNode("span",{class:"button groupItem"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"pointerEvents-none bi bi-search",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"})])],-1)),Be=["onKeyup"],Ne={value:""},be=["value"],Ee={class:"tableResponsive"},Ve={class:"table tableList dataTableBody"},_e={key:0,class:"check"},we=["onChange","checked"],$e={key:1},Ce={key:2,class:"dataTableSort"},Se=["onClick"],Te=[A(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-alpha-down tableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.082 5.629 9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),e.createElementVNode("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zM4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"})],-1))],xe=["onClick"],De=[A(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-alpha-up-alt tableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.082 12.629 9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"}),e.createElementVNode("path",{d:"M4.5 13.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})],-1))],Le=["onClick"],Me=[A(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-numeric-up tableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"}),e.createElementVNode("g",{transform:"translate(7 0)"},[e.createElementVNode("path",{d:"M4.5 13.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1))],ve={key:0},Ie={key:0},ze=["onUpdate:modelValue"],Fe=A(()=>e.createElementVNode("option",{value:"",selected:""},null,-1)),He=["value"],Re=["onUpdate:modelValue","onInput"],Ue={key:0},Ae=["colspan"],Pe={key:1,class:"check"},Ke=["value","checked","onChange"],Oe={style:{height:"60px"}},qe=["rowspan","colspan"],Ge={key:0},Je={class:"dataTableFooter"},Qe={class:"dataTableLimit"},We={class:"dataTableSelect"},Xe=[e.createStaticVNode('',6)],Ye={class:"dataTableInfo"},Ze=e.defineComponent({__name:"DataTable",props:{columns:null,filterBy:null,filterDelay:null,sortBy:null,entries:null,footers:null,placeholder:null,translate:null,checks:null,checkprop:null},emits:["checklist","filter","sort"],setup(l,{emit:a}){var q,G,J,f;const t=l,r=e.ref(10),i=e.ref(1),k=e.ref(2),y=e.ref(""),d=e.ref({}),n=e.ref({col:((q=t==null?void 0:t.sortBy)==null?void 0:q[0])||((J=(G=t.columns)==null?void 0:G[0])==null?void 0:J.prop)||"",by:((f=t==null?void 0:t.sortBy)==null?void 0:f[1])||"desc"}),{getColumnProperties:w,getColumnData:p}=ee(e.toRef(t,"columns"),e.toRef(t,"entries")),{filteredEntries:b}=te(e.toRef(t,"entries"),y,d),{sortedEntries:S}=le(b,n),{getOffset:L,getPages:$,paginatedEntries:N,getPagination:E,getPageInfo:g}=ne(S,r,i,k),T=e.ref(null),M=e.ref(!1),V=e.ref([]),Z=c=>{c&&V.value.push(c)},_=e.ref((t==null?void 0:t.checks)||[]);e.watch(()=>t==null?void 0:t.checks,()=>{if(_.value=(t==null?void 0:t.checks)||[],t!=null&&t.checkprop){let c=Number(t.entries.length)_.value.includes(u[t.checkprop])).length)===Number(c)?(T.value&&(T.value.checked=!0),M.value=!0):(T.value&&(T.value.checked=!1),M.value=!1)}});const j=(c,u)=>{c.target.checked===!0?(_.value=N.value.map(B=>B[u]),M.value=!0):(_.value=[],M.value=!1),a("checklist",_.value)},F=c=>{const u=_.value.findIndex(B=>B===c);_.value.splice(u,1)},Q=(c,u,B)=>{c.target.checked===!0&&!_.value.includes(u)?_.value.push(u):F(u);let C=Number(t.entries.length)_.value.includes(x[B])).length)===Number(C)?(T.value&&(T.value.checked=!0),M.value=!0):(T.value&&(T.value.checked=!1),M.value=!1),a("checklist",_.value)},H=e.ref(""),I=e.ref(null),K=e.ref(void 0),R=()=>{clearTimeout(K.value),K.value=setTimeout(()=>{var c;y.value="",d.value={},(c=I.value)!=null&&c.value&&(H.value!==""?d.value[H.value]=I.value.value:y.value=I.value.value,z())},(t==null?void 0:t.filterDelay)||500)},z=()=>{i.value>=$.value&&(i.value=$.value)},v=e.ref({}),O=e.ref(void 0),W=c=>{clearTimeout(O.value),O.value=setTimeout(()=>{var u,B;d.value[c]="",(u=v.value)!=null&&u[c]&&((B=v.value)==null?void 0:B[c])!==""&&(d.value[c]=v.value[c]),a("filter",d.value),z()},(t==null?void 0:t.filterDelay)||1e3)};return(c,u)=>{var B,C,x,s;return e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(c.$slots,"header",{},void 0,!0),e.createElementVNode("div",fe,[e.createElementVNode("div",ye,[ge,e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:I,onInput:R,onKeyup:e.withKeys(R,["enter"]),class:"input groupItem"},null,40,Be),l.filterBy==="search"?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,"onUpdate:modelValue":u[0]||(u[0]=o=>H.value=o),onChange:R,class:"select groupItem dataTableSearchBy"},[e.createElementVNode("option",Ne,e.toDisplayString(((B=l.translate)==null?void 0:B.all)||"All"),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(o,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[o!=null&&o.filter?(e.openBlock(),e.createElementBlock("option",{key:0,value:o.prop},e.toDisplayString(o.text),9,be)):e.createCommentVNode("",!0)],64))),128))],544)),[[e.vModelSelect,H.value]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.renderSlot(c.$slots,"default",{},void 0,!0)])]),e.createElementVNode("div",Ee,[e.createElementVNode("table",Ve,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(o,m)=>(e.openBlock(),e.createElementBlock("th",{key:"col-"+m,style:e.normalizeStyle({"text-align":o==null?void 0:o.align,width:o==null?void 0:o.width})},[o.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("input",{type:"checkbox",ref_for:!0,ref_key:"checkedAll",ref:T,class:"checkInput",onChange:h=>j(h,o.prop),checked:M.value},null,40,we)])):o.sort===!1?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(o.text),1)):(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("span",null,e.toDisplayString(o.text),1),n.value.col===o.prop&&n.value.by==="asc"?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:h=>{n.value.col=o.prop,n.value.by="desc",a("sort",n.value)}},Te,8,Se)):n.value.col===o.prop&&n.value.by==="desc"?(e.openBlock(),e.createElementBlock("span",{key:1,onClick:h=>{n.value.col=o.prop,n.value.by="asc",a("sort",n.value)}},De,8,xe)):(e.openBlock(),e.createElementBlock("span",{key:2,onClick:h=>{n.value.col=o.prop,n.value.by="asc",a("sort",n.value)}},Me,8,Le))]))],4))),128))]),l.filterBy==="column"||l.filterBy==="filter"?(e.openBlock(),e.createElementBlock("tr",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(o,m)=>(e.openBlock(),e.createElementBlock("th",{key:"filter-"+m},[o.filter===!0&&"prop"in o?(e.openBlock(),e.createElementBlock("div",Ie,[o.filterType==="select"?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,class:"select","onUpdate:modelValue":h=>d.value[o.prop]=h,onChange:u[1]||(u[1]=h=>{a("filter",d.value),z()})},[Fe,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p)(o.prop),(h,U)=>(e.openBlock(),e.createElementBlock("option",{key:U,value:h},e.toDisplayString(h),9,He))),128))],40,ze)),[[e.vModelSelect,d.value[o.prop]]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,type:"text","onUpdate:modelValue":h=>v.value[o.prop]=h,class:"input",onInput:h=>W(o.prop)},null,40,Re)),[[e.vModelText,v.value[o.prop]]])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("tbody",{style:e.normalizeStyle({height:(e.unref(N).length<=4?240:Number(e.unref(N).length)*60)+"px"})},[Number(e.unref(N).length)===0?(e.openBlock(),e.createElementBlock("tr",Ue,[e.createElementVNode("td",{colspan:l.columns.length,class:"dataTableEmpty"},e.toDisplayString(l.placeholder||"The data on this page is not yet available."),9,Ae)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(o,m)=>(e.openBlock(),e.createElementBlock("tr",{key:"entry-"+m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(h,U)=>(e.openBlock(),e.createElementBlock("td",{key:"col-"+U,style:e.normalizeStyle({"text-align":h==null?void 0:h.align,width:h==null?void 0:h.width})},[h.type==="slot"?e.renderSlot(c.$slots,h.prop,{key:0,entry:o,index:m},void 0,!0):h.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",ref_for:!0,ref:Z,value:o[h.prop],checked:_.value.includes(o[h.prop]),onChange:Ht=>Q(Ht,o[h.prop],h.prop)},null,40,Ke)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(o[h.prop]),1)],64))],4))),128))]))),128)),Number(l.entries.length)>=1&&Number(l.entries.length)<=3?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(4-Number(l.entries.length),o=>(e.openBlock(),e.createElementBlock("tr",Oe,[o===1?(e.openBlock(),e.createElementBlock("td",{key:0,rowspan:4-Number(l.entries.length),colspan:l.columns.length},null,8,qe)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0)],4),l.footers&&Array.isArray(l.footers[0])?(e.openBlock(),e.createElementBlock("tfoot",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.footers,(o,m)=>(e.openBlock(),e.createElementBlock("tr",{key:"row-"+m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(h,U)=>(e.openBlock(),e.createElementBlock("th",{key:"foot-"+U},[h.type==="slot"?e.renderSlot(c.$slots,"default",{key:0,value:h.value,options:h.options},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(h.text),1)],64))]))),128))]))),128))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Je,[e.createElementVNode("div",Qe,[e.createElementVNode("div",We,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[2]||(u[2]=o=>r.value=o),class:"select",onChange:u[3]||(u[3]=o=>{z()})},Xe,544),[[e.vModelSelect,r.value]])]),e.createElementVNode("div",Ye,e.toDisplayString(((C=l.translate)==null?void 0:C.from)||"from")+" "+e.toDisplayString(e.unref(g).start)+" "+e.toDisplayString(((x=l.translate)==null?void 0:x.to)||"to")+" "+e.toDisplayString(e.unref(g).end)+" "+e.toDisplayString(((s=l.translate)==null?void 0:s.of)||"of")+" "+e.toDisplayString(e.unref(g).length),1)]),e.createVNode(Y,{modelValue:i.value,"onUpdate:modelValue":u[4]||(u[4]=o=>i.value=o),pages:e.unref($),items:e.unref(E)},null,8,["modelValue","pages","items"])]),e.renderSlot(c.$slots,"footer",{},void 0,!0)])}}}),Ot="",je=X(Ze,[["__scopeId","data-v-4b215064"]]),P=l=>(e.pushScopeId("data-v-42a51e72"),l=l(),e.popScopeId(),l),et={class:"card cardBody dataTable"},tt={class:"dataTableHeader"},lt={class:"group"},nt=[P(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"dataTableEvent bi bi-search",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"})],-1))],at=["onKeyup"],ot={value:""},rt=["value"],st={class:"tableResponsive"},ct={class:"table tableList dataTableBody"},it={key:0,class:"check"},dt=["onClick","checked"],mt={key:1},ht={key:2,class:"dataTableSort"},ut=["onClick"],kt=[P(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-alpha-down dataTableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.082 5.629 9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z"}),e.createElementVNode("path",{d:"M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zM4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"})],-1))],pt=["onClick"],ft=[P(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-alpha-up-alt dataTableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V7z"}),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10.082 12.629 9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371h-1.781zm1.57-.785L11 9.688h-.047l-.652 2.156h1.351z"}),e.createElementVNode("path",{d:"M4.5 13.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})],-1))],yt=["onClick"],gt=[P(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-sort-numeric-up dataTableEvent",viewBox:"0 0 16 16"},[e.createElementVNode("path",{d:"M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z"}),e.createElementVNode("g",{transform:"translate(7 0)"},[e.createElementVNode("path",{d:"M4.5 13.5a.5.5 0 0 1-1 0V3.707L2.354 4.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.498.498 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L4.5 3.707V13.5z"})])],-1))],Bt={key:0},Nt={key:0},bt=["onUpdate:modelValue"],Et=P(()=>e.createElementVNode("option",{value:"",selected:""},null,-1)),Vt=["value"],_t=["onUpdate:modelValue","onInput"],wt={key:0},$t=["colspan"],Ct={key:1,class:"check"},St=["value","checked","onClick"],Tt={style:{height:"60px"}},xt=["rowspan","colspan"],Dt={key:0},Lt={class:"dataTableFooter"},Mt={class:"dataTableLimit"},vt={class:"dataTableSelect"},It=[e.createStaticVNode('',6)],zt=e.defineComponent({__name:"ServerTable",props:{modelValue:null,columns:null,entries:null,select:null,filterBy:null,filterDelay:null,footers:null,placeholder:null,translate:null,checks:null,checkprop:null},emits:["update:modelValue","checklist","handler"],setup(l,{emit:a}){var I,K,R,z,v,O,W,q,G,J;const t=l,r=e.ref((t==null?void 0:t.columns)||[]);e.watch(()=>t==null?void 0:t.columns,()=>{r.value=t.columns});const i=e.ref(((I=t.modelValue)==null?void 0:I.limit)||10),k=e.ref(((K=t.modelValue)==null?void 0:K.page)||1);e.ref(((R=t.modelValue)==null?void 0:R.ellipsis)||2);const y=e.ref(((z=t.modelValue)==null?void 0:z.search)||""),d=e.ref(((v=t.modelValue)==null?void 0:v.searchBy)||""),n=e.ref(null),w=e.ref(((O=t.modelValue)==null?void 0:O.filter)||{}),p=e.ref({col:((W=t.modelValue)==null?void 0:W.sort)||((G=(q=t.columns)==null?void 0:q[0])==null?void 0:G.prop)||"",by:((J=t.modelValue)==null?void 0:J.sortBy)||""});e.watch(()=>t.modelValue,()=>{var f,c,u,B,C,x;p.value={col:((f=t.modelValue)==null?void 0:f.sort)||((u=(c=t.columns)==null?void 0:c[0])==null?void 0:u.prop)||"",by:((B=t.modelValue)==null?void 0:B.sortBy)||""},y.value=((C=t.modelValue)==null?void 0:C.search)||"",d.value=((x=t.modelValue)==null?void 0:x.searchBy)||"",n.value!==null&&(n.value.value=y.value)}),e.onMounted(()=>{var f;n.value!==null&&(n.value.value=((f=t.modelValue)==null?void 0:f.search)||"")});const b=e.computed(()=>Number(i.value)*Number(k.value)-Number(i.value)),S=e.computed(()=>{var f;return ae((f=t.modelValue)==null?void 0:f.total,i.value)}),L=e.ref(void 0),$=()=>{clearTimeout(L.value),L.value=setTimeout(()=>{var f,c;y.value="",w.value={},n.value&&(d.value!==""?w.value[d.value]=((f=n.value)==null?void 0:f.value)||"":y.value=((c=n.value)==null?void 0:c.value)||"",F(),N())},(t==null?void 0:t.filterDelay)||1e3)},N=()=>{var c,u,B,C;const f={limit:i.value,page:k.value,offset:b.value,search:y.value,searchBy:d.value,filter:w.value,sort:p.value.col,sortBy:p.value.by,total:(c=t.modelValue)==null?void 0:c.total,length:(u=t.modelValue)==null?void 0:u.length,from:(B=t.modelValue)==null?void 0:B.from,to:(C=t.modelValue)==null?void 0:C.to};a("update:modelValue",f),a("handler",f)},E=e.ref(null),g=e.ref(!1),T=e.ref([]),M=f=>{f&&T.value.push(f)},V=e.ref((t==null?void 0:t.checks)||[]);e.watch(()=>t==null?void 0:t.checks,()=>{if(V.value=(t==null?void 0:t.checks)||[],t.entries&&(t!=null&&t.checkprop)){let f=Number(t.entries.length)V.value.includes(c[t.checkprop])).length)===Number(f)?(E.value&&(E.value.checked=!0),g.value=!0):(E.value&&(E.value.checked=!1),g.value=!1)}});const Z=(f,c)=>{f.target.checked===!0?(V.value=t.entries.map(u=>u[c]),g.value=!0):(V.value=[],g.value=!1),N(),a("checklist",V.value)},_=f=>{let c=Number(t.entries.length)V.value.includes(u[f])).length)===Number(c)?(E.value&&(E.value.checked=!0),g.value=!0):(E.value&&(E.value.checked=!1),g.value=!1),a("checklist",V.value)},j=f=>{const c=V.value.findIndex(u=>u===f);V.value.splice(c,1)},F=()=>{k.value=1},Q=e.ref(void 0),H=f=>{clearTimeout(Q.value),Q.value=setTimeout(()=>{F(),N()},(t==null?void 0:t.filterDelay)||1e3)};return(f,c)=>{var u,B,C,x;return e.openBlock(),e.createElementBlock("div",et,[e.renderSlot(f.$slots,"header",{},void 0,!0),e.createElementVNode("div",tt,[e.createElementVNode("div",lt,[e.createElementVNode("span",{class:"button groupItem",onClick:$},nt),e.createElementVNode("input",{type:"search",ref_key:"searchRef",ref:n,onKeyup:e.withKeys($,["enter"]),class:"input groupItem"},null,40,at),l.filterBy==="search"?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,"onUpdate:modelValue":c[0]||(c[0]=s=>d.value=s),onChange:$,class:"select groupItem dataTableSearchBy"},[e.createElementVNode("option",ot,e.toDisplayString(((u=l.translate)==null?void 0:u.all)||"All"),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[s!=null&&s.filter?(e.openBlock(),e.createElementBlock("option",{key:0,value:s.prop},e.toDisplayString(s.text),9,rt)):e.createCommentVNode("",!0)],64))),128))],544)),[[e.vModelSelect,d.value]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.renderSlot(f.$slots,"default",{},void 0,!0)])]),e.createElementVNode("div",st,[e.createElementVNode("table",ct,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,o)=>(e.openBlock(),e.createElementBlock("th",{key:"col-"+o,style:e.normalizeStyle({"text-align":s==null?void 0:s.align,width:s==null?void 0:s.width})},[s.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("input",{type:"checkbox",ref_for:!0,ref_key:"checkedAll",ref:E,class:"checkInput",onClick:e.withModifiers(m=>Z(m,s.prop),["self"]),checked:g.value},null,8,dt)])):s.sort===!1?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(s.text),1)):(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("span",null,e.toDisplayString(s.text),1),p.value.col===s.prop&&p.value.by==="asc"?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:e.withModifiers(m=>{p.value.col=s.prop,p.value.by="desc",N()},["self"])},kt,8,ut)):p.value.col===s.prop&&p.value.by==="desc"?(e.openBlock(),e.createElementBlock("span",{key:1,onClick:e.withModifiers(m=>{p.value.col=s.prop,p.value.by="",N()},["self"])},ft,8,pt)):(e.openBlock(),e.createElementBlock("span",{key:2,onClick:e.withModifiers(m=>{p.value.col=s.prop,p.value.by="asc",N()},["self"])},gt,8,yt))]))],4))),128))]),l.filterBy==="column"||l.filterBy==="filter"?(e.openBlock(),e.createElementBlock("tr",Bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,o)=>(e.openBlock(),e.createElementBlock("th",{key:"filter-"+o},[s.filter===!0&&"prop"in s?(e.openBlock(),e.createElementBlock("div",Nt,[s.filterType==="select"?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,class:"select","onUpdate:modelValue":m=>w.value[s.prop]=m,onChange:c[1]||(c[1]=m=>{F(),N()})},[Et,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.select[s.prop]||[],(m,h)=>(e.openBlock(),e.createElementBlock("option",{key:h,value:m},e.toDisplayString(m),9,Vt))),128))],40,bt)),[[e.vModelSelect,w.value[s.prop]]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,type:"text","onUpdate:modelValue":m=>w.value[s.prop]=m,class:"input",onInput:m=>H(s.prop)},null,40,_t)),[[e.vModelText,w.value[s.prop]]])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("tbody",{style:e.normalizeStyle({height:(l.entries.length<=4?240:Number(l.entries.length)*60)+"px"})},[Number(l.entries.length)===0?(e.openBlock(),e.createElementBlock("tr",wt,[e.createElementVNode("td",{colspan:r.value.length,class:"dataTableEmpty"},e.toDisplayString(l.placeholder||"The data on this page is not yet available."),9,$t)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.entries,(s,o)=>(e.openBlock(),e.createElementBlock("tr",{key:"entry-"+o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(m,h)=>(e.openBlock(),e.createElementBlock("td",{key:"col-"+h,style:e.normalizeStyle({"text-align":m==null?void 0:m.align,width:m==null?void 0:m.width})},[m.type==="slot"?e.renderSlot(f.$slots,m.prop,{key:0,entry:s,index:o},void 0,!0):m.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("input",{type:"checkbox",class:"checkInput",ref_for:!0,ref:M,value:s[m.prop],checked:V.value.includes(s[m.prop]),onClick:e.withModifiers(U=>{V.value.includes(s[m.prop])?j(s[m.prop]):V.value.push(s[m.prop]),_(m.prop)},["self"])},null,8,St)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(s[m.prop]),1)],64))],4))),128))]))),128)),Number(l.entries.length)>=1&&Number(l.entries.length)<=3?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(4-Number(l.entries.length),s=>(e.openBlock(),e.createElementBlock("tr",Tt,[s===1?(e.openBlock(),e.createElementBlock("td",{key:0,rowspan:4-Number(l.entries.length),colspan:r.value.length},null,8,xt)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0)],4),l.footers&&Array.isArray(l.footers[0])?(e.openBlock(),e.createElementBlock("tfoot",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.footers,(s,o)=>(e.openBlock(),e.createElementBlock("tr",{key:"row-"+o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(m,h)=>(e.openBlock(),e.createElementBlock("th",{key:"foot-"+h},[m.type==="slot"?e.renderSlot(f.$slots,"default",{key:0,value:m.value,options:m.options},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(m.text),1)],64))]))),128))]))),128))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Lt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",vt,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":c[2]||(c[2]=s=>i.value=s),onChange:c[3]||(c[3]=s=>{F(),N()}),class:"select"},It,544),[[e.vModelSelect,i.value]])]),e.withDirectives(e.createElementVNode("div",{class:"dataTableInfo"},e.toDisplayString(((B=l.translate)==null?void 0:B.from)||"from")+" "+e.toDisplayString(l.modelValue.from)+" "+e.toDisplayString(((C=l.translate)==null?void 0:C.to)||"to")+" "+e.toDisplayString(Number(l.modelValue.length)<=Number(l.modelValue.to)?l.modelValue.length:l.modelValue.to)+" "+e.toDisplayString(((x=l.translate)==null?void 0:x.of)||"of")+" "+e.toDisplayString(l.modelValue.length),513),[[e.vShow,l.modelValue.length>0]])]),e.createVNode(Y,{modelValue:k.value,"onUpdate:modelValue":c[4]||(c[4]=s=>k.value=s),pages:e.unref(S),onHandler:N},null,8,["modelValue","pages"])]),e.renderSlot(f.$slots,"footer",{},void 0,!0)])}}}),Xt="",Ft=X(zt,[["__scopeId","data-v-42a51e72"]]);D.DataTable=je,D.PaginationBox=Y,D.ServerTable=Ft,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});