import{d as Ue,A as Xe,bt as Ke,j as ze,v as ve,z as We,au as Ye,m as D,aH as Je,ao as Qe,ap as Ze,aq as et,g as ee,at as Me,aI as E,bX as tt,c as le,o as $,w as nt,b as k,E as x,e as P,l as W,ag as B,n as Ie,t as Oe,F as N,r as U,ah as se,G as ue,a as ot,ai as it}from"./Dk4AzF7j.js";import{u as rt}from"./88opOQSr.js";/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function T(e,o){return typeof e=="function"?e(o):e}function z(e,o){return t=>{o.setState(n=>({...n,[e]:T(t,n[e])}))}}function re(e){return e instanceof Function}function lt(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function st(e,o){const t=[],n=i=>{i.forEach(r=>{t.push(r);const l=o(r);l!=null&&l.length&&n(l)})};return n(e),t}function v(e,o,t){let n=[],i;return r=>{let l;t.key&&t.debug&&(l=Date.now());const u=e(r);if(!(u.length!==n.length||u.some((c,m)=>n[m]!==c)))return i;n=u;let g;if(t.key&&t.debug&&(g=Date.now()),i=o(...u),t==null||t.onChange==null||t.onChange(i),t.key&&t.debug&&t!=null&&t.debug()){const c=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-g)*100)/100,d=m/16,s=(f,p)=>{for(f=String(f);f.length<p;)f=" "+f;return f};console.info(`%c⏱ ${s(m,5)} /${s(c,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,t?.key)}return i}}function w(e,o,t,n){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[o]},key:!1,onChange:n}}function ut(e,o,t,n){const i=()=>{var l;return(l=r.getValue())!=null?l:e.options.renderFallbackValue},r={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:i,getContext:v(()=>[e,t,o,r],(l,u,a,g)=>({table:l,column:u,row:a,cell:g,getValue:g.getValue,renderValue:g.renderValue}),w(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(r,t,o,e)},{}),r}function at(e,o,t,n){var i,r;const u={...e._getDefaultColumnDef(),...o},a=u.accessorKey;let g=(i=(r=u.id)!=null?r:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,c;if(u.accessorFn?c=u.accessorFn:a&&(a.includes(".")?c=d=>{let s=d;for(const p of a.split(".")){var f;s=(f=s)==null?void 0:f[p]}return s}:c=d=>d[u.accessorKey]),!g)throw new Error;let m={id:`${String(g)}`,accessorFn:c,parent:n,depth:t,columnDef:u,columns:[],getFlatColumns:v(()=>[!0],()=>{var d;return[m,...(d=m.columns)==null?void 0:d.flatMap(s=>s.getFlatColumns())]},w(e.options,"debugColumns")),getLeafColumns:v(()=>[e._getOrderColumnsFn()],d=>{var s;if((s=m.columns)!=null&&s.length){let f=m.columns.flatMap(p=>p.getLeafColumns());return d(f)}return[m]},w(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(m,e);return m}const I="debugHeaders";function De(e,o,t){var n;let r={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(u),l.push(a)};return u(r),l},getContext:()=>({table:e,header:r,column:o})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(r,e)}),r}const gt={createTable:e=>{e.getHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>{var r,l;const u=(r=n?.map(m=>t.find(d=>d.id===m)).filter(Boolean))!=null?r:[],a=(l=i?.map(m=>t.find(d=>d.id===m)).filter(Boolean))!=null?l:[],g=t.filter(m=>!(n!=null&&n.includes(m.id))&&!(i!=null&&i.includes(m.id)));return te(o,[...u,...g,...a],e)},w(e.options,I)),e.getCenterHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>(t=t.filter(r=>!(n!=null&&n.includes(r.id))&&!(i!=null&&i.includes(r.id))),te(o,t,e,"center")),w(e.options,I)),e.getLeftHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var i;const r=(i=n?.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?i:[];return te(o,r,e,"left")},w(e.options,I)),e.getRightHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var i;const r=(i=n?.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?i:[];return te(o,r,e,"right")},w(e.options,I)),e.getFooterGroups=v(()=>[e.getHeaderGroups()],o=>[...o].reverse(),w(e.options,I)),e.getLeftFooterGroups=v(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),w(e.options,I)),e.getCenterFooterGroups=v(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),w(e.options,I)),e.getRightFooterGroups=v(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),w(e.options,I)),e.getFlatHeaders=v(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),w(e.options,I)),e.getLeftFlatHeaders=v(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),w(e.options,I)),e.getCenterFlatHeaders=v(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),w(e.options,I)),e.getRightFlatHeaders=v(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),w(e.options,I)),e.getCenterLeafHeaders=v(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),w(e.options,I)),e.getLeftLeafHeaders=v(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),w(e.options,I)),e.getRightLeafHeaders=v(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),w(e.options,I)),e.getLeafHeaders=v(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var i,r,l,u,a,g;return[...(i=(r=o[0])==null?void 0:r.headers)!=null?i:[],...(l=(u=t[0])==null?void 0:u.headers)!=null?l:[],...(a=(g=n[0])==null?void 0:g.headers)!=null?a:[]].map(c=>c.getLeafHeaders()).flat()},w(e.options,I))}};function te(e,o,t,n){var i,r;let l=0;const u=function(d,s){s===void 0&&(s=1),l=Math.max(l,s),d.filter(f=>f.getIsVisible()).forEach(f=>{var p;(p=f.columns)!=null&&p.length&&u(f.columns,s+1)},0)};u(e);let a=[];const g=(d,s)=>{const f={depth:s,id:[n,`${s}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(R=>{const h=[...p].reverse()[0],_=R.column.depth===f.depth;let y,A=!1;if(_&&R.column.parent?y=R.column.parent:(y=R.column,A=!0),h&&h?.column===y)h.subHeaders.push(R);else{const V=De(t,y,{id:[n,s,y.id,R?.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${p.filter(L=>L.column===y).length}`:void 0,depth:s,index:p.length});V.subHeaders.push(R),p.push(V)}f.headers.push(R),R.headerGroup=f}),a.push(f),s>0&&g(p,s-1)},c=o.map((d,s)=>De(t,d,{depth:l,index:s}));g(c,l-1),a.reverse();const m=d=>d.filter(f=>f.column.getIsVisible()).map(f=>{let p=0,R=0,h=[0];f.subHeaders&&f.subHeaders.length?(h=[],m(f.subHeaders).forEach(y=>{let{colSpan:A,rowSpan:V}=y;p+=A,h.push(V)})):p=1;const _=Math.min(...h);return R=R+_,f.colSpan=p,f.rowSpan=R,{colSpan:p,rowSpan:R}});return m((i=(r=a[0])==null?void 0:r.headers)!=null?i:[]),a}const ye=(e,o,t,n,i,r,l)=>{let u={id:o,index:n,original:t,depth:i,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(u._valuesCache.hasOwnProperty(a))return u._valuesCache[a];const g=e.getColumn(a);if(g!=null&&g.accessorFn)return u._valuesCache[a]=g.accessorFn(u.original,n),u._valuesCache[a]},getUniqueValues:a=>{if(u._uniqueValuesCache.hasOwnProperty(a))return u._uniqueValuesCache[a];const g=e.getColumn(a);if(g!=null&&g.accessorFn)return g.columnDef.getUniqueValues?(u._uniqueValuesCache[a]=g.columnDef.getUniqueValues(u.original,n),u._uniqueValuesCache[a]):(u._uniqueValuesCache[a]=[u.getValue(a)],u._uniqueValuesCache[a])},renderValue:a=>{var g;return(g=u.getValue(a))!=null?g:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>st(u.subRows,a=>a.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let a=[],g=u;for(;;){const c=g.getParentRow();if(!c)break;a.push(c),g=c}return a.reverse()},getAllCells:v(()=>[e.getAllLeafColumns()],a=>a.map(g=>ut(e,u,g,g.id)),w(e.options,"debugRows")),_getAllCellsByColumnId:v(()=>[u.getAllCells()],a=>a.reduce((g,c)=>(g[c.column.id]=c,g),{}),w(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const g=e._features[a];g==null||g.createRow==null||g.createRow(u,e)}return u},dt={createColumn:(e,o)=>{e._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():o.getPreFilteredRowModel(),e._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},He=(e,o,t)=>{var n,i;const r=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((i=e.getValue(o))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(r))};He.autoRemove=e=>G(e);const Ge=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};Ge.autoRemove=e=>G(e);const Le=(e,o,t)=>{var n;return((n=e.getValue(o))==null||(n=n.toString())==null?void 0:n.toLowerCase())===t?.toLowerCase()};Le.autoRemove=e=>G(e);const qe=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};qe.autoRemove=e=>G(e);const ke=(e,o,t)=>!t.some(n=>{var i;return!((i=e.getValue(o))!=null&&i.includes(n))});ke.autoRemove=e=>G(e)||!(e!=null&&e.length);const Be=(e,o,t)=>t.some(n=>{var i;return(i=e.getValue(o))==null?void 0:i.includes(n)});Be.autoRemove=e=>G(e)||!(e!=null&&e.length);const je=(e,o,t)=>e.getValue(o)===t;je.autoRemove=e=>G(e);const Te=(e,o,t)=>e.getValue(o)==t;Te.autoRemove=e=>G(e);const $e=(e,o,t)=>{let[n,i]=t;const r=e.getValue(o);return r>=n&&r<=i};$e.resolveFilterValue=e=>{let[o,t]=e,n=typeof o!="number"?parseFloat(o):o,i=typeof t!="number"?parseFloat(t):t,r=o===null||Number.isNaN(n)?-1/0:n,l=t===null||Number.isNaN(i)?1/0:i;if(r>l){const u=r;r=l,l=u}return[r,l]};$e.autoRemove=e=>G(e)||G(e[0])&&G(e[1]);const j={includesString:He,includesStringSensitive:Ge,equalsString:Le,arrIncludes:qe,arrIncludesAll:ke,arrIncludesSome:Be,equals:je,weakEquals:Te,inNumberRange:$e};function G(e){return e==null||e===""}const ct={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:z("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);return typeof n=="string"?j.includesString:typeof n=="number"?j.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?j.equals:Array.isArray(n)?j.arrIncludes:j.weakEquals},e.getFilterFn=()=>{var t,n;return re(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=o.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:j[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,i;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=o.options.enableColumnFilters)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=o.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=o.getState().columnFilters)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.setFilterValue=t=>{o.setColumnFilters(n=>{const i=e.getFilterFn(),r=n?.find(c=>c.id===e.id),l=T(t,r?r.value:void 0);if(Ae(i,l,e)){var u;return(u=n?.filter(c=>c.id!==e.id))!=null?u:[]}const a={id:e.id,value:l};if(r){var g;return(g=n?.map(c=>c.id===e.id?a:c))!=null?g:[]}return n!=null&&n.length?[...n,a]:[a]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=i=>{var r;return(r=T(o,i))==null?void 0:r.filter(l=>{const u=t.find(a=>a.id===l.id);if(u){const a=u.getFilterFn();if(Ae(a,l.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=o=>{var t,n;e.setColumnFilters(o?[]:(t=(n=e.initialState)==null?void 0:n.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ae(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const ft=(e,o,t)=>t.reduce((n,i)=>{const r=i.getValue(e);return n+(typeof r=="number"?r:0)},0),pt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}),n},mt=(e,o,t)=>{let n;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}),n},St=(e,o,t)=>{let n,i;return t.forEach(r=>{const l=r.getValue(e);l!=null&&(n===void 0?l>=l&&(n=i=l):(n>l&&(n=l),i<l&&(i=l)))}),[n,i]},Ct=(e,o)=>{let t=0,n=0;if(o.forEach(i=>{let r=i.getValue(e);r!=null&&(r=+r)>=r&&(++t,n+=r)}),t)return n/t},vt=(e,o)=>{if(!o.length)return;const t=o.map(r=>r.getValue(e));if(!lt(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),i=t.sort((r,l)=>r-l);return t.length%2!==0?i[n]:(i[n-1]+i[n])/2},wt=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),Rt=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,ht=(e,o)=>o.length,ae={sum:ft,min:pt,max:mt,extent:St,mean:Ct,median:vt,unique:wt,uniqueCount:Rt,count:ht},Ft={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:z("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);if(typeof n=="number")return ae.sum;if(Object.prototype.toString.call(n)==="[object Date]")return ae.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return re(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=o.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:ae[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=o=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(o),e.resetGrouping=o=>{var t,n;e.setGrouping(o?[]:(t=(n=e.initialState)==null?void 0:n.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,o)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=o.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,o,t,n)=>{e.getIsGrouped=()=>o.getIsGrouped()&&o.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&o.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=t.subRows)!=null&&i.length)}}};function _t(e,o,t){if(!(o!=null&&o.length)||!t)return e;const n=e.filter(r=>!o.includes(r.id));return t==="remove"?n:[...o.map(r=>e.find(l=>l.id===r)).filter(Boolean),...n]}const yt={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:z("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=v(t=>[Q(o,t)],t=>t.findIndex(n=>n.id===e.id),w(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=Q(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const i=Q(o,t);return((n=i[i.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=o=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(o),e.resetColumnOrder=o=>{var t;e.setColumnOrder(o?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=v(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>i=>{let r=[];if(!(o!=null&&o.length))r=i;else{const l=[...o],u=[...i];for(;u.length&&l.length;){const a=l.shift(),g=u.findIndex(c=>c.id===a);g>-1&&r.push(u.splice(g,1)[0])}r=[...r,...u]}return _t(r,t,n)},w(e.options,"debugTable"))}},ge=()=>({left:[],right:[]}),$t={getInitialState:e=>({columnPinning:ge(),...e}),getDefaultOptions:e=>({onColumnPinningChange:z("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(i=>i.id).filter(Boolean);o.setColumnPinning(i=>{var r,l;if(t==="right"){var u,a;return{left:((u=i?.left)!=null?u:[]).filter(m=>!(n!=null&&n.includes(m))),right:[...((a=i?.right)!=null?a:[]).filter(m=>!(n!=null&&n.includes(m))),...n]}}if(t==="left"){var g,c;return{left:[...((g=i?.left)!=null?g:[]).filter(m=>!(n!=null&&n.includes(m))),...n],right:((c=i?.right)!=null?c:[]).filter(m=>!(n!=null&&n.includes(m)))}}return{left:((r=i?.left)!=null?r:[]).filter(m=>!(n!=null&&n.includes(m))),right:((l=i?.right)!=null?l:[]).filter(m=>!(n!=null&&n.includes(m)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var i,r,l;return((i=n.columnDef.enablePinning)!=null?i:!0)&&((r=(l=o.options.enableColumnPinning)!=null?l:o.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(u=>u.id),{left:n,right:i}=o.getState().columnPinning,r=t.some(u=>n?.includes(u)),l=t.some(u=>i?.includes(u));return r?"left":l?"right":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();return i?(t=(n=o.getState().columnPinning)==null||(n=n[i])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,o)=>{e.getCenterVisibleCells=v(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,i)=>{const r=[...n??[],...i??[]];return t.filter(l=>!r.includes(l.column.id))},w(o.options,"debugRows")),e.getLeftVisibleCells=v(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(l=>l.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),w(o.options,"debugRows")),e.getRightVisibleCells=v(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(l=>l.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),w(o.options,"debugRows"))},createTable:e=>{e.setColumnPinning=o=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(o),e.resetColumnPinning=o=>{var t,n;return e.setColumnPinning(o?ge():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:ge())},e.getIsSomeColumnsPinned=o=>{var t;const n=e.getState().columnPinning;if(!o){var i,r;return!!((i=n.left)!=null&&i.length||(r=n.right)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e.getLeftLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),w(e.options,"debugColumns")),e.getRightLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),w(e.options,"debugColumns")),e.getCenterLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n)=>{const i=[...t??[],...n??[]];return o.filter(r=>!i.includes(r.id))},w(e.options,"debugColumns"))}};function xt(e){return e||(typeof document<"u"?document:null)}const ne={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},de=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Pt={getDefaultColumnDef:()=>ne,getInitialState:e=>({columnSizing:{},columnSizingInfo:de(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:z("columnSizing",e),onColumnSizingInfoChange:z("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,i;const r=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:ne.minSize,(n=r??e.columnDef.size)!=null?n:ne.size),(i=e.columnDef.maxSize)!=null?i:ne.maxSize)},e.getStart=v(t=>[t,Q(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((i,r)=>i+r.getSize(),0),w(o.options,"debugColumns")),e.getAfter=v(t=>[t,Q(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((i,r)=>i+r.getSize(),0),w(o.options,"debugColumns")),e.resetSize=()=>{o.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=o.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,o)=>{e.getSize=()=>{let t=0;const n=i=>{if(i.subHeaders.length)i.subHeaders.forEach(n);else{var r;t+=(r=i.column.getSize())!=null?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const n=o.getColumn(e.column.id),i=n?.getCanResize();return r=>{if(!n||!i||(r.persist==null||r.persist(),ce(r)&&r.touches&&r.touches.length>1))return;const l=e.getSize(),u=e?e.getLeafHeaders().map(h=>[h.column.id,h.column.getSize()]):[[n.id,n.getSize()]],a=ce(r)?Math.round(r.touches[0].clientX):r.clientX,g={},c=(h,_)=>{typeof _=="number"&&(o.setColumnSizingInfo(y=>{var A,V;const L=o.options.columnResizeDirection==="rtl"?-1:1,X=(_-((A=y?.startOffset)!=null?A:0))*L,K=Math.max(X/((V=y?.startSize)!=null?V:0),-.999999);return y.columnSizingStart.forEach(H=>{let[O,Z]=H;g[O]=Math.round(Math.max(Z+Z*K,0)*100)/100}),{...y,deltaOffset:X,deltaPercentage:K}}),(o.options.columnResizeMode==="onChange"||h==="end")&&o.setColumnSizing(y=>({...y,...g})))},m=h=>c("move",h),d=h=>{c("end",h),o.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},s=xt(t),f={moveHandler:h=>m(h.clientX),upHandler:h=>{s?.removeEventListener("mousemove",f.moveHandler),s?.removeEventListener("mouseup",f.upHandler),d(h.clientX)}},p={moveHandler:h=>(h.cancelable&&(h.preventDefault(),h.stopPropagation()),m(h.touches[0].clientX),!1),upHandler:h=>{var _;s?.removeEventListener("touchmove",p.moveHandler),s?.removeEventListener("touchend",p.upHandler),h.cancelable&&(h.preventDefault(),h.stopPropagation()),d((_=h.touches[0])==null?void 0:_.clientX)}},R=Vt()?{passive:!1}:!1;ce(r)?(s?.addEventListener("touchmove",p.moveHandler,R),s?.addEventListener("touchend",p.upHandler,R)):(s?.addEventListener("mousemove",f.moveHandler,R),s?.addEventListener("mouseup",f.upHandler,R)),o.setColumnSizingInfo(h=>({...h,startOffset:a,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=o=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(o),e.setColumnSizingInfo=o=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(o),e.resetColumnSizing=o=>{var t;e.setColumnSizing(o?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=o=>{var t;e.setColumnSizingInfo(o?de():(t=e.initialState.columnSizingInfo)!=null?t:de())},e.getTotalSize=()=>{var o,t;return(o=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getLeftTotalSize=()=>{var o,t;return(o=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getCenterTotalSize=()=>{var o,t;return(o=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getRightTotalSize=()=>{var o,t;return(o=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0}}};let oe=null;function Vt(){if(typeof oe=="boolean")return oe;let e=!1;try{const o={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,o),window.removeEventListener("test",t)}catch{e=!1}return oe=e,oe}function ce(e){return e.type==="touchstart"}const Mt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:z("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const i=e.columns;return(t=i.length?i.some(r=>r.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=v(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),w(o.options,"debugRows")),e.getVisibleCells=v(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,i)=>[...t,...n,...i],w(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>v(()=>[n(),n().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),w(e.options,"debugColumns"));e.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,r)=>({...i,[r.id]:t||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function Q(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const It={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Ot={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:z("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,i,r;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&((r=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>j.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return re(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:j[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},Dt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:z("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let o=!1,t=!1;e._autoResetExpanded=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var i,r;e.setExpanded(n?{}:(i=(r=e.initialState)==null?void 0:r.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const l=r.split(".");n=Math.max(n,l.length)}),n},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,o)=>{e.toggleExpanded=t=>{o.setExpanded(n=>{var i;const r=n===!0?!0:!!(n!=null&&n[e.id]);let l={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=n,t=(i=t)!=null?i:!r,!r&&t)return{...l,[e.id]:!0};if(r&&!t){const{[e.id]:u,...a}=l;return a}return n})},e.getIsExpanded=()=>{var t;const n=o.getState().expanded;return!!((t=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(e))!=null?t:n===!0||n?.[e.id])},e.getCanExpand=()=>{var t,n,i;return(t=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(e))!=null?t:((n=o.options.enableExpanding)!=null?n:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=o.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},we=0,Re=10,fe=()=>({pageIndex:we,pageSize:Re}),At={getInitialState:e=>({...e,pagination:{...fe(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:z("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const i=r=>T(n,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=n=>{var i;e.setPagination(n?fe():(i=e.initialState.pagination)!=null?i:fe())},e.setPageIndex=n=>{e.setPagination(i=>{let r=T(n,i.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,l)),{...i,pageIndex:r}})},e.resetPageIndex=n=>{var i,r;e.setPageIndex(n?we:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?i:we)},e.resetPageSize=n=>{var i,r;e.setPageSize(n?Re:(i=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?i:Re)},e.setPageSize=n=>{e.setPagination(i=>{const r=Math.max(1,T(n,i.pageSize)),l=i.pageSize*i.pageIndex,u=Math.floor(l/r);return{...i,pageIndex:u,pageSize:r}})},e.setPageCount=n=>e.setPagination(i=>{var r;let l=T(n,(r=e.options.pageCount)!=null?r:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...i,pageCount:l}}),e.getPageOptions=v(()=>[e.getPageCount()],n=>{let i=[];return n&&n>0&&(i=[...new Array(n)].fill(null).map((r,l)=>l)),i},w(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:n<i-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},pe=()=>({top:[],bottom:[]}),Et={getInitialState:e=>({rowPinning:pe(),...e}),getDefaultOptions:e=>({onRowPinningChange:z("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,i)=>{const r=n?e.getLeafRows().map(a=>{let{id:g}=a;return g}):[],l=i?e.getParentRows().map(a=>{let{id:g}=a;return g}):[],u=new Set([...l,e.id,...r]);o.setRowPinning(a=>{var g,c;if(t==="bottom"){var m,d;return{top:((m=a?.top)!=null?m:[]).filter(p=>!(u!=null&&u.has(p))),bottom:[...((d=a?.bottom)!=null?d:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)]}}if(t==="top"){var s,f;return{top:[...((s=a?.top)!=null?s:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)],bottom:((f=a?.bottom)!=null?f:[]).filter(p=>!(u!=null&&u.has(p)))}}return{top:((g=a?.top)!=null?g:[]).filter(p=>!(u!=null&&u.has(p))),bottom:((c=a?.bottom)!=null?c:[]).filter(p=>!(u!=null&&u.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:i}=o.options;return typeof n=="function"?n(e):(t=n??i)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:i}=o.getState().rowPinning,r=t.some(u=>n?.includes(u)),l=t.some(u=>i?.includes(u));return r?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();if(!i)return-1;const r=(t=i==="top"?o.getTopRows():o.getBottomRows())==null?void 0:t.map(l=>{let{id:u}=l;return u});return(n=r?.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=o=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(o),e.resetRowPinning=o=>{var t,n;return e.setRowPinning(o?pe():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:pe())},e.getIsSomeRowsPinned=o=>{var t;const n=e.getState().rowPinning;if(!o){var i,r;return!!((i=n.top)!=null&&i.length||(r=n.bottom)!=null&&r.length)}return!!((t=n[o])!=null&&t.length)},e._getPinnedRows=(o,t,n)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(t??[]).map(l=>{const u=e.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(t??[]).map(l=>o.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:n}))},e.getTopRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),w(e.options,"debugRows")),e.getBottomRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),w(e.options,"debugRows")),e.getCenterRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(o,t,n)=>{const i=new Set([...t??[],...n??[]]);return o.filter(r=>!i.has(r.id))},w(e.options,"debugRows"))}},zt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:z("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},i=e.getPreGroupedRowModel().flatRows;return o?i.forEach(r=>{r.getCanSelect()&&(n[r.id]=!0)}):i.forEach(r=>{delete n[r.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),i={...t};return e.getRowModel().rows.forEach(r=>{he(i,r.id,n,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=v(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?me(e,t):{rows:[],flatRows:[],rowsById:{}},w(e.options,"debugTable")),e.getFilteredSelectedRowModel=v(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?me(e,t):{rows:[],flatRows:[],rowsById:{}},w(e.options,"debugTable")),e.getGroupedSelectedRowModel=v(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?me(e,t):{rows:[],flatRows:[],rowsById:{}},w(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const o=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(o.length&&Object.keys(t).length);return n&&o.some(i=>i.getCanSelect()&&!t[i.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:t}=e.getState();let n=!!o.length;return n&&o.some(i=>!t[i.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var o;const t=Object.keys((o=e.getState().rowSelection)!=null?o:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:o.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>o=>{e.toggleAllRowsSelected(o.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>o=>{e.toggleAllPageRowsSelected(o.target.checked)}},createRow:(e,o)=>{e.toggleSelected=(t,n)=>{const i=e.getIsSelected();o.setRowSelection(r=>{var l;if(t=typeof t<"u"?t:!i,e.getCanSelect()&&i===t)return r;const u={...r};return he(u,e.id,t,(l=n?.selectChildren)!=null?l:!0,o),u})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return xe(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return Fe(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return Fe(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(e):(t=o.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(e):(t=o.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(e):(t=o.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected((i=n.target)==null?void 0:i.checked)}}}},he=(e,o,t,n,i)=>{var r;const l=i.getRow(o,!0);t?(l.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),l.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(r=l.subRows)!=null&&r.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>he(e,u.id,t,n,i))};function me(e,o){const t=e.getState().rowSelection,n=[],i={},r=function(l,u){return l.map(a=>{var g;const c=xe(a,t);if(c&&(n.push(a),i[a.id]=a),(g=a.subRows)!=null&&g.length&&(a={...a,subRows:r(a.subRows)}),c)return a}).filter(Boolean)};return{rows:r(o.rows),flatRows:n,rowsById:i}}function xe(e,o){var t;return(t=o[e.id])!=null?t:!1}function Fe(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let i=!0,r=!1;return e.subRows.forEach(l=>{if(!(r&&!i)&&(l.getCanSelect()&&(xe(l,o)?r=!0:i=!1),l.subRows&&l.subRows.length)){const u=Fe(l,o);u==="all"?r=!0:(u==="some"&&(r=!0),i=!1)}}),i?"all":r?"some":!1}const _e=/([0-9]+)/gm,Ht=(e,o,t)=>be(b(e.getValue(t)).toLowerCase(),b(o.getValue(t)).toLowerCase()),Gt=(e,o,t)=>be(b(e.getValue(t)),b(o.getValue(t))),Lt=(e,o,t)=>Pe(b(e.getValue(t)).toLowerCase(),b(o.getValue(t)).toLowerCase()),qt=(e,o,t)=>Pe(b(e.getValue(t)),b(o.getValue(t))),kt=(e,o,t)=>{const n=e.getValue(t),i=o.getValue(t);return n>i?1:n<i?-1:0},Bt=(e,o,t)=>Pe(e.getValue(t),o.getValue(t));function Pe(e,o){return e===o?0:e>o?1:-1}function b(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function be(e,o){const t=e.split(_e).filter(Boolean),n=o.split(_e).filter(Boolean);for(;t.length&&n.length;){const i=t.shift(),r=n.shift(),l=parseInt(i,10),u=parseInt(r,10),a=[l,u].sort();if(isNaN(a[0])){if(i>r)return 1;if(r>i)return-1;continue}if(isNaN(a[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return t.length-n.length}const Y={alphanumeric:Ht,alphanumericCaseSensitive:Gt,text:Lt,textCaseSensitive:qt,datetime:kt,basic:Bt},jt={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:z("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const i of t){const r=i?.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return Y.datetime;if(typeof r=="string"&&(n=!0,r.split(_e).length>1))return Y.alphanumeric}return n?Y.text:Y.basic},e.getAutoSortDir=()=>{const t=o.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return re(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=o.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:Y[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const i=e.getNextSortingOrder(),r=typeof t<"u"&&t!==null;o.setSorting(l=>{const u=l?.find(s=>s.id===e.id),a=l?.findIndex(s=>s.id===e.id);let g=[],c,m=r?t:i==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&n?u?c="toggle":c="add":l!=null&&l.length&&a!==l.length-1?c="replace":u?c="toggle":c="replace",c==="toggle"&&(r||i||(c="remove")),c==="add"){var d;g=[...l,{id:e.id,desc:m}],g.splice(0,g.length-((d=o.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else c==="toggle"?g=l.map(s=>s.id===e.id?{...s,desc:m}:s):c==="remove"?g=l.filter(s=>s.id!==e.id):g=[{id:e.id,desc:m}];return g})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:o.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,i;const r=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==r&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(i=o.options.enableMultiRemove)!=null)||i)?!1:l==="desc"?"asc":"desc":r},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=o.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:o.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=o.getState().sorting)==null?void 0:t.find(i=>i.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=o.getState().sorting)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.clearSorting=()=>{o.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=o=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(o),e.resetSorting=o=>{var t,n;e.setSorting(o?[]:(t=(n=e.initialState)==null?void 0:n.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Tt=[gt,Mt,yt,$t,dt,ct,It,Ot,jt,Ft,Dt,At,Et,zt,Pt];function bt(e){var o,t;const n=[...Tt,...(o=e._features)!=null?o:[]];let i={_features:n};const r=i._features.reduce((d,s)=>Object.assign(d,s.getDefaultOptions==null?void 0:s.getDefaultOptions(i)),{}),l=d=>i.options.mergeOptions?i.options.mergeOptions(r,d):{...r,...d};let a={...{},...(t=e.initialState)!=null?t:{}};i._features.forEach(d=>{var s;a=(s=d.getInitialState==null?void 0:d.getInitialState(a))!=null?s:a});const g=[];let c=!1;const m={_features:n,options:{...r,...e},initialState:a,_queue:d=>{g.push(d),c||(c=!0,Promise.resolve().then(()=>{for(;g.length;)g.shift()();c=!1}).catch(s=>setTimeout(()=>{throw s})))},reset:()=>{i.setState(i.initialState)},setOptions:d=>{const s=T(d,i.options);i.options=l(s)},getState:()=>i.options.state,setState:d=>{i.options.onStateChange==null||i.options.onStateChange(d)},_getRowId:(d,s,f)=>{var p;return(p=i.options.getRowId==null?void 0:i.options.getRowId(d,s,f))!=null?p:`${f?[f.id,s].join("."):s}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(d,s)=>{let f=(s?i.getPrePaginationRowModel():i.getRowModel()).rowsById[d];if(!f&&(f=i.getCoreRowModel().rowsById[d],!f))throw new Error;return f},_getDefaultColumnDef:v(()=>[i.options.defaultColumn],d=>{var s;return d=(s=d)!=null?s:{},{header:f=>{const p=f.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:f=>{var p,R;return(p=(R=f.renderValue())==null||R.toString==null?void 0:R.toString())!=null?p:null},...i._features.reduce((f,p)=>Object.assign(f,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},w(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:v(()=>[i._getColumnDefs()],d=>{const s=function(f,p,R){return R===void 0&&(R=0),f.map(h=>{const _=at(i,h,R,p),y=h;return _.columns=y.columns?s(y.columns,_,R+1):[],_})};return s(d)},w(e,"debugColumns")),getAllFlatColumns:v(()=>[i.getAllColumns()],d=>d.flatMap(s=>s.getFlatColumns()),w(e,"debugColumns")),_getAllFlatColumnsById:v(()=>[i.getAllFlatColumns()],d=>d.reduce((s,f)=>(s[f.id]=f,s),{}),w(e,"debugColumns")),getAllLeafColumns:v(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(d,s)=>{let f=d.flatMap(p=>p.getLeafColumns());return s(f)},w(e,"debugColumns")),getColumn:d=>i._getAllFlatColumnsById()[d]};Object.assign(i,m);for(let d=0;d<i._features.length;d++){const s=i._features[d];s==null||s.createTable==null||s.createTable(i)}return i}function Nt(){return e=>v(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(i,r,l){r===void 0&&(r=0);const u=[];for(let g=0;g<i.length;g++){const c=ye(e,e._getRowId(i[g],g,l),i[g],g,r,void 0,l?.id);if(t.flatRows.push(c),t.rowsById[c.id]=c,u.push(c),e.options.getSubRows){var a;c.originalSubRows=e.options.getSubRows(i[g],g),(a=c.originalSubRows)!=null&&a.length&&(c.subRows=n(c.originalSubRows,r+1,c))}}return u};return t.rows=n(o),t},w(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ut(){return e=>v(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(o,t,n)=>!t.rows.length||o!==!0&&!Object.keys(o??{}).length||!n?t:Xt(t),w(e.options,"debugTable"))}function Xt(e){const o=[],t=n=>{var i;o.push(n),(i=n.subRows)!=null&&i.length&&n.getIsExpanded()&&n.subRows.forEach(t)};return e.rows.forEach(t),{rows:o,flatRows:e.flatRows,rowsById:e.rowsById}}function Kt(e,o,t){return t.options.filterFromLeafRows?Wt(e,o,t):Yt(e,o,t)}function Wt(e,o,t){var n;const i=[],r={},l=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(a,g){g===void 0&&(g=0);const c=[];for(let d=0;d<a.length;d++){var m;let s=a[d];const f=ye(t,s.id,s.original,s.index,s.depth,void 0,s.parentId);if(f.columnFilters=s.columnFilters,(m=s.subRows)!=null&&m.length&&g<l){if(f.subRows=u(s.subRows,g+1),s=f,o(s)&&!f.subRows.length){c.push(s),r[s.id]=s,i.push(s);continue}if(o(s)||f.subRows.length){c.push(s),r[s.id]=s,i.push(s);continue}}else s=f,o(s)&&(c.push(s),r[s.id]=s,i.push(s))}return c};return{rows:u(e),flatRows:i,rowsById:r}}function Yt(e,o,t){var n;const i=[],r={},l=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(a,g){g===void 0&&(g=0);const c=[];for(let d=0;d<a.length;d++){let s=a[d];if(o(s)){var m;if((m=s.subRows)!=null&&m.length&&g<l){const p=ye(t,s.id,s.original,s.index,s.depth,void 0,s.parentId);p.subRows=u(s.subRows,g+1),s=p}c.push(s),i.push(s),r[s.id]=s}}return c};return{rows:u(e),flatRows:i,rowsById:r}}function Jt(){return e=>v(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(o,t,n)=>{if(!o.rows.length||!(t!=null&&t.length)&&!n){for(let d=0;d<o.flatRows.length;d++)o.flatRows[d].columnFilters={},o.flatRows[d].columnFiltersMeta={};return o}const i=[],r=[];(t??[]).forEach(d=>{var s;const f=e.getColumn(d.id);if(!f)return;const p=f.getFilterFn();p&&i.push({id:d.id,filterFn:p,resolvedValue:(s=p.resolveFilterValue==null?void 0:p.resolveFilterValue(d.value))!=null?s:d.value})});const l=(t??[]).map(d=>d.id),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());n&&u&&a.length&&(l.push("__global__"),a.forEach(d=>{var s;r.push({id:d.id,filterFn:u,resolvedValue:(s=u.resolveFilterValue==null?void 0:u.resolveFilterValue(n))!=null?s:n})}));let g,c;for(let d=0;d<o.flatRows.length;d++){const s=o.flatRows[d];if(s.columnFilters={},i.length)for(let f=0;f<i.length;f++){g=i[f];const p=g.id;s.columnFilters[p]=g.filterFn(s,p,g.resolvedValue,R=>{s.columnFiltersMeta[p]=R})}if(r.length){for(let f=0;f<r.length;f++){c=r[f];const p=c.id;if(c.filterFn(s,p,c.resolvedValue,R=>{s.columnFiltersMeta[p]=R})){s.columnFilters.__global__=!0;break}}s.columnFilters.__global__!==!0&&(s.columnFilters.__global__=!1)}}const m=d=>{for(let s=0;s<l.length;s++)if(d.columnFilters[l[s]]===!1)return!1;return!0};return Kt(o.rows,m,e)},w(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Qt(){return e=>v(()=>[e.getState().sorting,e.getPreSortedRowModel()],(o,t)=>{if(!t.rows.length||!(o!=null&&o.length))return t;const n=e.getState().sorting,i=[],r=n.filter(a=>{var g;return(g=e.getColumn(a.id))==null?void 0:g.getCanSort()}),l={};r.forEach(a=>{const g=e.getColumn(a.id);g&&(l[a.id]={sortUndefined:g.columnDef.sortUndefined,invertSorting:g.columnDef.invertSorting,sortingFn:g.getSortingFn()})});const u=a=>{const g=a.map(c=>({...c}));return g.sort((c,m)=>{for(let s=0;s<r.length;s+=1){var d;const f=r[s],p=l[f.id],R=p.sortUndefined,h=(d=f?.desc)!=null?d:!1;let _=0;if(R){const y=c.getValue(f.id),A=m.getValue(f.id),V=y===void 0,L=A===void 0;if(V||L){if(R==="first")return V?-1:1;if(R==="last")return V?1:-1;_=V&&L?0:V?R:-R}}if(_===0&&(_=p.sortingFn(c,m,f.id)),_!==0)return h&&(_*=-1),p.invertSorting&&(_*=-1),_}return c.index-m.index}),g.forEach(c=>{var m;i.push(c),(m=c.subRows)!=null&&m.length&&(c.subRows=u(c.subRows))}),g};return{rows:u(t.rows),flatRows:i,rowsById:t.rowsById}},w(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
   * vue-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function ie(){return!0}const Zt=Symbol("merge-proxy"),en={get(e,o,t){return o===Zt?t:e.get(o)},has(e,o){return e.has(o)},set:ie,deleteProperty:ie,getOwnPropertyDescriptor(e,o){return{configurable:!0,enumerable:!0,get(){return e.get(o)},set:ie,deleteProperty:ie}},ownKeys(e){return e.keys()}};function Se(e){return"value"in e?e.value:e}function J(){for(var e=arguments.length,o=new Array(e),t=0;t<e;t++)o[t]=arguments[t];return new Proxy({get(n){for(let i=o.length-1;i>=0;i--){const r=Se(o[i])[n];if(r!==void 0)return r}},has(n){for(let i=o.length-1;i>=0;i--)if(n in Se(o[i]))return!0;return!1},keys(){const n=[];for(let i=0;i<o.length;i++)n.push(...Object.keys(Se(o[i])));return[...Array.from(new Set(n))]}},en)}const Ce=Ue({props:["render","props"],setup:e=>()=>typeof e.render=="function"||typeof e.render=="object"?Ye(e.render,e.props):e.render});function Ee(e){return J(e,{data:D(e.data)})}function tn(e){const o=Xe(e.data),t=J({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(r,l){return o?{...r,...l}:J(r,l)}},o?Ee(e):e),n=bt(t);if(o){const r=Ke(e.data);ze(r,()=>{n.setState(l=>({...l,data:r.value}))},{immediate:!0})}const i=ve(n.initialState);return We(()=>{n.setOptions(r=>{var l;const u=new Proxy({},{get:(a,g)=>i.value[g]});return J(r,o?Ee(e):e,{state:J(u,(l=e.state)!=null?l:{}),onStateChange:a=>{a instanceof Function?i.value=a(i.value):i.value=a,e.onStateChange==null||e.onStateChange(a)}})})}),n}const nn={slots:{root:"relative overflow-auto",base:"min-w-full overflow-clip",caption:"sr-only",thead:"relative",tbody:"divide-y divide-default [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:focus-visible:outline-primary",tfoot:"relative",tr:"data-[selected=true]:bg-elevated/50",th:"px-4 py-3.5 text-sm text-highlighted text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",td:"p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",separator:"absolute z-[1] left-0 w-full h-px bg-(--ui-border-accented)",empty:"py-6 text-center text-sm text-muted",loading:"py-6 text-center"},variants:{pinned:{true:{th:"sticky bg-default/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0",td:"sticky bg-default/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0"}},sticky:{true:{thead:"sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur",tfoot:"sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"},header:{thead:"sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"},footer:{tfoot:"sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"}},loading:{true:{thead:"after:absolute after:z-[1] after:h-px"}},loadingAnimation:{carousel:"","carousel-inverse":"",swing:"",elastic:""},loadingColor:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""}},compoundVariants:[{loading:!0,loadingColor:"primary",class:{thead:"after:bg-primary"}},{loading:!0,loadingColor:"secondary",class:{thead:"after:bg-secondary"}},{loading:!0,loadingColor:"success",class:{thead:"after:bg-success"}},{loading:!0,loadingColor:"info",class:{thead:"after:bg-info"}},{loading:!0,loadingColor:"warning",class:{thead:"after:bg-warning"}},{loading:!0,loadingColor:"error",class:{thead:"after:bg-error"}},{loading:!0,loadingColor:"neutral",class:{thead:"after:bg-inverted"}},{loading:!0,loadingAnimation:"carousel",class:{thead:"after:animate-[carousel_2s_ease-in-out_infinite] rtl:after:animate-[carousel-rtl_2s_ease-in-out_infinite]"}},{loading:!0,loadingAnimation:"carousel-inverse",class:{thead:"after:animate-[carousel-inverse_2s_ease-in-out_infinite] rtl:after:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"}},{loading:!0,loadingAnimation:"swing",class:{thead:"after:animate-[swing_2s_ease-in-out_infinite]"}},{loading:!0,loadingAnimation:"elastic",class:{thead:"after:animate-[elastic_2s_ease-in-out_infinite]"}}],defaultVariants:{loadingColor:"primary",loadingAnimation:"carousel"}},on=["data-pinned","scope","colspan","rowspan"],rn=["data-selected","data-selectable","data-expanded","role","tabindex","onClick","onPointerenter","onContextmenu"],ln=["data-pinned","colspan","rowspan"],sn=["colspan"],un={key:1},an=["colspan"],gn={key:2},dn=["colspan"],cn=["data-pinned","colspan","rowspan"],mn={__name:"UTable",props:Je({as:{type:null,required:!1},data:{type:Array,required:!1},columns:{type:Array,required:!1},caption:{type:String,required:!1},meta:{type:Object,required:!1},empty:{type:String,required:!1},sticky:{type:[Boolean,String],required:!1},loading:{type:Boolean,required:!1},loadingColor:{type:null,required:!1},loadingAnimation:{type:null,required:!1},watchOptions:{type:Object,required:!1,default:()=>({deep:!0})},globalFilterOptions:{type:Object,required:!1},columnFiltersOptions:{type:Object,required:!1},columnPinningOptions:{type:Object,required:!1},columnSizingOptions:{type:Object,required:!1},visibilityOptions:{type:Object,required:!1},sortingOptions:{type:Object,required:!1},groupingOptions:{type:Object,required:!1},expandedOptions:{type:Object,required:!1},rowSelectionOptions:{type:Object,required:!1},rowPinningOptions:{type:Object,required:!1},paginationOptions:{type:Object,required:!1},facetedOptions:{type:Object,required:!1},onSelect:{type:Function,required:!1},onHover:{type:Function,required:!1},onContextmenu:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:null,required:!1},state:{type:Object,required:!1},onStateChange:{type:Function,required:!1},renderFallbackValue:{type:null,required:!1},_features:{type:Array,required:!1},autoResetAll:{type:Boolean,required:!1},debugAll:{type:Boolean,required:!1},debugCells:{type:Boolean,required:!1},debugColumns:{type:Boolean,required:!1},debugHeaders:{type:Boolean,required:!1},debugRows:{type:Boolean,required:!1},debugTable:{type:Boolean,required:!1},defaultColumn:{type:Object,required:!1},getRowId:{type:Function,required:!1},getSubRows:{type:Function,required:!1},initialState:{type:Object,required:!1},mergeOptions:{type:Function,required:!1}},{globalFilter:{type:String,default:void 0},globalFilterModifiers:{},columnFilters:{type:Array,default:[]},columnFiltersModifiers:{},columnOrder:{type:Array,default:[]},columnOrderModifiers:{},columnVisibility:{type:Object,default:{}},columnVisibilityModifiers:{},columnPinning:{type:Object,default:{}},columnPinningModifiers:{},columnSizing:{type:Object,default:{}},columnSizingModifiers:{},columnSizingInfo:{type:Object,default:{}},columnSizingInfoModifiers:{},rowSelection:{type:Object,default:{}},rowSelectionModifiers:{},rowPinning:{type:Object,default:{}},rowPinningModifiers:{},sorting:{type:Array,default:[]},sortingModifiers:{},grouping:{type:Array,default:[]},groupingModifiers:{},expanded:{type:[Boolean,Object],default:{}},expandedModifiers:{},pagination:{type:Object,default:{}},paginationModifiers:{}}),emits:["update:globalFilter","update:columnFilters","update:columnOrder","update:columnVisibility","update:columnPinning","update:columnSizing","update:columnSizingInfo","update:rowSelection","update:rowPinning","update:sorting","update:grouping","update:expanded","update:pagination"],setup(e,{expose:o}){const t=e,n=Qe(),{t:i}=Ze(),r=et(),l=ve(t.data??[]),u=ee(()=>t.columns??Object.keys(l.value[0]??{}).map(S=>({accessorKey:S,header:rt(S)}))),a=ee(()=>t.meta??{}),g=ee(()=>Me({extend:Me(nn),...r.ui?.table||{}})({sticky:t.sticky,loading:t.loading,loadingColor:t.loadingColor,loadingAnimation:t.loadingAnimation})),c=ee(()=>{function S(M){for(const F of M)if("footer"in F||"columns"in F&&S(F.columns))return!0;return!1}return S(u.value)}),m=E(e,"globalFilter",{type:String,default:void 0}),d=E(e,"columnFilters",{type:Array,default:[]}),s=E(e,"columnOrder",{type:Array,default:[]}),f=E(e,"columnVisibility",{type:Object,default:{}}),p=E(e,"columnPinning",{type:Object,default:{}}),R=E(e,"columnSizing",{type:Object,default:{}}),h=E(e,"columnSizingInfo",{type:Object,default:{}}),_=E(e,"rowSelection",{type:Object,default:{}}),y=E(e,"rowPinning",{type:Object,default:{}}),A=E(e,"sorting",{type:Array,default:[]}),V=E(e,"grouping",{type:Array,default:[]}),L=E(e,"expanded",{type:[Boolean,Object],default:{}}),X=E(e,"pagination",{type:Object,default:{}}),K=ve(null),H=tn({...tt(t,"as","data","columns","caption","sticky","loading","loadingColor","loadingAnimation","class","ui"),data:l,get columns(){return u.value},meta:a.value,getCoreRowModel:Nt(),...t.globalFilterOptions||{},onGlobalFilterChange:S=>O(S,m),...t.columnFiltersOptions||{},getFilteredRowModel:Jt(),onColumnFiltersChange:S=>O(S,d),onColumnOrderChange:S=>O(S,s),...t.visibilityOptions||{},onColumnVisibilityChange:S=>O(S,f),...t.columnPinningOptions||{},onColumnPinningChange:S=>O(S,p),...t.columnSizingOptions||{},onColumnSizingChange:S=>O(S,R),onColumnSizingInfoChange:S=>O(S,h),...t.rowSelectionOptions||{},onRowSelectionChange:S=>O(S,_),...t.rowPinningOptions||{},onRowPinningChange:S=>O(S,y),...t.sortingOptions||{},getSortedRowModel:Qt(),onSortingChange:S=>O(S,A),...t.groupingOptions||{},onGroupingChange:S=>O(S,V),...t.expandedOptions||{},getExpandedRowModel:Ut(),onExpandedChange:S=>O(S,L),...t.paginationOptions||{},onPaginationChange:S=>O(S,X),...t.facetedOptions||{},state:{get globalFilter(){return m.value},get columnFilters(){return d.value},get columnOrder(){return s.value},get columnVisibility(){return f.value},get columnPinning(){return p.value},get expanded(){return L.value},get rowSelection(){return _.value},get sorting(){return A.value},get grouping(){return V.value},get rowPinning(){return y.value},get columnSizing(){return R.value},get columnSizingInfo(){return h.value},get pagination(){return X.value}}});function O(S,M){M.value=typeof S=="function"?S(M.value):S}function Z(S,M){if(!t.onSelect)return;const F=S.target;F.closest("button")||F.closest("a")||(S.preventDefault(),S.stopPropagation(),t.onSelect(M,S))}function Ve(S,M){t.onHover&&t.onHover(S,M)}function Ne(S,M){t.onContextmenu&&(Array.isArray(t.onContextmenu)?t.onContextmenu.forEach(F=>F(S,M)):t.onContextmenu(S,M))}function q(S,M){return typeof S=="function"?S(M):S}return ze(()=>t.data,()=>{l.value=t.data?[...t.data]:[]},t.watchOptions),o({tableRef:K,tableApi:H}),(S,M)=>($(),le(D(it),{as:e.as,class:x(g.value.root({class:[t.ui?.root,t.class]}))},{default:nt(()=>[k("table",{ref_key:"tableRef",ref:K,class:x(g.value.base({class:[t.ui?.base]}))},[e.caption||n.caption?($(),P("caption",{key:0,class:x(g.value.caption({class:[t.ui?.caption]}))},[B(S.$slots,"caption",{},()=>[Ie(Oe(e.caption),1)])],2)):W("",!0),k("thead",{class:x(g.value.thead({class:[t.ui?.thead]}))},[($(!0),P(N,null,U(D(H).getHeaderGroups(),F=>($(),P("tr",{key:F.id,class:x(g.value.tr({class:[t.ui?.tr]}))},[($(!0),P(N,null,U(F.headers,C=>($(),P("th",{key:C.id,"data-pinned":C.column.getIsPinned(),scope:C.colSpan>1?"colgroup":"col",colspan:C.colSpan>1?C.colSpan:void 0,rowspan:C.rowSpan>1?C.rowSpan:void 0,class:x(g.value.th({class:[t.ui?.th,q(C.column.columnDef.meta?.class?.th,C)],pinned:!!C.column.getIsPinned()}))},[B(S.$slots,`${C.id}-header`,se({ref_for:!0},C.getContext()),()=>[C.isPlaceholder?W("",!0):($(),le(D(Ce),{key:0,render:C.column.columnDef.header,props:C.getContext()},null,8,["render","props"]))])],10,on))),128))],2))),128)),k("tr",{class:x(g.value.separator({class:[t.ui?.separator]}))},null,2)],2),k("tbody",{class:x(g.value.tbody({class:[t.ui?.tbody]}))},[B(S.$slots,"body-top"),D(H).getRowModel().rows?.length?($(!0),P(N,{key:0},U(D(H).getRowModel().rows,F=>($(),P(N,{key:F.id},[k("tr",{"data-selected":F.getIsSelected(),"data-selectable":!!t.onSelect||!!t.onHover||!!t.onContextmenu,"data-expanded":F.getIsExpanded(),role:t.onSelect?"button":void 0,tabindex:t.onSelect?0:void 0,class:x(g.value.tr({class:[t.ui?.tr,q(D(H).options.meta?.class?.tr,F)]})),style:ue(q(D(H).options.meta?.style?.tr,F)),onClick:C=>Z(C,F),onPointerenter:C=>Ve(C,F),onPointerleave:M[0]||(M[0]=C=>Ve(C,null)),onContextmenu:C=>Ne(C,F)},[($(!0),P(N,null,U(F.getVisibleCells(),C=>($(),P("td",{key:C.id,"data-pinned":C.column.getIsPinned(),colspan:q(C.column.columnDef.meta?.colspan?.td,C),rowspan:q(C.column.columnDef.meta?.rowspan?.td,C),class:x(g.value.td({class:[t.ui?.td,q(C.column.columnDef.meta?.class?.td,C)],pinned:!!C.column.getIsPinned()})),style:ue(q(C.column.columnDef.meta?.style?.td,C))},[B(S.$slots,`${C.column.id}-cell`,se({ref_for:!0},C.getContext()),()=>[ot(D(Ce),{render:C.column.columnDef.cell,props:C.getContext()},null,8,["render","props"])])],14,ln))),128))],46,rn),F.getIsExpanded()?($(),P("tr",{key:0,class:x(g.value.tr({class:[t.ui?.tr]}))},[k("td",{colspan:F.getAllCells().length,class:x(g.value.td({class:[t.ui?.td]}))},[B(S.$slots,"expanded",{row:F})],10,sn)],2)):W("",!0)],64))),128)):e.loading&&n.loading?($(),P("tr",un,[k("td",{colspan:D(H).getAllLeafColumns().length,class:x(g.value.loading({class:t.ui?.loading}))},[B(S.$slots,"loading")],10,an)])):($(),P("tr",gn,[k("td",{colspan:D(H).getAllLeafColumns().length,class:x(g.value.empty({class:t.ui?.empty}))},[B(S.$slots,"empty",{},()=>[Ie(Oe(e.empty||D(i)("table.noData")),1)])],10,dn)])),B(S.$slots,"body-bottom")],2),c.value?($(),P("tfoot",{key:1,class:x(g.value.tfoot({class:[t.ui?.tfoot]}))},[k("tr",{class:x(g.value.separator({class:[t.ui?.separator]}))},null,2),($(!0),P(N,null,U(D(H).getFooterGroups(),F=>($(),P("tr",{key:F.id,class:x(g.value.tr({class:[t.ui?.tr]}))},[($(!0),P(N,null,U(F.headers,C=>($(),P("th",{key:C.id,"data-pinned":C.column.getIsPinned(),colspan:C.colSpan>1?C.colSpan:void 0,rowspan:C.rowSpan>1?C.rowSpan:void 0,class:x(g.value.th({class:[t.ui?.th,q(C.column.columnDef.meta?.class?.th,C)],pinned:!!C.column.getIsPinned()})),style:ue(q(C.column.columnDef.meta?.style?.th,C))},[B(S.$slots,`${C.id}-footer`,se({ref_for:!0},C.getContext()),()=>[C.isPlaceholder?W("",!0):($(),le(D(Ce),{key:0,render:C.column.columnDef.footer,props:C.getContext()},null,8,["render","props"]))])],14,cn))),128))],2))),128))],2)):W("",!0)],2)]),_:3},8,["as","class"]))}};export{mn as _};
