@infinite-table/infinite-vue 9.4.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +110 -37
- package/index.js +9 -9
- package/index.mjs +9 -9
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";var Kp=Object.create;var Wo=Object.defineProperty;var Bp=Object.getOwnPropertyDescriptor;var Hp=Object.getOwnPropertyNames;var Wp=Object.getPrototypeOf,jp=Object.prototype.hasOwnProperty;var $p=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),Up=(o,t)=>{for(var e in t)Wo(o,e,{get:t[e],enumerable:!0})},il=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hp(t))!jp.call(o,i)&&i!==e&&Wo(o,i,{get:()=>t[i],enumerable:!(n=Bp(t,i))||n.enumerable});return o};var po=(o,t,e)=>(e=o!=null?Kp(Wp(o)):{},il(t||!o||!o.__esModule?Wo(e,"default",{value:o,enumerable:!0}):e,o)),qp=o=>il(Wo({},"__esModule",{value:!0}),o);var Kn=$p((LT,Qs)=>{"use strict";Qs.exports=function(o,t,e,n,i){var r,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(i===void 0)i=o.length-1;else if(i=i|0,i<n||i>=o.length)throw new RangeError("invalid upper bound");for(;n<=i;)if(r=n+(i-n>>>1),a=+e(o[r],t,r,o),a<0)n=r+1;else if(a>0)i=r-1;else return r;return~n}});var Ay={};Up(Ay,{CellSelectionState:()=>Be,DataSource:()=>Fi,DataSourceInjectionKeyForVue:()=>Xn,DeepMap:()=>$,FlashingColumnCell:()=>Pp,GroupRowsState:()=>St,InfiniteTable:()=>mr,InfiniteTableClassName:()=>vp,InfiniteTableDetailRow:()=>fr,InfiniteTableInjectionKeyForVue:()=>Bn,Menu:()=>At,NumberFilterEditor:()=>bi,RowDetailState:()=>bt,RowSelectionState:()=>_e,StringFilterEditor:()=>Hn,TreeDataSource:()=>Ap,TreeExpandState:()=>ot,TreeGrid:()=>Dp,TreeSelectionState:()=>Qe,components:()=>Dy,createFlashingColumnCellComponent:()=>Ja,debounce:()=>en,defaultFilterTypes:()=>kn,flatten:()=>_l,group:()=>Jo,keyboardShortcuts:()=>_p,toTreeDataArray:()=>ia,useDataSourceContext:()=>Jn,useGetMasterDetailContextForVue:()=>Mi,useInfiniteColumnCell:()=>ao,useInfiniteColumnEditor:()=>$a,useInfiniteColumnFilterEditor:()=>Wn,useInfiniteHeaderCell:()=>Mo,useInfiniteTableContext:()=>qe,useOverlay:()=>Dt,withSelectedLeafNodesOnly:()=>Qa});module.exports=qp(Ay);function en(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}var Le=require("vue");var tt=require("vue");function rl(o,t){let e=new Set;function n(...i){let r=t?t.getProxyTargetFromArgs(...i):i[0];e.clear();let a={get:function(d,s){return e.add(s),d[s]}},l=new Proxy(r,a),u=t?t.putProxyToArgs(l,...i):[l];return o.apply(this,u)}return{fn:n,propertyReads:e}}var br=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function mo(o){return o!==void 0}function ho(o,t){let e=t[o];return mo(e)}var Cr=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function Yp(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=ho(i,t)?t[i]:t[`default${br(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function al(o,t,e){let{fn:n,propertyReads:i}=rl(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function ll(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=Yp(n,t,e));let u={...e,...l};if(r){let d=al(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function sl(o,t,e){let{getProps:n,getParentState:i,mapPropsToState:r,concludeReducer:a,propsToStateSet:l}=e;if(t.type==="REPLACE_STATE")return t.payload;let u=i?.()??null,d=t.payload.mappedState,s=t.payload.updatedPropsToState,c={...o};if(d&&Object.assign(c,d),r){let m=al(r,{props:n(),state:c,oldState:o,parentState:u},l);Object.assign(c,m)}return t.type==="ASSIGN_STATE"&&Object.assign(c,t.payload),a?a({previousState:o,state:c,updatedProps:s,parentState:u}):c}function ul(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=Cr}=o,d=e();return Object.keys(d).reduce((s,c)=>{let f=c;return Object.defineProperty(s,c,{set:p=>{let h=n(),y=e(),C=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:s,state:y})===!1&&(C=!1),C){let w=[p],T=`on${br(c)}Change`;if(l&&l[f]){let x=l[f](p,y);T=x.callbackName||T,w=x.callbackParams}u(h,T,w)}let b=i[f];typeof b=="function"&&(p=b(p));let S=!!r?.[f];ho(c,h)&&!S||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function dl(o){let{currentProps:t,prevProps:e,state:n,propsToForward:i,propsToStateSet:r}=o,a={},l=0,u={},d=0,s={},c=0;return new Set([...Object.keys(t),...Object.keys(e)]).forEach(m=>{let p=m,h=e[p],y=t[p];if(p!=="children"&&h!==y&&(s[p]={newValue:y,oldValue:h},c++,ho(p,t)||ho(p,e)))if(i.hasOwnProperty(m)){let C=y,b=i[m];typeof b=="function"&&(C=b(y)),n[p]!==C&&(a[p]=C,l++)}else r.has(m)&&(u[p]=t[p],d++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:u,updatedPropsToStateCount:d,rawUpdatedProps:s,rawUpdatedPropsCount:c}}function Zp(o){return(t,e,n)=>{if(Cr(t,e,n),o){let i=/^on([A-Z].*)Change$/.exec(e);if(i){let r=i[1].charAt(0).toLowerCase()+i[1].slice(1);o(`update:${r}`,n[0])}}}}function En(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=(0,tt.getCurrentInstance)(),l=()=>({...r}),u=o.initSetupState?o.initSetupState(l()):{},d=new Set,s=o.forwardProps?o.forwardProps(u,l()):{},c=o.getParentState?o.getParentState():null,f=()=>c==null?null:(0,tt.isRef)(c)?(0,tt.unref)(c)??null:typeof c=="function"?c()??null:c,m=ll({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=(0,tt.shallowRef)(m),h=()=>m,y=l,C=T=>{m=sl(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=Zp(a?(T,...x)=>a.emit(T,...x):void 0),S=ul({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return(0,tt.watch)(()=>({props:l(),parentState:f()}),(T,x)=>{let R=T.props,E=x.props,N=T.parentState!==x.parentState,{newMappedState:v,newMappedStateCount:P,updatedPropsToState:F,updatedPropsToStateCount:M,rawUpdatedProps:_,rawUpdatedPropsCount:A}=dl({currentProps:R,prevProps:E,state:p.value,propsToForward:s,propsToStateSet:d}),D=!1;if(M>0||P>0){let O={payload:{mappedState:P?v:null,updatedPropsToState:M?F:null}},L=p.value;if(C(O),D=!0,o.onPropChange){for(let K in _)if(_.hasOwnProperty(K)){let{newValue:B,oldValue:G}=_[K];o.onPropChange({name:K,newValue:B,oldValue:G},R,S,L)}}o.onPropsChange&&A&&o.onPropsChange(_,R,S,L)}N&&T.parentState!=null&&!D&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:S,getComponentState:h,replaceState:T=>{C({type:"REPLACE_STATE",payload:T})},assignState:T=>{C({type:"ASSIGN_STATE",payload:T})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return(0,tt.provide)(t,a.contextValue),a}function i(){return(0,tt.inject)(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function he(o=!1){let t=null,e=[],n=null,i=(r,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{t=r,n=null;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)});else{t=r;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)}};return i.get=()=>t,i.onChange=r=>(e.push(r),()=>{e=e.filter(a=>a!==r)}),i.destroy=()=>{i(null),e.length=0},i.getListenersCount=()=>e.length,i}function Ft(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var cl=(o,t)=>o-t;var jo=(o,t)=>cl(o.revision,t.revision),$=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),d=!a;if(r!==void 0){if(r<0)return;r--}let s=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!d)return;let y=h?[]:[...t,f],C=p?()=>this.visitWithNext(y,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let b=e(m.value,y,l,C,m);if(n&&b===!0)return!0;l++}else C?.()};u&&(s(void 0,this.emptyKey),d=!1,l=0);for(let[c,f]of i){let m=s(f,c);if(n&&m===!0)return m}};this.fill(t)}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,d)=>{!d.map&&d.hasOwnProperty("value")&&(i?r.push(d):a.push(e(d)))},n),i?r.sort(jo).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},d=this.map,s,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(s=d.get(p),!s||!s.map)if(c=!0,f===m-1){c=!0;break}else return[];d=s.map}else if(!n&&d.has(this.emptyKey))return[[]];return s&&s.value!==void 0&&(n||(u({...s,keys:t}),c=!0)),c?r?a.sort(jo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(jo).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let d=0,s=t.length;d<s;d++){let c=t[d];if(l=a.get(c),!l||!l.map)if(u=!0,d===s-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(d,s,c,f,m)=>{e(s,d,{...m,keys:s}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0}delete(t){let e=this.map;t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],d=a===l-1,s=e.get(u);if(d){s&&(s.hasOwnProperty("value")&&(delete s.value,delete s.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),s.map&&s.map.size===0&&delete s.map,s.map||e.delete(u));break}else{if(!s||!s.map){r=!1;break}i.push(s),e=s.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],d=t[t.length-1],s=u?.get(d);s&&(delete s.map,s.hasOwnProperty("value")||u.delete(d))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],d=Ft(()=>{if(l)for(let[s]of l){let c=this.visitKey(s,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let s=i(a,u,d);if(r&&s===!0)return!0}d()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(jo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=$;function ze(){return globalThis}var Uo=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],fl=Symbol("color"),$o=new WeakMap,Tr=he();function Sr(o=Uo){$o.set(o,o.map(t=>0))}Sr();var Xp=(o=Uo)=>{let t=[];$o.has(o)?t=$o.get(o):(t=o.map(n=>0),$o.set(o,t));let e=t.reduce((n,i,r,a)=>i<a[n]?r:n,0);return t[e]!=null&&t[e]++,o[e]??o[0]??Uo[0]},yo=":",wr="*",pl="-",Jp=",",Qp="debug",em="diffdebug",hl=!1,go=new $,bo=new Map;function vr(o,t){let e=o.split(yo),n=new $;n.set(e,!0);let i=t.split(yo),r=new Set(i).has(wr),a=i.indexOf(wr),l=r?i.slice(0,a):i;if(n.getKeysStartingWith(l,{excludeSelf:r}).length>0){let u=i.slice(a+1);return u.length?o.endsWith(u.join(yo)):!0}}function gl(o,t){let e=`channel=${o}_permissions=${t}`;if(bo.has(e))return bo.get(e);let n=t.split(Jp);function i(l){return bo.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(wr)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(pl);if(d&&(u=u.substring(pl.length)),vr(o,u))return i(!d)}for(let l=0;l<a.length;l++){let u=a[l],d=u.startsWith("-");if(d&&(u=u.substring(1)),vr(o,u))return i(!d)}return i(!1)}var Ir=()=>at.enable??(ze()&&ze().localStorage?.getItem(Qp))??"",tm=()=>at.diffenable??(ze()&&ze().localStorage?.getItem(em))??`${hl}`,Rr="",yl=hl;function xr(o){yl=`${tm()}`=="true",Rr!==o&&(Rr=o,bo.clear())}function bl(o){xr(Ir()),typeof ze()<"u"&&ze().addEventListener&&ze().addEventListener("storage",function(){xr(Ir())});function t(e,n){let i=n?`${n}${yo}${e}`:e,r=i.split(yo),a=go.get(r);if(a)return a;let l=go.get(r.slice(0,-1)),u=(l?l.logFn:at.logFn)??Cl,d=u,s,c=0,f=()=>s??gl(i,Rr),m=Xp(at.colors),p=Object.defineProperties((...h)=>{let y=Tr.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Tr({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&yl){let w=C-c;d(`%c[${i}]`,`color: ${m}`,`+${w}ms:`)}c=C;let b=[],S;if(h.forEach(w=>{if(w[fl])S===void 0&&(S=!0),b.push(...w);else{if(typeof w!="string"&&typeof w!="number"){S=!1;return}b.push(`${w}%s`)}}),S){let w=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...w)}else d(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...y)=>{let C=[`%c${y.join(" ")}%c%s`,`color: ${h}`,""];return C.toString=()=>y.join(" "),C[fl]=!0,C}},extend:{value:h=>t(h,i)},enabled:{get:()=>f(),set:h=>{s=h}},logFn:{configurable:!1,get:()=>d,set:h=>{d=h??u}},destroy:{value:()=>{go.delete(r)}}});return go.set(r,p),p}return t(o)}var Cl=console.log.bind(console),ml;Object.defineProperty(bl,"enable",{get:()=>ml,set:o=>{ml=o,xr(Ir())}});var at=bl;at.colors=Uo;at.logFn=Cl;var nm=(o,t)=>Tr.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;vr(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});at.onLogIntent=nm;at.isChannelEnabled=gl;at.destroyAll=()=>{Sr(),Sr(at.colors),go.clear(),bo.clear()};var om=at("IT:InfiniteTable"),im="#dc3545",rm="#eb9316";var Sl="Warn",wl="Error",am="Info",lm="Success",sm="Logs",qo=om.extend(sm),rb=qo.extend(am),um=qo.extend(Sl),dm=qo.extend(wl),ab=qo.extend(lm);var cm=rm,fm=im;var pm=(o,t)=>{t=t?t.extend?t.extend(Sl):t:um,t(typeof t.color=="function"?t.color(cm,o):o)},mm=(o,t)=>{t=t?t.extend?t.extend(wl):t:dm,t(typeof t.color=="function"?t.color(fm,o):o)};var Tl=new $,vl=(o,...t)=>{Tl.has(t)||(Tl.set(t,!0),o())};var Fn=(o,t=o,e)=>{vl(()=>pm(o,e),t,"warn")},Il=(o,t=o,e)=>{vl(()=>mm(o,e),t,"error")};function Co(o){return o}function tn(o,t){return t.reduce((e,n)=>{let{field:i,valueGetter:r,toKey:a}=n,l=i?o[i]:r?.({data:o,field:i}),u=(a||Co)(l,o);return e.push(u),e},[])}var hm=new $,Rl=new WeakMap;function Yo(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return hm;let i=Rl.get(t);if(i&&i.groupBy===e)return i.groups;let r=new $,a=e.length,l=[];return t.forEach(u=>{let d=tn(u,e);l.length=0;for(let s=0;s<d.length;s++){l.push(d[s]);let c=r.get(l);c||(c={count:0},l.length===a&&(c.primaryKeys=[]),r.set(l,c)),c.count++,c.primaryKeys?.push(n(u))}}),Rl.set(t,{groupBy:e,groups:r}),r}function gm(o,t){let e=[];return o.getLeafNodesStartingWith(t,n=>{let i=n.value?.primaryKeys;if(i)for(let r=0;r<i.length;r++)e.push(i[r])}),e}var _e=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new $;this.deselectedMap=new $;this.onlyUsePrimaryKeys=!1;this.selectionCache=new $;this.selectionCountCache=new $;this.mapSet=(t,e)=>{Array.isArray(e)||(this.onlyUsePrimaryKeys?e=[e]:e=[...this.getGroupKeysForPrimaryKey(e),e]),this.xcache(),t==="selected"?this.selectedMap.set(e,!0):this.deselectedMap.set(e,!0)};this._selectedMapSet=t=>{this.mapSet("selected",t)};this._deselectedMapSet=t=>{this.mapSet("deselected",t)};let i=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;this.getConfig=e,this.onlyUsePrimaryKeys=e().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(i)}getGroupKeysForPrimaryKey(t){let{indexer:e,groupBy:n}=this.getConfig(),i=e.getDataForPrimaryKey(t);return i?tn(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t==="visible"&&!!e}targetsFilteredOutRows(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t!=="visible"&&!!e}getVisibleDataInsideGroup(t){let{postFilterDataArray:e,groupDeepMap:n}=this.getConfig();return t.length?n?.get(t)?.items??[]:e??[]}hasFilteredOutRowsInsideGroup(t){let e=this.getConfig();return e.someRowsFilteredOut?(t.length?Yo(e).get(t)?.count??0:e.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(t).length:!1}setVisibleRowsSelection(t,e){let{groupBy:n,toPrimaryKey:i}=this.getConfig(),r=e?this.selectedMap:this.deselectedMap,a=e?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(t).forEach(l=>{let u=tn(l,n),d=i(l),s=[...u,d];a.delete(s),this.isRowSelected(d,u)!==e&&r.set(s,!0)}),this.xcache()}getLazyUnfilteredCount(t){let e=this.getConfig();if(!(!e.lazyLoad||e.multiRowSelectionTarget==="visible"))return t.length?e.groupDeepMap?.get(t)?.totalChildrenCountUnfiltered:e.lazyUnfilteredCount}getLazyHiddenRowsCount(t){let e=t.length<this.getGroupByLength()?this.getLazyUnfilteredCount(t):void 0;if(e===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),i=0;return this.getGroupKeysDirectlyInsideGroup(t).forEach(r=>{i+=this.getLazyUnfilteredCount(r)??(n?.get(r)?.totalChildrenCount||0)}),Math.max(e-i,0)}getGroupCount(t){if(t.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Yo(this.getConfig()).get(t)?.count??0;let n=this.getGroupDeepMap()?.get(t);return n?this.getLazyUnfilteredCount(t)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let e=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Yo(e).getKeysStartingWith(t,n):e.groupDeepMap?.getKeysStartingWith(t,n)||[]}getAllPrimaryKeysInsideGroup(t){let e=this.getConfig(),{groupDeepMap:n,toPrimaryKey:i}=e;if(this.targetsFilteredOutRows())return t.length?gm(Yo(e),t):(e.originalDataArray??[]).map(i);if(!e.groupBy.length)return this.getVisibleDataInsideGroup([]).map(i);if(!t.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let r=n?.get(t);return r?r.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(t,e,n){return new o(t,e,n)}update(t){this.selectedRows=t.selectedRows||null,this.deselectedRows=t.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=t.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys||r===0&&a.length===1?a[0]:a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(t,e){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([t]):this.selectedMap.has([t]);e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t],i=this.selectionCache.get(n);if(i!==void 0)return i;let r=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(r)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(e))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(e))return this.selectionCache.set(n,!1),!1;for(e=[...e];e.length;){e.pop();let l=this.selectedMap.has(e),u=this.deselectedMap.has(e);if(l)return this.selectionCache.set(n,!0),!0;if(u)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(t,e){return!this.isRowSelected(t,e)}setRowSelected(t,e,n){e?this.setRowAsSelected(t,n):this.setRowAsDeselected(t,n)}getGroupRowSelectionState(t){let e=this.selectionCache.get(t);if(e!==void 0)return e;let{selectedCount:n,deselectedCount:i}=this.getSelectionCountFor(t,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(t)),r=n&&i?null:!!n;return this.selectionCache.set(t,r),r}getGroupRowBooleanSelectionStateFromParent(t){if(!t.length)return this.defaultSelection;let e=[...t],n=this.deselectedMap.has(e),i=this.selectedMap.has(e),r=i&&!n?!0:n&&!i?!1:void 0;if(r===void 0)for(;e.length;){if(e.pop(),this.deselectedMap.has(e)){r=!1;break}if(this.selectedMap.has(e)){r=!0;break}}return r===void 0&&(r=this.defaultSelection),r}isGroupRowPartlySelected(t){return this.getGroupRowSelectionState(t)===null}isGroupRowSelected(t){return this.getGroupRowSelectionState(t)===!0}isGroupRowDeselected(t){return this.getGroupRowSelectionState(t)===!1}selectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!0?this.deselectedMap.delete([r]):this._selectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!0);return}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!1);return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let f=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,f),f}if(this.onlyUsePrimaryKeys&&(i||this.targetsVisibleRowsOnly())){let f=this.getAllPrimaryKeysInsideGroup(t),m=0,p=0;f.forEach(y=>{if(this.defaultSelection){if(this.deselectedMap.has([y])){p++;return}m++}else{if(this.selectedMap.has([y])){m++;return}p++}});let h={selectedCount:m,deselectedCount:p};return this.selectionCountCache.set(t,h),h}if(t.length===i&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:f}=this.getConfig(),m=0,p=0;this.getVisibleDataInsideGroup(t).forEach(y=>{this.isRowSelected(f(y),t)?m++:p++});let h={selectedCount:m,deselectedCount:p};return this.selectionCountCache.set(t,h),h}e=e??this.getGroupRowBooleanSelectionStateFromParent(t);let r=this.getGroupKeysDirectlyInsideGroup(t);if(t.length===this.getGroupByLength()){let f=this.selectedMap.has(t)?!0:this.deselectedMap.has(t)?!1:e,m=this.getGroupCount(t),p=this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,h=this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,y=m-(p+h),C={selectedCount:p+(f?y:0),deselectedCount:h+(f?0:y)};return this.selectionCountCache.set(t,C),C}let a=0,l=0,{lazyLoad:u,groupDeepMap:d}=this.getConfig();if(u&&!r.length){let f=this.getLazyUnfilteredCount(t)??(d?.get(t)?.totalChildrenCount||0);e?(a=f,l=this.deselectedMap.getAllChildrenSizeFor(t),l===f&&(a=0)):(l=f,a=this.selectedMap.getAllChildrenSizeFor(t),a===f&&(l=0))}r.forEach(f=>{let m=this.selectedMap.get(f),p=this.deselectedMap.get(f),h=m?!0:p?!1:e,{selectedCount:y,deselectedCount:C}=this.getSelectionCountFor(f,h);a+=y,l+=C});let s=r.length?this.getLazyHiddenRowsCount(t):0;e?a+=s:l+=s;let c={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(t,c),c}};var nn=o=>{let t=at(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},on=o=>{let t=at(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},To=()=>To;To.extend=()=>To;var ft=class{constructor(t){this.debug=To,this.error=To}};var ym=function(o,t){return o-t},bm=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},Cm=function(o,t){return o-t},Tm={number:ym,string:bm,date:Cm},rn=Tm;var Ke=ze().requestAnimationFrame||(o=>setTimeout(o,16)),yn=ze().cancelAnimationFrame||(o=>clearTimeout(o));function an(o,t,e){if(o===t)return!0;if(!o||!t)return!1;let n=typeof o;if(n!==typeof t||n!=="object")return!1;var r=Object.keys(o),a=Object.keys(t);e&&(r=r.filter(s=>!e.has(s)),a=a.filter(s=>!e.has(s)));var l=r.length;if(a.length!==l)return!1;for(var u=0;u<l;u++){var d=r[u];if(!(e&&e.has(d))&&(o[d]!==t[d]||!Object.prototype.hasOwnProperty.call(t,d)))return!1}return!0}function Pr(o){return o.map(Nt)}function Nt(o){if(ze().structuredClone)return ze().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Pr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Pr(Array.from(o)));if(o instanceof Map)return new Map(Pr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Nt(o[e]));return t}var bn=Object.seal({data:null,field:null});var sn="____root____",Pl="____not_loaded_yet____";function ln(){return!1}function Dr(o){if(!o||!Object.keys(o).length)return{};let t={};for(let e in o)if(o.hasOwnProperty(e)){let n=o[e].initialValue;t[e]=typeof n=="function"?n():n}return t}function Zo(o,t,e,n,i){if(!(!e||!Object.keys(e).length)){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a.reducer!="function")continue;let l=n[r],u=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[r]=a.reducer(l,u,o,t,i)}}}function Dl(o,t){let{marker:e,reducers:n={},pivot:i,groupBy:r,indexer:a,toPrimaryKey:l,cache:u,mappings:d}=o;e&&e.start();let s=new $;function c(C,b,S,w=0,T=[]){let x=!S.length||w===S.length-1,R=b[d?.values||"values"]||{};for(let E in R)if(R.hasOwnProperty(E)){let N=E;T.push(N),f.set(T,!0),C.set(T,{reducerResults:R[E][d?.totals||"totals"]||{},items:[]}),x||c(C,R[E],S,w+1,T),T.pop()}}let f=i?new $:void 0,m=[],p=Dr(n),h=Nt(p);t.visitDepthFirst((C,b,S,w)=>{let[T,...x]=b,R=C.children,E=s.get(x);if(E&&(E.cache=C.cache,E.childrenLoading=C.childrenLoading,E.childrenAvailable=C.childrenAvailable,E.error=C.error),x.length==r.length&&r.length){if(E){E.items=R;for(let v=0,P=x.length;v<P;v++){let F=x.slice(0,v),M=s.get(F);M&&(M.items=M.items||[],M.items=M.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return w?.()}for(let N=0,v=R.length;N<v;N++){if(!R[N]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...x,`${Pl}${N}`],_);continue}let P=R[N].data,F=R[N].keys||[];if(F.length){let _=F[F.length-1];x.push(_)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:R[N].totalChildrenCount,totalChildrenCountUnfiltered:R[N].totalChildrenCountUnfiltered,reducerResults:R[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(x,M),i){let _=M.pivotDeepMap=new $,A=R[N].pivot;c(_,A,i,0,m)}F.length&&x.pop()}w?.()});let y={deepMap:s,groupParams:o,initialData:t,reducerResults:h};return i&&(y.topLevelPivotColumns=f,y.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(C=>C.field).join(", ")}]}),y}function xl(o,t,e,n,i,r,a,l,u,d=Co){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Zo(n,i,a,c,t),r){for(let m=0,p=r.length;m<p;m++){let{field:h,valueGetter:y,toKey:C}=r[m],b=h?n[h]:null;y&&(bn.data=n,bn.field=h,b=y(bn));let S=(C||d)(b,n);e.push(S),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Nt(u),items:[]}));let{reducerResults:w,items:T}=f.get(e);T.push(n),a&&Zo(n,i,a,w,t)}e.length=0}}function Al(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:d,toKey:s}=o,c=s(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let C=0,b=n.length;C<=b;C++){let S=n.slice(0,C),w=t.get(S),{reducerResults:T,items:x}=w;x.push(i),w.leavesAvailableCount++,w.totalLeafNodesCount++,a&&Zo(i,r,a,T,S)}return}let p=Nt(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=d(i);if(!(!y||!Array.isArray(y))){for(let C=0,b=y.length;C<b;C++){let S=y[C];Al(o,t,e,f,S,C,a,l)}a&&So(a,p,h)}}function Ar(o,t){let{reducers:e,marker:n}=o;if(n){let d=Object.keys(e??{});n.start({details:d.length>0?[{name:"Reducers",value:d.join(", ")}]:void 0})}let i=Dr(e),r=Nt(i),a=new $,l=new $;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let d=0,s=t.length;d<s;d++)Al(o,a,l,[],t[d],d,e,i);e&&So(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function Jo(o,t){let{marker:e,groupBy:n,defaultToKey:i=Co,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new $:void 0,d=new $,s=[],c=[],f=Dr(a),m=Nt(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(f)};r&&(h.pivotDeepMap=new $),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let S=0;S<l;S++){let{field:w,groupField:T,valueGetter:x,toKey:R}=n[S],E=w?C[w]:null;x&&(bn.data=C,bn.field=w,E=x(bn));let N=(R||i)(E,C);if(b[w||T]=N,s.push(N),!d.has(s)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(f)};r&&(v.pivotDeepMap=new $),d.set(s,v)}xl(d,s,c,C,h,r,a,u,f,i)}l||xl(d,s,c,C,h,r,a,u,f,i),a&&Zo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{So(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:w},T,x,R)=>{So(a,w,S),R?.()}),b?.()}),So(a,m,t));let p={deepMap:d,groupParams:o,initialData:t,reducerResults:m};return r&&(p.topLevelPivotColumns=u,p.pivot=r),e&&e.end({details:[{name:"Group by fields",value:n.map(h=>h.field).join(", ")}]}),p}function _l(o){let{groupParams:t,deepMap:e}=o,n=t.groupBy.length,i=[];return e.topDownKeys().reduce((r,a)=>{if(a.length===n){let l=e.get(a).items;r.push(...l)}return r},i),i}function Sm(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:d,pivotDeepMap:s,commonData:c}=t,f=c??null,m;if(Object.keys(d).length>0){f={...c},m={};for(let b in r)if(r.hasOwnProperty(b)){let w=r[b].field;w&&(m[w]=d[b]),w&&f[w]==null&&(f[w]=d[b])}}let p=!0,h=n[n.length-1],y=h;if(f!=null){let b=e[n.length-1];b&&b.field&&(y=f[b.field]),b&&b.toKey&&(y=b.toKey(y,f)),y=y??h}return typeof y=="string"&&y.startsWith(Pl)&&(p=!1,y=null),{data:f,reducerData:m,groupCount:u.length,groupData:u,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:ln,hasSelectedCells:ln,selfLoaded:p,error:o.error,parents:i,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:y,rootGroupBy:e,groupBy:l===e.length?e:e.slice(0,l),isGroupRow:!0,pivotValuesMap:s,groupNesting:l,reducerResults:d}}function Xo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function So(o,t,e){if(o){for(let n in o)if(o.hasOwnProperty(n)){let i=o[n];i.done&&(t[n]=i.done(t[n],e))}}return t}function Ml(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:d,treeResult:s,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:y,rowsPerPage:C}=i,{deepMap:b}=s,S=o.length,w=e[e.length-1],T=w?w.nodeExpanded:!0;for(let x=0;x<S;x++){let R=o[x],E=d(R,x),N=[...t,E];if(l(R)){let D={id:E,nodePath:N,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:ln,hasSelectedCells:ln,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,x],indexInParent:x,indexInAll:T?r.length:-1};f&&(D.rowSelected=f(D)),c&&(D.rowDisabled=c(D)),m&&m(D);let O=y&&C!=null&&C>0&&D.indexInAll%C===0?D.indexInAll/C:null;for(let L=0,K=e.length;L<K;L++){let B=e[L];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(D),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=Xo(B,D.indexInAll,O);r[G.indexInAll]=G,D.indexInAll++}}T&&(r[D.indexInAll]=D);continue}let F=b.get(N)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:E,data:R,indexInAll:r.length,indexInParent:x,indexInParentNodes:[...n,x],totalLeafNodesCount:F,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:ln,hasSelectedCells:ln,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(M.rowSelected=f(M),h)){let D=h.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=D.selectedCount,M.deselectedLeafNodesCount=D.deselectedCount}c&&(M.rowDisabled=c(M)),m&&m(M);let _=!0;if(p&&(M.selfExpanded=_=p(M)),T||(_=!1),M.nodeExpanded=_,T&&y&&C!=null&&C>0){let D=M.indexInAll,O=M.parentNodes;if(O.length>0&&D%C===0){let L=D/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(Xo(B,D+K,L)),K++,M.indexInAll++)})}}T&&(r[M.indexInAll]=M);let A=u(R);Array.isArray(A)&&Ml(A,N,[...e,M],M.indexInParentNodes,i,r)}return r}function El(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return Ml(t,[],[],[],o,n),e&&e.end(),{data:n}}function Fl(o){let{marker:t,lazyLoad:e,groupResult:n,rowsPerPage:i,repeatWrappedGroupRows:r,withRowInfo:a,toPrimaryKey:l,groupRowsState:u,isRowDisabled:d,isRowSelected:s,rowSelectionState:c,generateGroupRows:f,reducers:m={}}=o,{groupParams:p,deepMap:h,pivot:y}=n,{groupBy:C}=p;t&&t.start({details:[{name:"Group by fields",value:C.map(x=>x.field).join(", ")}]});let b=[],S=[],w=[],T=[];return h.visitDepthFirst((x,R,E,N)=>{let v=x.items,P=R.length,F=u?.isGroupRowCollapsed(R)??!1;T.push(E);let M=Sm({lazyLoad:e,groupBy:C,parents:Array.from(w),reducers:m,indexInGroup:E,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:R,error:x.error,totalChildrenCount:x.totalChildrenCount,childrenLoading:(x.childrenLoading||!F&&!x.childrenAvailable)&&e,childrenAvailable:x.childrenAvailable,directChildrenCount:R.length===C.length?x.items.length:h.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},x);if(s&&(M.rowSelected=s(M),c)){let L=c.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=L.selectedCount,M.deselectedChildredCount=L.deselectedCount}d&&(M.rowDisabled=d(M));let _=w[w.length-1],A=_?.collapsed??!1;A&&(F=!0),M.collapsed=F;let D=f||F;if(A&&(D=!1),D){if(r&&i!=null&&i>0){let L=M.indexInAll,K=M.parents;if(K.length>0&&L%i===0){let B=L/i,G=0;K.forEach(se=>{typeof r=="function"&&r(se)!==!0||(b.push(Xo(se,L+G,B)),G++,M.indexInAll++)})}}b.push(M),S.push(b.length-1)}M.collapsedChildrenCount=0,w.forEach(L=>{L.deepRowInfoArray.push(M),L.collapsedGroupsCount+=F?1:0}),_&&M.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),a&&a(M),w.push(M);let O=!0;if(O){if(N)N();else if(!y){let L=b.length;F||(b.length+=v.length);let K=0;for(let B=0,G=v.length;B<G;B++){let se=v[B];if(!F&&r&&i!=null&&i>0){let xe=L+B+K;if(xe%i===0){let Ge=xe/i;w.forEach(Oe=>{if(typeof r=="function"&&r(Oe)!==!0)return;let Se=L+B+K;b[Se]=Xo(Oe,Se,Ge),K++,b.length++})}}let Z=L+B+K,ge={id:se?l(se,Z):`${R}-${B}`,data:se,isCellSelected:ln,hasSelectedCells:ln,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!se,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:F,groupKeys:R,parents:Array.from(w),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:P+1,groupCount:M.groupCount};s&&(ge.rowSelected=s(ge)),d&&(ge.rowDisabled=d(ge)),a&&a(ge),w.forEach((xe,Ge)=>{Ge===w.length-1&&se&&(xe.directChildrenLoadedCount+=1),F&&(xe.collapsedChildrenCount+=1),xe.deepRowInfoArray.push(ge)}),F||(b[L+B+K]=ge)}}}w.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:S}}function Qo(o,t){return new _e(o,nt(t))}function nt(o){return()=>{let t=typeof o=="function"?o():o,{originalDataArray:e,postFilterDataArray:n}=t,i=!!t.lazyLoad,r=i?t.originalLazyGroupData.get([sn]):void 0;return{lazyLoad:i,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:i?e?.length??0:t.unfilteredCount,lazyUnfilteredCount:t.groupBy.length?r?.totalChildrenCountUnfiltered:r?.totalCountUnfiltered,multiRowSelectionTarget:t.multiRowSelectionTarget,someRowsFilteredOut:!t.lazyLoad&&!!e&&!!n&&n.length<e.length,originalDataArray:e,postFilterDataArray:n}}}function Nl(o){let{getDataSourceState:t,dataSourceActions:e}=o;return{get allRowsSelected(){return t().allRowsSelected},selectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof _e))throw"Invalid row selection";let a=new _e(i,nt(t));a.selectAll(),e.rowSelection=a},deselectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof _e))throw"Invalid row selection";let a=new _e(i,nt(t));a.deselectAll(),e.rowSelection=a},isRowSelected(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row")return a===i;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof _e))throw"Invalid row selection";if(!r){let s=u.getDataForPrimaryKey(i);r=s?tn(s,d):[]}return a.isRowSelected(i,r)},isRowDeselected(i,r){return!this.isRowSelected(i,r)},selectRow(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row"){e.rowSelection=i;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof _e))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?tn(c,d):[]}let s=new _e(a,nt(t));s.selectRow(i,r),e.rowSelection=s},deselectRow(i,r){let{selectionMode:a,rowSelection:l,indexer:u,groupBy:d}=t();if(a==="single-row"){e.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof _e))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?tn(c,d):[]}let s=new _e(l,nt(t));s.deselectRow(i,r),e.rowSelection=s}},toggleRowSelection(i,r){this.isRowSelected(i,r)?this.deselectRow(i,r):this.selectRow(i,r)},selectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,nt(t));u.selectGroupRow(i),e.rowSelection=u},deselectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,nt(t));u.deselectGroupRow(i),e.rowSelection=u},toggleGroupRowSelection(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof _e))throw"Invalid row selection";let u=new _e(a,nt(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new _e(r,nt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(d instanceof _e))throw"Invalid row selection";return d.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new _e(i,nt(r)):r.rowSelection,l=[];return r.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),r.originalDataArray.forEach(u=>{let d=r.toPrimaryKey(u);a.isRowSelected(d)&&l.push(d)}),l}}}var _r=new WeakMap,wm=o=>o;function Ol(o,t=50,e){_r.set(o,{lastCallTime:0,lastCallArg:null});let n=e??wm;return i=>{let{lastCallTime:r,lastCallArg:a}=_r.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=an(n(a),n(i));u<t&&d||(_r.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var vm="*",Be=class{constructor(t){this.wildcard=vm;this.cache=new $;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}selectCell(t,e){this.setCellSelected(t,e,!0)}deselectCell(t,e){this.setCellSelected(t,e,!1)}selectColumn(t){this.setCellSelected(this.wildcard,t,!0)}deselectColumn(t){this.setCellSelected(this.wildcard,t,!1)}setCellSelected(t,e,n){let i=t===this.wildcard,r=e===this.wildcard;if(this.isCellSelected_Internal(t,e)===n)return;let l=[];if(i){let d=this.deselectedColumnsToRows.get(e),s=this.selectedColumnsToRows.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(c,e,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(c,e,!1)}),[...this.cache.keys()].forEach(c=>{let[f,m]=c;m===e&&l.push([f,e])})}if(r){let d=this.deselectedRowsToColumns.get(e),s=this.selectedRowsToColumns.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(t,c,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(t,c,!1)}),[...this.cache.keys()].forEach(c=>{let[f]=c;f===t&&l.push([t,e])})}let u=[t,e];if(l.forEach(d=>{this.cache.delete(d)}),this.cache.delete(u),n)if(this.defaultSelection){let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1);let s=this.deselectedRowsToColumns.get(this.wildcard),c=this.deselectedColumnsToRows.get(this.wildcard);(s?.has(e)||c?.has(t))&&this.setCellInSelection(t,e,!0)}else{let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1),this.setCellInSelection(t,e,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1),this.setCellInDeselection(t,e,!0);else{this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1);let s=this.selectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard);if(s?.has(e)||c?.has(t)){this.setCellInDeselection(t,e,!0);return}}}setCellInDeselection(t,e,n){if(n){let i=this.deselectedRowsToColumns.get(t)||new Set;i.add(e),this.deselectedRowsToColumns.set(t,i)}else{let i=this.deselectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.deselectedRowsToColumns.delete(t))}if(n){let i=this.deselectedColumnsToRows.get(e)||new Set;i.add(t),this.deselectedColumnsToRows.set(e,i)}else{let i=this.deselectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.deselectedColumnsToRows.delete(e))}}setCellInSelection(t,e,n){if(t===this.wildcard&&e===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let i=this.selectedRowsToColumns.get(t)||new Set;i.add(e),this.selectedRowsToColumns.set(t,i)}else{let i=this.selectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.selectedRowsToColumns.delete(t))}if(n){let i=this.selectedColumnsToRows.get(e)||new Set;i.add(t),this.selectedColumnsToRows.set(e,i)}else{let i=this.selectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.selectedColumnsToRows.delete(e))}}update(t){let e=t.selectedCells||null,n=t.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),e&&e.forEach(([i,r])=>{this.setCellInSelection(i,r,!0)}),n&&n.forEach(([i,r])=>{this.setCellInDeselection(i,r,!0)}),this.defaultSelection=t.defaultSelection}isCellSelectionInRow(t,e){if(this.defaultSelection){let i=this.deselectedRowsToColumns.get(t);if(i){if(i.has(this.wildcard)){let r=this.selectedRowsToColumns.get(t);return r&&r.size>0?e.some(a=>r.has(a)):!1}return e.some(r=>!i.has(r))}return!0}let n=this.selectedRowsToColumns.get(t);if(n){if(n.has(this.wildcard)){let i=this.deselectedRowsToColumns.get(t);return i&&i.size>0?!e.every(a=>i.has(a)):!0}return e?e.some(i=>n.has(i)):!1}return!1}error(t){on(`${this.debugId}:CellSelectionState`)(t)}isCellSelected(t,e){return t===this.wildcard||e===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(t,e)}isCellSelected_Internal(t,e){let n=[t,e],{cache:i}=this,r=i.get(n);if(r!=null)return r;let a=()=>(i.set(n,!1),!1),l=()=>(i.set(n,!0),!0),u=this.deselectedColumnsToRows.get(this.wildcard),d=this.deselectedRowsToColumns.get(this.wildcard),s=this.selectedColumnsToRows.get(this.wildcard),c=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let p=this.deselectedRowsToColumns.get(t);return p&&p.has(e)?a():u?.has(t)||d?.has(e)?this.selectedRowsToColumns.get(t)?.has(e)?l():a():l()}let m=this.selectedRowsToColumns.get(t);return m&&m.has(e)?l():s?.has(t)||c?.has(e)?this.deselectedRowsToColumns.get(t)?.has(e)?a():l():a()}getState(){let t=[],e=[];return this.deselectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{t.push([i,r])})}),this.selectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{e.push([i,r])})}),{defaultSelection:this.defaultSelection,deselectedCells:t,selectedCells:e}}};var jn=require("vue");var Re=require("vue");var te=(...o)=>o.filter(t=>!!`${t}`).join(" ");var kl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Ll={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Tt="_16lm1iw3b _16lm1iw3c _16lm1iw35",zl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},ei={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Vl={1:"_16lm1iw1c",none:"_16lm1iw1d"},Mr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Gl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Kl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Bl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Hl={none:"_16lm1iwd"},ti={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Wl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var jl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var $l={none:"_16lm1iw1x"};var Ul={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var ql={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};var pt=require("vue");function Im(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var n=e.call(o,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function Rm(o){var t=Im(o,"string");return typeof t=="symbol"?t:String(t)}function xm(o,t,e){return t=Rm(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Yl(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,n)}return e}function Zl(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Yl(Object(e),!0).forEach(function(n){xm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Yl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function Xl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var Pm=(o,t,e)=>{for(var n of Object.keys(o)){var i;if(o[n]!==((i=t[n])!==null&&i!==void 0?i:e[n]))return!1}return!0},Ie=o=>{var t=e=>{var n=o.defaultClassName,i=Zl(Zl({},o.defaultVariants),e);for(var r in i){var a,l=(a=i[r])!==null&&a!==void 0?a:o.defaultVariants[r];if(l!=null){var u=l;typeof u=="boolean"&&(u=u===!0?"true":"false");var d=o.variantClassNames[r][u];d&&(n+=" "+d)}}for(var[s,c]of o.compoundVariants)Pm(s,i,o.defaultVariants)&&(n+=" "+c);return n};return t.variants=()=>Object.keys(o.variantClassNames),t.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Xl(o.variantClassNames,e=>Xl(e,n=>n.split(" ")[0]))}},t};var Jl="_1eexc2a6";var Ql=Ie({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),es="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",ts=Ie({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ns=Ie({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),os=Ie({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),is="_12zfob12u _16lm1iw22 _16lm1iw1z";var rs="_12zfob17",as="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",ls=Ie({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Er=Ie({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),ss="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",us=Ie({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),ds="_12zfob1b _16lm1iw2",cs="_16lm1iw1",fs="_12zfob16",ps=Ie({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),ms="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var ht="InfiniteIcon";var hs="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var gs={transition:"width 0.25s, opacity 0.25s"},ys=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var Nn=(0,pt.defineComponent)(o=>{let t=(0,pt.ref)(0),e=null;return(0,pt.onMounted)(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),(0,pt.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),()=>{let{lineWidth:n=1,className:i,index:r}=o,a=r!=null&&r>0,l=o.size??16,u=Math.floor(l/4),d=[l-1*u,l-2*u,l-3*u],s={...gs,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return(0,pt.h)("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:te(i,ht,hs,`${ht}-filter`)},[a?(0,pt.h)("div",{"data-name":"index",class:rs},`${r}`):null,(0,pt.h)("div",{style:{width:`${d[0]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[1]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...ys]});var ni=Object.freeze({}),Dm={string:ni,number:{}};function On(o,t){let e=t.default||ni;return o.type===void 0?e:o.type===null?ni:typeof o.type=="string"?t[o.type]||Dm[o.type]||ni:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var Nr=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],d=[];e.forEach((R,E)=>{let N=R.maxSize??i??void 0,v=R.minSize??n??void 0;u.push(v),d.push(N),R.size!=null&&(N!=null&&R.size>N&&(R.size=N),v!=null&&R.size<v&&(R.size=v));let P=R.flex==0?null:R.flex;if(R.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${E} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,r+=R.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((R,E)=>{if(R.flex!=null){let N=c*R.flex,v=R.maxSize??i??void 0,P=R.minSize??n??void 0,F=!1,M=0;v!=null&&N>v&&(f[E]=!0,F=!0,M=v),P!=null&&N<P&&(m[E]=!0,F=!0,M=P),F&&(p+=1,l-=1,a-=R.flex,s-=M)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,S=0,w=0,T=[];return{items:e.map((R,E)=>{let N={...R},v=R.maxSize??i??void 0,P=R.minSize??n??void 0,F=0,M=f[E],_=m[E],A=M||_,D=R.size??0;if(R.flex!=null){if(A)_&&(F=P),M&&(F=v);else{y+=1;let O=L=>(v!=null&&L>v&&(L=v),P!=null&&L<P&&(L=P),L);y===l?F=O(C):(F=O(Math.round(R.flex*c)),w+=F,C=s-w,b-=R.flex,c=C/b)}D=F,N.flexSize=F}return h.push(F),T.push(D),N.computedSize=D,S+=D,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-S)}};function oi(o,t,e,n){return t!=null&&o<=t?{value:t,clamped:"min",diff:(o-t)*n}:e!=null&&o>=e?{value:e,clamped:"max",diff:(e-o)*n}:{value:o,clamped:!1,diff:0}}function Cs(o,t,e){let n=!1,i=0;for(let r of o)r.computedFlex&&(n=!0),i+=r.computedWidth;return n&&Math.round(i)>Math.round(t-e)}function Fr(o,t){return o.computedFlex&&!t?"flex":"width"}function wo(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var Or=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((P,F)=>(P[F]={...o.columnSizing[F]},P),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],d=l.id,s=u?.id,c=Cs(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=Fr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,S=u?Fr(u,c):"width",w=!1,T=!1,x=i>0?1:-1,{value:R,clamped:E,diff:N}=oi(Math.round(f+i),m,p,x);if(o.shareSpaceOnResize){if(u==null)return n[d]=wo(n[d],h,R),T=E==="min",w=E==="max",{adjustedDiff:R-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:w,constrained:T||w};let{value:P,clamped:F,diff:M}=oi(Math.round(y-i),C,b,x);if(E&&F&&(Math.abs(N)>Math.abs(M)?F=!1:E=!1),!(!E&&!F)){if(E){let _=oi(Math.round(y-i-N),C,b,x);P=_.value,F=_.clamped,M=_.diff}else if(F){let _=oi(Math.round(f+i+M),m,p,x);R=_.value,E=_.clamped,N=_.diff}}n[d]=wo(n[d],h,R),n[s]=wo(n[s],S,P),T=E==="min"||F==="min",w=E==="max"||F==="max"}else n[d]=wo(n[d],h,R),T=E==="min",w=E==="max";let v=R-f;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-v),columnSizing:n,minReached:T,maxReached:w,constrained:T||w}};function bs(o,t){return o+t}function Am(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var Ts=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=Cs(o.items,t,e),d=a.map(b=>Fr(b,u)),s=0,{computedSizes:c}=Nr({items:a.map(b=>(b.resizable===!1&&(s+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(bs,0)+i-s,0)}),f=a.map((b,S)=>c[S]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,S)=>{let w=a[S];if(!w.resizable){y.push(0);return}let T=d[S],x=l[S],R=Am(n),{maxReached:E,minReached:N,constrained:v,adjustedDiff:P}=Or({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[S],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[w.id]=wo(R[w.id],T,Math.round(x+P)),y.push(P),E||(p=!1),N||(m=!1),v||(h=!1)});let C=y.reduce(bs,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var ii;function Ot(){if(ii!=null)return ii;let o=ze().document??null;if(!o)return 0;let t=o.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",o.body.appendChild(t);let e=o.createElement("div");return t.appendChild(e),ii=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),ii}var Ss=["start",void 0,"end"],ws=(o,t)=>(t&&Object.keys(t).length>0&&o.sort((e,n)=>{let i=t[e],r=t[n];return i===!0&&(i="start"),r===!0&&(r="start"),i==r?0:Ss.indexOf(i)-Ss.indexOf(r)}),o);function vs(o,t,...e){let n=t;return e.forEach(i=>{for(let r in i)i.hasOwnProperty(r)&&o(i[r],r)&&(n[r]=i[r])}),n}function kr(o,...t){return vs(e=>e!=null,o,...t)}function Is(o,t,...e){return vs((n,i)=>!(i in o),t,...e)}var ri=!0,_m=!0,Mm=!0,Rs="string",Ut="unknown";var Em=on("getComputedVisibleColumns"),Fm=(o,t,e)=>o[e]!==!1,Lr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function Cn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function Nm(o,t){let e=On(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:Rs}function Om(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Ut];let l=Cn(t,a);if(!l)return[Ut];let u=Nm(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Ut)?Ut:i.length===1?i[0]:i}function zr(o,t){let{colType:e,sortable:n,columnDefaultSortable:i}=t,r=o.defaultSortable??e.defaultSortable,a=!!o.groupByForColumn;if(r==null&&!a){let l=o.field??e.field,u=o.valueGetter??e.valueGetter;l==null&&u==null&&(r=!1)}return n??r??i??ri}var xs=({columns:o,userColumns:t,bodySize:e,columnMinWidth:n,columnMaxWidth:i,columnDefaultWidth:r,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:u,columnHeaderCssEllipsis:d,pinnedStartMaxWidth:s,pinnedEndMaxWidth:c,filterValue:f,sortable:m,sortInfo:p,multiSort:h,filterTypes:y=kn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:w,columnOrder:T,columnPinning:x,editable:R,columnDefaultEditable:E,columnDefaultFilterable:N,columnDefaultGroupable:v,columnDefaultSortable:P,columnSizing:F,columnTypes:M,columnVisibility:_,columnVisibilityAssumeVisible:A,groupBy:D})=>{let O=0,L={};D.forEach((g,I)=>{g.field&&(L[g.field]=I)});let K=(f||[]).reduce((g,I)=>{let{id:z,field:k}=I;return k&&(g[k]=I),z&&(g[z]=I),g},{}),B=ws(T===!0?Object.keys(o):T,x),G=B.filter(g=>o[g]?Fm(_,A,g):(Em(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),se=new Map,Z=G.map((g,I)=>{let z=o[g];return se.set(g,I),z}),Me=(p??[]).reduce((g,I,z)=>(I.id?g[I.id]={sortInfo:I,index:z}:I.field&&(g[I.field]={sortInfo:I,index:z}),g),{});function ge(g){let I=o[g],z=On(I,M),k={minWidth:z?.minWidth,maxWidth:z?.maxWidth,width:z?.defaultWidth,flex:z?.defaultFlex},Y={width:I?.defaultWidth,flex:I?.defaultFlex,minWidth:I?.minWidth,maxWidth:I?.maxWidth},V=F[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let Q=kr(Y,V);Q.width!=null&&delete k.flex,Q.flex!=null&&delete k.width,Q=kr(k,Q);let pe=Q.flex??void 0,ue=Q.minWidth??I?.minWidth??n,me=Q.maxWidth??I?.maxWidth??i,le=pe!=null?void 0:Q.width??(a?void 0:r);return!le&&pe==null&&(a?pe=a:le=ue),{size:le,flex:pe,minSize:ue,maxSize:me}}let xe=Nr({availableSize:Math.max(e.width-(C??0)-(l??Ot()),0),maxSize:i,minSize:n,items:G.map(ge)}),{computedSizes:Ge,flexSizes:Oe,minSizes:Se,maxSizes:Fe}=xe,ce=[],ee=[],H=[],q=[];q.length=G.length;let J=new Map,ne=new Map,ie=0,ye=0,be=0,oe=null,W=[],re=0,we=0,Pe=0;Z.forEach((g,I)=>{let z=G[I],k=Ge[I],Y=W[I]=Lr(z,x);Y==="start"?re+=k:Y==="end"?Pe+=k:we+=k});let ve=e.width-Pe,Xe=[],je=new Map;G.forEach((g,I)=>{let z=Z[I];je.set(g,z)});let fe=[];Object.keys(o).forEach(g=>{let I=o[g];fe.push(g),je.has(g)||je.set(g,I)});let mt=new Map;je.forEach((g,I)=>{let z=se.get(I);z==null&&(z=-1);let k=z!=-1,Y=G[z+1],V=On(g,M),Q=z,pe=Me[I]?Me[I]:g.field?Me[g.field]??null:null,ue=pe?.sortInfo??null,me=!!ue,le=me&&ue.dir===1,Ce=me&&!le,De=pe?.index??-1,ae=k?{}:ge(I),Ct=k?Ge[z]:ae.size||0,Ht=k&&Oe[z]||null,Wt=k?Se[z]||0:ae.minSize||0,Et=k?Fe[z]||1e4:ae.maxSize||1e4,Ue=k?Lr(I,x):!1,jt=k?z===G.length-1:!1,$t=Q,fo=k?Ue==="start"?ye:Ue==="end"?be:O-ye:0;Ue=="start"?$t=k?Q:-1:Ue==="end"?$t=k?Q-(ce.length+H.length):-1:$t=k?Q-ce.length:-1;let Qt=k?Ue==="start"||Ue===!1?O:ve+be:-1,Mp=k?Ue!==oe:!1,Ep=k?jt||Ue!==Lr(Y,x):!1,el=g.cssEllipsis??V.cssEllipsis??u,Fp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??el,Ho=k&&(K[I]||g.field||g.groupByForColumn)&&(K[I]||K[g.field||g.groupByForColumn])||null,Np=g.defaultFilterable??V.defaultFilterable??N??!0,Op=R??g.defaultEditable??V.defaultEditable??E??!1,hr=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||Rs,kp=g.sortType||V.sortType||hr,tl=g.filterType||V.filterType||hr,nl=!1;if(Ho!=null&&!Ho.disabled){let yr=y[tl];yr&&(!yr.emptyValues||!yr.emptyValues.includes(Ho.filter.value))&&(nl=!0)}let Mn=g.field??V.field,Lp=g.valueGetter??V.valueGetter,gr=g.defaultGroupable??V.defaultGroupable??v??!!Mn;Mn||(gr=!1),g.groupByForColumn&&(gr=!1);let ol=Mn?L[Mn]!==void 0:!1,zp=ol?L[Mn]:void 0,Vp=zr(g,{colType:V,sortable:m,columnDefaultSortable:P}),Gp=g.resizable??V.resizable??b??_m,Ze={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Lp,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:Mn,...g,components:{...V.components,...g.components},computedResizable:Gp,computedMinWidth:Wt,computedMaxWidth:Et,computedFlex:Ht,computedDataType:hr,computedEditable:Op,computedSortType:kp,computedFilterType:tl,cssEllipsis:el,headerCssEllipsis:Fp,computedFilterValue:Ho,computedFiltered:nl,computedFilterable:Np,computedGroupable:gr,computedGroupedBy:ol,computedGroupedByIndex:zp,computedWidth:Ct,computedAbsoluteOffset:Qt,computedPinningOffset:fo,computedVisibleIndexInCategory:$t,computedOffset:O,computedSortable:Vp,computedSortInfo:ue,computedSortIndex:De,computedMultiSort:h,computedSorted:me,computedSortedAsc:le,computedSortedDesc:Ce,computedVisibleIndex:Q,computedPinned:Ue,computedDraggable:S??g.defaultDraggable??w??Mm,computedFirstInCategory:Mp,computedLastInCategory:Ep,computedFirst:z===0,computedLast:jt,id:I,header:g.header??V.header??g.name??g.field};k&&(O+=Ct,J.set(Ze.id,Ze),q[z]=Ze,Ue==="start"&&(ce.push(Ze),ye+=Ze.computedWidth),Ue==="end"&&(ee.push(Ze),be+=Ze.computedWidth),Ue||(H.push(Ze),ie+=Ze.computedWidth),oe=Ue),Ze.groupByForColumn&&(Ze.computedSortType=g.sortType||V.sortType||Om(Ze.groupByForColumn,t,M),Xe.push(Ze)),ne.set(Ze.id,Ze),Ze.field&&!Ze.groupByForColumn&&!mt.has(Ze.field)&&mt.set(Ze.field,Ze)}),Xe.forEach(g=>{g.computedSortable=Ps(g,{fieldsToColumn:mt,userColumns:t,columnTypes:M,sortable:m,columnDefaultSortable:P})});let rt=new Map;fe.forEach(g=>{let I=ne.get(g);I&&rt.set(g,I)}),ne.forEach(g=>{rt.has(g.id)||rt.set(g.id,g)});let vt=s!=null?Math.min(s,ye):ye,Mt=c!=null?Math.min(c,be):be;return{computedRemainingSpace:e.width-(re+Pe+we),computedPinnedStartColumnsWidth:ye,computedPinnedEndColumnsWidth:be,computedUnpinnedColumnsWidth:ie,computedColumnOrder:B,computedPinnedStartColumns:ce,computedPinnedEndColumns:ee,computedUnpinnedOffset:ye,computedPinnedEndOffset:ye+ie,computedUnpinnedColumns:H,computedVisibleColumns:q,computedColumnsMap:ne,computedColumnsMapInInitialOrder:rt,computedVisibleColumnsMap:J,computedPinnedEndWidth:Mt,computedPinnedStartWidth:vt,renderSelectionCheckBox:q.reduce((g,I)=>g||!!I.renderSelectionCheckBox,!1),fieldsToColumn:mt}};function Ps(o,t){let{sortable:e,fieldsToColumn:n,columnDefaultSortable:i,userColumns:r,columnTypes:a}=t;if(e)return e;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let u=i??ri,d=o.sortType??o.colType.sortType;return d!=null&&d!==Ut&&u?!0:c=>{let{column:f,api:m}=c,p=f.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((h,y)=>{if(!h)return!1;let C=y.field||y.groupField,b;if(C){let S=n.get(C),w=S?m.getColumnApi(S.id):void 0;if(S&&w)b=w.isSortable();else{let T=Cn(r,C);if(T){let x=zr(T,{colType:On(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof x=="boolean"?x:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ri},!0)}}function lt(o,t){let{getComputed:e,getState:n,actions:i,api:r}=t;typeof o=="number"&&(o=e().computedVisibleColumns[o]);let a=typeof o=="string"?e().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(u){return t.api.getCellValues({columnId:a.id,primaryKey:u})},getCellValueByPrimaryKey(u){return l.getCellValuesByPrimaryKey(u)?.value??null},toggleContextMenu(u){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(u)},toggleFilterOperatorMenu(u){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(u)},showFilterOperatorMenu(u){n().onFilterOperatorMenuClick({target:u,column:a})},hideFilterOperatorMenu(){r.hideFilterOperatorMenu()},showContextMenu(u){n().onColumnMenuClick({target:u,column:a})},hideContextMenu(){i.columnMenuVisibleForColumnId=null},isVisible(){return e().computedVisibleColumnsMap.has(a.id)},setVisible(u){r.setVisibilityForColumn(a.id,u)},toggleSort(u={multiSortBehavior:"replace"}){return r.toggleSortingForColumn(a.id,u)},isSortable(){let{computedColumnsMap:u}=e();return typeof a.computedSortable=="function"?a.computedSortable({api:r,columnApi:l,column:a,columns:u}):a.computedSortable},getSortDir(){return r.getSortingForColumn(a.id)},setFilter(u){return r.setColumnFilter(a.id,u)},clearFilter(){return r.clearColumnFilter(a.id)},getSortInfo(){return r.getSortInfoForColumn(a.id)},setSort(u){u?r.setSortingForColumn(a.id,u):r.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function vo(o,t,e){let n=typeof o=="string"?t.getComputed().computedColumnsMap.get(o):o,{api:i,getComputed:r,getDataSourceState:a,actions:l,dataSourceActions:u,dataSourceApi:d}=t,s=a(),{allRowsSelected:c,someRowsSelected:f,selectionMode:m}=s,p=r(),h=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let y=lt(n.id,{...t,actions:l,dataSourceActions:u,dataSourceApi:d});h=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:y,dataSourceApi:d,renderLocation:e,dragging:!1,columnsMap:p.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:f,selectionMode:m,api:i,renderBag:{header:h}})??null}return h}var Ve="Infinite",He={rootClassName:Ve};var ai=`${Ve}HeaderCell__filter`,Vr=`${Ve}HeaderCell__filterOperator`,Ds=`${ai}__input`;var de=require("vue");function U(o){return o.slice(4,-1)}function li(o,t,e,n){let i=[...t],r={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=e(r);return i.push(a),o.computedFirst&&i.push(...t.map(l=>`${l}--first`)),o.groupByForColumn&&i.push(...t.map(l=>`${l}--group-column`)),o.computedLast&&i.push(...t.map(l=>`${l}--last`)),o.computedFirstInCategory&&i.push(...t.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&i.push(...t.map(l=>`${l}--last-in-category`)),n.rowSelected&&i.push(...t.map(l=>`${l}--row-selected`)),n.cellSelected&&i.push(...t.map(l=>`${l}--cell-selected`)),n.firstRow&&i.push(...t.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&i.push(...t.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&i.push(...t.map(l=>`${l}--disabled`)),n.treeNode&&i.push(...t.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(i.push(...t.map(l=>`${l}--group-row`)),i.push(...t.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?i.push(...t.map(l=>`${l}--pinned-${o.computedPinned}`)):i.push(...t.map(l=>`${l}--unpinned`)),i.filter(Boolean).join(" ")}var ru=require("vue");var Je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function As(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function _s(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function km(o,t,e){let n=As(o,e),i=As(t,e);return n===i?_s(e,t)-_s(e,o):n-i}function Ms(o){if(o.length<3)return o;let[...t]=o,e={top:0,left:0};return o.forEach(n=>{e.top+=n.top,e.left+=n.left}),e.top/=o.length,e.left/=o.length,t.sort((n,i)=>km(n,i,e)),t}function Lm(o){if(o.length<2)return!1;let t=o[0].left,e=o[0].top,n={left:!1,top:!1};for(let i=1,r=o.length;i<r;i++){if(n.left&&n.top)return!1;o[i].left!==t&&(n.left=!0),o[i].top!==e&&(n.top=!0)}return!(n.left&&n.top)}function zm(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=Ms(o);let e=o[0],n=o[o.length-1];return e.left===n.left?t.left===e.left&&t.top>=Math.min(e.top,n.top)&&t.top<=Math.max(e.top,n.top):t.top===e.top&&t.left>=Math.min(e.left,n.left)&&t.left<=Math.max(e.left,n.left)}function Es(o,t){if(Lm(o))return zm(o,t);o=Ms(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(Vm([e,r,a],t))return!0}return!1}function Vm(o,t){let[e,n,i]=o,r=t,a=(n.left-e.left)*(i.top-e.top)-(n.top-e.top)*(i.left-e.left);return a*((n.left-e.left)*(r.top-e.top)-(n.top-e.top)*(r.left-e.left))>=0&&a*((i.left-n.left)*(r.top-n.top)-(i.top-n.top)*(r.left-n.left))>=0&&a*((e.left-i.left)*(r.top-i.top)-(e.top-i.top)*(r.left-i.left))>=0}var Ln=class{containsPoint(t){return Es(this.getPoints(),t)}contains(t){let e=t.getPoints();for(let n=0,i=e.length;n<i;n++)if(!this.containsPoint(e[n]))return!1;return!0}intersects(t){return this.privateIntersects(t,!1)}privateIntersects(t,e){let n=t.getPoints();for(let i=0,r=n.length;i<r;i++)if(this.containsPoint(n[i]))return!0;return e?!1:t.privateIntersects(this,!0)}};var zn=class o extends Ln{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(Je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function Gm(o,t){let e=Math.min(o.left,t.left),n=Math.min(o.top,t.top),i=o.left+o.width,r=t.left+t.width,a=Math.max(i,r),l=o.top+o.height,u=t.top+t.height,d=Math.max(l,u);return new Ee({top:n,left:e,width:a-e,height:d-n})}var Ee=class o extends Ln{constructor(e){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=e.top,this.left=e.left,typeof e.width=="number"?(this.width=e.width,this.height=e.height):(this.width=e.right-e.left,this.height=e.bottom-e.top)}static fromDOMRect(e){return new o(e)}static clone(e){return new o(e)}static from(e){return o.clone(e)}static fromPoint(e){return o.from({top:e.top,left:e.left,width:0,height:0})}getMinimumBoundingRectangle(...e){let n=this;for(let i of e)n=Gm(n,i);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(e){return new zn(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function Io(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var Fs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Ns="_1yeub2vs",Os="_1yeub2vr",ks=Ie({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Gr="_1yeub2vp";var pT=Ie({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var j={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Kr=`${Ve}Body`,Ls=o=>o.querySelector(`.${Kr}`);var Tn=`${Ve}HeaderCell`,Br=`${Ve}HeaderWrapper`,zs=o=>Array.from(o.querySelectorAll(`.${Br}`));function Vn(o,t){let e=o;if(!e)return null;if(e&&e.matches(t))return e;for(;e=e.parentElement;)if(e.matches(t))return e;return null}function Vs(o,t,e){let n=o;if(!n)return null;if(n&&n.matches(t))return n;for(;n=n.parentElement;){if(n.matches(t))return n;if(n===e)return null}return null}var Ae={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},Gs="column-header-height";var Ks=`.${He.rootClassName}`;function Hr(o){return Vn(o,Ks)}var Bs=U(j.scrollLeft),Km=U(j.scrollTop),Bm=U(j.columnWidthAtIndex),Wr=U(j.columnOffsetAtIndex),Hs=U(j.columnReorderEffectDurationAtIndex),Hm=U(j.columnOffsetAtIndexWhileReordering),Wm=U(j.columnVisibilityAtIndex),jm=U(j.columnZIndexAtIndex);function kt(o,t,e){let n=e?Hr(e):document.querySelector(Ks);$m(o,t,n)}function $m(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Gn(o,t){if(t)for(var e in o){let n=j[e]?U(j[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function jr(o,t,e){kt(`${Wr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Bs}))`:`${o.computedAbsoluteOffset+t}px`,e)}function $r(o,t,e){kt(`${jm}-${o}`,`${t}`,e)}function Ro(o,t,e){kt(`${Hm}-${o}`,typeof t=="number"?`calc( var(${Wr}-${o}) + ${t}px )`:t,e)}function xo(o,t,e){kt(`${Wm}-${o}`,t,e)}function si(o,t,e){kt(`${Hs}-${o}`,e??"",t)}function Ur(o,t){let e=`${Hs}-${o}`;kt(e,Ae.components.Cell.reorderEffectDuration,t)}var Te={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Bm}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,kt(this.varName.get(o),t,e)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Wr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,kt(this.varName.get(o),t,e)}}};function Ws(o,t){Gn({[Bs]:`${o.scrollLeft}px`,[Km]:`${o.scrollTop}px`},t)}var Po={bodyWidth:{name:U(Ae.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(Ae.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(Ae.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(Ae.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(Ae.runtime.browserScrollbarWidth),value:""}},Um=U(j.scrollbarWidthHorizontal),js=U(j.scrollbarWidthVertical),qm=U(j.columnWidthAtIndex),Ym=U(j.columnZIndexAtIndex),$s=U(j.scrollLeft),Zm=U(j.activeCellColWidth),Us=U(j.activeCellColOffset),Xs=U(j.baseZIndexForCells),Xm=U(j.pinnedStartWidth),qs=U(j.bodyWidth),Jm=U(j.bodyHeight),Ys=U(j.pinnedEndOffset),Zs=U(j.pinnedEndWidth),Qm=U(j.computedVisibleColumnsCount);function qr(o,t){let e="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?e=t.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(e=t.visibleColsCount+o.computedVisibleIndexInCategory):e=-n*10,typeof e=="number"?`calc( var(${Xs}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Js(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Ot(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Te.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Te.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${$s}) )`:h.computedPinned==="end"?`calc( var(${Ys}) ${f.length?"+":""} ${f.map(b=>Te.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${$s}) )`:`${h.computedOffset}px`;let C=qr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${Ym}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[Po.browserScrollbarWidth.name]=`${Ot()}px`),m[Po.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[Po.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[Po.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${qm}-${h})`).join(" + ")})`,m[Po.visibleColumnsCount.name]=t.length,u!=null){m[Zm]=Te.columnWidths.get(u[1]);let p=Te.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Us]=h?`calc( ${Ae.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Us]=p}return m[Qm]=t.length,m[Um]=s.horizontal?`${c}px`:"0px",m[js]=s.vertical?`${c}px`:"0px",m[Xm]="calc( "+e.map(p=>Te.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Zs]="calc( "+n.map(p=>Te.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Xs]=t.length*10,m[Ys]=`calc( var(${qs}) - var(${Zs}) - var(${js}) )`,m[qs]=`${l.width}px`,m[Jm]=`${l.height}px`,m}var Do=(o,t,e)=>{if(o=[...o],t===e||o[t]===void 0||o[e]===void 0)return o;let n=o[t];return e<t,o.splice(t,1),o.splice(e,0,n),o};function Yr(o){let{newColumnOrder:t,visibleColumnOrder:e,existingColumnOrder:n,dragColumnId:i}=o;if(e.length!==t.length)return console.warn("new column order cannot contain less columns than the visible column order"),t;let r=e.indexOf(i),a=t.indexOf(i);if(r===a)return n;if(a>r){let l=t.indexOf(i),u=t[l-1],d=n.indexOf(u),s=n.indexOf(i);return Do(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return Do(n,s,d)}return t}var ou=po(Kn());function ui(o){return o.map(t=>t instanceof un?t:new un(null,[t]))}var un=class o{constructor(t,e=[]){this.__operands=[];this.__operation=null;this.__operands=e,this.__operation=t}add(...t){return new o("+",[this,...t])}subtract(...t){return new o("-",[this,...t])}minus(...t){return this.subtract(...t)}multiply(...t){return new o("*",[this,...t])}divide(...t){return new o("/",[this,...t])}__get(t){let{__operation:e,__operands:n}=this,i=n.map(a=>eh(a,this)).join(` ${e} `);return(n.length<=1?!0:t?.__operation==="+"||t?.__operation==="-")?i:`(${i})`}done(){let t=this.__get();return`calc${t.startsWith("(")&&t.endsWith(")")?t:`(${t})`}`}};function eh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var th=(...o)=>new un("+",ui(o)),eu=(...o)=>new un("-",ui(o)),nh=(...o)=>new un("*",ui(o)),oh=(...o)=>new un("/",ui(o)),Ao={add:th,subtract:eu,minus:eu,multiply:nh,divide:oh};var tu=o=>{let t=null,e=null;return{stop(){t!==null&&yn(t),e!=null&&yn(e)},scroll(n){t!==null&&yn(t),e!=null&&yn(e);let i={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},r=this;function a(){let u=i.scrollOffsetStart+i.offset-i.mousePosition.clientX;if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft-f,t=Ke(()=>{r.scroll(n)}),!0}function l(){let u=i.mousePosition.clientX-(i.scrollOffsetEnd-i.offset);if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft+f,e=Ke(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var nu=10,ih=U(j.pinnedStartWidth);function iu(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:d,tableRect:s,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:y,horizontalLayoutPageIndex:C,pageWidth:b}=o;function S(H){let q=H==="start"?L:K;return A===O?q:O===H?q+M.computedWidth:A===H?q-M.computedWidth:q}function w(H){if(H.columnIndex===_||C!=null)return!0;let q=t[H.columnIndex];if(q.computedPinned)return!0;let J=l.getScrollPosition().scrollLeft,ne=q.computedOffset+(C!=null&&b!=null?b*C:0);return ne>=J+S("start")&&ne+q.computedWidth<=J+s.width-S("end")}let T=(H,q)=>{let{restrictToParentGroup:J,dragColumn:ne}=q,ie=[];if(H.forEach(be=>{if(be.computedVisibleIndex===_)return;let oe={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};w(oe)&&ie.push(oe)}),J){let oe=function(re,we,Pe){let ve=H[re];ve&&(ve.columnGroup!==ne.columnGroup&&Pe.add(ve.id),oe(re+we,we,Pe))};var ye=oe;let be=ne.computedVisibleIndex,W=new Set;oe(be-1,-1,W),oe(be+1,1,W),ie=ie.filter(re=>!W.has(re.columnId))}return ie},R=i.length,E={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:E.clientX-s.left-(E.clientX-u.left)+nu,top:E.clientY-s.top-(E.clientY-u.top)+nu},v=l.getScrollPosition(),P=t.map(H=>H.computedVisibleIndex),F=P,M=e.get(r),_=M.computedVisibleIndex,A=M?.computedPinned,D=_,O=A,L=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=E,G={x:0,y:0},se=1,Z=0;function Me(H){let q=Math.round(H.clientX),J=Math.round(H.clientY);if(q===B.clientX&&J===B.clientY)return Ee.from(u).shift({left:G.x,top:G.y});B={clientX:q,clientY:J};let ie=l.getScrollPosition().scrollLeft-v.scrollLeft;return G.x=B.clientX-E.clientX,G.y=B.clientY-E.clientY,Z=G.x+ie,se=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ee.from(u).shift({left:G.x,top:G.y})}function ge(H){let q=0;A?A==="start"&&H.forEach((J,ne)=>{q||t[J]?.computedPinned!=="start"&&(q=ne)}):H.forEach((J,ne)=>{t[J]?.computedPinned==="start"&&(q=ne+1)}),R=q,xe("start",H,q)}function xe(H,q,J){if(H==="start"){let ne=0;for(let ie=0;ie<J;ie++){let ye=q[ie],be=t[ye];ne+=be.computedWidth}kt(ih,`${ne}px`,a)}}function Ge(H){if(H==null||H===D)return;if(D===-1&&H!==-1&&(xo(_,"",a),p(!1)),D=H,H===-1){Oe(_);return}let q=Do(P,_,D>_?D-1:D);R=0;let ne=new Set;return q.forEach((ie,ye)=>{let be=F[ye];ie!==be&&ne.add(ie),ge(q)}),F=q,Se(ne),{newColumnIndexes:q,indexesWithTransition:ne,pinnedStartCount:R}}function Oe(H){F=F.filter(J=>J!==H),t.forEach(J=>{let ne=J.computedVisibleIndex,ie=ne>H;Ur(ne,a);let ye="";ie&&(ye=Ao.minus(Te.columnOffsets.get(ne),Te.columnWidths.get(H)).done()),Ro(ne,ye,a)}),xo(H,"hidden",a),p(!0)}function Se(H){t.forEach(q=>{let J=q.computedVisibleIndex;H.has(J)?Ur(J,a):si(J,a);let ne=J===_,ie=se===-1?J<D||J>_:J<_||J>=D,ye="";se===-1?ye=ne?Te.columnOffsets.get(D):ie?Te.columnOffsets.get(J):Ao.add(Te.columnOffsets.get(J),Te.columnWidths.get(_)).done():ye=ie?Te.columnOffsets.get(J):ne?Ao.add(Te.columnOffsets.get(D-1),Te.columnWidths.get(D-1)).minus(Te.columnWidths.get(_)).done():Ao.minus(Te.columnOffsets.get(J),Te.columnWidths.get(_)).done(),Ro(J,ye,a)})}let Fe=s.left+S("start"),ce=s.right-S("end"),ee=tu({scrollOffsetStart:Fe,scrollOffsetEnd:ce});return Me(E),{speedScroller:ee,stop(){ee.stop()},onMove(H){let q=Me(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(q.getCenter()))return f&&Ge(-1),null;ee.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(oe){y.scrollLeft=oe}});let J=T(t,{dragColumn:M,restrictToParentGroup:d==="group"}),ne=se===-1?M.computedOffset+Z:M.computedOffset+M.computedWidth+Z,ie=(0,ou.default)(J,ne,({offsetX:oe},W)=>oe<W?-1:oe>W?1:0);ie<0&&(ie=~ie),J.length?ie=J[ie]?J[ie].columnIndex:J[J.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),ie=0),ie===_+1&&(ie=_),Ge(ie);let ye={};n.forEach(oe=>{ye[oe.id]="end"});for(let oe=0;oe<R;oe++){let W=F[oe],re=t[W];ye[re.id]="start"}let be=F.map(oe=>t[oe].id);return{columnPinning:ye,columnOrder:be}}}}var rh=U(j.baseZIndexForCells),ah=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:an(o,t)},lh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function au(o){let{columnId:t,context:e,domRef:n,getHorizontalLayoutPageIndex:i,allowColumnHideOnDrag:r,proxyPosition:a,dragColumnOutside:l}=o,{getState:u,getComputed:d,actions:s,api:c}=e,f=p=>{let h=d().computedVisibleColumnsMap.get(t);if(!h||!h.computedSortable)return;let{multiSortBehavior:y}=u();c.toggleSortingForColumn(t,{multiSortBehavior:y==="replace"&&(p.ctrlKey||p.metaKey)?"append":y})},m=p=>{if(p.target&&Io(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:S,computedVisibleColumnsMap:w,computedPinnedStartColumns:T,computedUnpinnedColumns:x,computedPinnedEndColumns:R}=d(),E=w.get(t);if(!E||!E.computedDraggable){f(p);return}let N=n.current,v=N.getBoundingClientRect(),P=y.current.getBoundingClientRect(),F=C.getAvailableSize(),M=E.computedVisibleIndex,_=C.getVirtualColIndex(E.computedVisibleIndex,{pageIndex:h||0}),A=C.isHorizontalLayoutBrain?C.getPageWidth():null,D=N.style.cursor??"auto",O=!1,L=y.current,K=Ee.from(Ls(L).getBoundingClientRect()),B=zs(L).map(Se=>Ee.from(Se.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),se=iu({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:A,draggableColumnsRestrictTo:b,computedPinnedEndColumns:R,computedPinnedStartColumns:T,computedUnpinnedColumns:x,computedVisibleColumns:S,computedVisibleColumnsMap:w,dragColumnHeaderTargetRect:v,dragColumnId:t,getCurrentDragSourceAndTarget:lh,api:c,infiniteDOMNode:y.current,setProxyPosition:Se=>{a.value=Se},setDragColumnOutside:Se=>{l.value=Se},tableRect:P,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Z=null,Me,ge;function xe(Se){let{columnPinning:Fe,columnOrder:ce}=Se;ah(u().columnPinning,Fe)||(s.columnPinning=Fe);let ee=d().computedColumnOrder;s.columnOrder=Yr({newColumnOrder:ce,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:ee,dragColumnId:t})}let Ge=Se=>{let{headerBrain:Fe,brain:ce}=u();if(!O){O=!0;let ee=ce.keepColumnRendered(_),H=Fe.keepColumnRendered(_);if(ce.isHorizontalLayoutBrain){let J=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=Fe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ge=()=>{J(),ne()}}Me=()=>{ee(),H()},s.columnReorderDragColumnId=E.id,h!=null&&(s.columnReorderInPageIndex=h),$r(M,`calc( var(${rh}) + 10000 )`,y.current),y.current?.classList.add(Gr),N.style.cursor="grabbing"}Z=se.onMove(Se)},Oe=Se=>{let Fe=Se.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ce}=u(),ee=y.current;ee?.classList.remove(Gr),se.stop(),C.update({...F}),Me?.(),ge?.(),N.style.cursor=D,N.hasPointerCapture?.(Fe)&&N.releasePointerCapture(Fe),N.removeEventListener("pointermove",Ge),N.removeEventListener("pointerup",Oe),a.value=null;let H=c.getColumnApi(E.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(E.id,{multiSortBehavior:ce==="replace"&&(Se.ctrlKey||Se.metaKey)?"append":ce}),Z?xe(Z):O&&r&&c.setVisibilityForColumn(E.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await(0,ru.nextTick)(),S.forEach(q=>{si(q.computedVisibleIndex,ee),xo(q.computedVisibleIndex,"",ee),Ro(q.computedVisibleIndex,"",ee)}),$r(M,qr(E,{pinnedStartColsCount:T.length,visibleColsCount:S.length}),ee)})};N.addEventListener("pointermove",Ge),N.addEventListener("pointerup",Oe),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Io(p.target)||f(p)}}}var Sn=require("vue");var gt={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var lu=(0,Sn.defineComponent)({name:"InfiniteIcon",props:{size:{type:Number,default:void 0},style:{type:Object,default:void 0},className:{type:String,default:void 0},viewBox:{type:String,default:"0 0 24 24"},paths:{type:Array,required:!0}},setup(o){return()=>{let t=o.size??"var(--infinite-icon-size)",e={flex:"none",width:typeof t=="number"?`${t}px`:t,height:typeof t=="number"?`${t}px`:t,fill:"currentColor",...o.style};return(0,Sn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,Sn.h)("path",{d:n})))}}});function It(o,t){let e=n=>(0,Sn.h)(lu,{...n,paths:t});return e.displayName=o,e}var su=It("IncludesOperatorIcon",gt.includesOperator),uu=It("StartsWithOperatorIcon",gt.startsWithOperator),du=It("EndsWithOperatorIcon",gt.endsWithOperator),cu=It("EqualOperatorIcon",gt.eqOperator),fu=It("NotEqualOperatorIcon",gt.neqOperator),pu=It("GTOperatorIcon",gt.gtOperator),mu=It("GTEOperatorIcon",gt.gteOperator),hu=It("LTOperatorIcon",gt.ltOperator),gu=It("LTEOperatorIcon",gt.lteOperator),yu=It("DoneIcon",gt.done),bu=It("ClearIcon",gt.clear),Zr=o=>(0,Sn.h)(lu,{...o,viewBox:"0 -960 960 960",paths:gt.hidden});Zr.displayName="HiddenIcon";var di="_1eexc2a7 _1eexc2a6",Cu=Ie({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Tu=Ie({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Su="_1eexc2a5",ci=Ie({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),fi="_1eexc2a8";var Rt=require("vue");var wu="qz8ht90 _16lm1iwk";var dn=(0,Rt.defineComponent)({name:"InfiniteCheckBox",props:{disabled:{type:Boolean,default:!1},checked:{type:[Boolean,Object],default:void 0},defaultChecked:{type:[Boolean,Object],default:void 0},onChange:{type:Function,default:void 0},domProps:{type:Object,default:void 0}},setup(o){let t=()=>o.checked!==void 0,e=t()?o.checked:o.defaultChecked,n=(0,Rt.ref)(e===void 0?!1:e),i=(0,Rt.ref)(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};(0,Rt.onMounted)(r),(0,Rt.watch)(()=>o.checked,l=>{t()&&(n.value=l===void 0?!1:l,r())});let a=()=>{if(o.disabled)return;let l=!n.value;t()||(n.value=l,r()),o.onChange?.(l)};return()=>{let l=o.domProps||{};return(0,Rt.h)("input",{...l,class:te("InfiniteCheckBox",wu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var wn=require("vue");function vu(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var Iu=vu({"data-name":""}),Xr={[Iu["data-name"]]:"menu-icon"},Ru=`[${Iu["data-name"]}="${Xr["data-name"]}"]`;var sh={width:"100%",pointerEvents:"none"},Jr=`${ht}-menu`,_o=(0,wn.defineComponent)({name:"MenuIcon",props:{lineWidth:{type:Number,required:!1},lineStyle:{type:Object,required:!1},style:{type:Object,required:!1},className:{type:String,required:!1},domProps:{type:Object,required:!1},reserveSpaceWhenHidden:{type:Boolean,required:!1},menuVisible:{type:Boolean,required:!1}},setup(o,{slots:t}){return()=>{let e={...sh,borderTop:`${Ae.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[(0,wn.h)("div",{class:Jr,style:e}),(0,wn.h)("div",{class:Jr,style:e}),(0,wn.h)("div",{class:Jr,style:e})];return(0,wn.h)("div",{...o.domProps,style:o.style,...Xr,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:te(o.className,us({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),ht,`${ht}-menu`)},n)}}});var st=require("vue");var xu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Pu={transition:"width 0.25s, opacity 0.25s"},Du=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var Au=(0,st.defineComponent)(o=>{let t=(0,st.ref)(!0),e=(0,st.ref)(0),n=null;(0,st.watch)(()=>o.direction,r=>{let a=r!=0?1:0;!t.value&&a&&(t.value=!0),a!==e.value&&(n!=null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,e.value=a}))},{immediate:!0}),(0,st.onBeforeUnmount)(()=>{n!=null&&cancelAnimationFrame(n)});let i=()=>{let a=!(e.value===0&&o.direction===0);a!==t.value&&(t.value=a)};return()=>{let{direction:r,lineWidth:a=1,className:l,index:u}=o;if(!t.value&&!o.forceSize)return null;let d=u!=null&&u>0,s=o.size??16,c=Math.floor(s/4),f=r?[s-3*c,s-2*c,s-c]:[0,0,0];r===-1&&f.reverse();let m={...Pu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),(0,st.h)("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:te(l,ht,xu,`${ht}-sort`)},[d?(0,st.h)("div",{"data-name":"index",style:p,class:fs},`${u}`):null,(0,st.h)("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),(0,st.h)("div",{style:{width:`${f[1]}px`,...m}}),(0,st.h)("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...Du]});var{rootClassName:_u}=He,Lt=`${_u}Cell`,pi=`${_u}Cell_content`;function Qr(o){return Math.max(o.width-Ot(),0)}function Mu(o){let{context:t,column:e,diff:n,shareSpaceOnResize:i}=o,r=t.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:u}=r,d=t.getComputed().computedVisibleColumns,s=!1,c=d.reduce((m,p)=>(p.computedFlex&&(m[p.id]={...a[p.id],flex:p.computedWidth},s=!0),m),{}),f=s?{...a,...c}:a;return Or({shareSpaceOnResize:i,availableSize:Qr(u),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:e.computedVisibleIndex,columnSizing:f,items:d.map(m=>({id:m.id,computedFlex:m.computedFlex,computedWidth:m.computedWidth,computedMinWidth:m.computedMinWidth,computedMaxWidth:m.computedMaxWidth}))})}var vn=require("vue");function Eu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Te.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?jr(l,r,n.current):Te.columnOffsets.set(a,l.computedOffset+r,n.current);return}if(i.computedPinned!=="end"){if(i.computedPinned==="start"){for(let l=a,u=t.length;l<u;l++){let d=t[l];if(d.computedPinned==="start"){jr(d,r,n.current);continue}d.computedPinned!=="end"&&Te.columnOffsets.set(l,d.computedOffset+r,n.current)}return}for(let l=a,u=t.length;l<u;l++){let d=t[l];d.computedPinned||Te.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function Fu(o,t){let e=o[o.length-1];return{resize(n){let{columns:i,domRef:r}=t,a=i[o[0]],l=a.computedOffset,u=0,d=r.current;if(n.forEach((s,c)=>{u+=s;let f=o[c],m=i[f],p=m.computedWidth+s;Te.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Te.columnOffsets.set(f,l,d),l+=p)}),a.computedPinned!=="end")for(let s=e+1;s<i.length;s++){let c=i[s];c.computedPinned!=="end"&&Te.columnOffsets.set(s,c.computedOffset+u,d)}}}}var mi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",hi=Ie({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),gi=Ie({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var Nu=require("vue"),Bn=Symbol("InfiniteTable");function qe(){return(0,Nu.inject)(Bn)}var{rootClassName:uh}=He,dh=`${uh}HeaderCell_ResizeHandle`,Ou=(0,vn.defineComponent)({name:"ResizeHandle",props:{horizontalLayoutPageIndex:{type:Number,default:null},columnIndex:{type:Number,required:!0},columns:{type:Array,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t=qe(),{getState:e}=t,n={current:null},i=(0,vn.ref)(!1),r=a=>{a.stopPropagation();let l=o.columns[o.columnIndex];if(!l)return;let u=l.computedPinned,d=o.horizontalLayoutPageIndex,{brain:s,headerBrain:c}=e(),f=!!a.shiftKey,m=a.pointerId,p=a.clientX,h=a.target,y=()=>{};if(s.isHorizontalLayoutBrain){let T=s.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),x=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),x()}}h.setPointerCapture(m);let C=Eu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:x}={})=>{d&&(T=T/(d+1),x&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:R,constrained:E}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==E&&(i.value=E),C.resize(R),R},S=T=>{b(Math.round(T.clientX-p))},w=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",S),h.removeEventListener("pointerup",w);let x=Math.round(T.clientX-p),R=b(x,{done:!0});y(),C.resize(0),o.onResize({diff:R,shareSpaceOnResize:f})};h.addEventListener("pointermove",S),h.addEventListener("pointerup",w)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,d=a.computedLastInCategory,s=(l===!1||l==="start")&&d?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return(0,vn.h)("div",{ref:c=>{n.current=c??null},class:`${dh} ${mi} ${gi({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[(0,vn.h)("div",{style:s,class:hi({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var ch=U(j.columnWidthAtIndex),fh=U(j.columnReorderEffectDurationAtIndex),ph=U(j.columnZIndexAtIndex),mh=U(j.columnVisibilityAtIndex),ku=Symbol("InfiniteHeaderCell");function Mo(){return(0,de.inject)(ku)}var hh=o=>{let{allRowsSelected:t,someRowsSelected:e,api:n,dataSourceApi:i}=o,r=t?!0:e?null:!1,{components:a,isTree:l}=n.getState(),u=a?.CheckBox||dn;return(0,de.h)(u,{domProps:{class:fi},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function In(o,t){return o(t)}var ea=()=>(0,de.h)("div",{class:Vl[1]}),Lu=(0,de.defineComponent)({name:"InfiniteTableHeaderCell",props:{column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},headerOptions:{type:Object,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0},allRowsSelected:{type:Boolean,required:!0},someRowsSelected:{type:Boolean,required:!0},selectionMode:{type:[String,Boolean],required:!0}},setup(o){let t=qe(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=v=>{let P=v&&v.$el!==void 0?v.$el:v;s.current=P??null,o.domRef(s.current)},f=(0,de.shallowRef)(null);(0,de.provide)(ku,f);let m=()=>lt(o.column,{actions:n,api:e,dataSourceActions:d,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let v=o.column.id,P=l().filterDelay,F=`${v}:${P}`;if(!p||p.key!==F){let M=_=>{e.setColumnFilter(v,_)};p={key:F,fn:P>0?en(M,{wait:P}):M}}return p.fn},y=(0,de.ref)(null),C=(0,de.ref)(!1),{onPointerDown:b}=au({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),S=(0,de.computed)(()=>t.state.value.columnMenuVisibleForColumnId),w=(0,de.computed)(()=>t.state.value.columnReorderDragColumnId),T=(0,de.computed)(()=>t.state.value.columnReorderInPageIndex),x=(0,de.computed)(()=>t.state.value.showColumnFilters),R=(0,de.computed)(()=>t.state.value.columnHeaderHeight),E=(0,de.computed)(()=>t.state.value.components),N=(0,de.computed)(()=>a.state.value.filterTypes);return()=>{let{column:v,columnsMap:P,horizontalLayoutPageIndex:F,headerOptions:M}=o,{allRowsSelected:_,someRowsSelected:A,selectionMode:D}=o,O=v.computedSortInfo,L=v.header,K=m(),B=K.isSortable(),G=M.alwaysReserveSpaceForSortIcon,se=v.headerAlign??v.align,Z=(typeof se=="function"?se({isHeader:!0,column:v}):se)??"start",Me=(typeof v.verticalAlign=="function"?v.verticalAlign({isHeader:!0,column:v}):v.verticalAlign)??"center",ge=B&&(v.computedSorted||G)?(0,de.h)(Au,{index:v.computedMultiSort?v.computedSortIndex+1:void 0,style:{marginInlineStart:Ae.spacing[2],marginInlineEnd:Ae.spacing[2]},className:`${Tn}__sort-icon ${cs} ${ps({align:Z})}`,direction:v.computedSorted?v.computedSortedAsc?1:-1:0}):null,Ge=v.computedFilterable&&v.computedFiltered?(0,de.h)(Nn):null,Oe=v.headerCssEllipsis??v.cssEllipsis??!0,Se=S.value,Fe=w.value,ce=T.value,ee=Fe===v.id,H=ce!=null?F!==ce:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:Se===v.id,style:Z==="end"?{marginInlineStart:`calc(${Ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:Ae.spacing[2]}:{marginInlineEnd:`calc(${Ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:Ae.spacing[2]},domProps:{onMousedown:ae=>{ae.stopPropagation(),K.toggleContextMenu(ae.target)}}},J=v.components?.MenuIcon||E.value?.MenuIcon||_o,ne=(0,de.h)(J,q),ie=x.value,ye=N.value,be=v.computedFilterType,oe=ye[be],W=v.computedFilterable?v.computedFilterValue?.filter.operator??oe?.defaultOperator:void 0,re=v.computedFilterable&&oe?oe.operators.find(ae=>ae.name===W):void 0,we=re?.components?.FilterEditor||oe?.components?.FilterEditor||v.components?.FilterEditor||Hn,Pe=oe?.components?.FilterOperatorSwitch||v.components?.FilterOperatorSwitch||Vu,ve=v.computedFilterable?(0,de.h)(zu,{filterProps:{horizontalLayoutPageIndex:F,filterEditor:we,filterOperatorSwitch:Pe,operator:re,filterTypes:ye,onChange:h(),columnFilterType:be,columnLabel:v.field||v.name||v.id,columnFilterValue:v.computedFilterValue,columnHeaderHeight:R.value}}):(0,de.h)(Gu),Xe={horizontalLayoutPageIndex:F,dragging:ee,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:v,columnsMap:P,columnSortInfo:O,columnFilterValue:v.computedFilterValue,filtered:v.computedFiltered,someRowsSelected:A,allRowsSelected:_,selectionMode:D,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:ge,filterIcon:Ge,menuIcon:ne,menuIconProps:q,selectionCheckBox:null,header:v.header&&typeof v.header!="function"?v.header:v.name}},je=Xe;je.renderBag.filterEditor=ve,f.value=je;let fe={...Xe,renderBag:{...Xe.renderBag}};if(v.renderSortIcon&&(fe.renderBag.sortIcon=In(v.renderSortIcon,{...fe,renderBag:{...fe.renderBag}})),v.renderFilterIcon&&(fe.renderBag.filterIcon=In(v.renderFilterIcon,{...fe,renderBag:{...fe.renderBag}})),typeof v.renderMenuIcon=="function"){let ae=In(v.renderMenuIcon,{...fe,renderBag:{...fe.renderBag}});fe.renderBag.menuIcon=ae?ae.type===J||ae.type===_o?ae:(0,de.h)(J,q,()=>ae):null}if(v.renderSelectionCheckBox&&D==="multi-row"){fe.renderBag.selectionCheckBox=In(hh,{...fe,renderBag:{...fe.renderBag}});let ae=v.renderHeaderSelectionCheckBox??v.renderSelectionCheckBox;ae&&ae!==!0&&(fe.renderBag.selectionCheckBox=In(ae,{...fe,renderBag:{...fe.renderBag}}))}L instanceof Function&&(fe.renderBag.header=In(L,{...fe,renderBag:{...fe.renderBag}}));let mt=Oe?(0,de.h)("div",{class:Tt},[fe.renderBag.header]):fe.renderBag.header,rt=v.renderMenuIcon===!1?null:fe.renderBag.menuIcon,vt=[Z==="center"?ea():null,fe.renderBag.selectionCheckBox,mt,fe.renderBag.sortIcon,fe.renderBag.filterIcon,Z==="center"?ea():null,Z!=="center"?ea():null,rt],Mt=v.renderHeader?In(v.renderHeader,{...fe,renderBag:{...fe.renderBag,all:vt}}):vt,$e={height:`${o.height}px`};v.headerStyle&&($e=typeof v.headerStyle=="function"?{...$e,...v.headerStyle(je)||{}}:{...$e,...v.headerStyle});let g=typeof v.headerClassName=="function"?v.headerClassName(je):v.headerClassName,I=`var(${ph}-${v.computedVisibleIndex})`;$e.zIndex=I,$e.visibility=`var(${mh}-${v.computedVisibleIndex}, visible)`,$e.width=`var(${ch}-${v.computedVisibleIndex})`,$e.transition=`transform var(${fh}-${v.computedVisibleIndex}, 0s)`;let z={filtered:v.computedFiltered,verticalAlign:Me,align:Z},k={"data-field":`${v.field||""}`,"data-column-id":v.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":v.computedSortedAsc?"asc":v.computedSortedDesc?"desc":"none","data-sort-index":`${v.computedSortIndex??-1}`},Y=te(Tn,$l.none,B?zl.pointer:"",g,li(v,[Tn,Lt],ns,{dragging:ee,insideDisabledDraggingPage:H,align:Z,verticalAlign:Me,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Jl,Lt,di),V=(0,de.h)("div",{class:te(pi,Oe?Tt:ti.hidden,Ql(z),Kl[Z]),style:ie?{height:`${o.height/2}px`}:void 0},[Mt]),Q=ae=>Mu({context:{getState:i,getComputed:r},column:v,diff:ae.diff,shareSpaceOnResize:ae.shareSpaceOnResize}),pe=v.computedResizable?(0,de.h)(Ou,{horizontalLayoutPageIndex:F,columns:r().computedVisibleColumns,columnIndex:v.computedVisibleIndex,computeResize:Q,onResize:ae=>{let{columnSizing:Ct,reservedWidth:Ht}=Q(ae);ae.shareSpaceOnResize||(n.viewportReservedWidth=Ht),n.columnSizing=Ct}}):null,ue=[ie?ve:null,pe],me={ref:c,...k,"data-z-index":I,style:$e,class:Y,onPointerdown:b},le=null,Ce=i().portalDOMRef.current;ee&&y.value&&Ce&&(le=(0,de.h)(de.Teleport,{to:Ce},[(0,de.h)("div",{key:v.id,class:`${Tn}Proxy ${es}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[(0,de.h)("div",{class:ts({visible:C.value})},[(0,de.h)(Zr,{size:16})]),fe.renderBag.header])]));let De=v.components?.HeaderCell;return De?[(0,de.h)(De,me,{default:()=>[V,ue]}),le]:[(0,de.h)("div",me,[V,ue]),le]}}});var Ku=Symbol("InfiniteColumnHeaderFilter"),yi=o=>o.stopPropagation(),zu=(0,Re.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=qe(),e=Mo(),n=(0,Re.shallowRef)(o.filterProps);(0,Re.provide)(Ku,n);let i=(0,Re.ref)(!1),r=()=>{i.value=!0},a=()=>{i.value=!1};return()=>{n.value=o.filterProps;let l=e.value.column,d=t.state.value.filterOperatorMenuVisibleForColumnId===l.id||i.value,s=o.filterProps.filterEditor,c=o.filterProps.filterOperatorSwitch;return(0,Re.h)("div",{onPointerup:yi,onPointerdown:yi,onFocusin:r,onFocusout:a,class:`${ai} ${Er({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Re.h)(c),(0,Re.h)(s)])}}}),Vu=(0,Re.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=Wn();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??Nn;return(0,Re.h)("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:te(Vr,as,t?`${Vr}--disabled`:"")},[(0,Re.h)(n,{size:20,className:`${ls({disabled:!!t})}`})])}}}),Gu=(0,Re.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Re.h)("div",{onPointerup:yi,onPointerdown:yi,class:`${ai} ${Er({active:!1})} ${Gl["50%"]}`})}});function Wn(){let o=qe(),t=Mo(),e=(0,Re.inject)(Ku),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=(0,Re.computed)(()=>t.value.column),f=(0,Re.computed)(()=>{let{columnFilterType:S,filterTypes:w}=e.value;return w[S]}),m=(0,Re.ref)(e.value.columnFilterValue?.filter.value??"");(0,Re.watch)(()=>e.value.columnFilterValue?.filter.value,S=>{if(e.value.columnFilterValue)m.value!==S&&(m.value=S);else{let w=f.value;if(w){let T=[...w.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=S=>{m.value=S,e.value.onChange(S)},h=()=>{n.clearColumnFilter(c.value.id)},y=()=>{n.removeColumnFilter(c.value.id)},C={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:s,dataSourceApi:d},b=(0,Re.computed)(()=>`Filter for ${vo(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:(0,Re.computed)(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:(0,Re.computed)(()=>e.value.operator),operatorName:(0,Re.computed)(()=>e.value.operator?.name),value:m,disabled:(0,Re.computed)(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:(0,Re.computed)(()=>e.value.filterTypes),filterTypeKey:(0,Re.computed)(()=>e.value.columnFilterType),filtered:(0,Re.computed)(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${is} ${Ds}`}}var Hn=(0,jn.defineComponent)({name:"StringFilterEditor",setup(){let o=Wn();return()=>(0,jn.h)("input",{"aria-label":o.ariaLabel.value,type:"text",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{o.setValue(t.target.value)},class:o.className})}}),bi=(0,jn.defineComponent)({name:"NumberFilterEditor",setup(){let o=Wn();return()=>(0,jn.h)("input",{"aria-label":o.ariaLabel.value,type:"number",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{let e=t.target,n=isNaN(e.valueAsNumber)?e.value:e.valueAsNumber;o.setValue(n)},class:o.className})}});var zt=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function Bu(o={}){let{StringFilterEditor:t,NumberFilterEditor:e,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:t?{FilterEditor:t}:void 0,operators:[{name:"includes",...zt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...zt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...zt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...zt(n,"endsWith"),label:"Ends With",fn:({currentValue:i,filterValue:r})=>i.endsWith(r)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:e?{FilterEditor:e}:void 0,operators:[{label:"Equals",...zt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...zt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...zt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...zt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...zt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...zt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var kn=Bu({StringFilterEditor:Hn,NumberFilterEditor:bi,icons:{includes:su,eq:cu,neq:fu,startsWith:uu,endsWith:du,gt:pu,gte:mu,lt:hu,lte:gu}});var Ci=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(i=>[i,!0]))):this.negativeMap=new $(n.map(i=>[i,!0])),this.positiveMap&&this.positiveMap.clear()),e!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(e.map(i=>[i,!0]))):this.positiveMap=new $(e.map(i=>[i,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var St=class extends Ci{constructor(t){super(t)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(t){return this.isItemPositive(t)}isGroupRowCollapsed(t){return!this.isGroupRowExpanded(t)}setGroupRowExpanded(t,e){return this.setItemValue(t,e)}collapseGroupRow(t){this.setGroupRowExpanded(t,!1)}expandGroupRow(t){this.setGroupRowExpanded(t,!0)}toggleGroupRow(t){this.toggleItem(t)}};var Ti=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new $;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let d=n&&!n.isEmpty();if(d&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let s=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=s.length;c<f;c++){let m=s[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let s=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];d&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let y=i(p),C=u?[...f,y]:void 0,b=u&&!!C,S=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let w=0,T=S.length;w<T;w++){let x=S[w];if(x.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),x.type==="update"&&!h&&(p={...p,...x.data},c[m]=p),x.type==="update-children"&&!h){let R=x.children(p[l],p);p={...p},R!==void 0?p[l]=R:delete p[l],c[m]=p}x.type==="insert"&&(x.position==="before"?(c.splice(m,0,x.data),m--):c.splice(m+1,0,x.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let w=a(p),T=w?null:r(p);!w&&Array.isArray(T)&&(f.push(y),d&&(p[l]=T=T.concat()),s(T,f),f.pop())}else this.add(y,p)}}};s(t,[])}return t}}};function ta(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function na(o){let{pivotByAtIndex:t,pivotAggregator:e}=o;return t?.column&&(typeof t.column=="function"?Object.assign(o,t.column({column:o})):Object.assign(o,t.column)),e?.pivotColumn&&(typeof e.pivotColumn=="function"?Object.assign(o,e.pivotColumn({column:o})):Object.assign(o,e.pivotColumn)),o}function oa(o){let{pivotByAtIndex:t}=o;return t?.columnGroup&&(typeof t.columnGroup=="function"?Object.assign(o,t.columnGroup({columnGroup:o})):Object.assign(o,t.columnGroup)),o}function Hu({deepMap:o,pivotBy:t,pivotTotalColumnPosition:e,pivotGrandTotalColumnPosition:n,reducers:i={},showSeparatePivotColumnForSingleAggregation:r=!1}){let a=t.length,l=Object.keys(i).map(m=>({...i[m],id:m}));l.length||(r=!0,n=!1,e=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let u={},d={},s=Ft(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=na({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&s();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,y)=>{if(p=[...p],e==="end"&&y?.(),p.length===a){let C=t[p.length-1],S=p.slice(0,-1).join("/");if(!c){let w=S;S=p.join("/");let T=p[p.length-1];d[S]=oa({header:`${T}`,columnGroup:w,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((w,T)=>{let x=c?`${p[p.length-1]}`:w.name||w.id,R=na({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:w,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:S,header:x,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[w.id]:null}),E=`${w.id}:${p.join("/")}`;u[E]=R})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=oa({columnGroup:b.length?b.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let S=t[p.length-1],w=b.length?b.join("/"):void 0;if(!c){let T=w;w=`total:${p.join("/")}`,d[w]=oa({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:S,pivotGroupKey:p[p.length-1]})}l.forEach((T,x)=>{let R=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,E=na({columnGroup:w,header:R,pivotAggregator:T,pivotAggregatorIndex:x,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:S,pivotIndex:p.length-1,pivotBy:t,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[T.id]:null});u[`total:${T.id}:${p.join("/")}`]=E})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var gh=()=>{};function ia(o,t){let e=new $,n=t.nodesKey??"children",i=t.emptyGroup??{},r=typeof t.pathKey=="function"?t.pathKey:l=>l[t.pathKey];for(let l of o){let u=r(l);for(let d=0;d<u.length;d++){let s=u.slice(0,d);e.has(s)||e.set(s,void 0)}e.set(u,l)}function a(l,u){let d=e.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let s of d){let c=[...l,s[s.length-1]],f=e.get(c),m=f?f[n]??[]:[];a(c,m),m.length&&(f||(f=typeof i=="function"?i(c,m):i),f[n]=m),u.push(f)}return u}return a([],[])}function Wu(o,t,e,n){let{isLeafNode:i,getNodeChildren:r,toKey:a}=o,{onParentNode:l,onNode:u,onLeafNode:d}=t,s=a(n),c=[...e,s],f=i(n),m=Ft(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];Wu(o,t,c,C)}});f?(d?.(n),u?.(n,gh)):(l?.(n,m,r(n)),u?.(n,m))}function ju(o,t,e){for(let n=0,i=e.length;n<i;n++)Wu(o,t,[],e[n])}function $u(o){return o.map(e=>Array.isArray(e.field)?e.field.map((n,i)=>{let r=Array.isArray(e.type)?e.type[i]??e.type[0]:e.type;return typeof n=="function"?{...e,valueGetter:n,field:void 0,type:r}:{...e,type:r,field:n}}):e).flat()}var cn=(o,t,e)=>{let n=typeof e=="function"?e:e?.get,i=e&&typeof e=="object"?e.marker:void 0;return i&&i.start(),t.sort(qu($u(o),n)),i&&i.end(),t},Uu=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=qu($u(o),e.get),r=e.depthFirst??!1,a=e.inplace??!1;r||(a?t.sort(i):t=[...t].sort(i));let{nodesKey:l,toKey:u}=e,d=c=>c[l],s=c=>c[l]===void 0;return ju({isLeafNode:e.isLeafNode??s,getNodeChildren:e.getNodeChildren??d,toKey:u},{onParentNode:(c,f,m)=>{if(r&&f(),Array.isArray(m)){let p=a?m.sort(i):[...m].sort(i);c[l]=p}r||f()}},t),r&&(a?t.sort(i):t=[...t].sort(i)),n&&n.end(),t};cn.knownTypes=rn;var yh=o=>{if(!o)return;let t=o.field,e=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let i=o.fn;if(!i&&o.type){let r=Array.isArray(o.type)?o.type[0]:o.type;i=cn.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(cn.knownTypes).join(", ")}`)}return i||(i=rn.string),(r,a)=>{let l=e?e(r):t?r[t]:r,u=e?e(a):t?a[t]:a,d=i(l,u);return d===0?d:n*d}},bh=o=>o.map(yh).filter(t=>t instanceof Function),qu=(o,t)=>{let e=bh(o);return(n,i)=>{t&&(n=t(n),i=t(i));let r=0,a=0,l,u=e.length;for(;a<u;a++)if(l=e[a],!!l&&(r=l(n,i),r!==0))return r;return r}};var Yu=Symbol("CLEAR"),Rn=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new $;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(t,e,n)=>{this.allFieldsAffected=!0;let i=t,r=this.primaryKeyToData.get(i)||[];r.push({type:"delete",primaryKey:t,originalData:e,metadata:n}),this.primaryKeyToData.set(i,r)};this.deleteNodePath=(t,e,n)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(t)||[];i.push({type:"delete",nodePath:t,originalData:e,metadata:n}),this.nodePathToData.set(t,i)};this.insert=(t,e,n,i)=>{let r=t,a=this.primaryKeyToData.get(r)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:t,data:e,position:n,originalData:null,metadata:i}),this.primaryKeyToData.set(r,a)};this.insertNodePath=(t,e,n,i)=>{let r=this.nodePathToData.get(t)||[];this.allFieldsAffected=!0,r.push({type:"insert",nodePath:t,data:e,position:n,originalData:null,metadata:i}),this.nodePathToData.set(t,r)};this.update=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(u=>this.affectedFields.add(u)));let r=t,a=this.primaryKeyToData.get(r)||[];a.push({type:"update",primaryKey:t,data:e,originalData:n,metadata:i}),this.primaryKeyToData.set(t,a)};this.updateNodePath=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(l=>this.affectedFields.add(l)));let r=this.nodePathToData.get(t)||[];r.push({type:"update",nodePath:t,data:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.updateChildren=(t,e,n,i)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(t)||[];r.push({type:"update-children",nodePath:t,children:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.resetDataSource=t=>{this.clear(),this.allFieldsAffected=!0;let e=Yu,n=this.primaryKeyToData.get(e)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:t}),this.primaryKeyToData.set(e,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Yu);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=t=>{this.primaryKeyToData.delete(t)};this.removeNodePathInfo=t=>{this.nodePathToData.delete(t)};this.getMutationsForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getMutationsForNodePath=t=>this.nodePathToData.get(t);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>$.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=t.nodesKey}static clone(t,{light:e=!1}={}){let n=new o({nodesKey:t.nodesKey});return n.allFieldsAffected=t.allFieldsAffected,n.affectedFields=new Set(t.affectedFields),n.primaryKeyToData=e?t.primaryKeyToData:new Map(t.primaryKeyToData),n.nodePathToData=e?t.nodePathToData:$.clone(t.nodePathToData),n}};function fn(o,t){return t().dataArray[o]}function Si(o){return o().dataArray}var ot=class{constructor(t){this.collapsedPathsMap=new $;this.expandedPathsMap=new $;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};var ra=o=>Array.isArray(o)?new $(o.map(t=>[t,!0])):o,Ch=(o,t)=>o.length-t.length,Qe=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new $;this.cache=new $;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new $})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?ra(t):this.config.treePaths}withTreePaths(t,e){let n=this.config.treePaths;e=this.getTreePaths(e);let i=e!==n;i&&this.xcache(),this.config.treePaths=e;let r=t(e);return this.config.treePaths=n,i&&this.xcache(),r}getLeafNodePaths(t=[],e){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(t),e)}forEachLeafNodePath(t,e=[],n){let i={selected:!1};this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,a=>{i.selected=this.isNodeSelected(a.keys)===!0,t(a.keys,i)})},n)}getSelectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)})},e),n}getDeselectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)})},e),n}isLeafNode(t){let{treePaths:e}=this.config;return e.has(t)?e.getKeysForLeafNodesStartingWith(t).length===1:null}getLeafNodesCount(t){return this.config.treePaths.getKeysForLeafNodesStartingWith(t).length}static from(t,e){return new o(t,e)}setConfig(t){let e=typeof t=="function"?t():t;this.config={treePaths:ra(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?ra(e.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(t){let{multiRowSelectionTarget:e,unfilteredTreePaths:n,treePaths:i}=this.config;return e!=="visible"||!n||n===i?!1:n.getAllChildrenSizeFor(t)>i.getAllChildrenSizeFor(t)}setVisibleLeafNodesSelection(t,e){let{unfilteredTreePaths:n,treePaths:i}=this.config;this.xcache(),i.getKeysForLeafNodesStartingWith(t).forEach(r=>{n.getAllChildrenSizeFor(r)>0||(this.selectionMap.delete(r),this.isNodeSelected(r)!==e&&this.setSelectionForPath(r,e))}),this.xcache()}xcache(){this.cache.clear()}update(t){this.selectedPaths=t.selectedPaths||null,this.deselectedPaths=t.deselectedPaths||null;let{selectionMap:e,selectedPaths:n,deselectedPaths:i}=this;e.clear(),n?.forEach(r=>this.setSelectionForPath(r,!0)),i?.forEach(r=>this.setSelectionForPath(r,!1)),this.defaultSelection=t.defaultSelection,this.xcache()}setSelectionForPath(t,e){this.isPathAvailable(t)&&this.selectionMap.set(t,e)}getState(){let t=[],e=[];return this.selectionMap.topDownEntries().forEach(([n,i])=>{i?t.push(n):e.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:t,deselectedPaths:e}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(t){if(!this.strictMode)return!0;let{treePaths:e}=this.config;return e.has(t)}isNodeSelected(t){return this.isPathSelected(t)}isSelfSelected(t){return this.selectionMap.get(t)??null}cacheIt(t,e){return this.cache.set(t,e),e}getSelectionStateForNode(t,e){let n=this.cache.get(t);if(n)return n;if(this.isLeafNode(t)!==!1){let c=this.isSelfSelected(t);if(c!==null)return this.cacheIt(t,{selected:c,selectedCount:c?1:0,deselectedCount:c?0:1,leafCount:1})}let i=this.getLeafNodesCount(t),r=this.isSelfSelected(t),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0}).sort(Ch);if(this.strictMode&&(l=l.filter(c=>this.isPathAvailable(c))),!l.length){if(r!==null){let f=i?r:!1;return this.cacheIt(t,{selected:f,selectedCount:f?i:0,deselectedCount:f?0:i,leafCount:i})}let c=this.getNodeBooleanSelectionStateFromParent(t);return this.cacheIt(t,{selected:c,selectedCount:c?i:0,deselectedCount:c?0:i,leafCount:i})}let u=0,d=0,s=this.getNodeBooleanSelectionStateFromParent(t);s?u+=i:d+=i;for(let c=0,f=l.length;c<f;c++){let m=l[c],{selectedCount:p,deselectedCount:h}=this.getSelectionStateForNode(m);if(s?(u-=h,d+=h):(d-=p,u+=p),e&&p>0&&h>0)return this.cacheIt(t,{selected:null,leafCount:i,selectedCount:u,deselectedCount:d})}if(!u&&!d)return this.cacheIt(t,{selected:s,selectedCount:s?i:0,deselectedCount:s?0:i,leafCount:i});if(u){let c=u===i?!0:null;return this.cacheIt(t,{selected:c,selectedCount:u,deselectedCount:d,leafCount:i})}return this.cacheIt(t,{selected:!1,selectedCount:0,deselectedCount:i,leafCount:i})}isPathSelected(t){return this.isPathAvailable(t)?this.getSelectionStateForNode(t,!0).selected:!1}getNodeBooleanSelectionStateFromParent(t){let{defaultSelection:e,selectionMap:n}=this;if(!t.length)return e;let i=[...t];do{let r=n.get(i);if(r!==void 0)return r;i.pop()}while(i.length);return e}setNodeSelection(t,e){if(!t.length)return;if(this.hasFilteredOutLeavesInside(t)){this.setVisibleLeafNodesSelection(t,e);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(t).forEach(i=>{this.selectionMap.delete(i)}),!(t.length===1&&this.defaultSelection===e)){if(this.setSelectionForPath(t,e),t.length>1){let i=t.slice(0,-1);this.isNodeSelected(i)===e&&this.setNodeSelection(i,e)}}}selectNode(t){this.setNodeSelection(t,!0)}deselectNode(t){this.setNodeSelection(t,!1)}toggleNodeSelection(t){this.setNodeSelection(t,!this.isNodeSelected(t))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[]){let{selectedCount:e,deselectedCount:n}=this.getSelectionStateForNode(t);return{selectedCount:e,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function vi(o,t){return new Qe(o,$n(t))}function $n(o){return()=>{let t=typeof o=="function"?o():o,{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}=t;return i==="visible"?{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}:{treePaths:n??e,multiRowSelectionTarget:i}}}var wi=class{constructor(t){this.setNodeSelection=(t,e,n)=>{let{treeSelectionState:i,selectionMode:r}=this.getState();if(!this.isNodeSelectable(t)&&!n?.force)return;if(r==="single-row"){this.actions.treeSelection=e?t[t.length-1]:null;return}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(i instanceof Qe))throw"Invalid tree selection";let a=new Qe(i,$n(this.getState));a.setNodeSelection(t,e),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:t,selected:e},this.actions.treeSelection=a};this.getCallbackParam=t=>({dataSourceApi:this.dataSourceApi});this.getState=t.getState,this.actions=t.actions,this.dataSourceApi=t.dataSourceApi}getSelectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(t?.rootNodePath,e):[]}getDeselectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(t?.rootNodePath,e):[]}getSelectedLeafRowInfos(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;if(!e||!n)return[];let i=t?.rootNodePath||[],r=[];return e.getLeafNodesStartingWith(i,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&r.push(l)}},{excludeSelf:!0}),r}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeReadOnly;return e&&e.isTreeNode&&e.isParentNode&&n?n(e):!1}isNodeSelectable(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeSelectable;return e&&e.isTreeNode?n(e):!1}isNodeExpanded(t){let e=this.getState(),{isNodeExpanded:n,isNodeCollapsed:i,treeExpandState:r}=e,a=this.getRowInfoByPath(t);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(i)return!n(a,r);if(n)return n(a,r)}return r.isNodeExpanded(t)}expandAll(){let t=new ot({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new ot({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=t}expandNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new ot(n.treeExpandState);i.expandNode(t),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:t},this.actions.treeExpandState=i,n.onNodeExpand?.(t,this.getCallbackParam(t))}collapseNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new ot(n.treeExpandState);i.collapseNode(t),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:t},this.actions.treeExpandState=i,n.onNodeCollapse?.(t,this.getCallbackParam(t))}toggleNode(t,e){let n=this.getState(),i=new ot(n.treeExpandState),r=!this.isNodeExpanded(t);this.isNodeReadOnly(t)&&!e?.force||(i.setNodeExpanded(t,r),this.getState().lastExpandStateInfoRef.current={state:r?"expanded":"collapsed",nodePath:t},this.actions.treeExpandState=i,r?n.onNodeExpand?.(t,this.getCallbackParam(t)):n.onNodeCollapse?.(t,this.getCallbackParam(t)))}getNodeDataByPath(t){if(!t.length)return null;let e=this.getRowInfoByPath(t);return e?e.data:null}getRowInfoByPath(t){let{pathToIndexMap:e}=this.getState(),n=e.get(t);return n!==void 0?fn(n,this.getState):null}selectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,$n(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,$n(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(t){let{treeSelectionState:e,treeSelection:n,selectionMode:i}=this.getState();if(i==="single-row"){let r=t[t.length-1];return Array.isArray(n)?treeSelection.join(",")===t.join(","):n===r}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(e instanceof Qe))throw"Invalid tree selection";return e.isNodeSelected(t)}selectNode(t,e){this.setNodeSelection(t,!0,e)}deselectNode(t,e){this.setNodeSelection(t,!1,e)}toggleNodeSelection(t,e){this.isNodeSelected(t)?this.deselectNode(t,e):this.selectNode(t,e)}};var Un=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let i of n)this.negativeMap.set(i,!0);this.positiveMap&&this.positiveMap.clear()}if(e&&e!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let i of e)this.positiveMap.set(i,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return!!this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var wt=class extends Un{constructor(e){super(e);this.isRowEnabled=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:e,disabledRows:n}}getPositiveFromState(e){return e.enabledRows}getNegativeFromState(e){return e.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(e){return!this.isRowEnabled(e)}setRowEnabled(e,n){return this.setItemValue(e,n)}disableRow(e){this.setRowEnabled(e,!1)}enableRow(e){this.setRowEnabled(e,!0)}toggleRow(e){this.toggleItem(e)}};var aa=1e3;function Zu(o){return new la(o)}var la=class{constructor(t){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=t=>this.getState().toPrimaryKey(t);this.getRowInfoArray=()=>Si(this.getState);this.getRowInfoByIndex=t=>fn(t,this.getState)??null;this.getRowInfoByPrimaryKey=t=>{let e=this.getIndexByPrimaryKey(t);return this.getRowInfoByIndex(e)};this.getRowInfoByNodePath=t=>{let e=this.getIndexByNodePath(t);return this.getRowInfoByIndex(e)};this.getIndexByPrimaryKey=t=>this.getState().idToIndexMap.get(t)??-1;this.getIndexByNodePath=t=>this.getState().pathToIndexMap.get(t)??-1;this.getNodePathById=t=>this.getState().idToPathMap.get(t)??null;this.getNodePathByIndex=t=>{let e=this.getRowInfoByIndex(t);return e&&e.isTreeNode?e.nodePath:null};this.getPrimaryKeyByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.data:null};this.getDataByPrimaryKey=t=>{let{indexer:e}=this.getState();return e.getDataForPrimaryKey(t)??null};this.isNodePathAvailable=t=>this.getState().indexer.getDataForNodePath(t)!==void 0;this.getDataByNodePath=t=>{let{indexer:e}=this.getState(),n=e.getDataForNodePath(t);return n||null};this.replaceAllData=(t,e)=>(this.batchOperation({type:"replace-all",array:t,metadata:e?.metadata}),this.addDataArray(t,e));this.clearAllData=t=>this.replaceAllData([],t);this.updateData=(t,e)=>this.updateDataArray([t],e);this.updateDataArray=(t,e)=>{let n=this.getState().isTree,i=n?void 0:t.map(l=>this.toPrimaryKey(l)),r=n?t.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=i?this.batchOperation({type:"update",array:t,primaryKeys:t.map(l=>this.toPrimaryKey(l)),metadata:e?.metadata}):this.batchOperation({type:"update",array:t,nodePaths:r||[],metadata:e?.metadata});return e?.flush&&this.commit(),a};this.withWaitForNode=(t,e,n)=>{let i=n?.waitForNode??!0;if(i===!0||typeof i=="number"){let a=i===!0?aa:i;return isNaN(a)||(a=aa),this.waitForNodePath(t,{timeout:a}).then(l=>{if(!l){let u=`Cannot find node path "${t.join("/")}" (we waited for it ${a}ms)`;return console.error(u),e({error:u,resolved:!1})}return e({resolved:!0})})}let r=e({resolved:void 0});return r instanceof Promise?r:Promise.resolve(r)};this.updateChildrenByNodePath=(t,e,n)=>this.withWaitForNode(e,({error:i})=>i?!1:this.updateChildrenByNodePath_Internal(t,e,n),n);this.updateChildrenByNodePath_Internal=(t,e,n)=>{let i=typeof t=="function"?t:()=>t;return this.updateDataArrayByNodePath_Internal([{nodePath:e,children:i}],n)};this.updateDataByNodePath=(t,e,n)=>this.isNodePathAvailable(e)?this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n):this.withWaitForNode(e,({error:i})=>i?!1:this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n),n);this.updateDataArrayByNodePath=(t,e)=>{if(e&&typeof e.waitForNode<"u"&&!e.waitForNode)return this.updateDataArrayByNodePath_Internal(t,e);let n=t.map(r=>r.nodePath);return Promise.allSettled(n.map(r=>this.withWaitForNode(r,({error:a})=>!a,e))).then(r=>r.every(Boolean)?this.updateDataArrayByNodePath_Internal(t,e):!1)};this.updateDataArrayByNodePath_Internal=(t,e)=>{let n=[],i=[];t.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),i.push(a.nodePath)});let r=this.batchOperation({type:"update",array:n,nodePaths:i,metadata:e?.metadata});return e?.flush&&this.commit(),r};this.removeDataByPrimaryKey=(t,e)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(t)||[],e);let i=this.batchOperation({type:"delete",primaryKeys:[t],metadata:e?.metadata});return e?.flush&&this.commit(),i};this.removeDataByNodePath=(t,e)=>this.batchDeleteNodePaths([t],e);this.removeData=(t,e)=>{if(this.getState().isTree){let i=this.getNodePathById(this.toPrimaryKey(t));return this.removeDataByNodePath(i,e)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(t)],e)};this.removeDataArrayByPrimaryKeys=(t,e)=>{if(this.getState().isTree){let i=t.map(r=>this.getNodePathById(r)||[]);return this.batchDeleteNodePaths(i,e)}return this.batchDeletePrimaryKeys(t,e)};this.batchDeleteNodePaths=(t,e)=>{let n=this.batchOperation({type:"delete",nodePaths:t||[],metadata:e?.metadata});return e?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(t,e)=>{let n=this.batchOperation({type:"delete",primaryKeys:t,metadata:e?.metadata});return e?.flush&&this.commit(),n};this.removeDataArray=(t,e)=>{if(this.getState().isTree){let r=t.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(r,e)}let i=t.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(i,e)};this.addData=(t,e)=>this.addDataArray([t],e);this.addDataArray=(t,e)=>this.insertDataArray(t,{...e,position:"end"});this.insertData=(t,e)=>this.insertDataArray([t],e);this.insertDataArray=(t,e)=>{let n=this.getState().isTree,i="before",r,a=e.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:u})=>{if(u)return!1;if(e.position==="before"||e.position==="after")return this.batchTreeInsert(t,e.position,a,e);let d=s=>e.position==="start"?[...t,...s||[]]:[...s||[],...t];return this.updateChildrenByNodePath(d,a,e)},e);if(e.position==="before"||e.position==="after")i=e.position,r=e.primaryKey;else{let u=this.getOriginalDataArray();e.position==="start"?(i="before",u.length?r=this.toPrimaryKey(u[0]):r=void 0):(i="after",u.length?r=this.toPrimaryKey(u[u.length-1]):r=void 0)}let l=n?this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,nodePath:this.getNodePathById(r)||[]}):this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,primaryKey:r,nodePath:a});return e?.flush&&this.commit(),l};this.batchTreeInsert=(t,e,n,i)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),l},i);let r=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),r};this.setSortInfo=t=>{let e=this.getState().multiSort;if(Array.isArray(t)){this.actions.sortInfo=t.length?e?t:t[0]:null;return}this.actions.sortInfo=t};this.setGroupBy=t=>{this.actions.groupBy=t};this.toggleGroupByField=t=>{let e=this.getState().groupBy;e.findIndex(i=>i.field===t)===-1?this.actions.groupBy=[...e,{field:t}]:this.actions.groupBy=e.filter(i=>i.field!==t)};this.isRowDisabledAt=t=>this.getRowInfoByIndex(t)?.rowDisabled??!1;this.isRowDisabled=t=>this.getRowInfoByPrimaryKey(t)?.rowDisabled??!1;this.setRowEnabledAt=(t,e)=>{let n=this.getState().rowDisabledState,i=n?new wt(n):new wt({enabledRows:!0,disabledRows:[]}),r=this.getRowInfoByIndex(t);r&&(i.setRowEnabled(r.id,e),this.actions.rowDisabledState=i)};this.setRowEnabled=(t,e)=>{let n=this.getRowInfoByPrimaryKey(t);n&&this.setRowEnabledAt(n.indexInAll,e)};this.enableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new wt({enabledRows:!0,disabledRows:[]});return}let e=new wt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new wt({disabledRows:!0,enabledRows:[]});return}let e=new wt(t);e.disableAll(),this.actions.rowDisabledState=e};this.areAllRowsEnabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllDisabled():!1};this.getState=t.getState,this.getState().__apiRef.current=this,this.actions=t.actions,this.treeApi=new wi({...t,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(t){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let e=Math.max(0,this.getState().batchOperationDelay??0);e===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},e)}return t.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(t),this.pendingPromise}commitOperations(t){if(!t.length)return;let e=this.getState().cache,{isTree:n,nodesKey:i}=this.getState(),r=e?Rn.clone(e,{light:!0}):new Rn({nodesKey:n?i:void 0});t.forEach(a=>{switch(a.type){case"update":a.array.forEach((s,c)=>{if(a.primaryKeys){let f=a.primaryKeys[c],m=this.getDataByPrimaryKey(f);m&&r.update(a.primaryKeys[c],s,m,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[c]);f&&(typeof s=="function"?r.updateChildren(a.nodePaths[c],s,f,a.metadata):r.updateNodePath(a.nodePaths[c],s,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(s=>{let c=this.getDataByPrimaryKey(s);c&&r.delete(s,c,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(s=>{let c=this.getDataByNodePath(s);c&&r.deleteNodePath(s,c,a.metadata)});break;case"insert":let l=a.primaryKey,u=a.position,d=a.nodePath;d?a.array.forEach(s=>{r.insertNodePath([...d],s,u,a.metadata),l=this.toPrimaryKey(s),d.pop(),d.push(l),u="after"}):a.array.forEach(s=>{r.insert(l,s,u,a.metadata),l=this.toPrimaryKey(s),u="after"});break;case"replace-all":r.resetDataSource(a.metadata);break}}),this.actions.cache=r}flush(){return this.commit()}waitForNodePath(t,e){let n=this.getState();if(this.isNodePathAvailable(t))return Promise.resolve(!0);let i=e?.timeout??aa,r=n.waitForNodePathPromises.get(t);if(r)return r.promise;let a=Date.now(),l=()=>{},u=new Promise(d=>{let s,c;l=f=>{clearTimeout(c),s=f,n.waitForNodePathPromises.delete(t),d(f)},c=setTimeout(()=>{s===void 0&&l(!1)},i)});return n.waitForNodePathPromises.set(t,{timestamp:a,promise:u,resolve:l}),u}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let t=this.pendingPromise;if(t&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return t||Promise.resolve(!0)}};function Xu(o){let t=o.cache;if(!t)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let e=!1,n=!1,i=!1,r=!1,a=!1,l=t.getAffectedFields(),{sortInfo:u,groupBy:d,filterValue:s,aggregationReducers:c,nodesKey:f,isTree:m}=o;if(u&&u.length)if(l===!0)e=!0;else for(let p of u){let h=p.field;if(h&&(h=Array.isArray(h)?h:[h],e=h.reduce((y,C)=>y||typeof C!="function"?l.has(C):!1,!1),e))break}if(d&&d.length){if(l===!0)n=!0;else for(let p of d)if(p.field&&l.has(p.field)){n=!0;break}}if(m&&(l===!0?i=!0:i=l.has(f)),s&&s.length)if(l===!0)r=!0;else for(let p of s){if(p.id){r=!0;break}if(p.field&&l.has(p.field)){r=!0;break}}if(c&&Object.keys(c).length){if(l===!0)a=!0;else for(let p in c)if(c.hasOwnProperty(p)){let h=c[p];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:e,groupBy:n,filterValue:r,aggregationReducers:a,tree:i}}function Ii(o){if(!o)return;let t=Object.keys(o);if(!t.length)return;let e={};for(let n=0,i=t.length;n<i;n++){let r=t[n],a=o[r].initialValue;a!==void 0&&(e[r]=typeof a=="function"?a():a)}return e}function Ri(o){let t=o.reducerKeys,e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].reducer;n[a]=l(n[a],o.rowInfo)}}function xi(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var Th="group-by",Ju="group-by-";function Qu(o){let t=o.map(e=>e.valueGetter?n=>e.valueGetter({data:n,field:e.field}):e.field??e.groupField).filter(Boolean);if(t.length)return t.length===1&&typeof t[0]!="function"?t[0]:t}function Pi(o,t){if(!o?.length||!t?.length)return o;let e=!1,n=o.map(i=>{if(i.field!=null||!i.id)return i;if(i.id===Th){let r=Qu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Ju)){let r=i.id.slice(Ju.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Qu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function ed(o){return"groupNesting"in o?o.groupNesting??0:0}function td(o,t){if(!(!o.isGroupRow||!t.reducerId))return t.pivotTotalColumn&&(!t.pivotGroupKeys||t.pivotGroupKeys.length===0)?o.reducerResults?.[t.reducerId]:o.pivotValuesMap?.get(t.pivotGroupKeys)?.reducerResults?.[t.reducerId]}function Sh(o,t,e,n){if(o==null&&t==null)return 0;if(o==null)return 1;if(t==null)return-1;let i=Array.isArray(e.type)?e.type[0]:e.type,a=(e.fn||i&&n[i]||n.string||rn.string)(o,t);return a===0?0:e.dir*a}function wh(o,t){if(!o?.length||!t)return[];let e=[];for(let n of o){let i=n.id?t[n.id]:void 0;!i?.pivotColumn||!i.pivotAggregator||e.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:i.pivotGroupKeys??[],reducerId:i.pivotAggregator.id,pivotTotalColumn:!!i.pivotTotalColumn})}return e}function vh(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=ed(n);for(;e.length&&ed(e[e.length-1].row)>=r;)e.pop();e.length?e[e.length-1].children.push(i):t.push(i),e.push(i)}return t}function Ih(o){let t=[],e=(n,i)=>{n.forEach((r,a)=>{let l=[...i,a],u=r.row;u.indexInGroup=a,u.indexInParentGroups=l,u.indexInAll=t.length,t.push(u),e(r.children,l)})};return e(o,[]),t}function nd(o,t,e,n){let i=wh(t,e);if(!i.length||!o.length)return o;let r={...rn,...n},a=vh(o),l=(d,s)=>{for(let c of i){let f=Sh(td(d.row,c),td(s.row,c),c,r);if(f!==0)return f}return 0},u=d=>{d.sort(l);for(let s of d)u(s.children)};return u(a),Ih(a)}var Eo={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var sa=class o{constructor(t){this.debugId=t;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=t=>{if(this.markerDetails.startTs)return this;let e=performance.now();return this.markerDetails.details=t?.details??[],this.markerDetails.startTs=e,this};this.end=(t={})=>{if(this.stopped)return this;this.stopped=!0;let e=t.startTs??this.markerDetails.startTs,n=t.endTs??this.markerDetails.endTs??performance.now(),i=t.color||this.markerDetails.color||"primary",r=t.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...t.details||[]],l=t.tooltip||this.markerDetails.tooltip,u=t.label||this.markerDetails.label||"Unknown",d=t.track||this.markerDetails.track||"Unknown";return performance.measure(u,{start:e,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:r,track:d,color:i,properties:a.length>0?a.map(s=>[s.name,s.value]):void 0,tooltipText:l}}}),this};this.debugId=t}static create(t){return new o(t)}get startTimestamp(){return this.markerDetails.startTs}get track(){let t=this;return Object.keys(Eo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:Eo[n].track,label:r.label}),get label(){let r=Eo[n];return Object.keys(r.labels).reduce((a,l)=>{let u={start:t.start,end:d=>t.end({...d,track:r.track,label:r.labels[l]})};return Object.defineProperty(a,l,{get:()=>(t.markerDetails.label=r.labels[l],u)}),a},{})}};return Object.defineProperty(e,n,{get:()=>{let r=Eo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function yt(o){return sa.create(o)}function qn(o){if(o==null)return!1;let t=o;return!0}function da(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Vt=(o,t,e)=>{for(let n=0,i=e.length;n<i;n++){let r=e[n],a=o[r],l=t[r];if(a!==l)return!0}return!1};function ua(){return!1}function Rh(o,t,e,n,i,r){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:t,indexInAll:e,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:ua,hasSelectedCells:ua};return n&&(a.rowSelected=n(a)),i&&(a.rowDisabled=i(a)),r&&(a.isCellSelected=l=>r.isCellSelected(a.id,l),a.hasSelectedCells=l=>r.isCellSelectionInRow(a.id,l)),a}var xh=Ft(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
"use strict";var qp=Object.create;var Ho=Object.defineProperty;var Yp=Object.getOwnPropertyDescriptor;var Zp=Object.getOwnPropertyNames;var Xp=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty;var Qp=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),em=(o,t)=>{for(var e in t)Ho(o,e,{get:t[e],enumerable:!0})},dl=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zp(t))!Jp.call(o,i)&&i!==e&&Ho(o,i,{get:()=>t[i],enumerable:!(n=Yp(t,i))||n.enumerable});return o};var fo=(o,t,e)=>(e=o!=null?qp(Xp(o)):{},dl(t||!o||!o.__esModule?Ho(e,"default",{value:o,enumerable:!0}):e,o)),tm=o=>dl(Ho({},"__esModule",{value:!0}),o);var Gn=Qp((XT,ru)=>{"use strict";ru.exports=function(o,t,e,n,i){var r,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(i===void 0)i=o.length-1;else if(i=i|0,i<n||i>=o.length)throw new RangeError("invalid upper bound");for(;n<=i;)if(r=n+(i-n>>>1),a=+e(o[r],t,r,o),a<0)n=r+1;else if(a>0)i=r-1;else return r;return~n}});var Gy={};em(Gy,{CellSelectionState:()=>He,DataSource:()=>Li,DataSourceInjectionKeyForVue:()=>Zn,DeepMap:()=>W,FlashingColumnCell:()=>Np,GroupRowsState:()=>wt,InfiniteTable:()=>br,InfiniteTableClassName:()=>_p,InfiniteTableDetailRow:()=>gr,InfiniteTableInjectionKeyForVue:()=>Kn,Menu:()=>_t,NumberFilterEditor:()=>bi,RowDetailState:()=>bt,RowSelectionState:()=>De,StringFilterEditor:()=>Bn,TreeDataSource:()=>kp,TreeExpandState:()=>ot,TreeGrid:()=>Op,TreeSelectionState:()=>Qe,components:()=>Vy,createFlashingColumnCellComponent:()=>il,debounce:()=>nn,defaultFilterFunction:()=>la,defaultFilterTypes:()=>On,defaultTreeFilterFunction:()=>vi,flatten:()=>kl,group:()=>Jo,keyboardShortcuts:()=>Lp,multisort:()=>Bt,multisortNested:()=>_i,toTreeDataArray:()=>ga,useDataSourceContext:()=>Xn,useGetMasterDetailContextForVue:()=>Oi,useInfiniteColumnCell:()=>ro,useInfiniteColumnEditor:()=>Ja,useInfiniteColumnFilterEditor:()=>Hn,useInfiniteHeaderCell:()=>_o,useInfiniteTableContext:()=>Ye,useOverlay:()=>At,withSelectedLeafNodesOnly:()=>rl});module.exports=tm(Gy);function nn(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}var Le=require("vue");var tt=require("vue");function cl(o,t){let e=new Set;function n(...i){let r=t?t.getProxyTargetFromArgs(...i):i[0];e.clear();let a={get:function(d,s){return e.add(s),d[s]}},l=new Proxy(r,a),u=t?t.putProxyToArgs(l,...i):[l];return o.apply(this,u)}return{fn:n,propertyReads:e}}var wr=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function po(o){return o!==void 0}function mo(o,t){let e=t[o];return po(e)}var vr=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function nm(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=mo(i,t)?t[i]:t[`default${wr(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function fl(o,t,e){let{fn:n,propertyReads:i}=cl(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function pl(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=nm(n,t,e));let u={...e,...l};if(r){let d=fl(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function ml(o,t,e){let{getProps:n,getParentState:i,mapPropsToState:r,concludeReducer:a,propsToStateSet:l}=e;if(t.type==="REPLACE_STATE")return t.payload;let u=i?.()??null,d=t.payload.mappedState,s=t.payload.updatedPropsToState,c={...o};if(d&&Object.assign(c,d),r){let m=fl(r,{props:n(),state:c,oldState:o,parentState:u},l);Object.assign(c,m)}return t.type==="ASSIGN_STATE"&&Object.assign(c,t.payload),a?a({previousState:o,state:c,updatedProps:s,parentState:u}):c}function hl(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=vr}=o,d=e();return Object.keys(d).reduce((s,c)=>{let f=c;return Object.defineProperty(s,c,{set:p=>{let h=n(),y=e(),C=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:s,state:y})===!1&&(C=!1),C){let w=[p],T=`on${wr(c)}Change`;if(l&&l[f]){let x=l[f](p,y);T=x.callbackName||T,w=x.callbackParams}u(h,T,w)}let b=i[f];typeof b=="function"&&(p=b(p));let S=!!r?.[f];mo(c,h)&&!S||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function gl(o){let{currentProps:t,prevProps:e,state:n,propsToForward:i,propsToStateSet:r}=o,a={},l=0,u={},d=0,s={},c=0;return new Set([...Object.keys(t),...Object.keys(e)]).forEach(m=>{let p=m,h=e[p],y=t[p];if(p!=="children"&&h!==y&&(s[p]={newValue:y,oldValue:h},c++,mo(p,t)||mo(p,e)))if(i.hasOwnProperty(m)){let C=y,b=i[m];typeof b=="function"&&(C=b(y)),n[p]!==C&&(a[p]=C,l++)}else r.has(m)&&(u[p]=t[p],d++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:u,updatedPropsToStateCount:d,rawUpdatedProps:s,rawUpdatedPropsCount:c}}function om(o){return(t,e,n)=>{if(vr(t,e,n),o){let i=/^on([A-Z].*)Change$/.exec(e);if(i){let r=i[1].charAt(0).toLowerCase()+i[1].slice(1);o(`update:${r}`,n[0])}}}}function Mn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=(0,tt.getCurrentInstance)(),l=()=>({...r}),u=o.initSetupState?o.initSetupState(l()):{},d=new Set,s=o.forwardProps?o.forwardProps(u,l()):{},c=o.getParentState?o.getParentState():null,f=()=>c==null?null:(0,tt.isRef)(c)?(0,tt.unref)(c)??null:typeof c=="function"?c()??null:c,m=pl({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=(0,tt.shallowRef)(m),h=()=>m,y=l,C=T=>{m=ml(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=om(a?(T,...x)=>a.emit(T,...x):void 0),S=hl({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return(0,tt.watch)(()=>({props:l(),parentState:f()}),(T,x)=>{let I=T.props,M=x.props,F=T.parentState!==x.parentState,{newMappedState:v,newMappedStateCount:D,updatedPropsToState:E,updatedPropsToStateCount:P,rawUpdatedProps:A,rawUpdatedPropsCount:N}=gl({currentProps:I,prevProps:M,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(P>0||D>0){let O={payload:{mappedState:D?v:null,updatedPropsToState:P?E:null}},z=p.value;if(C(O),_=!0,o.onPropChange){for(let K in A)if(A.hasOwnProperty(K)){let{newValue:B,oldValue:G}=A[K];o.onPropChange({name:K,newValue:B,oldValue:G},I,S,z)}}o.onPropsChange&&N&&o.onPropsChange(A,I,S,z)}F&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:S,getComponentState:h,replaceState:T=>{C({type:"REPLACE_STATE",payload:T})},assignState:T=>{C({type:"ASSIGN_STATE",payload:T})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return(0,tt.provide)(t,a.contextValue),a}function i(){return(0,tt.inject)(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function he(o=!1){let t=null,e=[],n=null,i=(r,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{t=r,n=null;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)});else{t=r;for(let u=0,d=e.length;u<d;u++)l.push(e[u](r));a?.(l)}};return i.get=()=>t,i.onChange=r=>(e.push(r),()=>{e=e.filter(a=>a!==r)}),i.destroy=()=>{i(null),e.length=0},i.getListenersCount=()=>e.length,i}function Nt(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var yl=(o,t)=>o-t;var Wo=(o,t)=>yl(o.revision,t.revision),W=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),d=!a;if(r!==void 0){if(r<0)return;r--}let s=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!d)return;let y=h?[]:[...t,f],C=p?()=>this.visitWithNext(y,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let b=e(m.value,y,l,C,m);if(n&&b===!0)return!0;l++}else C?.()};u&&(s(void 0,this.emptyKey),d=!1,l=0);for(let[c,f]of i){let m=s(f,c);if(n&&m===!0)return m}};this.fill(t)}get version(){return this.mutations}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,d)=>{!d.map&&d.hasOwnProperty("value")&&(i?r.push(d):a.push(e(d)))},n),i?r.sort(Wo).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},d=this.map,s,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(s=d.get(p),!s||!s.map)if(c=!0,f===m-1){c=!0;break}else return[];d=s.map}else if(!n&&d.has(this.emptyKey))return[[]];return s&&s.value!==void 0&&(n||(u({...s,keys:t}),c=!0)),c?r?a.sort(Wo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(Wo).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let d=0,s=t.length;d<s;d++){let c=t[d];if(l=a.get(c),!l||!l.map)if(u=!0,d===s-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(d,s,c,f,m)=>{e(s,d,{...m,keys:s}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;this.mutations++,t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0,this.mutations++}delete(t){let e=this.map;this.mutations++,t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],d=a===l-1,s=e.get(u);if(d){s&&(s.hasOwnProperty("value")&&(delete s.value,delete s.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),s.map&&s.map.size===0&&delete s.map,s.map||e.delete(u));break}else{if(!s||!s.map){r=!1;break}i.push(s),e=s.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],d=t[t.length-1],s=u?.get(d);s&&(delete s.map,s.hasOwnProperty("value")||u.delete(d))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],d=Nt(()=>{if(l)for(let[s]of l){let c=this.visitKey(s,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let s=i(a,u,d);if(r&&s===!0)return!0}d()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(Wo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=W;function Ve(){return globalThis}var $o=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],bl=Symbol("color"),jo=new WeakMap,Rr=he();function Ir(o=$o){jo.set(o,o.map(t=>0))}Ir();var im=(o=$o)=>{let t=[];jo.has(o)?t=jo.get(o):(t=o.map(n=>0),jo.set(o,t));let e=t.reduce((n,i,r,a)=>i<a[n]?r:n,0);return t[e]!=null&&t[e]++,o[e]??o[0]??$o[0]},go=":",xr="*",Cl="-",rm=",",am="debug",lm="diffdebug",Sl=!1,ho=new W,yo=new Map;function Pr(o,t){let e=o.split(go),n=new W;n.set(e,!0);let i=t.split(go),r=new Set(i).has(xr),a=i.indexOf(xr),l=r?i.slice(0,a):i;if(n.getKeysStartingWith(l,{excludeSelf:r}).length>0){let u=i.slice(a+1);return u.length?o.endsWith(u.join(go)):!0}}function wl(o,t){let e=`channel=${o}_permissions=${t}`;if(yo.has(e))return yo.get(e);let n=t.split(rm);function i(l){return yo.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(xr)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(Cl);if(d&&(u=u.substring(Cl.length)),Pr(o,u))return i(!d)}for(let l=0;l<a.length;l++){let u=a[l],d=u.startsWith("-");if(d&&(u=u.substring(1)),Pr(o,u))return i(!d)}return i(!1)}var Dr=()=>at.enable??(Ve()&&Ve().localStorage?.getItem(am))??"",sm=()=>at.diffenable??(Ve()&&Ve().localStorage?.getItem(lm))??`${Sl}`,Ar="",vl=Sl;function _r(o){vl=`${sm()}`=="true",Ar!==o&&(Ar=o,yo.clear())}function Rl(o){_r(Dr()),typeof Ve()<"u"&&Ve().addEventListener&&Ve().addEventListener("storage",function(){_r(Dr())});function t(e,n){let i=n?`${n}${go}${e}`:e,r=i.split(go),a=ho.get(r);if(a)return a;let l=ho.get(r.slice(0,-1)),u=(l?l.logFn:at.logFn)??Il,d=u,s,c=0,f=()=>s??wl(i,Ar),m=im(at.colors),p=Object.defineProperties((...h)=>{let y=Rr.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Rr({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&vl){let w=C-c;d(`%c[${i}]`,`color: ${m}`,`+${w}ms:`)}c=C;let b=[],S;if(h.forEach(w=>{if(w[bl])S===void 0&&(S=!0),b.push(...w);else{if(typeof w!="string"&&typeof w!="number"){S=!1;return}b.push(`${w}%s`)}}),S){let w=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...w)}else d(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...y)=>{let C=[`%c${y.join(" ")}%c%s`,`color: ${h}`,""];return C.toString=()=>y.join(" "),C[bl]=!0,C}},extend:{value:h=>t(h,i)},enabled:{get:()=>f(),set:h=>{s=h}},logFn:{configurable:!1,get:()=>d,set:h=>{d=h??u}},destroy:{value:()=>{ho.delete(r)}}});return ho.set(r,p),p}return t(o)}var Il=console.log.bind(console),Tl;Object.defineProperty(Rl,"enable",{get:()=>Tl,set:o=>{Tl=o,_r(Dr())}});var at=Rl;at.colors=$o;at.logFn=Il;var um=(o,t)=>Rr.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;Pr(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});at.onLogIntent=um;at.isChannelEnabled=wl;at.destroyAll=()=>{Ir(),Ir(at.colors),ho.clear(),yo.clear()};var dm=at("IT:InfiniteTable"),cm="#dc3545",fm="#eb9316";var Pl="Warn",Dl="Error",pm="Info",mm="Success",hm="Logs",Uo=dm.extend(hm),gb=Uo.extend(pm),gm=Uo.extend(Pl),ym=Uo.extend(Dl),yb=Uo.extend(mm);var bm=fm,Cm=cm;var Tm=(o,t)=>{t=t?t.extend?t.extend(Pl):t:gm,t(typeof t.color=="function"?t.color(bm,o):o)},Sm=(o,t)=>{t=t?t.extend?t.extend(Dl):t:ym,t(typeof t.color=="function"?t.color(Cm,o):o)};var xl=new W,Al=(o,...t)=>{xl.has(t)||(xl.set(t,!0),o())};var _l=(o,t=o,e)=>{Al(()=>Tm(o,e),t,"warn")},El=(o,t=o,e)=>{Al(()=>Sm(o,e),t,"error")};function bo(o){return o}function on(o,t){return t.reduce((e,n)=>{let{field:i,valueGetter:r,toKey:a}=n,l=i?o[i]:r?.({data:o,field:i}),u=(a||bo)(l,o);return e.push(u),e},[])}var qo="____not_loaded_yet____";function Er(o){return typeof o=="string"&&o.startsWith(qo)}var wm=new W,Ml=new WeakMap;function Yo(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return wm;let i=Ml.get(t);if(i&&i.groupBy===e)return i.groups;let r=new W,a=e.length,l=[];return t.forEach(u=>{let d=on(u,e);l.length=0;for(let s=0;s<d.length;s++){l.push(d[s]);let c=r.get(l);c||(c={count:0},l.length===a&&(c.primaryKeys=[]),r.set(l,c)),c.count++,c.primaryKeys?.push(n(u))}}),Ml.set(t,{groupBy:e,groups:r}),r}function vm(o,t){let e=[];return o.getLeafNodesStartingWith(t,n=>{let i=n.value?.primaryKeys;if(i)for(let r=0;r<i.length;r++)e.push(i[r])}),e}var De=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new W;this.deselectedMap=new W;this.onlyUsePrimaryKeys=!1;this.selectionCache=new W;this.selectionCountCache=new W;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;this.mapSet=(t,e)=>{Array.isArray(e)||(this.onlyUsePrimaryKeys?e=[e]:e=[...this.getGroupKeysForPrimaryKey(e),e]),this.xcache(),t==="selected"?this.selectedMap.set(e,!0):this.deselectedMap.set(e,!0)};this._selectedMapSet=t=>{this.mapSet("selected",t)};this._deselectedMapSet=t=>{this.mapSet("deselected",t)};let i=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;this.getConfig=e,this.onlyUsePrimaryKeys=e().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(i)}getGroupKeysForPrimaryKey(t){let{indexer:e,groupBy:n}=this.getConfig(),i=e.getDataForPrimaryKey(t);return i?on(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t==="visible"&&!!e}targetsFilteredOutRows(){let{multiRowSelectionTarget:t,someRowsFilteredOut:e}=this.getConfig();return t!=="visible"&&!!e}getVisibleDataInsideGroup(t){let{postFilterDataArray:e,groupDeepMap:n}=this.getConfig();return t.length?n?.get(t)?.items??[]:e??[]}hasFilteredOutRowsInsideGroup(t){let e=this.getConfig();return e.someRowsFilteredOut?(t.length?Yo(e).get(t)?.count??0:e.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(t).length:!1}setVisibleRowsSelection(t,e){let{groupBy:n,toPrimaryKey:i}=this.getConfig(),r=e?this.selectedMap:this.deselectedMap,a=e?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(t).forEach(l=>{let u=on(l,n),d=i(l),s=[...u,d];a.delete(s),this.isRowSelected(d,u)!==e&&r.set(s,!0)}),this.xcache()}getLazyUnfilteredCount(t){let e=this.getConfig();if(!(!e.lazyLoad||e.multiRowSelectionTarget==="visible"))return t.length?e.groupDeepMap?.get(t)?.totalChildrenCountUnfiltered:e.lazyUnfilteredCount}getLazyHiddenRowsCount(t){let e=t.length<this.getGroupByLength()?this.getLazyUnfilteredCount(t):void 0;if(e===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),i=0;return this.getGroupKeysDirectlyInsideGroup(t).forEach(r=>{i+=this.getLazyUnfilteredCount(r)??(n?.get(r)?.totalChildrenCount||0)}),Math.max(e-i,0)}getLazyEntries(){let t=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==t){let e=new W;this.selectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>e.set(n,!1)),this.lazyEntries={version:t,entries:e}}return this.lazyEntries.entries}getLazyRowCount(t){this.lazyRowCounts=this.lazyRowCounts??new W;let e=this.lazyRowCounts.get(t);if(e!==void 0)return e??void 0;let n=this.computeLazyRowCount(t);return this.lazyRowCounts.set(t,n??null),n}computeLazyRowCount(t){let e=this.getConfig(),n=this.getGroupByLength(),i=this.getLazyUnfilteredCount(t);if(i!==void 0)return i;if(!t.length&&!n)return e.totalCount;let r=t.length?e.groupDeepMap?.get(t):void 0,a=t.length?r?.totalChildrenCount:e.lazyGroupedRowCount;if(a!=null)return a;if(t.length===n)return r?.childrenAvailable?r.items.length:void 0;let l=e.groupDeepMap?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((u,d)=>u+(Er(d[d.length-1])?1:this.getLazyRowCount(d)??1),0)}areLazyChildrenLoaded(t){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new W;let e=this.lazyChildrenLoaded.get(t);if(e!==void 0)return e;let n=this.computeLazyChildrenLoaded(t);return this.lazyChildrenLoaded.set(t,n),n}computeLazyChildrenLoaded(t){let{groupDeepMap:e}=this.getConfig(),n=t.length?e?.get(t):void 0;return t.length&&!n?.childrenAvailable?!1:t.length===this.getGroupByLength()?this.getLazyLoadedRows(t).complete:(e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})??[]).every(i=>!Er(i[i.length-1]))}getLazyLoadedRows(t){this.lazyLoadedRows=this.lazyLoadedRows??new W;let e=this.lazyLoadedRows.get(t);if(!e){let{groupDeepMap:n,originalDataArray:i,toPrimaryKey:r,totalCount:a}=this.getConfig(),l=t.length?n?.get(t):void 0,u=l?l.items:i??[],d=l?l.totalChildrenCount:a,s=new Set,c=d==null||u.length>=d;for(let f=0;f<u.length;f++){let m=u[f];m==null?c=!1:s.add(r(m))}e={primaryKeys:s,complete:c},this.lazyLoadedRows.set(t,e)}return e}isLazyEntryFilteredOut(t){let{groupDeepMap:e}=this.getConfig(),n=this.getGroupByLength();for(let i=1;i<=t.length;i++){let r=t.slice(0,i-1);if(!(i>n?this.getLazyLoadedRows(r).primaryKeys.has(t[i-1]):!!e?.get(t.slice(0,i))))return this.areLazyChildrenLoaded(r)}return!1}getLazySelectionCountFor(t,e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getLazyEntries(),r=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,u=0;i.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0,respectOrder:!1}).forEach(f=>{if(!a&&this.isLazyEntryFilteredOut(f))return;let m=i.get(f);if(f.length>=r){m?l++:u++;return}let p=this.getLazySelectionCountFor(f,m);l+=p.selectedCount,u+=p.deselectedCount});let d=this.getLazyRowCount(t),s=d===void 0?1:Math.max(d-l-u,0);e?l+=s:u+=s;let c={selectedCount:l,deselectedCount:u};return this.selectionCountCache.set(t,c),c}getGroupCount(t){if(t.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return Yo(this.getConfig()).get(t)?.count??0;let n=this.getGroupDeepMap()?.get(t);return n?this.getLazyUnfilteredCount(t)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let e=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?Yo(e).getKeysStartingWith(t,n):e.groupDeepMap?.getKeysStartingWith(t,n)||[]}getAllPrimaryKeysInsideGroup(t){let e=this.getConfig(),{groupDeepMap:n,toPrimaryKey:i}=e;if(this.targetsFilteredOutRows())return t.length?vm(Yo(e),t):(e.originalDataArray??[]).map(i);if(!e.groupBy.length)return this.getVisibleDataInsideGroup([]).map(i);if(!t.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let r=n?.get(t);return r?r.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(t,e,n){return new o(t,e,n)}update(t){this.selectedRows=t.selectedRows||null,this.deselectedRows=t.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=t.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys||r===0&&a.length===1?a[0]:a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(t,e){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([t]):this.selectedMap.has([t]);e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t],i=this.selectionCache.get(n);if(i!==void 0)return i;let r=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(r)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(e))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(e))return this.selectionCache.set(n,!1),!1;for(e=[...e];e.length;){e.pop();let l=this.selectedMap.has(e),u=this.deselectedMap.has(e);if(l)return this.selectionCache.set(n,!0),!0;if(u)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(t,e){return!this.isRowSelected(t,e)}setRowSelected(t,e,n){e?this.setRowAsSelected(t,n):this.setRowAsDeselected(t,n)}getGroupRowSelectionState(t){let e=this.selectionCache.get(t);if(e!==void 0)return e;let{selectedCount:n,deselectedCount:i}=this.getSelectionCountFor(t,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(t)),r=n&&i?null:!!n;return this.selectionCache.set(t,r),r}getGroupRowBooleanSelectionStateFromParent(t){if(!t.length)return this.defaultSelection;let e=[...t],n=this.deselectedMap.has(e),i=this.selectedMap.has(e),r=i&&!n?!0:n&&!i?!1:void 0;if(r===void 0)for(;e.length;){if(e.pop(),this.deselectedMap.has(e)){r=!1;break}if(this.selectedMap.has(e)){r=!0;break}}return r===void 0&&(r=this.defaultSelection),r}isGroupRowPartlySelected(t){return this.getGroupRowSelectionState(t)===null}isGroupRowSelected(t){return this.getGroupRowSelectionState(t)===!0}isGroupRowDeselected(t){return this.getGroupRowSelectionState(t)===!1}selectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!0?this.deselectedMap.delete([r]):this._selectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!0);return}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!1);return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let d=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,d),d}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!i))return this.getLazySelectionCountFor(t,e??this.getGroupRowBooleanSelectionStateFromParent(t));if(this.onlyUsePrimaryKeys&&(i||this.targetsVisibleRowsOnly())){let d=this.getAllPrimaryKeysInsideGroup(t),s=0,c=0;d.forEach(m=>{if(this.defaultSelection){if(this.deselectedMap.has([m])){c++;return}s++}else{if(this.selectedMap.has([m])){s++;return}c++}});let f={selectedCount:s,deselectedCount:c};return this.selectionCountCache.set(t,f),f}if(t.length===i&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:d}=this.getConfig(),s=0,c=0;this.getVisibleDataInsideGroup(t).forEach(m=>{this.isRowSelected(d(m),t)?s++:c++});let f={selectedCount:s,deselectedCount:c};return this.selectionCountCache.set(t,f),f}e=e??this.getGroupRowBooleanSelectionStateFromParent(t);let r=this.getGroupKeysDirectlyInsideGroup(t);if(t.length===this.getGroupByLength()){let d=this.selectedMap.has(t)?!0:this.deselectedMap.has(t)?!1:e,s=this.getGroupCount(t),c=this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,f=this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,m=s-(c+f),p={selectedCount:c+(d?m:0),deselectedCount:f+(d?0:m)};return this.selectionCountCache.set(t,p),p}let a=0,l=0;r.forEach(d=>{let s=this.selectedMap.get(d),c=this.deselectedMap.get(d),f=s?!0:c?!1:e,{selectedCount:m,deselectedCount:p}=this.getSelectionCountFor(d,f);a+=m,l+=p});let u={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(t,u),u}};var rn=o=>{let t=at(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},an=o=>{let t=at(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},Co=()=>Co;Co.extend=()=>Co;var ft=class{constructor(t){this.debug=Co,this.error=Co}};var Rm=function(o,t){return o-t},Im=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},xm=function(o,t){return o-t},Pm={number:Rm,string:Im,date:xm},ln=Pm;var Be=Ve().requestAnimationFrame||(o=>setTimeout(o,16)),yn=Ve().cancelAnimationFrame||(o=>clearTimeout(o));function sn(o,t,e){if(o===t)return!0;if(!o||!t)return!1;let n=typeof o;if(n!==typeof t||n!=="object")return!1;var r=Object.keys(o),a=Object.keys(t);e&&(r=r.filter(s=>!e.has(s)),a=a.filter(s=>!e.has(s)));var l=r.length;if(a.length!==l)return!1;for(var u=0;u<l;u++){var d=r[u];if(!(e&&e.has(d))&&(o[d]!==t[d]||!Object.prototype.hasOwnProperty.call(t,d)))return!1}return!0}function Mr(o){return o.map(Ot)}function Ot(o){if(Ve().structuredClone)return Ve().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Mr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Mr(Array.from(o)));if(o instanceof Map)return new Map(Mr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Ot(o[e]));return t}var bn=Object.seal({data:null,field:null});var Tt="____root____";function un(){return!1}function Fr(o){if(!o||!Object.keys(o).length)return{};let t={};for(let e in o)if(o.hasOwnProperty(e)){let n=o[e].initialValue;t[e]=typeof n=="function"?n():n}return t}function Zo(o,t,e,n,i){if(!(!e||!Object.keys(e).length)){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a.reducer!="function")continue;let l=n[r],u=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[r]=a.reducer(l,u,o,t,i)}}}function Nl(o,t){let{marker:e,reducers:n={},pivot:i,groupBy:r,indexer:a,toPrimaryKey:l,cache:u,mappings:d}=o;e&&e.start();let s=new W;function c(C,b,S,w=0,T=[]){let x=!S.length||w===S.length-1,I=b[d?.values||"values"]||{};for(let M in I)if(I.hasOwnProperty(M)){let F=M;T.push(F),f.set(T,!0),C.set(T,{reducerResults:I[M][d?.totals||"totals"]||{},items:[]}),x||c(C,I[M],S,w+1,T),T.pop()}}let f=i?new W:void 0,m=[],p=Fr(n),h=Ot(p);t.visitDepthFirst((C,b,S,w)=>{let[T,...x]=b,I=C.children,M=s.get(x);if(M&&(M.cache=C.cache,M.childrenLoading=C.childrenLoading,M.childrenAvailable=C.childrenAvailable,M.error=C.error),x.length==r.length&&r.length){if(M){M.items=I;for(let v=0,D=x.length;v<D;v++){let E=x.slice(0,v),P=s.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return w?.()}for(let F=0,v=I.length;F<v;F++){if(!I[F]){let A={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...x,`${qo}${F}`],A);continue}let D=I[F].data,E=I[F].keys||[];if(E.length){let A=E[E.length-1];x.push(A)}let P={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:I[F].totalChildrenCount,totalChildrenCountUnfiltered:I[F].totalChildrenCountUnfiltered,reducerResults:I[F].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(x,P),i){let A=P.pivotDeepMap=new W,N=I[F].pivot;c(A,N,i,0,m)}E.length&&x.pop()}w?.()});let y={deepMap:s,groupParams:o,initialData:t,reducerResults:h};return i&&(y.topLevelPivotColumns=f,y.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(C=>C.field).join(", ")}]}),y}function Fl(o,t,e,n,i,r,a,l,u,d=bo){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Zo(n,i,a,c,t),r){for(let m=0,p=r.length;m<p;m++){let{field:h,valueGetter:y,toKey:C}=r[m],b=h?n[h]:null;y&&(bn.data=n,bn.field=h,b=y(bn));let S=(C||d)(b,n);e.push(S),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Ot(u),items:[]}));let{reducerResults:w,items:T}=f.get(e);T.push(n),a&&Zo(n,i,a,w,t)}e.length=0}}function Ol(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:d,toKey:s}=o,c=s(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let C=0,b=n.length;C<=b;C++){let S=n.slice(0,C),w=t.get(S),{reducerResults:T,items:x}=w;x.push(i),w.leavesAvailableCount++,w.totalLeafNodesCount++,a&&Zo(i,r,a,T,S)}return}let p=Ot(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=d(i);if(!(!y||!Array.isArray(y))){for(let C=0,b=y.length;C<b;C++){let S=y[C];Ol(o,t,e,f,S,C,a,l)}a&&To(a,p,h)}}function Nr(o,t){let{reducers:e,marker:n}=o;if(n){let d=Object.keys(e??{});n.start({details:d.length>0?[{name:"Reducers",value:d.join(", ")}]:void 0})}let i=Fr(e),r=Ot(i),a=new W,l=new W;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let d=0,s=t.length;d<s;d++)Ol(o,a,l,[],t[d],d,e,i);e&&To(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function Jo(o,t){let{marker:e,groupBy:n,defaultToKey:i=bo,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new W:void 0,d=new W,s=[],c=[],f=Fr(a),m=Ot(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(f)};r&&(h.pivotDeepMap=new W),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let S=0;S<l;S++){let{field:w,groupField:T,valueGetter:x,toKey:I}=n[S],M=w?C[w]:null;x&&(bn.data=C,bn.field=w,M=x(bn));let F=(I||i)(M,C);if(b[w||T]=F,s.push(F),!d.has(s)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(f)};r&&(v.pivotDeepMap=new W),d.set(s,v)}Fl(d,s,c,C,h,r,a,u,f,i)}l||Fl(d,s,c,C,h,r,a,u,f,i),a&&Zo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{To(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:w},T,x,I)=>{To(a,w,S),I?.()}),b?.()}),To(a,m,t));let p={deepMap:d,groupParams:o,initialData:t,reducerResults:m};return r&&(p.topLevelPivotColumns=u,p.pivot=r),e&&e.end({details:[{name:"Group by fields",value:n.map(h=>h.field).join(", ")}]}),p}function kl(o){let{groupParams:t,deepMap:e}=o,n=t.groupBy.length,i=[];return e.topDownKeys().reduce((r,a)=>{if(a.length===n){let l=e.get(a).items;r.push(...l)}return r},i),i}function Dm(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:d,pivotDeepMap:s,commonData:c}=t,f=c??null,m;if(Object.keys(d).length>0){f={...c},m={};for(let b in r)if(r.hasOwnProperty(b)){let w=r[b].field;w&&(m[w]=d[b]),w&&f[w]==null&&(f[w]=d[b])}}let p=!0,h=n[n.length-1],y=h;if(f!=null){let b=e[n.length-1];b&&b.field&&(y=f[b.field]),b&&b.toKey&&(y=b.toKey(y,f)),y=y??h}return typeof y=="string"&&y.startsWith(qo)&&(p=!1,y=null),{data:f,reducerData:m,groupCount:u.length,groupData:u,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:un,hasSelectedCells:un,selfLoaded:p,error:o.error,parents:i,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:y,rootGroupBy:e,groupBy:l===e.length?e:e.slice(0,l),isGroupRow:!0,pivotValuesMap:s,groupNesting:l,reducerResults:d}}function Xo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function To(o,t,e){if(o){for(let n in o)if(o.hasOwnProperty(n)){let i=o[n];i.done&&(t[n]=i.done(t[n],e))}}return t}function Ll(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:d,treeResult:s,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:y,rowsPerPage:C}=i,{deepMap:b}=s,S=o.length,w=e[e.length-1],T=w?w.nodeExpanded:!0;for(let x=0;x<S;x++){let I=o[x],M=d(I,x),F=[...t,M];if(l(I)){let _={id:M,nodePath:F,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:un,hasSelectedCells:un,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,x],indexInParent:x,indexInAll:T?r.length:-1};f&&(_.rowSelected=f(_)),c&&(_.rowDisabled=c(_)),m&&m(_);let O=y&&C!=null&&C>0&&_.indexInAll%C===0?_.indexInAll/C:null;for(let z=0,K=e.length;z<K;z++){let B=e[z];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=Xo(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let E=b.get(F)?.totalLeafNodesCount??0,P={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:F,id:M,data:I,indexInAll:r.length,indexInParent:x,indexInParentNodes:[...n,x],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:un,hasSelectedCells:un,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(P.rowSelected=f(P),h)){let _=h.getSelectionCountFor(P.nodePath);P.selectedLeafNodesCount=_.selectedCount,P.deselectedLeafNodesCount=_.deselectedCount}c&&(P.rowDisabled=c(P)),m&&m(P);let A=!0;if(p&&(P.selfExpanded=A=p(P)),T||(A=!1),P.nodeExpanded=A,T&&y&&C!=null&&C>0){let _=P.indexInAll,O=P.parentNodes;if(O.length>0&&_%C===0){let z=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(Xo(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let N=u(I);Array.isArray(N)&&Ll(N,F,[...e,P],P.indexInParentNodes,i,r)}return r}function zl(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return Ll(t,[],[],[],o,n),e&&e.end(),{data:n}}function Vl(o){let{marker:t,lazyLoad:e,groupResult:n,rowsPerPage:i,repeatWrappedGroupRows:r,withRowInfo:a,toPrimaryKey:l,groupRowsState:u,isRowDisabled:d,isRowSelected:s,rowSelectionState:c,generateGroupRows:f,reducers:m={}}=o,{groupParams:p,deepMap:h,pivot:y}=n,{groupBy:C}=p;t&&t.start({details:[{name:"Group by fields",value:C.map(x=>x.field).join(", ")}]});let b=[],S=[],w=[],T=[];return h.visitDepthFirst((x,I,M,F)=>{let v=x.items,D=I.length,E=u?.isGroupRowCollapsed(I)??!1;T.push(M);let P=Dm({lazyLoad:e,groupBy:C,parents:Array.from(w),reducers:m,indexInGroup:M,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:I,error:x.error,totalChildrenCount:x.totalChildrenCount,childrenLoading:(x.childrenLoading||!E&&!x.childrenAvailable)&&e,childrenAvailable:x.childrenAvailable,directChildrenCount:I.length===C.length?x.items.length:h.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},x);if(s&&(P.rowSelected=s(P),c)){let z=c.getSelectionCountFor(P.groupKeys);P.selectedChildredCount=z.selectedCount,P.deselectedChildredCount=z.deselectedCount}d&&(P.rowDisabled=d(P));let A=w[w.length-1],N=A?.collapsed??!1;N&&(E=!0),P.collapsed=E;let _=f||E;if(N&&(_=!1),_){if(r&&i!=null&&i>0){let z=P.indexInAll,K=P.parents;if(K.length>0&&z%i===0){let B=z/i,G=0;K.forEach(se=>{typeof r=="function"&&r(se)!==!0||(b.push(Xo(se,z+G,B)),G++,P.indexInAll++)})}}b.push(P),S.push(b.length-1)}P.collapsedChildrenCount=0,w.forEach(z=>{z.deepRowInfoArray.push(P),z.collapsedGroupsCount+=E?1:0}),A&&P.selfLoaded&&e&&(A.directChildrenLoadedCount+=1),a&&a(P),w.push(P);let O=!0;if(O){if(F)F();else if(!y){let z=b.length;E||(b.length+=v.length);let K=0;for(let B=0,G=v.length;B<G;B++){let se=v[B];if(!E&&r&&i!=null&&i>0){let xe=z+B+K;if(xe%i===0){let Ke=xe/i;w.forEach(Oe=>{if(typeof r=="function"&&r(Oe)!==!0)return;let we=z+B+K;b[we]=Xo(Oe,we,Ke),K++,b.length++})}}let Z=z+B+K,ge={id:se?l(se,Z):`${I}-${B}`,data:se,isCellSelected:un,hasSelectedCells:un,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!se,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:E,groupKeys:I,parents:Array.from(w),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:D+1,groupCount:P.groupCount};s&&(ge.rowSelected=s(ge)),d&&(ge.rowDisabled=d(ge)),a&&a(ge),w.forEach((xe,Ke)=>{Ke===w.length-1&&se&&(xe.directChildrenLoadedCount+=1),E&&(xe.collapsedChildrenCount+=1),xe.deepRowInfoArray.push(ge)}),E||(b[z+B+K]=ge)}}}w.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:S}}function Qo(o,t){return new De(o,nt(t))}function nt(o){return()=>{let t=typeof o=="function"?o():o,{originalDataArray:e,postFilterDataArray:n}=t,i=!!t.lazyLoad,r=i?t.originalLazyGroupData.get([Tt]):void 0;return{lazyLoad:i,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:i?e?.length??0:t.unfilteredCount,lazyGroupedRowCount:t.groupBy.length?r?.totalChildrenCount:void 0,lazyUnfilteredCount:t.groupBy.length?r?.totalChildrenCountUnfiltered:r?.totalCountUnfiltered,multiRowSelectionTarget:t.multiRowSelectionTarget,someRowsFilteredOut:!t.lazyLoad&&!!e&&!!n&&n.length<e.length,originalDataArray:e,postFilterDataArray:n}}}function Gl(o){let{getDataSourceState:t,dataSourceActions:e}=o;return{get allRowsSelected(){return t().allRowsSelected},selectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof De))throw"Invalid row selection";let a=new De(i,nt(t));a.selectAll(),e.rowSelection=a},deselectAll(){let{rowSelection:i,selectionMode:r}=t();if(r!=="multi-row")throw"Selection mode is not multi-row";if(!(i instanceof De))throw"Invalid row selection";let a=new De(i,nt(t));a.deselectAll(),e.rowSelection=a},isRowSelected(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row")return a===i;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof De))throw"Invalid row selection";if(!r){let s=u.getDataForPrimaryKey(i);r=s?on(s,d):[]}return a.isRowSelected(i,r)},isRowDeselected(i,r){return!this.isRowSelected(i,r)},selectRow(i,r){let{rowSelection:a,selectionMode:l,indexer:u,groupBy:d}=t();if(l==="single-row"){e.rowSelection=i;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof De))throw"Invalid row selection";if(!r){let c=u.getDataForPrimaryKey(i);r=c?on(c,d):[]}let s=new De(a,nt(t));s.selectRow(i,r),e.rowSelection=s},deselectRow(i,r){let{selectionMode:a,rowSelection:l,indexer:u,groupBy:d}=t();if(a==="single-row"){e.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof De))throw"Invalid row selection";if(a==="multi-row"){if(!r){let c=u.getDataForPrimaryKey(i);r=c?on(c,d):[]}let s=new De(l,nt(t));s.deselectRow(i,r),e.rowSelection=s}},toggleRowSelection(i,r){this.isRowSelected(i,r)?this.deselectRow(i,r):this.selectRow(i,r)},selectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof De))throw"Invalid row selection";let u=new De(a,nt(t));u.selectGroupRow(i),e.rowSelection=u},deselectGroupRow(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof De))throw"Invalid row selection";let u=new De(a,nt(t));u.deselectGroupRow(i),e.rowSelection=u},toggleGroupRowSelection(i){let{selectionMode:r,rowSelection:a,groupBy:l}=t();if(r!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof De))throw"Invalid row selection";let u=new De(a,nt(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new De(r,nt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!u)throw"No grouping specified";if(!(d instanceof De))throw"Invalid row selection";return d.getGroupRowSelectionState(i)},getSelectedPrimaryKeys:i=>{let r=t(),a=i?new De(i,nt(r)):r.rowSelection,l=[];return r.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),r.originalDataArray.forEach(u=>{let d=r.toPrimaryKey(u);a.isRowSelected(d)&&l.push(d)}),l}}}var Or=new WeakMap,Am=o=>o;function Kl(o,t=50,e){Or.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Am;return i=>{let{lastCallTime:r,lastCallArg:a}=Or.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=sn(n(a),n(i));u<t&&d||(Or.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var _m="*",He=class{constructor(t){this.wildcard=_m;this.cache=new W;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}selectCell(t,e){this.setCellSelected(t,e,!0)}deselectCell(t,e){this.setCellSelected(t,e,!1)}selectColumn(t){this.setCellSelected(this.wildcard,t,!0)}deselectColumn(t){this.setCellSelected(this.wildcard,t,!1)}setCellSelected(t,e,n){let i=t===this.wildcard,r=e===this.wildcard;if(this.isCellSelected_Internal(t,e)===n)return;let l=[];if(i){let d=this.deselectedColumnsToRows.get(e),s=this.selectedColumnsToRows.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(c,e,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(c,e,!1)}),[...this.cache.keys()].forEach(c=>{let[f,m]=c;m===e&&l.push([f,e])})}if(r){let d=this.deselectedRowsToColumns.get(e),s=this.selectedRowsToColumns.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(t,c,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(t,c,!1)}),[...this.cache.keys()].forEach(c=>{let[f]=c;f===t&&l.push([t,e])})}let u=[t,e];if(l.forEach(d=>{this.cache.delete(d)}),this.cache.delete(u),n)if(this.defaultSelection){let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1);let s=this.deselectedRowsToColumns.get(this.wildcard),c=this.deselectedColumnsToRows.get(this.wildcard);(s?.has(e)||c?.has(t))&&this.setCellInSelection(t,e,!0)}else{let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1),this.setCellInSelection(t,e,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1),this.setCellInDeselection(t,e,!0);else{this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1);let s=this.selectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard);if(s?.has(e)||c?.has(t)){this.setCellInDeselection(t,e,!0);return}}}setCellInDeselection(t,e,n){if(n){let i=this.deselectedRowsToColumns.get(t)||new Set;i.add(e),this.deselectedRowsToColumns.set(t,i)}else{let i=this.deselectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.deselectedRowsToColumns.delete(t))}if(n){let i=this.deselectedColumnsToRows.get(e)||new Set;i.add(t),this.deselectedColumnsToRows.set(e,i)}else{let i=this.deselectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.deselectedColumnsToRows.delete(e))}}setCellInSelection(t,e,n){if(t===this.wildcard&&e===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let i=this.selectedRowsToColumns.get(t)||new Set;i.add(e),this.selectedRowsToColumns.set(t,i)}else{let i=this.selectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.selectedRowsToColumns.delete(t))}if(n){let i=this.selectedColumnsToRows.get(e)||new Set;i.add(t),this.selectedColumnsToRows.set(e,i)}else{let i=this.selectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.selectedColumnsToRows.delete(e))}}update(t){let e=t.selectedCells||null,n=t.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),e&&e.forEach(([i,r])=>{this.setCellInSelection(i,r,!0)}),n&&n.forEach(([i,r])=>{this.setCellInDeselection(i,r,!0)}),this.defaultSelection=t.defaultSelection}isCellSelectionInRow(t,e){if(this.defaultSelection){let i=this.deselectedRowsToColumns.get(t);if(i){if(i.has(this.wildcard)){let r=this.selectedRowsToColumns.get(t);return r&&r.size>0?e.some(a=>r.has(a)):!1}return e.some(r=>!i.has(r))}return!0}let n=this.selectedRowsToColumns.get(t);if(n){if(n.has(this.wildcard)){let i=this.deselectedRowsToColumns.get(t);return i&&i.size>0?!e.every(a=>i.has(a)):!0}return e?e.some(i=>n.has(i)):!1}return!1}error(t){an(`${this.debugId}:CellSelectionState`)(t)}isCellSelected(t,e){return t===this.wildcard||e===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(t,e)}isCellSelected_Internal(t,e){let n=[t,e],{cache:i}=this,r=i.get(n);if(r!=null)return r;let a=()=>(i.set(n,!1),!1),l=()=>(i.set(n,!0),!0),u=this.deselectedColumnsToRows.get(this.wildcard),d=this.deselectedRowsToColumns.get(this.wildcard),s=this.selectedColumnsToRows.get(this.wildcard),c=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let p=this.deselectedRowsToColumns.get(t);return p&&p.has(e)?a():u?.has(t)||d?.has(e)?this.selectedRowsToColumns.get(t)?.has(e)?l():a():l()}let m=this.selectedRowsToColumns.get(t);return m&&m.has(e)?l():s?.has(t)||c?.has(e)?this.deselectedRowsToColumns.get(t)?.has(e)?a():l():a()}getState(){let t=[],e=[];return this.deselectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{t.push([i,r])})}),this.selectedRowsToColumns.forEach((n,i)=>{n.forEach(r=>{e.push([i,r])})}),{defaultSelection:this.defaultSelection,deselectedCells:t,selectedCells:e}}};var Wn=require("vue");var Ie=require("vue");var ne=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Bl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Hl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var St="_16lm1iw3b _16lm1iw3c _16lm1iw35",Wl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},ei={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var jl={1:"_16lm1iw1c",none:"_16lm1iw1d"},kr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var $l={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Ul={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},ql={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Yl={none:"_16lm1iwd"},ti={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Zl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Xl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Jl={none:"_16lm1iw1x"};var Ql={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var es={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};var pt=require("vue");function Em(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var n=e.call(o,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function Mm(o){var t=Em(o,"string");return typeof t=="symbol"?t:String(t)}function Fm(o,t,e){return t=Mm(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function ts(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,n)}return e}function ns(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ts(Object(e),!0).forEach(function(n){Fm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):ts(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function os(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var Nm=(o,t,e)=>{for(var n of Object.keys(o)){var i;if(o[n]!==((i=t[n])!==null&&i!==void 0?i:e[n]))return!1}return!0},Re=o=>{var t=e=>{var n=o.defaultClassName,i=ns(ns({},o.defaultVariants),e);for(var r in i){var a,l=(a=i[r])!==null&&a!==void 0?a:o.defaultVariants[r];if(l!=null){var u=l;typeof u=="boolean"&&(u=u===!0?"true":"false");var d=o.variantClassNames[r][u];d&&(n+=" "+d)}}for(var[s,c]of o.compoundVariants)Nm(s,i,o.defaultVariants)&&(n+=" "+c);return n};return t.variants=()=>Object.keys(o.variantClassNames),t.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return os(o.variantClassNames,e=>os(e,n=>n.split(" ")[0]))}},t};var is="_1eexc2a6";var rs=Re({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),as="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",ls=Re({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ss=Re({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),us=Re({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),ds="_12zfob12u _16lm1iw22 _16lm1iw1z";var cs="_12zfob17",fs="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",ps=Re({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Lr=Re({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),ms="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",hs=Re({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),gs="_12zfob1b _16lm1iw2",ys="_16lm1iw1",bs="_12zfob16",Cs=Re({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Ts="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var ht="InfiniteIcon";var Ss="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var ws={transition:"width 0.25s, opacity 0.25s"},vs=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var Fn=(0,pt.defineComponent)(o=>{let t=(0,pt.ref)(0),e=null;return(0,pt.onMounted)(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),(0,pt.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),()=>{let{lineWidth:n=1,className:i,index:r}=o,a=r!=null&&r>0,l=o.size??16,u=Math.floor(l/4),d=[l-1*u,l-2*u,l-3*u],s={...ws,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return(0,pt.h)("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:ne(i,ht,Ss,`${ht}-filter`)},[a?(0,pt.h)("div",{"data-name":"index",class:cs},`${r}`):null,(0,pt.h)("div",{style:{width:`${d[0]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[1]}px`,...s}}),(0,pt.h)("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...vs]});var ni=Object.freeze({}),Om={string:ni,number:{}};function Nn(o,t){let e=t.default||ni;return o.type===void 0?e:o.type===null?ni:typeof o.type=="string"?t[o.type]||Om[o.type]||ni:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var Vr=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],d=[];e.forEach((I,M)=>{let F=I.maxSize??i??void 0,v=I.minSize??n??void 0;u.push(v),d.push(F),I.size!=null&&(F!=null&&I.size>F&&(I.size=F),v!=null&&I.size<v&&(I.size=v));let D=I.flex==0?null:I.flex;if(I.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${M} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,r+=I.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((I,M)=>{if(I.flex!=null){let F=c*I.flex,v=I.maxSize??i??void 0,D=I.minSize??n??void 0,E=!1,P=0;v!=null&&F>v&&(f[M]=!0,E=!0,P=v),D!=null&&F<D&&(m[M]=!0,E=!0,P=D),E&&(p+=1,l-=1,a-=I.flex,s-=P)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,S=0,w=0,T=[];return{items:e.map((I,M)=>{let F={...I},v=I.maxSize??i??void 0,D=I.minSize??n??void 0,E=0,P=f[M],A=m[M],N=P||A,_=I.size??0;if(I.flex!=null){if(N)A&&(E=D),P&&(E=v);else{y+=1;let O=z=>(v!=null&&z>v&&(z=v),D!=null&&z<D&&(z=D),z);y===l?E=O(C):(E=O(Math.round(I.flex*c)),w+=E,C=s-w,b-=I.flex,c=C/b)}_=E,F.flexSize=E}return h.push(E),T.push(_),F.computedSize=_,S+=_,F}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-S)}};function oi(o,t,e,n){return t!=null&&o<=t?{value:t,clamped:"min",diff:(o-t)*n}:e!=null&&o>=e?{value:e,clamped:"max",diff:(e-o)*n}:{value:o,clamped:!1,diff:0}}function Is(o,t,e){let n=!1,i=0;for(let r of o)r.computedFlex&&(n=!0),i+=r.computedWidth;return n&&Math.round(i)>Math.round(t-e)}function zr(o,t){return o.computedFlex&&!t?"flex":"width"}function So(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var Gr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((D,E)=>(D[E]={...o.columnSizing[E]},D),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],d=l.id,s=u?.id,c=Is(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=zr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,S=u?zr(u,c):"width",w=!1,T=!1,x=i>0?1:-1,{value:I,clamped:M,diff:F}=oi(Math.round(f+i),m,p,x);if(o.shareSpaceOnResize){if(u==null)return n[d]=So(n[d],h,I),T=M==="min",w=M==="max",{adjustedDiff:I-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:w,constrained:T||w};let{value:D,clamped:E,diff:P}=oi(Math.round(y-i),C,b,x);if(M&&E&&(Math.abs(F)>Math.abs(P)?E=!1:M=!1),!(!M&&!E)){if(M){let A=oi(Math.round(y-i-F),C,b,x);D=A.value,E=A.clamped,P=A.diff}else if(E){let A=oi(Math.round(f+i+P),m,p,x);I=A.value,M=A.clamped,F=A.diff}}n[d]=So(n[d],h,I),n[s]=So(n[s],S,D),T=M==="min"||E==="min",w=M==="max"||E==="max"}else n[d]=So(n[d],h,I),T=M==="min",w=M==="max";let v=I-f;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-v),columnSizing:n,minReached:T,maxReached:w,constrained:T||w}};function Rs(o,t){return o+t}function km(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var xs=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=Is(o.items,t,e),d=a.map(b=>zr(b,u)),s=0,{computedSizes:c}=Vr({items:a.map(b=>(b.resizable===!1&&(s+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Rs,0)+i-s,0)}),f=a.map((b,S)=>c[S]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,S)=>{let w=a[S];if(!w.resizable){y.push(0);return}let T=d[S],x=l[S],I=km(n),{maxReached:M,minReached:F,constrained:v,adjustedDiff:D}=Gr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[S],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[w.id]=So(I[w.id],T,Math.round(x+D)),y.push(D),M||(p=!1),F||(m=!1),v||(h=!1)});let C=y.reduce(Rs,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var ii;function kt(){if(ii!=null)return ii;let o=Ve().document??null;if(!o)return 0;let t=o.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",o.body.appendChild(t);let e=o.createElement("div");return t.appendChild(e),ii=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),ii}var Ps=["start",void 0,"end"],Ds=(o,t)=>(t&&Object.keys(t).length>0&&o.sort((e,n)=>{let i=t[e],r=t[n];return i===!0&&(i="start"),r===!0&&(r="start"),i==r?0:Ps.indexOf(i)-Ps.indexOf(r)}),o);function As(o,t,...e){let n=t;return e.forEach(i=>{for(let r in i)i.hasOwnProperty(r)&&o(i[r],r)&&(n[r]=i[r])}),n}function Kr(o,...t){return As(e=>e!=null,o,...t)}function _s(o,t,...e){return As((n,i)=>!(i in o),t,...e)}var ri=!0,Lm=!0,zm=!0,Es="string",Zt="unknown";var Vm=an("getComputedVisibleColumns"),Gm=(o,t,e)=>o[e]!==!1,Br=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function Cn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function Km(o,t){let e=Nn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:Es}function Bm(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Zt];let l=Cn(t,a);if(!l)return[Zt];let u=Km(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Zt)?Zt:i.length===1?i[0]:i}function Hr(o,t){let{colType:e,sortable:n,columnDefaultSortable:i}=t,r=o.defaultSortable??e.defaultSortable,a=!!o.groupByForColumn;if(r==null&&!a){let l=o.field??e.field,u=o.valueGetter??e.valueGetter;l==null&&u==null&&(r=!1)}return n??r??i??ri}var Ms=({columns:o,userColumns:t,bodySize:e,columnMinWidth:n,columnMaxWidth:i,columnDefaultWidth:r,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:u,columnHeaderCssEllipsis:d,pinnedStartMaxWidth:s,pinnedEndMaxWidth:c,filterValue:f,sortable:m,sortInfo:p,multiSort:h,filterTypes:y=On,viewportReservedWidth:C,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:w,columnOrder:T,columnPinning:x,editable:I,columnDefaultEditable:M,columnDefaultFilterable:F,columnDefaultGroupable:v,columnDefaultSortable:D,columnSizing:E,columnTypes:P,columnVisibility:A,columnVisibilityAssumeVisible:N,groupBy:_})=>{let O=0,z={};_.forEach((g,R)=>{g.field&&(z[g.field]=R)});let K=(f||[]).reduce((g,R)=>{let{id:L,field:k}=R;return k&&(g[k]=R),L&&(g[L]=R),g},{}),B=Ds(T===!0?Object.keys(o):T,x),G=B.filter(g=>o[g]?Gm(A,N,g):(Vm(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),se=new Map,Z=G.map((g,R)=>{let L=o[g];return se.set(g,R),L}),Ee=(p??[]).reduce((g,R,L)=>(R.id?g[R.id]={sortInfo:R,index:L}:R.field&&(g[R.field]={sortInfo:R,index:L}),g),{});function ge(g){let R=o[g],L=Nn(R,P),k={minWidth:L?.minWidth,maxWidth:L?.maxWidth,width:L?.defaultWidth,flex:L?.defaultFlex},Y={width:R?.defaultWidth,flex:R?.defaultFlex,minWidth:R?.minWidth,maxWidth:R?.maxWidth},V=E[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let Q=Kr(Y,V);Q.width!=null&&delete k.flex,Q.flex!=null&&delete k.width,Q=Kr(k,Q);let pe=Q.flex??void 0,ue=Q.minWidth??R?.minWidth??n,me=Q.maxWidth??R?.maxWidth??i,le=pe!=null?void 0:Q.width??(a?void 0:r);return!le&&pe==null&&(a?pe=a:le=ue),{size:le,flex:pe,minSize:ue,maxSize:me}}let xe=Vr({availableSize:Math.max(e.width-(C??0)-(l??kt()),0),maxSize:i,minSize:n,items:G.map(ge)}),{computedSizes:Ke,flexSizes:Oe,minSizes:we,maxSizes:Fe}=xe,ce=[],ee=[],H=[],q=[];q.length=G.length;let J=new Map,oe=new Map,re=0,ye=0,be=0,ie=null,$=[],te=0,ve=0,_e=0;Z.forEach((g,R)=>{let L=G[R],k=Ke[R],Y=$[R]=Br(L,x);Y==="start"?te+=k:Y==="end"?_e+=k:ve+=k});let Te=e.width-_e,ze=[],$e=new Map;G.forEach((g,R)=>{let L=Z[R];$e.set(g,L)});let fe=[];Object.keys(o).forEach(g=>{let R=o[g];fe.push(g),$e.has(g)||$e.set(g,R)});let mt=new Map;$e.forEach((g,R)=>{let L=se.get(R);L==null&&(L=-1);let k=L!=-1,Y=G[L+1],V=Nn(g,P),Q=L,pe=Ee[R]?Ee[R]:g.field?Ee[g.field]??null:null,ue=pe?.sortInfo??null,me=!!ue,le=me&&ue.dir===1,Ce=me&&!le,Pe=pe?.index??-1,ae=k?{}:ge(R),Ct=k?Ke[L]:ae.size||0,$t=k&&Oe[L]||null,Ut=k?we[L]||0:ae.minSize||0,Ft=k?Fe[L]||1e4:ae.maxSize||1e4,qe=k?Br(R,x):!1,qt=k?L===G.length-1:!1,Yt=Q,co=k?qe==="start"?ye:qe==="end"?be:O-ye:0;qe=="start"?Yt=k?Q:-1:qe==="end"?Yt=k?Q-(ce.length+H.length):-1:Yt=k?Q-ce.length:-1;let tn=k?qe==="start"||qe===!1?O:Te+be:-1,zp=k?qe!==ie:!1,Vp=k?qt||qe!==Br(Y,x):!1,al=g.cssEllipsis??V.cssEllipsis??u,Gp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??al,Bo=k&&(K[R]||g.field||g.groupByForColumn)&&(K[R]||K[g.field||g.groupByForColumn])||null,Kp=g.defaultFilterable??V.defaultFilterable??F??!0,Bp=I??g.defaultEditable??V.defaultEditable??M??!1,Cr=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||Es,Hp=g.sortType||V.sortType||Cr,ll=g.filterType||V.filterType||Cr,sl=!1;if(Bo!=null&&!Bo.disabled){let Sr=y[ll];Sr&&(!Sr.emptyValues||!Sr.emptyValues.includes(Bo.filter.value))&&(sl=!0)}let En=g.field??V.field,Wp=g.valueGetter??V.valueGetter,Tr=g.defaultGroupable??V.defaultGroupable??v??!!En;En||(Tr=!1),g.groupByForColumn&&(Tr=!1);let ul=En?z[En]!==void 0:!1,jp=ul?z[En]:void 0,$p=Hr(g,{colType:V,sortable:m,columnDefaultSortable:D}),Up=g.resizable??V.resizable??b??Lm,Xe={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Wp,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:En,...g,components:{...V.components,...g.components},computedResizable:Up,computedMinWidth:Ut,computedMaxWidth:Ft,computedFlex:$t,computedDataType:Cr,computedEditable:Bp,computedSortType:Hp,computedFilterType:ll,cssEllipsis:al,headerCssEllipsis:Gp,computedFilterValue:Bo,computedFiltered:sl,computedFilterable:Kp,computedGroupable:Tr,computedGroupedBy:ul,computedGroupedByIndex:jp,computedWidth:Ct,computedAbsoluteOffset:tn,computedPinningOffset:co,computedVisibleIndexInCategory:Yt,computedOffset:O,computedSortable:$p,computedSortInfo:ue,computedSortIndex:Pe,computedMultiSort:h,computedSorted:me,computedSortedAsc:le,computedSortedDesc:Ce,computedVisibleIndex:Q,computedPinned:qe,computedDraggable:S??g.defaultDraggable??w??zm,computedFirstInCategory:zp,computedLastInCategory:Vp,computedFirst:L===0,computedLast:qt,id:R,header:g.header??V.header??g.name??g.field};k&&(O+=Ct,J.set(Xe.id,Xe),q[L]=Xe,qe==="start"&&(ce.push(Xe),ye+=Xe.computedWidth),qe==="end"&&(ee.push(Xe),be+=Xe.computedWidth),qe||(H.push(Xe),re+=Xe.computedWidth),ie=qe),Xe.groupByForColumn&&(Xe.computedSortType=g.sortType||V.sortType||Bm(Xe.groupByForColumn,t,P),ze.push(Xe)),oe.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!mt.has(Xe.field)&&mt.set(Xe.field,Xe)}),ze.forEach(g=>{g.computedSortable=Fs(g,{fieldsToColumn:mt,userColumns:t,columnTypes:P,sortable:m,columnDefaultSortable:D})});let rt=new Map;fe.forEach(g=>{let R=oe.get(g);R&&rt.set(g,R)}),oe.forEach(g=>{rt.has(g.id)||rt.set(g.id,g)});let Rt=s!=null?Math.min(s,ye):ye,Mt=c!=null?Math.min(c,be):be;return{computedRemainingSpace:e.width-(te+_e+ve),computedPinnedStartColumnsWidth:ye,computedPinnedEndColumnsWidth:be,computedUnpinnedColumnsWidth:re,computedColumnOrder:B,computedPinnedStartColumns:ce,computedPinnedEndColumns:ee,computedUnpinnedOffset:ye,computedPinnedEndOffset:ye+re,computedUnpinnedColumns:H,computedVisibleColumns:q,computedColumnsMap:oe,computedColumnsMapInInitialOrder:rt,computedVisibleColumnsMap:J,computedPinnedEndWidth:Mt,computedPinnedStartWidth:Rt,renderSelectionCheckBox:q.reduce((g,R)=>g||!!R.renderSelectionCheckBox,!1),fieldsToColumn:mt}};function Fs(o,t){let{sortable:e,fieldsToColumn:n,columnDefaultSortable:i,userColumns:r,columnTypes:a}=t;if(e)return e;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let u=i??ri,d=o.sortType??o.colType.sortType;return d!=null&&d!==Zt&&u?!0:c=>{let{column:f,api:m}=c,p=f.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((h,y)=>{if(!h)return!1;let C=y.field||y.groupField,b;if(C){let S=n.get(C),w=S?m.getColumnApi(S.id):void 0;if(S&&w)b=w.isSortable();else{let T=Cn(r,C);if(T){let x=Hr(T,{colType:Nn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof x=="boolean"?x:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ri},!0)}}function lt(o,t){let{getComputed:e,getState:n,actions:i,api:r}=t;typeof o=="number"&&(o=e().computedVisibleColumns[o]);let a=typeof o=="string"?e().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(u){return t.api.getCellValues({columnId:a.id,primaryKey:u})},getCellValueByPrimaryKey(u){return l.getCellValuesByPrimaryKey(u)?.value??null},toggleContextMenu(u){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(u)},toggleFilterOperatorMenu(u){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(u)},showFilterOperatorMenu(u){n().onFilterOperatorMenuClick({target:u,column:a})},hideFilterOperatorMenu(){r.hideFilterOperatorMenu()},showContextMenu(u){n().onColumnMenuClick({target:u,column:a})},hideContextMenu(){i.columnMenuVisibleForColumnId=null},isVisible(){return e().computedVisibleColumnsMap.has(a.id)},setVisible(u){r.setVisibilityForColumn(a.id,u)},toggleSort(u={multiSortBehavior:"replace"}){return r.toggleSortingForColumn(a.id,u)},isSortable(){let{computedColumnsMap:u}=e();return typeof a.computedSortable=="function"?a.computedSortable({api:r,columnApi:l,column:a,columns:u}):a.computedSortable},getSortDir(){return r.getSortingForColumn(a.id)},setFilter(u){return r.setColumnFilter(a.id,u)},clearFilter(){return r.clearColumnFilter(a.id)},getSortInfo(){return r.getSortInfoForColumn(a.id)},setSort(u){u?r.setSortingForColumn(a.id,u):r.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function wo(o,t,e){let n=typeof o=="string"?t.getComputed().computedColumnsMap.get(o):o,{api:i,getComputed:r,getDataSourceState:a,actions:l,dataSourceActions:u,dataSourceApi:d}=t,s=a(),{allRowsSelected:c,someRowsSelected:f,selectionMode:m}=s,p=r(),h=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let y=lt(n.id,{...t,actions:l,dataSourceActions:u,dataSourceApi:d});h=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:y,dataSourceApi:d,renderLocation:e,dragging:!1,columnsMap:p.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:c,someRowsSelected:f,selectionMode:m,api:i,renderBag:{header:h}})??null}return h}var Ge="Infinite",We={rootClassName:Ge};var ai=`${Ge}HeaderCell__filter`,Wr=`${Ge}HeaderCell__filterOperator`,Ns=`${ai}__input`;var de=require("vue");function U(o){return o.slice(4,-1)}function li(o,t,e,n){let i=[...t],r={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=e(r);return i.push(a),o.computedFirst&&i.push(...t.map(l=>`${l}--first`)),o.groupByForColumn&&i.push(...t.map(l=>`${l}--group-column`)),o.computedLast&&i.push(...t.map(l=>`${l}--last`)),o.computedFirstInCategory&&i.push(...t.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&i.push(...t.map(l=>`${l}--last-in-category`)),n.rowSelected&&i.push(...t.map(l=>`${l}--row-selected`)),n.cellSelected&&i.push(...t.map(l=>`${l}--cell-selected`)),n.firstRow&&i.push(...t.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&i.push(...t.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&i.push(...t.map(l=>`${l}--disabled`)),n.treeNode&&i.push(...t.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(i.push(...t.map(l=>`${l}--group-row`)),i.push(...t.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?i.push(...t.map(l=>`${l}--pinned-${o.computedPinned}`)):i.push(...t.map(l=>`${l}--unpinned`)),i.filter(Boolean).join(" ")}var cu=require("vue");var Je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function Os(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function ks(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function Hm(o,t,e){let n=Os(o,e),i=Os(t,e);return n===i?ks(e,t)-ks(e,o):n-i}function Ls(o){if(o.length<3)return o;let[...t]=o,e={top:0,left:0};return o.forEach(n=>{e.top+=n.top,e.left+=n.left}),e.top/=o.length,e.left/=o.length,t.sort((n,i)=>Hm(n,i,e)),t}function Wm(o){if(o.length<2)return!1;let t=o[0].left,e=o[0].top,n={left:!1,top:!1};for(let i=1,r=o.length;i<r;i++){if(n.left&&n.top)return!1;o[i].left!==t&&(n.left=!0),o[i].top!==e&&(n.top=!0)}return!(n.left&&n.top)}function jm(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=Ls(o);let e=o[0],n=o[o.length-1];return e.left===n.left?t.left===e.left&&t.top>=Math.min(e.top,n.top)&&t.top<=Math.max(e.top,n.top):t.top===e.top&&t.left>=Math.min(e.left,n.left)&&t.left<=Math.max(e.left,n.left)}function zs(o,t){if(Wm(o))return jm(o,t);o=Ls(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if($m([e,r,a],t))return!0}return!1}function $m(o,t){let[e,n,i]=o,r=t,a=(n.left-e.left)*(i.top-e.top)-(n.top-e.top)*(i.left-e.left);return a*((n.left-e.left)*(r.top-e.top)-(n.top-e.top)*(r.left-e.left))>=0&&a*((i.left-n.left)*(r.top-n.top)-(i.top-n.top)*(r.left-n.left))>=0&&a*((e.left-i.left)*(r.top-i.top)-(e.top-i.top)*(r.left-i.left))>=0}var kn=class{containsPoint(t){return zs(this.getPoints(),t)}contains(t){let e=t.getPoints();for(let n=0,i=e.length;n<i;n++)if(!this.containsPoint(e[n]))return!1;return!0}intersects(t){return this.privateIntersects(t,!1)}privateIntersects(t,e){let n=t.getPoints();for(let i=0,r=n.length;i<r;i++)if(this.containsPoint(n[i]))return!0;return e?!1:t.privateIntersects(this,!0)}};var Ln=class o extends kn{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(Je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function Um(o,t){let e=Math.min(o.left,t.left),n=Math.min(o.top,t.top),i=o.left+o.width,r=t.left+t.width,a=Math.max(i,r),l=o.top+o.height,u=t.top+t.height,d=Math.max(l,u);return new Me({top:n,left:e,width:a-e,height:d-n})}var Me=class o extends kn{constructor(e){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=e.top,this.left=e.left,typeof e.width=="number"?(this.width=e.width,this.height=e.height):(this.width=e.right-e.left,this.height=e.bottom-e.top)}static fromDOMRect(e){return new o(e)}static clone(e){return new o(e)}static from(e){return o.clone(e)}static fromPoint(e){return o.from({top:e.top,left:e.left,width:0,height:0})}getMinimumBoundingRectangle(...e){let n=this;for(let i of e)n=Um(n,i);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(e){return new Ln(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function vo(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var Vs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Gs="_1yeub2vs",Ks="_1yeub2vr",Bs=Re({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var jr="_1yeub2vp";var PT=Re({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var j={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var $r=`${Ge}Body`,Hs=o=>o.querySelector(`.${$r}`);var Tn=`${Ge}HeaderCell`,Ur=`${Ge}HeaderWrapper`,Ws=o=>Array.from(o.querySelectorAll(`.${Ur}`));function zn(o,t){let e=o;if(!e)return null;if(e&&e.matches(t))return e;for(;e=e.parentElement;)if(e.matches(t))return e;return null}function js(o,t,e){let n=o;if(!n)return null;if(n&&n.matches(t))return n;for(;n=n.parentElement;){if(n.matches(t))return n;if(n===e)return null}return null}var Ae={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},$s="column-header-height";var Us=`.${We.rootClassName}`;function qr(o){return zn(o,Us)}var qs=U(j.scrollLeft),qm=U(j.scrollTop),Ym=U(j.columnWidthAtIndex),Yr=U(j.columnOffsetAtIndex),Ys=U(j.columnReorderEffectDurationAtIndex),Zm=U(j.columnOffsetAtIndexWhileReordering),Xm=U(j.columnVisibilityAtIndex),Jm=U(j.columnZIndexAtIndex);function Lt(o,t,e){let n=e?qr(e):document.querySelector(Us);Qm(o,t,n)}function Qm(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Vn(o,t){if(t)for(var e in o){let n=j[e]?U(j[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function Zr(o,t,e){Lt(`${Yr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${qs}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Xr(o,t,e){Lt(`${Jm}-${o}`,`${t}`,e)}function Ro(o,t,e){Lt(`${Zm}-${o}`,typeof t=="number"?`calc( var(${Yr}-${o}) + ${t}px )`:t,e)}function Io(o,t,e){Lt(`${Xm}-${o}`,t,e)}function si(o,t,e){Lt(`${Ys}-${o}`,e??"",t)}function Jr(o,t){let e=`${Ys}-${o}`;Lt(e,Ae.components.Cell.reorderEffectDuration,t)}var Se={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ym}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Lt(this.varName.get(o),t,e)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Yr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Lt(this.varName.get(o),t,e)}}};function Zs(o,t){Vn({[qs]:`${o.scrollLeft}px`,[qm]:`${o.scrollTop}px`},t)}var xo={bodyWidth:{name:U(Ae.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(Ae.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(Ae.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(Ae.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(Ae.runtime.browserScrollbarWidth),value:""}},eh=U(j.scrollbarWidthHorizontal),Xs=U(j.scrollbarWidthVertical),th=U(j.columnWidthAtIndex),nh=U(j.columnZIndexAtIndex),Js=U(j.scrollLeft),oh=U(j.activeCellColWidth),Qs=U(j.activeCellColOffset),ou=U(j.baseZIndexForCells),ih=U(j.pinnedStartWidth),eu=U(j.bodyWidth),rh=U(j.bodyHeight),tu=U(j.pinnedEndOffset),nu=U(j.pinnedEndWidth),ah=U(j.computedVisibleColumnsCount);function Qr(o,t){let e="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?e=t.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(e=t.visibleColsCount+o.computedVisibleIndexInCategory):e=-n*10,typeof e=="number"?`calc( var(${ou}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function iu(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=kt(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Se.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Se.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Js}) )`:h.computedPinned==="end"?`calc( var(${tu}) ${f.length?"+":""} ${f.map(b=>Se.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Js}) )`:`${h.computedOffset}px`;let C=Qr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${nh}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[xo.browserScrollbarWidth.name]=`${kt()}px`),m[xo.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[xo.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[xo.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${th}-${h})`).join(" + ")})`,m[xo.visibleColumnsCount.name]=t.length,u!=null){m[oh]=Se.columnWidths.get(u[1]);let p=Se.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Qs]=h?`calc( ${Ae.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Qs]=p}return m[ah]=t.length,m[eh]=s.horizontal?`${c}px`:"0px",m[Xs]=s.vertical?`${c}px`:"0px",m[ih]="calc( "+e.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[nu]="calc( "+n.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[ou]=t.length*10,m[tu]=`calc( var(${eu}) - var(${nu}) - var(${Xs}) )`,m[eu]=`${l.width}px`,m[rh]=`${l.height}px`,m}var Po=(o,t,e)=>{if(o=[...o],t===e||o[t]===void 0||o[e]===void 0)return o;let n=o[t];return e<t,o.splice(t,1),o.splice(e,0,n),o};function ea(o){let{newColumnOrder:t,visibleColumnOrder:e,existingColumnOrder:n,dragColumnId:i}=o;if(e.length!==t.length)return console.warn("new column order cannot contain less columns than the visible column order"),t;let r=e.indexOf(i),a=t.indexOf(i);if(r===a)return n;if(a>r){let l=t.indexOf(i),u=t[l-1],d=n.indexOf(u),s=n.indexOf(i);return Po(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return Po(n,s,d)}return t}var uu=fo(Gn());function ui(o){return o.map(t=>t instanceof dn?t:new dn(null,[t]))}var dn=class o{constructor(t,e=[]){this.__operands=[];this.__operation=null;this.__operands=e,this.__operation=t}add(...t){return new o("+",[this,...t])}subtract(...t){return new o("-",[this,...t])}minus(...t){return this.subtract(...t)}multiply(...t){return new o("*",[this,...t])}divide(...t){return new o("/",[this,...t])}__get(t){let{__operation:e,__operands:n}=this,i=n.map(a=>lh(a,this)).join(` ${e} `);return(n.length<=1?!0:t?.__operation==="+"||t?.__operation==="-")?i:`(${i})`}done(){let t=this.__get();return`calc${t.startsWith("(")&&t.endsWith(")")?t:`(${t})`}`}};function lh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var sh=(...o)=>new dn("+",ui(o)),au=(...o)=>new dn("-",ui(o)),uh=(...o)=>new dn("*",ui(o)),dh=(...o)=>new dn("/",ui(o)),Do={add:sh,subtract:au,minus:au,multiply:uh,divide:dh};var lu=o=>{let t=null,e=null;return{stop(){t!==null&&yn(t),e!=null&&yn(e)},scroll(n){t!==null&&yn(t),e!=null&&yn(e);let i={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},r=this;function a(){let u=i.scrollOffsetStart+i.offset-i.mousePosition.clientX;if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft-f,t=Be(()=>{r.scroll(n)}),!0}function l(){let u=i.mousePosition.clientX-(i.scrollOffsetEnd-i.offset);if(!(u>0&&u<=i.offset))return!1;let s=i.scrollAmountsPerRaf.length,c=Math.round(i.offset/s),f=0;for(let m=0;m<s;m++)u>(m+1)*c&&(f=i.scrollAmountsPerRaf[m]);return n.scrollLeft=n.scrollLeft+f,e=Be(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var su=10,ch=U(j.pinnedStartWidth);function du(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:d,tableRect:s,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:y,horizontalLayoutPageIndex:C,pageWidth:b}=o;function S(H){let q=H==="start"?z:K;return N===O?q:O===H?q+P.computedWidth:N===H?q-P.computedWidth:q}function w(H){if(H.columnIndex===A||C!=null)return!0;let q=t[H.columnIndex];if(q.computedPinned)return!0;let J=l.getScrollPosition().scrollLeft,oe=q.computedOffset+(C!=null&&b!=null?b*C:0);return oe>=J+S("start")&&oe+q.computedWidth<=J+s.width-S("end")}let T=(H,q)=>{let{restrictToParentGroup:J,dragColumn:oe}=q,re=[];if(H.forEach(be=>{if(be.computedVisibleIndex===A)return;let ie={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};w(ie)&&re.push(ie)}),J){let ie=function(te,ve,_e){let Te=H[te];Te&&(Te.columnGroup!==oe.columnGroup&&_e.add(Te.id),ie(te+ve,ve,_e))};var ye=ie;let be=oe.computedVisibleIndex,$=new Set;ie(be-1,-1,$),ie(be+1,1,$),re=re.filter(te=>!$.has(te.columnId))}return re},I=i.length,M={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},F={left:M.clientX-s.left-(M.clientX-u.left)+su,top:M.clientY-s.top-(M.clientY-u.top)+su},v=l.getScrollPosition(),D=t.map(H=>H.computedVisibleIndex),E=D,P=e.get(r),A=P.computedVisibleIndex,N=P?.computedPinned,_=A,O=N,z=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=M,G={x:0,y:0},se=1,Z=0;function Ee(H){let q=Math.round(H.clientX),J=Math.round(H.clientY);if(q===B.clientX&&J===B.clientY)return Me.from(u).shift({left:G.x,top:G.y});B={clientX:q,clientY:J};let re=l.getScrollPosition().scrollLeft-v.scrollLeft;return G.x=B.clientX-M.clientX,G.y=B.clientY-M.clientY,Z=G.x+re,se=Z<0?-1:1,m({left:F.left+G.x,top:F.top+G.y}),Me.from(u).shift({left:G.x,top:G.y})}function ge(H){let q=0;N?N==="start"&&H.forEach((J,oe)=>{q||t[J]?.computedPinned!=="start"&&(q=oe)}):H.forEach((J,oe)=>{t[J]?.computedPinned==="start"&&(q=oe+1)}),I=q,xe("start",H,q)}function xe(H,q,J){if(H==="start"){let oe=0;for(let re=0;re<J;re++){let ye=q[re],be=t[ye];oe+=be.computedWidth}Lt(ch,`${oe}px`,a)}}function Ke(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Io(A,"",a),p(!1)),_=H,H===-1){Oe(A);return}let q=Po(D,A,_>A?_-1:_);I=0;let oe=new Set;return q.forEach((re,ye)=>{let be=E[ye];re!==be&&oe.add(re),ge(q)}),E=q,we(oe),{newColumnIndexes:q,indexesWithTransition:oe,pinnedStartCount:I}}function Oe(H){E=E.filter(J=>J!==H),t.forEach(J=>{let oe=J.computedVisibleIndex,re=oe>H;Jr(oe,a);let ye="";re&&(ye=Do.minus(Se.columnOffsets.get(oe),Se.columnWidths.get(H)).done()),Ro(oe,ye,a)}),Io(H,"hidden",a),p(!0)}function we(H){t.forEach(q=>{let J=q.computedVisibleIndex;H.has(J)?Jr(J,a):si(J,a);let oe=J===A,re=se===-1?J<_||J>A:J<A||J>=_,ye="";se===-1?ye=oe?Se.columnOffsets.get(_):re?Se.columnOffsets.get(J):Do.add(Se.columnOffsets.get(J),Se.columnWidths.get(A)).done():ye=re?Se.columnOffsets.get(J):oe?Do.add(Se.columnOffsets.get(_-1),Se.columnWidths.get(_-1)).minus(Se.columnWidths.get(A)).done():Do.minus(Se.columnOffsets.get(J),Se.columnWidths.get(A)).done(),Ro(J,ye,a)})}let Fe=s.left+S("start"),ce=s.right-S("end"),ee=lu({scrollOffsetStart:Fe,scrollOffsetEnd:ce});return Ee(M),{speedScroller:ee,stop(){ee.stop()},onMove(H){let q=Ee(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(q.getCenter()))return f&&Ke(-1),null;ee.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ie){y.scrollLeft=ie}});let J=T(t,{dragColumn:P,restrictToParentGroup:d==="group"}),oe=se===-1?P.computedOffset+Z:P.computedOffset+P.computedWidth+Z,re=(0,uu.default)(J,oe,({offsetX:ie},$)=>ie<$?-1:ie>$?1:0);re<0&&(re=~re),J.length?re=J[re]?J[re].columnIndex:J[J.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),re=0),re===A+1&&(re=A),Ke(re);let ye={};n.forEach(ie=>{ye[ie.id]="end"});for(let ie=0;ie<I;ie++){let $=E[ie],te=t[$];ye[te.id]="start"}let be=E.map(ie=>t[ie].id);return{columnPinning:ye,columnOrder:be}}}}var fh=U(j.baseZIndexForCells),ph=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:sn(o,t)},mh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function fu(o){let{columnId:t,context:e,domRef:n,getHorizontalLayoutPageIndex:i,allowColumnHideOnDrag:r,proxyPosition:a,dragColumnOutside:l}=o,{getState:u,getComputed:d,actions:s,api:c}=e,f=p=>{let h=d().computedVisibleColumnsMap.get(t);if(!h||!h.computedSortable)return;let{multiSortBehavior:y}=u();c.toggleSortingForColumn(t,{multiSortBehavior:y==="replace"&&(p.ctrlKey||p.metaKey)?"append":y})},m=p=>{if(p.target&&vo(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:S,computedVisibleColumnsMap:w,computedPinnedStartColumns:T,computedUnpinnedColumns:x,computedPinnedEndColumns:I}=d(),M=w.get(t);if(!M||!M.computedDraggable){f(p);return}let F=n.current,v=F.getBoundingClientRect(),D=y.current.getBoundingClientRect(),E=C.getAvailableSize(),P=M.computedVisibleIndex,A=C.getVirtualColIndex(M.computedVisibleIndex,{pageIndex:h||0}),N=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=F.style.cursor??"auto",O=!1,z=y.current,K=Me.from(Hs(z).getBoundingClientRect()),B=Ws(z).map(we=>Me.from(we.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),se=du({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:N,draggableColumnsRestrictTo:b,computedPinnedEndColumns:I,computedPinnedStartColumns:T,computedUnpinnedColumns:x,computedVisibleColumns:S,computedVisibleColumnsMap:w,dragColumnHeaderTargetRect:v,dragColumnId:t,getCurrentDragSourceAndTarget:mh,api:c,infiniteDOMNode:y.current,setProxyPosition:we=>{a.value=we},setDragColumnOutside:we=>{l.value=we},tableRect:D,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Z=null,Ee,ge;function xe(we){let{columnPinning:Fe,columnOrder:ce}=we;ph(u().columnPinning,Fe)||(s.columnPinning=Fe);let ee=d().computedColumnOrder;s.columnOrder=ea({newColumnOrder:ce,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:ee,dragColumnId:t})}let Ke=we=>{let{headerBrain:Fe,brain:ce}=u();if(!O){O=!0;let ee=ce.keepColumnRendered(A),H=Fe.keepColumnRendered(A);if(ce.isHorizontalLayoutBrain){let J=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),oe=Fe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ge=()=>{J(),oe()}}Ee=()=>{ee(),H()},s.columnReorderDragColumnId=M.id,h!=null&&(s.columnReorderInPageIndex=h),Xr(P,`calc( var(${fh}) + 10000 )`,y.current),y.current?.classList.add(jr),F.style.cursor="grabbing"}Z=se.onMove(we)},Oe=we=>{let Fe=we.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ce}=u(),ee=y.current;ee?.classList.remove(jr),se.stop(),C.update({...E}),Ee?.(),ge?.(),F.style.cursor=_,F.hasPointerCapture?.(Fe)&&F.releasePointerCapture(Fe),F.removeEventListener("pointermove",Ke),F.removeEventListener("pointerup",Oe),a.value=null;let H=c.getColumnApi(M.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(M.id,{multiSortBehavior:ce==="replace"&&(we.ctrlKey||we.metaKey)?"append":ce}),Z?xe(Z):O&&r&&c.setVisibilityForColumn(M.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await(0,cu.nextTick)(),S.forEach(q=>{si(q.computedVisibleIndex,ee),Io(q.computedVisibleIndex,"",ee),Ro(q.computedVisibleIndex,"",ee)}),Xr(P,Qr(M,{pinnedStartColsCount:T.length,visibleColsCount:S.length}),ee)})};F.addEventListener("pointermove",Ke),F.addEventListener("pointerup",Oe),F.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&vo(p.target)||f(p)}}}var Sn=require("vue");var gt={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var pu=(0,Sn.defineComponent)({name:"InfiniteIcon",props:{size:{type:Number,default:void 0},style:{type:Object,default:void 0},className:{type:String,default:void 0},viewBox:{type:String,default:"0 0 24 24"},paths:{type:Array,required:!0}},setup(o){return()=>{let t=o.size??"var(--infinite-icon-size)",e={flex:"none",width:typeof t=="number"?`${t}px`:t,height:typeof t=="number"?`${t}px`:t,fill:"currentColor",...o.style};return(0,Sn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,Sn.h)("path",{d:n})))}}});function It(o,t){let e=n=>(0,Sn.h)(pu,{...n,paths:t});return e.displayName=o,e}var mu=It("IncludesOperatorIcon",gt.includesOperator),hu=It("StartsWithOperatorIcon",gt.startsWithOperator),gu=It("EndsWithOperatorIcon",gt.endsWithOperator),yu=It("EqualOperatorIcon",gt.eqOperator),bu=It("NotEqualOperatorIcon",gt.neqOperator),Cu=It("GTOperatorIcon",gt.gtOperator),Tu=It("GTEOperatorIcon",gt.gteOperator),Su=It("LTOperatorIcon",gt.ltOperator),wu=It("LTEOperatorIcon",gt.lteOperator),vu=It("DoneIcon",gt.done),Ru=It("ClearIcon",gt.clear),ta=o=>(0,Sn.h)(pu,{...o,viewBox:"0 -960 960 960",paths:gt.hidden});ta.displayName="HiddenIcon";var di="_1eexc2a7 _1eexc2a6",Iu=Re({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),xu=Re({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Pu="_1eexc2a5",ci=Re({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),fi="_1eexc2a8";var xt=require("vue");var Du="qz8ht90 _16lm1iwk";var cn=(0,xt.defineComponent)({name:"InfiniteCheckBox",props:{disabled:{type:Boolean,default:!1},checked:{type:[Boolean,Object],default:void 0},defaultChecked:{type:[Boolean,Object],default:void 0},onChange:{type:Function,default:void 0},domProps:{type:Object,default:void 0}},setup(o){let t=()=>o.checked!==void 0,e=t()?o.checked:o.defaultChecked,n=(0,xt.ref)(e===void 0?!1:e),i=(0,xt.ref)(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};(0,xt.onMounted)(r),(0,xt.watch)(()=>o.checked,l=>{t()&&(n.value=l===void 0?!1:l,r())});let a=()=>{if(o.disabled)return;let l=!n.value;t()||(n.value=l,r()),o.onChange?.(l)};return()=>{let l=o.domProps||{};return(0,xt.h)("input",{...l,class:ne("InfiniteCheckBox",Du,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var wn=require("vue");function Au(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var _u=Au({"data-name":""}),na={[_u["data-name"]]:"menu-icon"},Eu=`[${_u["data-name"]}="${na["data-name"]}"]`;var hh={width:"100%",pointerEvents:"none"},oa=`${ht}-menu`,Ao=(0,wn.defineComponent)({name:"MenuIcon",props:{lineWidth:{type:Number,required:!1},lineStyle:{type:Object,required:!1},style:{type:Object,required:!1},className:{type:String,required:!1},domProps:{type:Object,required:!1},reserveSpaceWhenHidden:{type:Boolean,required:!1},menuVisible:{type:Boolean,required:!1}},setup(o,{slots:t}){return()=>{let e={...hh,borderTop:`${Ae.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[(0,wn.h)("div",{class:oa,style:e}),(0,wn.h)("div",{class:oa,style:e}),(0,wn.h)("div",{class:oa,style:e})];return(0,wn.h)("div",{...o.domProps,style:o.style,...na,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ne(o.className,hs({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),ht,`${ht}-menu`)},n)}}});var st=require("vue");var Mu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Fu={transition:"width 0.25s, opacity 0.25s"},Nu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var Ou=(0,st.defineComponent)(o=>{let t=(0,st.ref)(!0),e=(0,st.ref)(0),n=null;(0,st.watch)(()=>o.direction,r=>{let a=r!=0?1:0;!t.value&&a&&(t.value=!0),a!==e.value&&(n!=null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,e.value=a}))},{immediate:!0}),(0,st.onBeforeUnmount)(()=>{n!=null&&cancelAnimationFrame(n)});let i=()=>{let a=!(e.value===0&&o.direction===0);a!==t.value&&(t.value=a)};return()=>{let{direction:r,lineWidth:a=1,className:l,index:u}=o;if(!t.value&&!o.forceSize)return null;let d=u!=null&&u>0,s=o.size??16,c=Math.floor(s/4),f=r?[s-3*c,s-2*c,s-c]:[0,0,0];r===-1&&f.reverse();let m={...Fu,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),(0,st.h)("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:ne(l,ht,Mu,`${ht}-sort`)},[d?(0,st.h)("div",{"data-name":"index",style:p,class:bs},`${u}`):null,(0,st.h)("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),(0,st.h)("div",{style:{width:`${f[1]}px`,...m}}),(0,st.h)("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...Nu]});var{rootClassName:ku}=We,zt=`${ku}Cell`,pi=`${ku}Cell_content`;function ia(o){return Math.max(o.width-kt(),0)}function Lu(o){let{context:t,column:e,diff:n,shareSpaceOnResize:i}=o,r=t.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:u}=r,d=t.getComputed().computedVisibleColumns,s=!1,c=d.reduce((m,p)=>(p.computedFlex&&(m[p.id]={...a[p.id],flex:p.computedWidth},s=!0),m),{}),f=s?{...a,...c}:a;return Gr({shareSpaceOnResize:i,availableSize:ia(u),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:e.computedVisibleIndex,columnSizing:f,items:d.map(m=>({id:m.id,computedFlex:m.computedFlex,computedWidth:m.computedWidth,computedMinWidth:m.computedMinWidth,computedMaxWidth:m.computedMaxWidth}))})}var vn=require("vue");function zu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Se.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Se.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?Zr(l,r,n.current):Se.columnOffsets.set(a,l.computedOffset+r,n.current);return}if(i.computedPinned!=="end"){if(i.computedPinned==="start"){for(let l=a,u=t.length;l<u;l++){let d=t[l];if(d.computedPinned==="start"){Zr(d,r,n.current);continue}d.computedPinned!=="end"&&Se.columnOffsets.set(l,d.computedOffset+r,n.current)}return}for(let l=a,u=t.length;l<u;l++){let d=t[l];d.computedPinned||Se.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function Vu(o,t){let e=o[o.length-1];return{resize(n){let{columns:i,domRef:r}=t,a=i[o[0]],l=a.computedOffset,u=0,d=r.current;if(n.forEach((s,c)=>{u+=s;let f=o[c],m=i[f],p=m.computedWidth+s;Se.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Se.columnOffsets.set(f,l,d),l+=p)}),a.computedPinned!=="end")for(let s=e+1;s<i.length;s++){let c=i[s];c.computedPinned!=="end"&&Se.columnOffsets.set(s,c.computedOffset+u,d)}}}}var mi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",hi=Re({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),gi=Re({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var Gu=require("vue"),Kn=Symbol("InfiniteTable");function Ye(){return(0,Gu.inject)(Kn)}var{rootClassName:gh}=We,yh=`${gh}HeaderCell_ResizeHandle`,Ku=(0,vn.defineComponent)({name:"ResizeHandle",props:{horizontalLayoutPageIndex:{type:Number,default:null},columnIndex:{type:Number,required:!0},columns:{type:Array,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t=Ye(),{getState:e}=t,n={current:null},i=(0,vn.ref)(!1),r=a=>{a.stopPropagation();let l=o.columns[o.columnIndex];if(!l)return;let u=l.computedPinned,d=o.horizontalLayoutPageIndex,{brain:s,headerBrain:c}=e(),f=!!a.shiftKey,m=a.pointerId,p=a.clientX,h=a.target,y=()=>{};if(s.isHorizontalLayoutBrain){let T=s.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),x=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),x()}}h.setPointerCapture(m);let C=zu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:x}={})=>{d&&(T=T/(d+1),x&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:I,constrained:M}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==M&&(i.value=M),C.resize(I),I},S=T=>{b(Math.round(T.clientX-p))},w=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",S),h.removeEventListener("pointerup",w);let x=Math.round(T.clientX-p),I=b(x,{done:!0});y(),C.resize(0),o.onResize({diff:I,shareSpaceOnResize:f})};h.addEventListener("pointermove",S),h.addEventListener("pointerup",w)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,d=a.computedLastInCategory,s=(l===!1||l==="start")&&d?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return(0,vn.h)("div",{ref:c=>{n.current=c??null},class:`${yh} ${mi} ${gi({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[(0,vn.h)("div",{style:s,class:hi({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var bh=U(j.columnWidthAtIndex),Ch=U(j.columnReorderEffectDurationAtIndex),Th=U(j.columnZIndexAtIndex),Sh=U(j.columnVisibilityAtIndex),Bu=Symbol("InfiniteHeaderCell");function _o(){return(0,de.inject)(Bu)}var wh=o=>{let{allRowsSelected:t,someRowsSelected:e,api:n,dataSourceApi:i}=o,r=t?!0:e?null:!1,{components:a,isTree:l}=n.getState(),u=a?.CheckBox||cn;return(0,de.h)(u,{domProps:{class:fi},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function Rn(o,t){return o(t)}var ra=()=>(0,de.h)("div",{class:jl[1]}),Hu=(0,de.defineComponent)({name:"InfiniteTableHeaderCell",props:{column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},headerOptions:{type:Object,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0},allRowsSelected:{type:Boolean,required:!0},someRowsSelected:{type:Boolean,required:!0},selectionMode:{type:[String,Boolean],required:!0}},setup(o){let t=Ye(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=v=>{let D=v&&v.$el!==void 0?v.$el:v;s.current=D??null,o.domRef(s.current)},f=(0,de.shallowRef)(null);(0,de.provide)(Bu,f);let m=()=>lt(o.column,{actions:n,api:e,dataSourceActions:d,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let v=o.column.id,D=l().filterDelay,E=`${v}:${D}`;if(!p||p.key!==E){let P=A=>{e.setColumnFilter(v,A)};p={key:E,fn:D>0?nn(P,{wait:D}):P}}return p.fn},y=(0,de.ref)(null),C=(0,de.ref)(!1),{onPointerDown:b}=fu({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),S=(0,de.computed)(()=>t.state.value.columnMenuVisibleForColumnId),w=(0,de.computed)(()=>t.state.value.columnReorderDragColumnId),T=(0,de.computed)(()=>t.state.value.columnReorderInPageIndex),x=(0,de.computed)(()=>t.state.value.showColumnFilters),I=(0,de.computed)(()=>t.state.value.columnHeaderHeight),M=(0,de.computed)(()=>t.state.value.components),F=(0,de.computed)(()=>a.state.value.filterTypes);return()=>{let{column:v,columnsMap:D,horizontalLayoutPageIndex:E,headerOptions:P}=o,{allRowsSelected:A,someRowsSelected:N,selectionMode:_}=o,O=v.computedSortInfo,z=v.header,K=m(),B=K.isSortable(),G=P.alwaysReserveSpaceForSortIcon,se=v.headerAlign??v.align,Z=(typeof se=="function"?se({isHeader:!0,column:v}):se)??"start",Ee=(typeof v.verticalAlign=="function"?v.verticalAlign({isHeader:!0,column:v}):v.verticalAlign)??"center",ge=B&&(v.computedSorted||G)?(0,de.h)(Ou,{index:v.computedMultiSort?v.computedSortIndex+1:void 0,style:{marginInlineStart:Ae.spacing[2],marginInlineEnd:Ae.spacing[2]},className:`${Tn}__sort-icon ${ys} ${Cs({align:Z})}`,direction:v.computedSorted?v.computedSortedAsc?1:-1:0}):null,Ke=v.computedFilterable&&v.computedFiltered?(0,de.h)(Fn):null,Oe=v.headerCssEllipsis??v.cssEllipsis??!0,we=S.value,Fe=w.value,ce=T.value,ee=Fe===v.id,H=ce!=null?E!==ce:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:we===v.id,style:Z==="end"?{marginInlineStart:`calc(${Ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:Ae.spacing[2]}:{marginInlineEnd:`calc(${Ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:Ae.spacing[2]},domProps:{onMousedown:ae=>{ae.stopPropagation(),K.toggleContextMenu(ae.target)}}},J=v.components?.MenuIcon||M.value?.MenuIcon||Ao,oe=(0,de.h)(J,q),re=x.value,ye=F.value,be=v.computedFilterType,ie=ye[be],$=v.computedFilterable?v.computedFilterValue?.filter.operator??ie?.defaultOperator:void 0,te=v.computedFilterable&&ie?ie.operators.find(ae=>ae.name===$):void 0,ve=te?.components?.FilterEditor||ie?.components?.FilterEditor||v.components?.FilterEditor||Bn,_e=ie?.components?.FilterOperatorSwitch||v.components?.FilterOperatorSwitch||ju,Te=v.computedFilterable?(0,de.h)(Wu,{filterProps:{horizontalLayoutPageIndex:E,filterEditor:ve,filterOperatorSwitch:_e,operator:te,filterTypes:ye,onChange:h(),columnFilterType:be,columnLabel:v.field||v.name||v.id,columnFilterValue:v.computedFilterValue,columnHeaderHeight:I.value}}):(0,de.h)($u),ze={horizontalLayoutPageIndex:E,dragging:ee,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:v,columnsMap:D,columnSortInfo:O,columnFilterValue:v.computedFilterValue,filtered:v.computedFiltered,someRowsSelected:N,allRowsSelected:A,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:ge,filterIcon:Ke,menuIcon:oe,menuIconProps:q,selectionCheckBox:null,header:v.header&&typeof v.header!="function"?v.header:v.name}},$e=ze;$e.renderBag.filterEditor=Te,f.value=$e;let fe={...ze,renderBag:{...ze.renderBag}};if(v.renderSortIcon&&(fe.renderBag.sortIcon=Rn(v.renderSortIcon,{...fe,renderBag:{...fe.renderBag}})),v.renderFilterIcon&&(fe.renderBag.filterIcon=Rn(v.renderFilterIcon,{...fe,renderBag:{...fe.renderBag}})),typeof v.renderMenuIcon=="function"){let ae=Rn(v.renderMenuIcon,{...fe,renderBag:{...fe.renderBag}});fe.renderBag.menuIcon=ae?ae.type===J||ae.type===Ao?ae:(0,de.h)(J,q,()=>ae):null}if(v.renderSelectionCheckBox&&_==="multi-row"){fe.renderBag.selectionCheckBox=Rn(wh,{...fe,renderBag:{...fe.renderBag}});let ae=v.renderHeaderSelectionCheckBox??v.renderSelectionCheckBox;ae&&ae!==!0&&(fe.renderBag.selectionCheckBox=Rn(ae,{...fe,renderBag:{...fe.renderBag}}))}z instanceof Function&&(fe.renderBag.header=Rn(z,{...fe,renderBag:{...fe.renderBag}}));let mt=Oe?(0,de.h)("div",{class:St},[fe.renderBag.header]):fe.renderBag.header,rt=v.renderMenuIcon===!1?null:fe.renderBag.menuIcon,Rt=[Z==="center"?ra():null,fe.renderBag.selectionCheckBox,mt,fe.renderBag.sortIcon,fe.renderBag.filterIcon,Z==="center"?ra():null,Z!=="center"?ra():null,rt],Mt=v.renderHeader?Rn(v.renderHeader,{...fe,renderBag:{...fe.renderBag,all:Rt}}):Rt,Ue={height:`${o.height}px`};v.headerStyle&&(Ue=typeof v.headerStyle=="function"?{...Ue,...v.headerStyle($e)||{}}:{...Ue,...v.headerStyle});let g=typeof v.headerClassName=="function"?v.headerClassName($e):v.headerClassName,R=`var(${Th}-${v.computedVisibleIndex})`;Ue.zIndex=R,Ue.visibility=`var(${Sh}-${v.computedVisibleIndex}, visible)`,Ue.width=`var(${bh}-${v.computedVisibleIndex})`,Ue.transition=`transform var(${Ch}-${v.computedVisibleIndex}, 0s)`;let L={filtered:v.computedFiltered,verticalAlign:Ee,align:Z},k={"data-field":`${v.field||""}`,"data-column-id":v.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":v.computedSortedAsc?"asc":v.computedSortedDesc?"desc":"none","data-sort-index":`${v.computedSortIndex??-1}`},Y=ne(Tn,Jl.none,B?Wl.pointer:"",g,li(v,[Tn,zt],ss,{dragging:ee,insideDisabledDraggingPage:H,align:Z,verticalAlign:Ee,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),is,zt,di),V=(0,de.h)("div",{class:ne(pi,Oe?St:ti.hidden,rs(L),Ul[Z]),style:re?{height:`${o.height/2}px`}:void 0},[Mt]),Q=ae=>Lu({context:{getState:i,getComputed:r},column:v,diff:ae.diff,shareSpaceOnResize:ae.shareSpaceOnResize}),pe=v.computedResizable?(0,de.h)(Ku,{horizontalLayoutPageIndex:E,columns:r().computedVisibleColumns,columnIndex:v.computedVisibleIndex,computeResize:Q,onResize:ae=>{let{columnSizing:Ct,reservedWidth:$t}=Q(ae);ae.shareSpaceOnResize||(n.viewportReservedWidth=$t),n.columnSizing=Ct}}):null,ue=[re?Te:null,pe],me={ref:c,...k,"data-z-index":R,style:Ue,class:Y,onPointerdown:b},le=null,Ce=i().portalDOMRef.current;ee&&y.value&&Ce&&(le=(0,de.h)(de.Teleport,{to:Ce},[(0,de.h)("div",{key:v.id,class:`${Tn}Proxy ${as}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[(0,de.h)("div",{class:ls({visible:C.value})},[(0,de.h)(ta,{size:16})]),fe.renderBag.header])]));let Pe=v.components?.HeaderCell;return Pe?[(0,de.h)(Pe,me,{default:()=>[V,ue]}),le]:[(0,de.h)("div",me,[V,ue]),le]}}});var Uu=Symbol("InfiniteColumnHeaderFilter"),yi=o=>o.stopPropagation(),Wu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=Ye(),e=_o(),n=(0,Ie.shallowRef)(o.filterProps);(0,Ie.provide)(Uu,n);let i=(0,Ie.ref)(!1),r=()=>{i.value=!0},a=()=>{i.value=!1};return()=>{n.value=o.filterProps;let l=e.value.column,d=t.state.value.filterOperatorMenuVisibleForColumnId===l.id||i.value,s=o.filterProps.filterEditor,c=o.filterProps.filterOperatorSwitch;return(0,Ie.h)("div",{onPointerup:yi,onPointerdown:yi,onFocusin:r,onFocusout:a,class:`${ai} ${Lr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Ie.h)(c),(0,Ie.h)(s)])}}}),ju=(0,Ie.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=Hn();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??Fn;return(0,Ie.h)("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:ne(Wr,fs,t?`${Wr}--disabled`:"")},[(0,Ie.h)(n,{size:20,className:`${ps({disabled:!!t})}`})])}}}),$u=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Ie.h)("div",{onPointerup:yi,onPointerdown:yi,class:`${ai} ${Lr({active:!1})} ${$l["50%"]}`})}});function Hn(){let o=Ye(),t=_o(),e=(0,Ie.inject)(Uu),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=(0,Ie.computed)(()=>t.value.column),f=(0,Ie.computed)(()=>{let{columnFilterType:S,filterTypes:w}=e.value;return w[S]}),m=(0,Ie.ref)(e.value.columnFilterValue?.filter.value??"");(0,Ie.watch)(()=>e.value.columnFilterValue?.filter.value,S=>{if(e.value.columnFilterValue)m.value!==S&&(m.value=S);else{let w=f.value;if(w){let T=[...w.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=S=>{m.value=S,e.value.onChange(S)},h=()=>{n.clearColumnFilter(c.value.id)},y=()=>{n.removeColumnFilter(c.value.id)},C={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:s,dataSourceApi:d},b=(0,Ie.computed)(()=>`Filter for ${wo(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:(0,Ie.computed)(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:(0,Ie.computed)(()=>e.value.operator),operatorName:(0,Ie.computed)(()=>e.value.operator?.name),value:m,disabled:(0,Ie.computed)(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:(0,Ie.computed)(()=>e.value.filterTypes),filterTypeKey:(0,Ie.computed)(()=>e.value.columnFilterType),filtered:(0,Ie.computed)(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${ds} ${Ns}`}}var Bn=(0,Wn.defineComponent)({name:"StringFilterEditor",setup(){let o=Hn();return()=>(0,Wn.h)("input",{"aria-label":o.ariaLabel.value,type:"text",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{o.setValue(t.target.value)},class:o.className})}}),bi=(0,Wn.defineComponent)({name:"NumberFilterEditor",setup(){let o=Hn();return()=>(0,Wn.h)("input",{"aria-label":o.ariaLabel.value,type:"number",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{let e=t.target,n=isNaN(e.valueAsNumber)?e.value:e.valueAsNumber;o.setValue(n)},class:o.className})}});var Vt=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function qu(o={}){let{StringFilterEditor:t,NumberFilterEditor:e,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:t?{FilterEditor:t}:void 0,operators:[{name:"includes",...Vt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...Vt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...Vt(n,"endsWith"),label:"Ends With",fn:({currentValue:i,filterValue:r})=>i.endsWith(r)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:e?{FilterEditor:e}:void 0,operators:[{label:"Equals",...Vt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...Vt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...Vt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...Vt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...Vt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...Vt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var On=qu({StringFilterEditor:Bn,NumberFilterEditor:bi,icons:{includes:mu,eq:yu,neq:bu,startsWith:hu,endsWith:gu,gt:Cu,gte:Tu,lt:Su,lte:wu}});var Ci=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(i=>[i,!0]))):this.negativeMap=new W(n.map(i=>[i,!0])),this.positiveMap&&this.positiveMap.clear()),e!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(e.map(i=>[i,!0]))):this.positiveMap=new W(e.map(i=>[i,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var wt=class extends Ci{constructor(t){super(t)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(t){return this.isItemPositive(t)}isGroupRowCollapsed(t){return!this.isGroupRowExpanded(t)}setGroupRowExpanded(t,e){return this.setItemValue(t,e)}collapseGroupRow(t){this.setGroupRowExpanded(t,!1)}expandGroupRow(t){this.setGroupRowExpanded(t,!0)}toggleGroupRow(t){this.toggleItem(t)}};var Ti=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new W;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let d=n&&!n.isEmpty();if(d&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let s=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=s.length;c<f;c++){let m=s[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let s=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];d&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let y=i(p),C=u?[...f,y]:void 0,b=u&&!!C,S=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let w=0,T=S.length;w<T;w++){let x=S[w];if(x.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),x.type==="update"&&!h&&(p={...p,...x.data},c[m]=p),x.type==="update-children"&&!h){let I=x.children(p[l],p);p={...p},I!==void 0?p[l]=I:delete p[l],c[m]=p}x.type==="insert"&&(x.position==="before"?(c.splice(m,0,x.data),m--):c.splice(m+1,0,x.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let w=a(p),T=w?null:r(p);!w&&Array.isArray(T)&&(f.push(y),d&&(p[l]=T=T.concat()),s(T,f),f.pop())}else this.add(y,p)}}};s(t,[])}return t}}};function Si(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Yu=new WeakMap;function wi(o,t){if(!o||!o.length)return[];let e=Yu.get(o);e||(e=new WeakMap,Yu.set(o,e));let n=e.get(t);if(n)return n;let i=[],r=Si(o,t)||[];for(let a=0,l=r.length;a<l;a++){let u=r[a],d=t[u.filter.type];if(u.disabled||!d)continue;let s;for(let c=0;c<d.operators.length;c++){let f=d.operators[c];f.name===u.filter.operator&&(s=f.fn)}s&&i.push({field:u.field,valueGetter:u.valueGetter||d.valueGetter,fn:s,value:u.filter.value,emptyValues:d.emptyValues})}return e.set(t,i),i}function aa(o,t){if(!o.length)return!0;let{data:e}=t,n={data:e,index:t.index,dataArray:t.dataArray,primaryKey:t.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let i=0,r=o.length;i<r;i++){let a=o[i];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?e[a.field]:e,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var vh=0;function la(o){return vh++,aa(wi(o.filterValue,o.filterTypes),o)}function vi(o){return wi(o.filterValue,o.filterTypes).length?o.isLeafNode?la(o):o.filterTreeNode(o.data):!0}var Rh="group-by",Zu="group-by-";function Xu(o){let t=o.map(e=>e.valueGetter?n=>e.valueGetter({data:n,field:e.field}):e.field??e.groupField).filter(Boolean);if(t.length)return t.length===1&&typeof t[0]!="function"?t[0]:t}function Ri(o,t){if(!o?.length||!t?.length)return o;let e=!1,n=o.map(i=>{if(i.field!=null||!i.id)return i;if(i.id===Rh){let r=Xu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Zu)){let r=i.id.slice(Zu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Xu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function Gt(){let o=Ve().performance?.now();return`${Date.now()}:${o}`}var Ju=!0,Ih={originalDataArray:!0,changes:!0},xh={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function Kt(o,t,e){let n=Ri(o.sortInfo,o.groupBy),i=o.multiSort?n:n?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:i,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(e&&(r.masterRowInfo=e.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[],o.selectionMode==="multi-row"&&(r.multiRowSelectionTarget=o.multiRowSelectionTarget)),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=ed(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});u&&u.length&&(r.filterValue=u)}let a={},l=o.dataParams||{};for(let u in r)if(r.hasOwnProperty(u)&&!Ih[u]){let d=u,s=xh[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function jn(o,t,e,n,i){let r=Kt(t,n,i),a=r.append;if(t.lazyLoad){let s=t.originalLazyGroupData,c=[Tt,...r.groupKeys||[]],f=s.get(c);if(!f){let m=[...r.groupKeys||[],r.lazyLoadStartIndex??0];t.lazyLoadCacheOfLoadedBatches.set(m,!0)}if(f&&f.cache&&c.length>1){let m=f.children,p=m.length,h=!0;for(let y=0;y<p;y++)if(m[y]==null){h=!1;break}if(h)return Promise.resolve(!0)}f?f.childrenLoading||(f.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Ju,totalCount:0}),e.originalLazyGroupDataChangeDetect=Gt()}if(typeof o=="function")try{o=o(r)}catch(s){o=Promise.reject(s)}let u=typeof o=="object"&&typeof o.then=="function"&&(!t.lazyLoad||t.lazyLoad&&!a);u&&(e.loading=!0);let d=s=>{if(console.error('The DataSource "data" function failed:',s),t.lazyLoad){let c=r.groupKeys||[],f=t.originalLazyGroupData.get([Tt,...c]),m=s instanceof Error?s.message:String(s);c.length&&f&&!f.childrenAvailable?(f.childrenLoading=!1,f.cache=!1,f.error=m,e.originalLazyGroupDataChangeDetect=Gt()):(t.lazyLoadCacheOfLoadedBatches.delete([...c,r.lazyLoadStartIndex??0]),f&&(f.childrenLoading=!1,f.error=m))}u&&(e.loading=!1)};return Promise.resolve(o).then(s=>{let c=[],f=!1;if(Array.isArray(s.data)){let p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(e.livePaginationCursor=p.livePaginationCursor),p.mappings&&(e.pivotMappings=p.mappings),t.lazyLoad||(e.unfilteredCount=p.totalCountUnfiltered??c.length),t.lazyLoad){let y=function(C,b,S){let w=[Tt,...C],T=b.data,x={cache:b.cache??Ju,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??T.length,totalCountUnfiltered:b.totalCountUnfiltered,totalChildrenCount:b.totalChildrenCount,totalChildrenCountUnfiltered:b.totalChildrenCountUnfiltered,children:T,error:b.error},I=[];if(r.lazyLoadBatchSize&&!S){let F=h.get(w),v=!F,D=_s({children:!0},F||{},x);v&&(D.chidren=[]),D.children.length=D.totalCount;let E=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,E+r.lazyLoadBatchSize);for(let A=E;A<P;A++){let N=x.children[A-E];if(!N)throw`lazily loaded item not found at index ${A-E}`;D.children[A]=N,N.dataset&&I.push({keys:N.keys,dataset:N.dataset})}v&&h.set(w,D)}else x.children.forEach(F=>{F&&F.dataset&&I.push({keys:F.keys,dataset:F.dataset})}),x.children.length=x.totalCount,h.set(w,x);let M=!1;if(!C||!C.length){let F=h.get([Tt]);e.originalDataArray=[...F.children],M=!0}if(M||(e.originalLazyGroupDataChangeDetect=Gt()),I.length){let F=C;I.forEach(({keys:v,dataset:D})=>{y(v,D,F)})}};var m=y;let h=t.originalLazyGroupData;f=!0,y(r.groupKeys||[],p)}}else c=s;f||(e.originalDataArray=a?t.originalDataArray.concat(c):c),u&&(e.loading=!1)}).catch(d)}function ed(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(Qu):(Si(o,t)||[]).map(Qu)}function Qu(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function td(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=ed(t,{filterTypes:e,filterMode:n});return o&&o.filterValue===t&&JSON.stringify(o.result)===JSON.stringify(i)&&(i=o.result),o={filterValue:t,filterTypes:e,filterMode:n,result:i},i}}var Ph=()=>new Promise(o=>{Be(o)});function sa(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function nd(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;if(!t||!e||e<=0)return!1;for(let i of n.keys())if(i.length===1)return!0;return!1}function od(o,t){let{startIndex:e,endIndex:n,lazyLoadBatchSize:i,componentState:r,componentActions:a,dismissLoadedRows:l}=o,{dataArray:u}=r,d=l?()=>!1:h=>u[h].data!=null,s=!l,c=new W,f=["_______xxx______"];for(let h=e;h<=n;h++){let y=u[h];if(!y)continue;let C=d(h),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:f,w=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},x=y.groupKeys,I=c.get(x);if(!I?.[y.id]){let M=!I;I=I||{},I[y.id]||(I[y.id]=T),M&&c.set(x,I)}}if(!C&&i!=null){let T=c.get(S),x=Math.floor(w/i)*i,I=w-x,M=u[y.indexInAll-I].indexInAll,F=d(M),v=u[M].id;if(F||T?.[v])continue;let D=!T;T=T||{};let E={lazyLoadStartIndex:x,lazyLoadBatchSize:i,groupKeys:b,append:s};T[v]||(T[v]=E),D&&c.set(S,T)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,y)=>{let C=[...y.groupKeys,y.lazyLoadStartIndex];if(t&&t.has(C))return h;t?.set(C,!0);let b=[r.data,r,a,y];return h.then(()=>Ph()).then(()=>jn(...b))},m)}var Dh=Object.freeze([]),id=(o,t)=>{let e=o??Dh,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};var $n=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let i of n)this.negativeMap.set(i,!0);this.positiveMap&&this.positiveMap.clear()}if(e&&e!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let i of e)this.positiveMap.set(i,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return!!this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var vt=class extends $n{constructor(e){super(e);this.isRowEnabled=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:e,disabledRows:n}}getPositiveFromState(e){return e.enabledRows}getNegativeFromState(e){return e.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(e){return!this.isRowEnabled(e)}setRowEnabled(e,n){return this.setItemValue(e,n)}disableRow(e){this.setRowEnabled(e,!1)}enableRow(e){this.setRowEnabled(e,!0)}toggleRow(e){this.toggleItem(e)}};var ot=class{constructor(t){this.collapsedPathsMap=new W;this.expandedPathsMap=new W;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};function Ii(o,t){if(o===t)return!0;if(o==null||t==null)return o===t;if(typeof o!=typeof t)return!1;if(Array.isArray(o)&&Array.isArray(t)){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!Ii(o[e],t[e]))return!1;return!0}if(typeof o=="object"){let e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i of e)if(!Object.prototype.hasOwnProperty.call(t,i)||!Ii(o[i],t[i]))return!1;return!0}return!1}function Ah(o,t){return!(o===void 0||t===void 0||o.isGroupRow!==t.isGroupRow||o.dataSourceHasGrouping!==t.dataSourceHasGrouping||o.isTreeNode!==t.isTreeNode||o.isTreeNode&&o.isParentNode!==t.isParentNode)}var xi={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},rd={...xi,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},_h={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},Eh={...xi,..._h,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},ad={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},Mh={...xi,...ad,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Fh={...xi,...ad,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Nh=Object.entries(rd).map(([o,t])=>t?o:void 0).filter(Boolean),Oh=Object.entries(rd).map(([o,t])=>t?o:void 0),kh=Object.entries(Eh).map(([o,t])=>t?o:void 0),Lh=Object.entries(Mh).map(([o,t])=>t?o:void 0),zh=Object.entries(Fh).map(([o,t])=>t?o:void 0);function Vh(o,t){if(o===t)return!0;if(!o||!t||!Ah(o,t)||o.id!==t.id||o.data!==t.data&&!Ii(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?kh:Oh:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?zh:Lh:e=Nh;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!Ii(i,r))return!1}return!0}function ld(){let o=[],t=new Map,e=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},i=(f,m)=>{let p=o,h=m?.marker,C=f!==p&&e.size>0;C&&(n={dataSourceState:m?.dataSourceState,previousDataSourceState:m?.previousDataSourceState}),h&&h.start({details:[{name:"new dataArray length",value:f.length},{name:"old dataArray length",value:p.length}]});let b=[],S=l();for(let w of S){let T=p[w],x=f[w];if(x===void 0){b.push(w);continue}Vh(T,x)||b.push(w)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let w=0,T=b.length;w<T;w++){let x=b[w],I=t.get(x);if(I)for(let M of I)M()}if(C)for(let w of Array.from(e))w()}),h&&h.end({details:[{name:"updated row infos",value:b.length}]})},r=f=>o[f],a=(f,m)=>{let p=t.get(f);return p||(p=new Set,t.set(f,p)),p.add(m),()=>{let h=t.get(f);h&&(h.delete(m),h.size===0&&t.delete(f))}},l=()=>Array.from(t.keys());return{notifyDataArray:i,getRowInfoAtIndex:r,subscribeToRowIndex:a,subscribeToDataArrayChange:f=>(e.add(f),()=>{e.delete(f),e.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],t.clear(),e.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var ua=o=>Array.isArray(o)?new W(o.map(t=>[t,!0])):o,Gh=(o,t)=>o.length-t.length,Qe=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new W;this.cache=new W;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new W})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?ua(t):this.config.treePaths}withTreePaths(t,e){let n=this.config.treePaths;e=this.getTreePaths(e);let i=e!==n;i&&this.xcache(),this.config.treePaths=e;let r=t(e);return this.config.treePaths=n,i&&this.xcache(),r}getLeafNodePaths(t=[],e){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(t),e)}forEachLeafNodePath(t,e=[],n){let i={selected:!1};this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,a=>{i.selected=this.isNodeSelected(a.keys)===!0,t(a.keys,i)})},n)}getSelectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)})},e),n}getDeselectedLeafNodePaths(t=[],e){let n=[];return this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)})},e),n}isLeafNode(t){let{treePaths:e}=this.config;return e.has(t)?e.getKeysForLeafNodesStartingWith(t).length===1:null}getLeafNodesCount(t){return this.config.treePaths.getKeysForLeafNodesStartingWith(t).length}static from(t,e){return new o(t,e)}setConfig(t){let e=typeof t=="function"?t():t;this.config={treePaths:ua(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?ua(e.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(t){let{multiRowSelectionTarget:e,unfilteredTreePaths:n,treePaths:i}=this.config;return e!=="visible"||!n||n===i?!1:n.getAllChildrenSizeFor(t)>i.getAllChildrenSizeFor(t)}setVisibleLeafNodesSelection(t,e){let{unfilteredTreePaths:n,treePaths:i}=this.config;this.xcache(),i.getKeysForLeafNodesStartingWith(t).forEach(r=>{n.getAllChildrenSizeFor(r)>0||(this.selectionMap.delete(r),this.isNodeSelected(r)!==e&&this.setSelectionForPath(r,e))}),this.xcache()}xcache(){this.cache.clear()}update(t){this.selectedPaths=t.selectedPaths||null,this.deselectedPaths=t.deselectedPaths||null;let{selectionMap:e,selectedPaths:n,deselectedPaths:i}=this;e.clear(),n?.forEach(r=>this.setSelectionForPath(r,!0)),i?.forEach(r=>this.setSelectionForPath(r,!1)),this.defaultSelection=t.defaultSelection,this.xcache()}setSelectionForPath(t,e){this.isPathAvailable(t)&&this.selectionMap.set(t,e)}getState(){let t=[],e=[];return this.selectionMap.topDownEntries().forEach(([n,i])=>{i?t.push(n):e.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:t,deselectedPaths:e}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(t){if(!this.strictMode)return!0;let{treePaths:e}=this.config;return e.has(t)}isNodeSelected(t){return this.isPathSelected(t)}isSelfSelected(t){return this.selectionMap.get(t)??null}cacheIt(t,e){return this.cache.set(t,e),e}getSelectionStateForNode(t,e){let n=this.cache.get(t);if(n)return n;if(this.isLeafNode(t)!==!1){let c=this.isSelfSelected(t);if(c!==null)return this.cacheIt(t,{selected:c,selectedCount:c?1:0,deselectedCount:c?0:1,leafCount:1})}let i=this.getLeafNodesCount(t),r=this.isSelfSelected(t),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(t,{excludeSelf:!0}).sort(Gh);if(this.strictMode&&(l=l.filter(c=>this.isPathAvailable(c))),!l.length){if(r!==null){let f=i?r:!1;return this.cacheIt(t,{selected:f,selectedCount:f?i:0,deselectedCount:f?0:i,leafCount:i})}let c=this.getNodeBooleanSelectionStateFromParent(t);return this.cacheIt(t,{selected:c,selectedCount:c?i:0,deselectedCount:c?0:i,leafCount:i})}let u=0,d=0,s=this.getNodeBooleanSelectionStateFromParent(t);s?u+=i:d+=i;for(let c=0,f=l.length;c<f;c++){let m=l[c],{selectedCount:p,deselectedCount:h}=this.getSelectionStateForNode(m);if(s?(u-=h,d+=h):(d-=p,u+=p),e&&p>0&&h>0)return this.cacheIt(t,{selected:null,leafCount:i,selectedCount:u,deselectedCount:d})}if(!u&&!d)return this.cacheIt(t,{selected:s,selectedCount:s?i:0,deselectedCount:s?0:i,leafCount:i});if(u){let c=u===i?!0:null;return this.cacheIt(t,{selected:c,selectedCount:u,deselectedCount:d,leafCount:i})}return this.cacheIt(t,{selected:!1,selectedCount:0,deselectedCount:i,leafCount:i})}isPathSelected(t){return this.isPathAvailable(t)?this.getSelectionStateForNode(t,!0).selected:!1}getNodeBooleanSelectionStateFromParent(t){let{defaultSelection:e,selectionMap:n}=this;if(!t.length)return e;let i=[...t];do{let r=n.get(i);if(r!==void 0)return r;i.pop()}while(i.length);return e}setNodeSelection(t,e){if(!t.length)return;if(this.hasFilteredOutLeavesInside(t)){this.setVisibleLeafNodesSelection(t,e);return}if(this.xcache(),this.selectionMap.getKeysStartingWith(t).forEach(i=>{this.selectionMap.delete(i)}),!(t.length===1&&this.defaultSelection===e)){if(this.setSelectionForPath(t,e),t.length>1){let i=t.slice(0,-1);this.isNodeSelected(i)===e&&this.setNodeSelection(i,e)}}}selectNode(t){this.setNodeSelection(t,!0)}deselectNode(t){this.setNodeSelection(t,!1)}toggleNodeSelection(t){this.setNodeSelection(t,!this.isNodeSelected(t))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[]){let{selectedCount:e,deselectedCount:n}=this.getSelectionStateForNode(t);return{selectedCount:e,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function fn(o,t){return t().dataArray[o]}function Pi(o){return o().dataArray}function Ai(o,t){return new Qe(o,Un(t))}function Un(o){return()=>{let t=typeof o=="function"?o():o,{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}=t;return i==="visible"?{treePaths:e,unfilteredTreePaths:n,multiRowSelectionTarget:i}:{treePaths:n??e,multiRowSelectionTarget:i}}}var Di=class{constructor(t){this.setNodeSelection=(t,e,n)=>{let{treeSelectionState:i,selectionMode:r}=this.getState();if(!this.isNodeSelectable(t)&&!n?.force)return;if(r==="single-row"){this.actions.treeSelection=e?t[t.length-1]:null;return}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(i instanceof Qe))throw"Invalid tree selection";let a=new Qe(i,Un(this.getState));a.setNodeSelection(t,e),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:t,selected:e},this.actions.treeSelection=a};this.getCallbackParam=t=>({dataSourceApi:this.dataSourceApi});this.getState=t.getState,this.actions=t.actions,this.dataSourceApi=t.dataSourceApi}getSelectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(t?.rootNodePath,e):[]}getDeselectedLeafNodePaths(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(t?.rootNodePath,e):[]}getSelectedLeafRowInfos(t){let{treePaths:e}=this.getState(),n=t?.treeSelectionState||this.getState().treeSelectionState;if(!e||!n)return[];let i=t?.rootNodePath||[],r=[];return e.getLeafNodesStartingWith(i,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&r.push(l)}},{excludeSelf:!0}),r}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeReadOnly;return e&&e.isTreeNode&&e.isParentNode&&n?n(e):!1}isNodeSelectable(t){let e=this.getRowInfoByPath(t),n=this.getState().isNodeSelectable;return e&&e.isTreeNode?n(e):!1}isNodeExpanded(t){let e=this.getState(),{isNodeExpanded:n,isNodeCollapsed:i,treeExpandState:r}=e,a=this.getRowInfoByPath(t);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(i)return!n(a,r);if(n)return n(a,r)}return r.isNodeExpanded(t)}expandAll(){let t=new ot({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new ot({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=t}expandNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new ot(n.treeExpandState);i.expandNode(t),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:t},this.actions.treeExpandState=i,n.onNodeExpand?.(t,this.getCallbackParam(t))}collapseNode(t,e){if(this.isNodeReadOnly(t)&&!e?.force)return;let n=this.getState(),i=new ot(n.treeExpandState);i.collapseNode(t),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:t},this.actions.treeExpandState=i,n.onNodeCollapse?.(t,this.getCallbackParam(t))}toggleNode(t,e){let n=this.getState(),i=new ot(n.treeExpandState),r=!this.isNodeExpanded(t);this.isNodeReadOnly(t)&&!e?.force||(i.setNodeExpanded(t,r),this.getState().lastExpandStateInfoRef.current={state:r?"expanded":"collapsed",nodePath:t},this.actions.treeExpandState=i,r?n.onNodeExpand?.(t,this.getCallbackParam(t)):n.onNodeCollapse?.(t,this.getCallbackParam(t)))}getNodeDataByPath(t){if(!t.length)return null;let e=this.getRowInfoByPath(t);return e?e.data:null}getRowInfoByPath(t){let{pathToIndexMap:e}=this.getState(),n=e.get(t);return n!==void 0?fn(n,this.getState):null}selectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,Un(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:t,selectionMode:e}=this.getState();if(e!=="multi-row")throw"Selection mode is not multi-row";if(!(t instanceof Qe))throw"Invalid node selection";let n=new Qe(t,Un(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(t){let{treeSelectionState:e,treeSelection:n,selectionMode:i}=this.getState();if(i==="single-row"){let r=t[t.length-1];return Array.isArray(n)?treeSelection.join(",")===t.join(","):n===r}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(e instanceof Qe))throw"Invalid tree selection";return e.isNodeSelected(t)}selectNode(t,e){this.setNodeSelection(t,!0,e)}deselectNode(t,e){this.setNodeSelection(t,!1,e)}toggleNodeSelection(t,e){this.isNodeSelected(t)?this.deselectNode(t,e):this.selectNode(t,e)}};var da=new Map,ca=new Map;var fa="DebugID=";function qn(o,t){return t&&t.startsWith(fa)?t:t?`${fa}${o}:${t}`:`${fa}${o}`}var Kh=Symbol("cursorId"),sd=o=>o.totalLeafNodesCount===0,Bh=o=>o.isParentNode?!sd(o):!0;function ud(o){let t=Date.now(),e=[],n=[],i=new W;return{logger:rn(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:ld(),indexer:new Ti,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new W,waitForNodePathPromises:new W,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new W,dataParams:void 0,onCleanup:he(),notifyScrollbarsChange:he(),notifyScrollStop:he(),notifyRenderRangeChange:he(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Kh,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function Hh(o){let t={...o};return delete t.originalDataArray,t}var Wh=[],dd=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},cd=(o,t)=>({onDataParamsChange:e=>e?Kl(e,100,Hh):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??sd,isNodeSelectable:e=>e??Bh,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:e=>e??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e??!1,multiRowSelectionTarget:e=>e??"all",filterDelay:e=>e??200,filterTypes:e=>({...On,...e}),sortTypes:e=>({...ln,...e}),sortFunction:1,onReady:1,rowInfoReducers:(e,n)=>{let i={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{t.debugId&&!t.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},r=e?{...e,__idToIndex:i}:{__idToIndex:i};if(t.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,u)=>{u.isTreeNode&&(n.idToPathMap.set(u.id,u.nodePath),t.debugId&&n.pathToIndexMap.has(u.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${t.debugId||"none"}): ${u.nodePath}`),n.pathToIndexMap.set(u.nodePath,u.indexInAll))}};r.__pathToIndex=a}return r},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:e=>{if(!e)return null;if(e instanceof vt)return e;let n=o.propsCache.get("rowDisabledState")??Pt,i=n.get(e);return i||(i=new vt(e),n.set(e,i)),e=i,e??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e??!0,loading:e=>e??!1,sortInfo:e=>id(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Wh});function jh(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var Pt=new WeakMap;function $h(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let t={};return o.filterValue!=null&&(t.filterValue=o.filterValue),o.sortInfo!=null&&(t.sortInfo=o.sortInfo),o.groupBy!=null&&(t.groupBy=o.groupBy),o.pivotBy!=null&&(t.pivotBy=o.pivotBy),t}var Uh={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function fd(o,t,e){if(t!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${t}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
`);let n=Un(e);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Uh,r=Pt.get(i);return r&&r.setConfig(n),r=r??new Qe(i,n),Pt.set(i,r),r}function pd(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=po(t.sortInfo),a=po(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((P,A)=>{let N=l[A].operators;P[A]=P[A]||{};let _=P[A];return N.forEach(O=>{_[O.name]=O}),P},{}),d=t,s=t.selectionMode;if(s===void 0)if(t.cellSelection!==void 0||t.defaultCellSelection!==void 0)s="multi-cell";else{let P=t.rowSelection!==void 0?t.rowSelection:t.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?s="multi-row":s="single-row"),!s){let A=d.treeSelection??d.defaultTreeSelection;A!==void 0&&(s=typeof A=="object"?"multi-row":"single-row")}s=s??!1}let c=null,f=null,m=t.rowSelection!==void 0?t.rowSelection:e.rowSelection===void 0?t.defaultRowSelection!==void 0?t.defaultRowSelection:null:e.rowSelection,p=t.cellSelection!==void 0?t.cellSelection:e.cellSelection===void 0?t.defaultCellSelection!==void 0?t.defaultCellSelection:null:e.cellSelection||null;if(!i&&(s!==!1&&(s==="single-row"||s==="multi-row")&&(m===null?c=s==="single-row"?null:new De({selectedRows:[],deselectedRows:[],defaultSelection:!1},nt(e)):s==="single-row"||m instanceof De?c=m:c=new De(m,nt(e))),s==="single-cell"||s==="multi-cell"))if(p===null)f=s==="single-cell"?null:new He;else if(p instanceof He)f=p;else{let P=Pt.get(p)??new He(p);Pt.set(p,P),f=P}let h=e.primaryKey,y=typeof h=="function"?P=>h(P):P=>P[h],C=d.treeExpandState||e.treeExpandState||d.defaultTreeExpandState;if(C&&!(C instanceof ot)){let P=Pt.get(C)??new ot(C);Pt.set(C,P),C=P}C=C||new ot({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof wt)){let P=Pt.get(b)??new wt(b);Pt.set(b,P),b=P}b=b||new wt(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=$h(t.shouldReloadData||{}),w=typeof t.data=="function"&&!!t.lazyLoad,T=!!t.livePagination,x={sortInfo:S.sortInfo??(w||T),filterValue:S.filterValue??(w||T),groupBy:S.groupBy??w,pivotBy:S.pivotBy??w},I=t.sortFunction?"local":x.sortInfo?"remote":"local",F=(typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function")&&!t.lazyLoad?"local":x.filterValue||t.lazyLoad?"remote":"local",v=e.rowDisabledState,D=t.isRowDisabled;if(!D&&v){let P=Pt.get(v);P?D=P:(D=A=>v.isRowDisabled(A.id),Pt.set(v,D))}let E={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:x,isRowDisabled:D,rowSelection:c,cellSelection:f,sortMode:I,filterMode:F,toPrimaryKey:y,operatorsByFilterType:u,controlledSort:r,controlledFilter:a,multiSort:Array.isArray(r?t.sortInfo:t.defaultSortInfo),lazyLoadBatchSize:typeof t.lazyLoad=="object"?t.lazyLoad.batchSize:void 0};if(t.livePagination){let P=!n||n.originalDataArray!==e.originalDataArray,A=typeof t.livePaginationCursor=="function"?P?jh(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;E.livePaginationCursor=A}if(e.devToolsDetected&&e.debugId){let P=ca.get(e.debugId);P&&(E={...E,...P})}return E}var qh=rn("DataSource:fullLazyLoad");function md(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&qh('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new wt({collapsedRows:!0,expandedRows:[]})))}function hd(){return{rowSelection:(o,t)=>t.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,t)=>{if(t.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let e=t.__apiRef.current,n=e.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:t.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:t.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:t.unfilteredTreePaths,dataSourceApi:e,treeApi:n}]}},treeExpandState:(o,t)=>({callbackParams:[o.getState(),{nodeState:t.lastExpandStateInfoRef.current.state,nodePath:t.lastExpandStateInfoRef.current.nodePath,dataSourceApi:t.__apiRef.current}]}),cellSelection:(o,t)=>t.selectionMode==="single-cell"?{callbackParams:[o instanceof He?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function gd(){return{sortInfo:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{sortInfo:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Be(()=>{t.livePaginationCursor=null})},groupBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{groupBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Be(()=>{t.livePaginationCursor=null})},pivotBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{pivotBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Be(()=>{t.livePaginationCursor=null})},filterValue:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{filterValue:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Be(()=>{t.livePaginationCursor=null})},cursorId:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{__cursorId:o},n());t.dataParams=i},livePaginationCursor:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Kt(e,{livePaginationCursor:o},n());t.dataParams=i},dataParams:(o,{state:t})=>sn(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(rn(qn(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function yd(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function pa(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function ma(o){let{pivotByAtIndex:t,pivotAggregator:e}=o;return t?.column&&(typeof t.column=="function"?Object.assign(o,t.column({column:o})):Object.assign(o,t.column)),e?.pivotColumn&&(typeof e.pivotColumn=="function"?Object.assign(o,e.pivotColumn({column:o})):Object.assign(o,e.pivotColumn)),o}function ha(o){let{pivotByAtIndex:t}=o;return t?.columnGroup&&(typeof t.columnGroup=="function"?Object.assign(o,t.columnGroup({columnGroup:o})):Object.assign(o,t.columnGroup)),o}function bd({deepMap:o,pivotBy:t,pivotTotalColumnPosition:e,pivotGrandTotalColumnPosition:n,reducers:i={},showSeparatePivotColumnForSingleAggregation:r=!1}){let a=t.length,l=Object.keys(i).map(m=>({...i[m],id:m}));l.length||(r=!0,n=!1,e=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let u={},d={},s=Nt(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=ma({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&s();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,y)=>{if(p=[...p],e==="end"&&y?.(),p.length===a){let C=t[p.length-1],S=p.slice(0,-1).join("/");if(!c){let w=S;S=p.join("/");let T=p[p.length-1];d[S]=ha({header:`${T}`,columnGroup:w,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((w,T)=>{let x=c?`${p[p.length-1]}`:w.name||w.id,I=ma({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:w,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:S,header:x,valueFormatter:({rowInfo:F})=>F.isGroupRow?F.pivotValuesMap?.get(p)?.reducerResults[w.id]:null}),M=`${w.id}:${p.join("/")}`;u[M]=I})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=ha({columnGroup:b.length?b.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let S=t[p.length-1],w=b.length?b.join("/"):void 0;if(!c){let T=w;w=`total:${p.join("/")}`,d[w]=ha({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:S,pivotGroupKey:p[p.length-1]})}l.forEach((T,x)=>{let I=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,M=ma({columnGroup:w,header:I,pivotAggregator:T,pivotAggregatorIndex:x,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:S,pivotIndex:p.length-1,pivotBy:t,valueFormatter:({rowInfo:F})=>F.isGroupRow?F.pivotValuesMap?.get(p)?.reducerResults[T.id]:null});u[`total:${T.id}:${p.join("/")}`]=M})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var Yh=()=>{};function ga(o,t){let e=new W,n=t.nodesKey??"children",i=t.emptyGroup??{},r=typeof t.pathKey=="function"?t.pathKey:l=>l[t.pathKey];for(let l of o){let u=r(l);for(let d=0;d<u.length;d++){let s=u.slice(0,d);e.has(s)||e.set(s,void 0)}e.set(u,l)}function a(l,u){let d=e.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let s of d){let c=[...l,s[s.length-1]],f=e.get(c),m=f?f[n]??[]:[];a(c,m),m.length&&(f||(f=typeof i=="function"?i(c,m):i),f[n]=m),u.push(f)}return u}return a([],[])}function Cd(o,t,e,n){let{isLeafNode:i,getNodeChildren:r,toKey:a}=o,{onParentNode:l,onNode:u,onLeafNode:d}=t,s=a(n),c=[...e,s],f=i(n),m=Nt(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];Cd(o,t,c,C)}});f?(d?.(n),u?.(n,Yh)):(l?.(n,m,r(n)),u?.(n,m))}function Td(o,t,e){for(let n=0,i=e.length;n<i;n++)Cd(o,t,[],e[n])}function Sd(o){return o.map(e=>Array.isArray(e.field)?e.field.map((n,i)=>{let r=Array.isArray(e.type)?e.type[i]??e.type[0]:e.type;return typeof n=="function"?{...e,valueGetter:n,field:void 0,type:r}:{...e,type:r,field:n}}):e).flat()}var Bt=(o,t,e)=>{let n=typeof e=="function"?e:e?.get,i=e&&typeof e=="object"?e.marker:void 0;return i&&i.start(),t.sort(wd(Sd(o),n)),i&&i.end(),t},_i=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=wd(Sd(o),e.get),r=e.depthFirst??!1,a=e.inplace??!1;r||(a?t.sort(i):t=[...t].sort(i));let{nodesKey:l,toKey:u}=e,d=c=>c[l],s=c=>c[l]===void 0;return Td({isLeafNode:e.isLeafNode??s,getNodeChildren:e.getNodeChildren??d,toKey:u},{onParentNode:(c,f,m)=>{if(r&&f(),Array.isArray(m)){let p=a?m.sort(i):[...m].sort(i);c[l]=p}r||f()}},t),r&&(a?t.sort(i):t=[...t].sort(i)),n&&n.end(),t};Bt.knownTypes=ln;var Zh=o=>{if(!o)return;let t=o.field,e=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let i=o.fn;if(!i&&o.type){let r=Array.isArray(o.type)?o.type[0]:o.type;i=Bt.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Bt.knownTypes).join(", ")}`)}return i||(i=ln.string),(r,a)=>{let l=e?e(r):t?r[t]:r,u=e?e(a):t?a[t]:a,d=i(l,u);return d===0?d:n*d}},Xh=o=>o.map(Zh).filter(t=>t instanceof Function),wd=(o,t)=>{let e=Xh(o);return(n,i)=>{t&&(n=t(n),i=t(i));let r=0,a=0,l,u=e.length;for(;a<u;a++)if(l=e[a],!!l&&(r=l(n,i),r!==0))return r;return r}};var vd=Symbol("CLEAR"),In=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new W;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(t,e,n)=>{this.allFieldsAffected=!0;let i=t,r=this.primaryKeyToData.get(i)||[];r.push({type:"delete",primaryKey:t,originalData:e,metadata:n}),this.primaryKeyToData.set(i,r)};this.deleteNodePath=(t,e,n)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(t)||[];i.push({type:"delete",nodePath:t,originalData:e,metadata:n}),this.nodePathToData.set(t,i)};this.insert=(t,e,n,i)=>{let r=t,a=this.primaryKeyToData.get(r)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:t,data:e,position:n,originalData:null,metadata:i}),this.primaryKeyToData.set(r,a)};this.insertNodePath=(t,e,n,i)=>{let r=this.nodePathToData.get(t)||[];this.allFieldsAffected=!0,r.push({type:"insert",nodePath:t,data:e,position:n,originalData:null,metadata:i}),this.nodePathToData.set(t,r)};this.update=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(u=>this.affectedFields.add(u)));let r=t,a=this.primaryKeyToData.get(r)||[];a.push({type:"update",primaryKey:t,data:e,originalData:n,metadata:i}),this.primaryKeyToData.set(t,a)};this.updateNodePath=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(l=>this.affectedFields.add(l)));let r=this.nodePathToData.get(t)||[];r.push({type:"update",nodePath:t,data:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.updateChildren=(t,e,n,i)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(t)||[];r.push({type:"update-children",nodePath:t,children:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.resetDataSource=t=>{this.clear(),this.allFieldsAffected=!0;let e=vd,n=this.primaryKeyToData.get(e)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:t}),this.primaryKeyToData.set(e,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(vd);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=t=>{this.primaryKeyToData.delete(t)};this.removeNodePathInfo=t=>{this.nodePathToData.delete(t)};this.getMutationsForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getMutationsForNodePath=t=>this.nodePathToData.get(t);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>W.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=t.nodesKey}static clone(t,{light:e=!1}={}){let n=new o({nodesKey:t.nodesKey});return n.allFieldsAffected=t.allFieldsAffected,n.affectedFields=new Set(t.affectedFields),n.primaryKeyToData=e?t.primaryKeyToData:new Map(t.primaryKeyToData),n.nodePathToData=e?t.nodePathToData:W.clone(t.nodePathToData),n}};var ya=1e3;function Rd(o){return new ba(o)}var ba=class{constructor(t){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=t=>this.getState().toPrimaryKey(t);this.getRowInfoArray=()=>Pi(this.getState);this.getRowInfoByIndex=t=>fn(t,this.getState)??null;this.getRowInfoByPrimaryKey=t=>{let e=this.getIndexByPrimaryKey(t);return this.getRowInfoByIndex(e)};this.getRowInfoByNodePath=t=>{let e=this.getIndexByNodePath(t);return this.getRowInfoByIndex(e)};this.getIndexByPrimaryKey=t=>this.getState().idToIndexMap.get(t)??-1;this.getIndexByNodePath=t=>this.getState().pathToIndexMap.get(t)??-1;this.getNodePathById=t=>this.getState().idToPathMap.get(t)??null;this.getNodePathByIndex=t=>{let e=this.getRowInfoByIndex(t);return e&&e.isTreeNode?e.nodePath:null};this.getPrimaryKeyByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=t=>{let e=this.getRowInfoByIndex(t);return e?e.data:null};this.getDataByPrimaryKey=t=>{let{indexer:e}=this.getState();return e.getDataForPrimaryKey(t)??null};this.isNodePathAvailable=t=>this.getState().indexer.getDataForNodePath(t)!==void 0;this.getDataByNodePath=t=>{let{indexer:e}=this.getState(),n=e.getDataForNodePath(t);return n||null};this.replaceAllData=(t,e)=>(this.batchOperation({type:"replace-all",array:t,metadata:e?.metadata}),this.addDataArray(t,e));this.clearAllData=t=>this.replaceAllData([],t);this.updateData=(t,e)=>this.updateDataArray([t],e);this.updateDataArray=(t,e)=>{let n=this.getState().isTree,i=n?void 0:t.map(l=>this.toPrimaryKey(l)),r=n?t.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=i?this.batchOperation({type:"update",array:t,primaryKeys:t.map(l=>this.toPrimaryKey(l)),metadata:e?.metadata}):this.batchOperation({type:"update",array:t,nodePaths:r||[],metadata:e?.metadata});return e?.flush&&this.commit(),a};this.withWaitForNode=(t,e,n)=>{let i=n?.waitForNode??!0;if(i===!0||typeof i=="number"){let a=i===!0?ya:i;return isNaN(a)||(a=ya),this.waitForNodePath(t,{timeout:a}).then(l=>{if(!l){let u=`Cannot find node path "${t.join("/")}" (we waited for it ${a}ms)`;return console.error(u),e({error:u,resolved:!1})}return e({resolved:!0})})}let r=e({resolved:void 0});return r instanceof Promise?r:Promise.resolve(r)};this.updateChildrenByNodePath=(t,e,n)=>this.withWaitForNode(e,({error:i})=>i?!1:this.updateChildrenByNodePath_Internal(t,e,n),n);this.updateChildrenByNodePath_Internal=(t,e,n)=>{let i=typeof t=="function"?t:()=>t;return this.updateDataArrayByNodePath_Internal([{nodePath:e,children:i}],n)};this.updateDataByNodePath=(t,e,n)=>this.isNodePathAvailable(e)?this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n):this.withWaitForNode(e,({error:i})=>i?!1:this.updateDataArrayByNodePath_Internal([{data:t,nodePath:e}],n),n);this.updateDataArrayByNodePath=(t,e)=>{if(e&&typeof e.waitForNode<"u"&&!e.waitForNode)return this.updateDataArrayByNodePath_Internal(t,e);let n=t.map(r=>r.nodePath);return Promise.allSettled(n.map(r=>this.withWaitForNode(r,({error:a})=>!a,e))).then(r=>r.every(Boolean)?this.updateDataArrayByNodePath_Internal(t,e):!1)};this.updateDataArrayByNodePath_Internal=(t,e)=>{let n=[],i=[];t.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),i.push(a.nodePath)});let r=this.batchOperation({type:"update",array:n,nodePaths:i,metadata:e?.metadata});return e?.flush&&this.commit(),r};this.removeDataByPrimaryKey=(t,e)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(t)||[],e);let i=this.batchOperation({type:"delete",primaryKeys:[t],metadata:e?.metadata});return e?.flush&&this.commit(),i};this.removeDataByNodePath=(t,e)=>this.batchDeleteNodePaths([t],e);this.removeData=(t,e)=>{if(this.getState().isTree){let i=this.getNodePathById(this.toPrimaryKey(t));return this.removeDataByNodePath(i,e)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(t)],e)};this.removeDataArrayByPrimaryKeys=(t,e)=>{if(this.getState().isTree){let i=t.map(r=>this.getNodePathById(r)||[]);return this.batchDeleteNodePaths(i,e)}return this.batchDeletePrimaryKeys(t,e)};this.batchDeleteNodePaths=(t,e)=>{let n=this.batchOperation({type:"delete",nodePaths:t||[],metadata:e?.metadata});return e?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(t,e)=>{let n=this.batchOperation({type:"delete",primaryKeys:t,metadata:e?.metadata});return e?.flush&&this.commit(),n};this.removeDataArray=(t,e)=>{if(this.getState().isTree){let r=t.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(r,e)}let i=t.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(i,e)};this.addData=(t,e)=>this.addDataArray([t],e);this.addDataArray=(t,e)=>this.insertDataArray(t,{...e,position:"end"});this.insertData=(t,e)=>this.insertDataArray([t],e);this.insertDataArray=(t,e)=>{let n=this.getState().isTree,i="before",r,a=e.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:u})=>{if(u)return!1;if(e.position==="before"||e.position==="after")return this.batchTreeInsert(t,e.position,a,e);let d=s=>e.position==="start"?[...t,...s||[]]:[...s||[],...t];return this.updateChildrenByNodePath(d,a,e)},e);if(e.position==="before"||e.position==="after")i=e.position,r=e.primaryKey;else{let u=this.getOriginalDataArray();e.position==="start"?(i="before",u.length?r=this.toPrimaryKey(u[0]):r=void 0):(i="after",u.length?r=this.toPrimaryKey(u[u.length-1]):r=void 0)}let l=n?this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,nodePath:this.getNodePathById(r)||[]}):this.batchOperation({type:"insert",array:t,position:i,metadata:e?.metadata,primaryKey:r,nodePath:a});return e?.flush&&this.commit(),l};this.batchTreeInsert=(t,e,n,i)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),l},i);let r=this.batchOperation({type:"insert",array:t,position:e,metadata:i?.metadata,nodePath:n});return i?.flush&&this.commit(),r};this.setSortInfo=t=>{let e=this.getState().multiSort;if(Array.isArray(t)){this.actions.sortInfo=t.length?e?t:t[0]:null;return}this.actions.sortInfo=t};this.setGroupBy=t=>{this.actions.groupBy=t};this.toggleGroupByField=t=>{let e=this.getState().groupBy;e.findIndex(i=>i.field===t)===-1?this.actions.groupBy=[...e,{field:t}]:this.actions.groupBy=e.filter(i=>i.field!==t)};this.isRowDisabledAt=t=>this.getRowInfoByIndex(t)?.rowDisabled??!1;this.isRowDisabled=t=>this.getRowInfoByPrimaryKey(t)?.rowDisabled??!1;this.setRowEnabledAt=(t,e)=>{let n=this.getState().rowDisabledState,i=n?new vt(n):new vt({enabledRows:!0,disabledRows:[]}),r=this.getRowInfoByIndex(t);r&&(i.setRowEnabled(r.id,e),this.actions.rowDisabledState=i)};this.setRowEnabled=(t,e)=>{let n=this.getRowInfoByPrimaryKey(t);n&&this.setRowEnabledAt(n.indexInAll,e)};this.enableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new vt({enabledRows:!0,disabledRows:[]});return}let e=new vt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new vt({disabledRows:!0,enabledRows:[]});return}let e=new vt(t);e.disableAll(),this.actions.rowDisabledState=e};this.areAllRowsEnabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let t=this.getState().rowDisabledState;return t?t.areAllDisabled():!1};this.getState=t.getState,this.getState().__apiRef.current=this,this.actions=t.actions,this.treeApi=new Di({...t,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(t){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let e=Math.max(0,this.getState().batchOperationDelay??0);e===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},e)}return t.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(t),this.pendingPromise}commitOperations(t){if(!t.length)return;let e=this.getState().cache,{isTree:n,nodesKey:i}=this.getState(),r=e?In.clone(e,{light:!0}):new In({nodesKey:n?i:void 0});t.forEach(a=>{switch(a.type){case"update":a.array.forEach((s,c)=>{if(a.primaryKeys){let f=a.primaryKeys[c],m=this.getDataByPrimaryKey(f);m&&r.update(a.primaryKeys[c],s,m,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[c]);f&&(typeof s=="function"?r.updateChildren(a.nodePaths[c],s,f,a.metadata):r.updateNodePath(a.nodePaths[c],s,f,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(s=>{let c=this.getDataByPrimaryKey(s);c&&r.delete(s,c,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(s=>{let c=this.getDataByNodePath(s);c&&r.deleteNodePath(s,c,a.metadata)});break;case"insert":let l=a.primaryKey,u=a.position,d=a.nodePath;d?a.array.forEach(s=>{r.insertNodePath([...d],s,u,a.metadata),l=this.toPrimaryKey(s),d.pop(),d.push(l),u="after"}):a.array.forEach(s=>{r.insert(l,s,u,a.metadata),l=this.toPrimaryKey(s),u="after"});break;case"replace-all":r.resetDataSource(a.metadata);break}}),this.actions.cache=r}flush(){return this.commit()}waitForNodePath(t,e){let n=this.getState();if(this.isNodePathAvailable(t))return Promise.resolve(!0);let i=e?.timeout??ya,r=n.waitForNodePathPromises.get(t);if(r)return r.promise;let a=Date.now(),l=()=>{},u=new Promise(d=>{let s,c;l=f=>{clearTimeout(c),s=f,n.waitForNodePathPromises.delete(t),d(f)},c=setTimeout(()=>{s===void 0&&l(!1)},i)});return n.waitForNodePathPromises.set(t,{timestamp:a,promise:u,resolve:l}),u}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let t=this.pendingPromise;if(t&&this.resolvePendingPromise){let e=this.resolvePendingPromise;requestAnimationFrame(()=>{e(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return t||Promise.resolve(!0)}};function Id(o){let t=o.cache;if(!t)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let e=!1,n=!1,i=!1,r=!1,a=!1,l=t.getAffectedFields(),{sortInfo:u,groupBy:d,filterValue:s,aggregationReducers:c,nodesKey:f,isTree:m}=o;if(u&&u.length)if(l===!0)e=!0;else for(let p of u){let h=p.field;if(h&&(h=Array.isArray(h)?h:[h],e=h.reduce((y,C)=>y||typeof C!="function"?l.has(C):!1,!1),e))break}if(d&&d.length){if(l===!0)n=!0;else for(let p of d)if(p.field&&l.has(p.field)){n=!0;break}}if(m&&(l===!0?i=!0:i=l.has(f)),s&&s.length)if(l===!0)r=!0;else for(let p of s){if(p.id){r=!0;break}if(p.field&&l.has(p.field)){r=!0;break}}if(c&&Object.keys(c).length){if(l===!0)a=!0;else for(let p in c)if(c.hasOwnProperty(p)){let h=c[p];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:e,groupBy:n,filterValue:r,aggregationReducers:a,tree:i}}function Ei(o){if(!o)return;let t=Object.keys(o);if(!t.length)return;let e={};for(let n=0,i=t.length;n<i;n++){let r=t[n],a=o[r].initialValue;a!==void 0&&(e[r]=typeof a=="function"?a():a)}return e}function Mi(o){let t=o.reducerKeys,e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].reducer;n[a]=l(n[a],o.rowInfo)}}function Fi(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function xd(o){return"groupNesting"in o?o.groupNesting??0:0}function Pd(o,t){if(!(!o.isGroupRow||!t.reducerId))return t.pivotTotalColumn&&(!t.pivotGroupKeys||t.pivotGroupKeys.length===0)?o.reducerResults?.[t.reducerId]:o.pivotValuesMap?.get(t.pivotGroupKeys)?.reducerResults?.[t.reducerId]}function Jh(o,t,e,n){if(o==null&&t==null)return 0;if(o==null)return 1;if(t==null)return-1;let i=Array.isArray(e.type)?e.type[0]:e.type,a=(e.fn||i&&n[i]||n.string||ln.string)(o,t);return a===0?0:e.dir*a}function Qh(o,t){if(!o?.length||!t)return[];let e=[];for(let n of o){let i=n.id?t[n.id]:void 0;!i?.pivotColumn||!i.pivotAggregator||e.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:i.pivotGroupKeys??[],reducerId:i.pivotAggregator.id,pivotTotalColumn:!!i.pivotTotalColumn})}return e}function eg(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=xd(n);for(;e.length&&xd(e[e.length-1].row)>=r;)e.pop();e.length?e[e.length-1].children.push(i):t.push(i),e.push(i)}return t}function tg(o){let t=[],e=(n,i)=>{n.forEach((r,a)=>{let l=[...i,a],u=r.row;u.indexInGroup=a,u.indexInParentGroups=l,u.indexInAll=t.length,t.push(u),e(r.children,l)})};return e(o,[]),t}function Dd(o,t,e,n){let i=Qh(t,e);if(!i.length||!o.length)return o;let r={...ln,...n},a=eg(o),l=(d,s)=>{for(let c of i){let f=Jh(Pd(d.row,c),Pd(s.row,c),c,r);if(f!==0)return f}return 0},u=d=>{d.sort(l);for(let s of d)u(s.children)};return u(a),tg(a)}var Eo={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Ca=class o{constructor(t){this.debugId=t;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=t=>{if(this.markerDetails.startTs)return this;let e=performance.now();return this.markerDetails.details=t?.details??[],this.markerDetails.startTs=e,this};this.end=(t={})=>{if(this.stopped)return this;this.stopped=!0;let e=t.startTs??this.markerDetails.startTs,n=t.endTs??this.markerDetails.endTs??performance.now(),i=t.color||this.markerDetails.color||"primary",r=t.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...t.details||[]],l=t.tooltip||this.markerDetails.tooltip,u=t.label||this.markerDetails.label||"Unknown",d=t.track||this.markerDetails.track||"Unknown";return performance.measure(u,{start:e,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:r,track:d,color:i,properties:a.length>0?a.map(s=>[s.name,s.value]):void 0,tooltipText:l}}}),this};this.debugId=t}static create(t){return new o(t)}get startTimestamp(){return this.markerDetails.startTs}get track(){let t=this;return Object.keys(Eo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:Eo[n].track,label:r.label}),get label(){let r=Eo[n];return Object.keys(r.labels).reduce((a,l)=>{let u={start:t.start,end:d=>t.end({...d,track:r.track,label:r.labels[l]})};return Object.defineProperty(a,l,{get:()=>(t.markerDetails.label=r.labels[l],u)}),a},{})}};return Object.defineProperty(e,n,{get:()=>{let r=Eo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function yt(o){return Ca.create(o)}function Yn(o){if(o==null)return!1;let t=o;return!0}var Ht=(o,t,e)=>{for(let n=0,i=e.length;n<i;n++){let r=e[n],a=o[r],l=t[r];if(a!==l)return!0}return!1};function ng(o){let t=o.get([Tt]);if(!t)return;if(t.totalChildrenCount!=null)return t.totalChildrenCount;let e=0;for(let n=0;n<t.children.length;n++){let i=t.children[n]?.totalChildrenCount;if(i==null)return;e+=i}return e}function og(o,t){let e=o.get([Tt]);if(e)return t?e.totalChildrenCountUnfiltered:e.totalCountUnfiltered}function Ta(){return!1}function ig(o,t,e,n,i,r){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:t,indexInAll:e,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ta,hasSelectedCells:Ta};return n&&(a.rowSelected=n(a)),i&&(a.rowDisabled=i(a)),r&&(a.isCellSelected=l=>r.isCellSelected(a.id,l),a.hasSelectedCells=l=>r.isCellSelectionInRow(a.id,l)),a}var rg=Nt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
5
|
|
|
3
6
|
Your filtering function probably looks like this:
|
|
4
7
|
|
|
@@ -10,19 +13,16 @@ function treeFilterFunction({ data }) {
|
|
|
10
13
|
|
|
11
14
|
Make sure you avoid mutations.
|
|
12
15
|
|
|
13
|
-
`)});function od(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a}=o,l=[],u=d=>{let s=i(d);if(r(d)||!Array.isArray(s))return d;let c=od({...o,dataArray:s});return c.length===0?!1:(d={...d,[a]:c},d)};for(let d=0,s=t.length;d<s;d++){let c=t[d],f=i(c),m=e({data:c,index:d,dataArray:t,primaryKey:n(c,d),filterTreeNode:u});m&&(m===!0?m=c:typeof m=="object"&&m===c&&f!==i(m)&&xh(),l.push(m))}return l}function Ph(o){let{filterTypes:t,marker:e,operatorsByFilterType:n,filterFunction:i,toPrimaryKey:r,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}=o,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]}),i&&(s=s.filter((f,m,p)=>i({data:f,index:m,dataArray:p,primaryKey:r(f,m)}))),a&&(s=od({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}));let c=da(o.filterValue,t)||[];if(c&&c.length){let f=s.filter((m,p,h)=>{let y={data:m,index:p,dataArray:h,primaryKey:r(m,p),field:void 0};for(let C=0,b=c.length;C<b;C++){let S=c[C],{disabled:w,field:T,valueGetter:x,filter:{type:R,value:E,operator:N}}=S,v=t[R];if(w||!v)continue;let P=n[R]?.[N];if(!P)continue;let M=x||v.valueGetter||(({data:A,field:D})=>D?A[D]:A);y.field=T;let _=y;if(_.filterValue=E,_.currentValue=M(_),_.emptyValues=v.emptyValues,!P.fn(_))return!1}return!0});return e?.end({details:[{name:"Count after",value:f.length}]}),f}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function id(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=yt(i).track.DataSource.label.PrepareData.start());let a=Xu(e),l=Pi(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Vt(n,e,["refetchKey"]),c=Vt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new $,c=!0);let m=e.cache?Rn.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?W=>W[h]:void 0,b=h?W=>W[h]===void 0:void 0,S,w;c&&(e.indexer.clear(),e.lazyLoad||(S=m?.getMutations(),w=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:W},re)=>{W&&e.indexer.getDataForNodePath(re)!==void 0&&W.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:x,treeFilterFunction:R,filterValue:E,filterTypes:N,operatorsByFilterType:v}=e,P=!!x||!!R||Array.isArray(E)&&E.length,F=P&&e.filterMode==="local",M=Vt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),_=c||M,A=Vt(n,e,["sortInfo"]),D=c||M||A,O=e.filterMode==="local"&&(_||!e.lastFilterDataArray),L=d&&(D||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),se=y,Z=Vt(n,e,["rowDisabledState","isRowDisabled"]),Me=Vt(n,e,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ge=Vt(n,e,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),xe=c||D||Vt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Ge=c||D||Vt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Oe=Vt(n,e,["rowInfoReducers"]),Se=G&&(xe||!e.lastGroupDataArray||a.groupBy)||Me||Z||Oe,Fe=se&&(Ge||a.tree||!e.lastTreeDataArray)||ge||Z||Oe,ce=Date.now(),ee=e.originalDataArray;if(se&&Fe){let W={marker:i?yt(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=Ar(W,ee).treePaths}if(P||(e.unfilteredCount=ee.length),F){e.unfilteredCount=ee.length;let W=ce;O?(e.devToolsDetected&&(W=Date.now()),ee=Ph({marker:i?yt(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:R,dataArray:ee,toPrimaryKey:p,filterTypes:N,operatorsByFilterType:v,filterFunction:x,filterValue:E}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-W)):ee=e.lastFilterDataArray,e.lastFilterDataArray=ee,e.filteredAt=ce}if(e.filteredCount=ee.length,e.postFilterDataArray=ee,d){let W=cn.knownTypes;if(cn.knownTypes={...W,...e.sortTypes},L){let re=ce;if(e.devToolsDetected&&(re=Date.now()),i&&(t=yt(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:ee.length}]})),e.sortFunction?(ee=e.sortFunction(l,[...ee]),t&&(t.end(),t=void 0)):y?ee=Uu(l,ee,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):ee=cn(l,[...ee],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let we=Date.now()-re;e.debugTimings.set("sort",we)}}else ee=e.lastSortDataArray;cn.knownTypes=W,e.lastSortDataArray=ee,e.sortedAt=ce}e.postSortDataArray=ee;let H=e.dataArray,q=e.rowSelection instanceof _e?e.rowSelection:void 0,J=e.treeExpandState instanceof ot?e.treeExpandState:void 0,ne=e.cellSelection instanceof Be?e.cellSelection:void 0;q&&(q.getConfig=nt(e)),q?.xcache();let ie=e.selectionMode==="single-row"?W=>W.id===e.rowSelection:e.selectionMode==="multi-row"?W=>{let re=q;return W.isGroupRow?re.getGroupRowSelectionState(W.groupKeys):re.isRowSelected(W.id,W.dataSourceHasGrouping?W.groupKeys:void 0)}:void 0,ye=e.isRowDisabled||ua;e.isRowSelected&&e.selectionMode==="multi-row"&&(ie=W=>e.isRowSelected(W,q,e.selectionMode));let be;e.isNodeExpanded&&(be=W=>e.isNodeExpanded(W,J)),e.isNodeCollapsed&&(be=W=>!e.isNodeExpanded(W,J)),be||(be=re=>J.isNodeExpanded(re.nodePath));let oe=e.rowInfoReducers;if(G){if(Se){let W=ce;e.devToolsDetected&&(W=Date.now());let re=e.aggregationReducers,we=e.lazyLoad?Dl({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:re,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?yt(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):Jo({groupBy:K,pivot:B,reducers:re,marker:i?yt(i).track.DataSource.label.Group.start():void 0},ee);e.groupDeepMap=we.deepMap,q&&(q.getConfig=nt(e));let Pe=Object.keys(oe||{}),ve=Ii(oe),Xe={reducers:oe,results:ve,reducerKeys:Pe,rowInfo:{}},je=ve?$e=>{Xe.rowInfo=$e,Ri(Xe)}:void 0,fe=ne?$e=>{$e.isCellSelected=g=>ne.isCellSelected($e.id,g)}:void 0,mt=je||fe?ta(je,fe):void 0,rt=Fl({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:we,lazyLoad:!!e.lazyLoad,reducers:re,toPrimaryKey:p,isRowSelected:ie,rowSelectionState:q,withRowInfo:mt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=rt.data,e.rowInfoReducerResults=xi({reducers:oe,results:ve,array:H}),e.groupRowsIndexesInDataArray=rt.groupRowsIndexes,e.reducerResults=we.reducerResults;let vt=B?Hu({deepMap:we.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=vt?.columns,e.pivotColumnGroups=vt?.columnGroups;let Mt=nd(H,l,e.pivotColumns,e.sortTypes);Mt!==H&&(H=Mt,e.groupRowsIndexesInDataArray=H.map(($e,g)=>$e.isGroupRow?g:-1).filter($e=>$e>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-W)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ce}else if(se){if(Fe){let W=ce;e.devToolsDetected&&(W=Date.now());let re=e.aggregationReducers,we={marker:i?yt(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:re},Pe=Ar(we,ee);e.treeDeepMap=Pe.deepMap,e.treePaths=Pe.treePaths;let ve=e.selectionMode==="multi-row"?rd(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=ve;let Xe=Object.keys(oe||{}),je=Ii(oe),fe={reducers:oe,results:je,reducerKeys:Xe,rowInfo:{}},mt=je?I=>{fe.rowInfo=I,Ri(fe)}:void 0,rt=ne?I=>{I.isCellSelected=z=>ne.isCellSelected(I.id,z)}:void 0,vt=mt||rt?ta(mt,rt):void 0,Mt=e.selectionMode==="single-row"?I=>I.id===e.treeSelection:e.selectionMode==="multi-row"?I=>ve.isNodeSelected(I.nodePath):void 0,$e=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=El({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:Pe,treeParams:we,dataArray:ee,reducers:re,toPrimaryKey:p,isNodeSelected:Mt,isNodeExpanded:be,treeSelectionState:ve,withRowInfo:vt,repeatWrappedGroupRows:$e,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=xi({reducers:oe,results:je,array:H}),e.reducerResults=Pe.reducerResults,e.totalLeafNodesCount=Pe.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ce,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-W)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||xe||Me||Z||Oe){let re=Object.keys(oe||{}),we=Ii(oe),Pe={reducers:oe,results:we,reducerKeys:re,rowInfo:{}};H=ee.map((ve,Xe)=>{let je=Rh(ve,ve?p(ve):Xe,Xe,ie,ye,ne);return we&&(Pe.rowInfo=je,Ri(Pe)),je}),e.rowInfoReducerResults=xi({reducers:oe,results:we,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ce),e.dataArray=H,e.reducedAt=ce,e.selectionMode==="multi-row")if(G&&e.lazyLoad){i&&(t=yt(i).track.DataSource.label.ComputeSelectionCountLazy.start());let W=!0,re=!1;e.dataArray.forEach(Pe=>{if(!Pe.isTreeNode&&Pe.isGroupRow&&Pe.groupKeys.length===1){let{rowSelected:ve}=Pe;ve!==!0&&(W=!1),(ve===!0||ve===null)&&(re=!0)}});let{rowSelection:we}=e;we instanceof _e&&we.getLazyHiddenRowsCount([])&&(we.defaultSelection?re=!0:W=!1),e.allRowsSelected=W,e.someRowsSelected=re,i&&(t?.end(),t=void 0)}else{i&&(t=yt(i).track.DataSource.label.ComputeSelectionCount.start());let W=e.isTree?e.treeSelectionState?.getSelectionCountFor([]):e.rowSelection.getSelectionCountFor([]);W?(e.allRowsSelected=W.deselectedCount===0,e.someRowsSelected=W.selectedCount>0):(e.allRowsSelected=e.totalLeafNodesCount===0,e.someRowsSelected=!1),i&&(t?.end(),t=void 0)}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ce,mutations:S?.size?S:void 0,treeMutations:w?.size?w:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?yt(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||L||Se||Fe?{name:"Performed operations",value:[O?"filter":null,L?"sort":null,Se?"group":null,Fe?"tree":null].filter(qn).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(qn)}),e}function qt(){let o=ze().performance?.now();return`${Date.now()}:${o}`}var ad=!0,Dh={originalDataArray:!0,changes:!0},Ah={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function Gt(o,t,e){let n=Pi(o.sortInfo,o.groupBy),i=o.multiSort?n:n?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:i,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(e&&(r.masterRowInfo=e.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[],o.selectionMode==="multi-row"&&(r.multiRowSelectionTarget=o.multiRowSelectionTarget)),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=ld(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});u&&u.length&&(r.filterValue=u)}let a={},l=o.dataParams||{};for(let u in r)if(r.hasOwnProperty(u)&&!Dh[u]){let d=u,s=Ah[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function Yn(o,t,e,n,i){let r=Gt(t,n,i),a=r.append;if(t.lazyLoad){let u=t.originalLazyGroupData,d=[sn,...r.groupKeys||[]],s=u.get(d);if(!s){let c=[...r.groupKeys||[],r.lazyLoadStartIndex];t.lazyLoadCacheOfLoadedBatches.set(c,!0)}if(s&&s.cache&&d.length>1){let c=s.children,f=c.length,m=!0;for(let p=0;p<f;p++)if(c[p]==null){m=!1;break}if(m)return Promise.resolve(!0)}s?s.childrenLoading||(s.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:ad,totalCount:0}),e.originalLazyGroupDataChangeDetect=qt()}typeof o=="function"&&(o=o(r));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!0),Promise.resolve(o).then(u=>{let d=[],s=!1;if(Array.isArray(u.data)){let f=u;if(d=f.data,f.livePaginationCursor!==void 0&&(e.livePaginationCursor=f.livePaginationCursor),f.mappings&&(e.pivotMappings=f.mappings),f.totalCountUnfiltered&&(e.unfilteredCount=f.totalCountUnfiltered),t.lazyLoad){let p=function(h,y,C){let b=[sn,...h],S=y.data,w={cache:y.cache??ad,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??S.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:S,error:y.error},T=[];if(r.lazyLoadBatchSize&&!C){let R=m.get(b),E=!R,N=Is({children:!0},R||{},w);E&&(N.chidren=[]),N.children.length=N.totalCount;let v=r.lazyLoadStartIndex??0,P=Math.min(y.totalCount??S.length,v+r.lazyLoadBatchSize);for(let F=v;F<P;F++){let M=w.children[F-v];if(!M)throw`lazily loaded item not found at index ${F-v}`;N.children[F]=M,M.dataset&&T.push({keys:M.keys,dataset:M.dataset})}E&&m.set(b,N)}else w.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),w.children.length=w.totalCount,m.set(b,w);let x=!1;if(!h||!h.length){let R=m.get([sn]);e.originalDataArray=[...R.children],x=!0}if(x||(e.originalLazyGroupDataChangeDetect=qt()),T.length){let R=h;T.forEach(({keys:E,dataset:N})=>{p(E,N,R)})}};var c=p;let m=t.originalLazyGroupData;s=!0,p(r.groupKeys||[],f)}}else d=u;s||(e.originalDataArray=a?t.originalDataArray.concat(d):d),l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!1)})}function ld(o,{filterTypes:t,filterMode:e}){return e==="local"?o:(da(o,t)||[]).map(n=>{let i={...n};return delete i.valueGetter,i})}function sd(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=ld(t,{filterTypes:e,filterMode:n});return o&&o.filterValue===t&&JSON.stringify(o.result)===JSON.stringify(i)&&(i=o.result),o={filterValue:t,filterTypes:e,filterMode:n,result:i},i}}var _h=()=>new Promise(o=>{Ke(o)});function ca(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function ud(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;return!!t&&!!e&&e>0&&n.has([0])}function dd(o,t){let{startIndex:e,endIndex:n,lazyLoadBatchSize:i,componentState:r,componentActions:a,dismissLoadedRows:l}=o,{dataArray:u}=r,d=l?()=>!1:h=>u[h].data!=null,s=!l,c=new $,f=["_______xxx______"];for(let h=e;h<=n;h++){let y=u[h];if(!y)continue;let C=d(h),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:f,w=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},x=y.groupKeys,R=c.get(x);if(!R?.[y.id]){let E=!R;R=R||{},R[y.id]||(R[y.id]=T),E&&c.set(x,R)}}if(!C&&i!=null){let T=c.get(S),x=Math.floor(w/i)*i,R=w-x,E=u[y.indexInAll-R].indexInAll,N=d(E),v=u[E].id;if(N||T?.[v])continue;let P=!T;T=T||{};let F={lazyLoadStartIndex:x,lazyLoadBatchSize:i,groupKeys:b,append:s};T[v]||(T[v]=F),P&&c.set(S,T)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,y)=>{let C=[...y.groupKeys,y.lazyLoadStartIndex];if(t&&t.has(C))return h;t?.set(C,!0);let b=[r.data,r,a,y];return h.then(()=>_h()).then(()=>Yn(...b))},m)}var Mh=Object.freeze([]),cd=(o,t)=>{let e=o??Mh,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};function Di(o,t){if(o===t)return!0;if(o==null||t==null)return o===t;if(typeof o!=typeof t)return!1;if(Array.isArray(o)&&Array.isArray(t)){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!Di(o[e],t[e]))return!1;return!0}if(typeof o=="object"){let e=Object.keys(o),n=Object.keys(t);if(e.length!==n.length)return!1;for(let i of e)if(!Object.prototype.hasOwnProperty.call(t,i)||!Di(o[i],t[i]))return!1;return!0}return!1}function Eh(o,t){return!(o===void 0||t===void 0||o.isGroupRow!==t.isGroupRow||o.dataSourceHasGrouping!==t.dataSourceHasGrouping||o.isTreeNode!==t.isTreeNode||o.isTreeNode&&o.isParentNode!==t.isParentNode)}var Ai={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},fd={...Ai,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},Fh={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},Nh={...Ai,...Fh,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},pd={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},Oh={...Ai,...pd,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},kh={...Ai,...pd,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Lh=Object.entries(fd).map(([o,t])=>t?o:void 0).filter(Boolean),zh=Object.entries(fd).map(([o,t])=>t?o:void 0),Vh=Object.entries(Nh).map(([o,t])=>t?o:void 0),Gh=Object.entries(Oh).map(([o,t])=>t?o:void 0),Kh=Object.entries(kh).map(([o,t])=>t?o:void 0);function Bh(o,t){if(o===t)return!0;if(!o||!t||!Eh(o,t)||o.id!==t.id||o.data!==t.data&&!Di(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?Vh:zh:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Kh:Gh:e=Lh;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!Di(i,r))return!1}return!0}function md(){let o=[],t=new Map,e=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},i=(f,m)=>{let p=o,h=m?.marker,C=f!==p&&e.size>0;C&&(n={dataSourceState:m?.dataSourceState,previousDataSourceState:m?.previousDataSourceState}),h&&h.start({details:[{name:"new dataArray length",value:f.length},{name:"old dataArray length",value:p.length}]});let b=[],S=l();for(let w of S){let T=p[w],x=f[w];if(x===void 0){b.push(w);continue}Bh(T,x)||b.push(w)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let w=0,T=b.length;w<T;w++){let x=b[w],R=t.get(x);if(R)for(let E of R)E()}if(C)for(let w of Array.from(e))w()}),h&&h.end({details:[{name:"updated row infos",value:b.length}]})},r=f=>o[f],a=(f,m)=>{let p=t.get(f);return p||(p=new Set,t.set(f,p)),p.add(m),()=>{let h=t.get(f);h&&(h.delete(m),h.size===0&&t.delete(f))}},l=()=>Array.from(t.keys());return{notifyDataArray:i,getRowInfoAtIndex:r,subscribeToRowIndex:a,subscribeToDataArrayChange:f=>(e.add(f),()=>{e.delete(f),e.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],t.clear(),e.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var fa=new Map,pa=new Map;var ma="DebugID=";function Zn(o,t){return t&&t.startsWith(ma)?t:t?`${ma}${o}:${t}`:`${ma}${o}`}var Hh=Symbol("cursorId"),hd=o=>o.totalLeafNodesCount===0,Wh=o=>o.isParentNode?!hd(o):!0;function gd(o){let t=Date.now(),e=[],n=[],i=new $;return{logger:nn(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:md(),indexer:new Ti,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new $,waitForNodePathPromises:new $,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new $,dataParams:void 0,onCleanup:he(),notifyScrollbarsChange:he(),notifyScrollStop:he(),notifyRenderRangeChange:he(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Hh,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function jh(o){let t={...o};return delete t.originalDataArray,t}var $h=[],yd=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},bd=(o,t)=>({onDataParamsChange:e=>e?Ol(e,100,jh):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??hd,isNodeSelectable:e=>e??Wh,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:e=>e??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:e=>e??!1,multiRowSelectionTarget:e=>e??"all",filterDelay:e=>e??200,filterTypes:e=>({...kn,...e}),sortTypes:e=>({...rn,...e}),sortFunction:1,onReady:1,rowInfoReducers:(e,n)=>{let i={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{t.debugId&&!t.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},r=e?{...e,__idToIndex:i}:{__idToIndex:i};if(t.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,u)=>{u.isTreeNode&&(n.idToPathMap.set(u.id,u.nodePath),t.debugId&&n.pathToIndexMap.has(u.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${t.debugId||"none"}): ${u.nodePath}`),n.pathToIndexMap.set(u.nodePath,u.indexInAll))}};r.__pathToIndex=a}return r},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:e=>{if(!e)return null;if(e instanceof wt)return e;let n=o.propsCache.get("rowDisabledState")??xt,i=n.get(e);return i||(i=new wt(e),n.set(e,i)),e=i,e??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:e=>e??!0,loading:e=>e??!1,sortInfo:e=>cd(e,o.propsCache.get("sortInfo")),groupBy:e=>e??$h});function Uh(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var xt=new WeakMap;function qh(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let t={};return o.filterValue!=null&&(t.filterValue=o.filterValue),o.sortInfo!=null&&(t.sortInfo=o.sortInfo),o.groupBy!=null&&(t.groupBy=o.groupBy),o.pivotBy!=null&&(t.pivotBy=o.pivotBy),t}var Yh={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function rd(o,t,e){if(t!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${t}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`);let n=$n(e);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Yh,r=xt.get(i);return r&&r.setConfig(n),r=r??new Qe(i,n),xt.set(i,r),r}function Cd(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=mo(t.sortInfo),a=mo(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((A,D)=>{let O=l[D].operators;A[D]=A[D]||{};let L=A[D];return O.forEach(K=>{L[K.name]=K}),A},{}),d=t,s=t.selectionMode;if(s===void 0)if(t.cellSelection!==void 0||t.defaultCellSelection!==void 0)s="multi-cell";else{let A=t.rowSelection!==void 0?t.rowSelection:t.defaultRowSelection;if(A!==void 0&&(A&&typeof A=="object"?s="multi-row":s="single-row"),!s){let D=d.treeSelection??d.defaultTreeSelection;D!==void 0&&(s=typeof D=="object"?"multi-row":"single-row")}s=s??!1}let c=null,f=null,m=t.rowSelection!==void 0?t.rowSelection:e.rowSelection===void 0?t.defaultRowSelection!==void 0?t.defaultRowSelection:null:e.rowSelection,p=t.cellSelection!==void 0?t.cellSelection:e.cellSelection===void 0?t.defaultCellSelection!==void 0?t.defaultCellSelection:null:e.cellSelection||null;if(!i&&(s!==!1&&(s==="single-row"||s==="multi-row")&&(m===null?c=s==="single-row"?null:new _e({selectedRows:[],deselectedRows:[],defaultSelection:!1},nt(e)):s==="single-row"||m instanceof _e?c=m:c=new _e(m,nt(e))),s==="single-cell"||s==="multi-cell"))if(p===null)f=s==="single-cell"?null:new Be;else if(p instanceof Be)f=p;else{let A=xt.get(p)??new Be(p);xt.set(p,A),f=A}let h=e.primaryKey,y=typeof h=="function"?A=>h(A):A=>A[h],C=d.treeExpandState||e.treeExpandState||d.defaultTreeExpandState;if(C&&!(C instanceof ot)){let A=xt.get(C)??new ot(C);xt.set(C,A),C=A}C=C||new ot({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof St)){let A=xt.get(b)??new St(b);xt.set(b,A),b=A}b=b||new St(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=qh(t.shouldReloadData||{}),w=t.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=t.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,x=t.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;t.groupMode&&Fn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",e.logger),t.sortMode&&Fn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",e.logger),t.filterMode&&Fn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",e.logger);let R=typeof t.data=="function"&&!!t.lazyLoad,E=typeof t.data=="function"?w??(R?"remote":"local"):"local",N=t.sortFunction?"local":T??(r?"remote":"local"),v=typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function"?"local":x??(typeof t.data=="function"?"remote":"local"),P=S.pivotBy??R?"remote":"local",F=e.rowDisabledState,M=t.isRowDisabled;if(!M&&F){let A=xt.get(F);A?M=A:(M=D=>F.isRowDisabled(D.id),xt.set(F,M))}let _={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:{filterValue:S?.filterValue??v==="remote",sortInfo:S?.sortInfo??N==="remote",groupBy:S?.groupBy??E==="remote",pivotBy:S?.pivotBy??P==="remote"},isRowDisabled:M,rowSelection:c,cellSelection:f,groupMode:E,sortMode:N,filterMode:v,pivotMode:P,toPrimaryKey:y,operatorsByFilterType:u,controlledSort:r,controlledFilter:a,multiSort:Array.isArray(r?t.sortInfo:t.defaultSortInfo),lazyLoadBatchSize:typeof t.lazyLoad=="object"?t.lazyLoad.batchSize:void 0};if(t.livePagination){let A=!n||n.originalDataArray!==e.originalDataArray,D=typeof t.livePaginationCursor=="function"?A?Uh(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;_.livePaginationCursor=D}if(e.devToolsDetected&&e.debugId){let A=pa.get(e.debugId);A&&(_={..._,...A})}return _}var Zh=nn("DataSource:fullLazyLoad");function Td(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&Zh('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new St({collapsedRows:!0,expandedRows:[]})))}function Sd(){return{rowSelection:(o,t)=>t.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,t)=>{if(t.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let e=t.__apiRef.current,n=e.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:t.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:t.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:t.unfilteredTreePaths,dataSourceApi:e,treeApi:n}]}},treeExpandState:(o,t)=>({callbackParams:[o.getState(),{nodeState:t.lastExpandStateInfoRef.current.state,nodePath:t.lastExpandStateInfoRef.current.nodePath,dataSourceApi:t.__apiRef.current}]}),cellSelection:(o,t)=>t.selectionMode==="single-cell"?{callbackParams:[o instanceof Be?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function wd(){return{sortInfo:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{sortInfo:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},groupBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{groupBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},pivotBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{pivotBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},filterValue:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{filterValue:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Ke(()=>{t.livePaginationCursor=null})},cursorId:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{__cursorId:o},n());t.dataParams=i},livePaginationCursor:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=Gt(e,{livePaginationCursor:o},n());t.dataParams=i},dataParams:(o,{state:t})=>an(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(nn(Zn(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function vd(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function Xh(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
|
|
16
|
+
`)});function Ad(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a,filterValue:l,filterTypes:u}=o,d=[],s=f=>r(f)||!Array.isArray(i(f)),c=f=>{if(s(f))return f;let m=Ad({...o,dataArray:i(f)});return m.length===0?!1:(f={...f,[a]:m},f)};for(let f=0,m=t.length;f<m;f++){let p=t[f],h=i(p),y=e({data:p,index:f,dataArray:t,primaryKey:n(p,f),filterValue:l,filterTypes:u,filterTreeNode:c,isLeafNode:s(p)});y&&(y===!0?y=p:typeof y=="object"&&y===p&&h!==i(y)&&rg(),d.push(y))}return d}var ag=[];function lg(o){let{filterTypes:t,marker:e,filterFunction:n,toPrimaryKey:i,treeFilterFunction:r,getNodeChildren:a,nodesKey:l,isLeafNode:u}=o,d=o.filterValue||ag,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]});let c=!!l&&!!a&&!!u,f=0;if(c){let m=n;s=Ad({dataArray:s,treeFilterFunction:r||(m?h=>h.isLeafNode?m(h):h.filterTreeNode(h.data):vi),toPrimaryKey:i,getNodeChildren:a,nodesKey:l,isLeafNode:u,filterValue:d,filterTypes:t})}else if(n)s=s.filter((m,p,h)=>n({data:m,index:p,dataArray:h,primaryKey:i(m,p),filterValue:d,filterTypes:t}));else{let m=wi(d,t);m.length&&(s=s.filter((p,h,y)=>aa(m,{data:p,index:h,dataArray:y,primaryKey:i(p,h)})))}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function _d(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=yt(i).track.DataSource.label.PrepareData.start());let a=Id(e),l=Ri(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Ht(n,e,["refetchKey"]),c=Ht(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new W,c=!0);let m=e.cache?In.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?$=>$[h]:void 0,b=h?$=>$[h]===void 0:void 0,S,w;c&&(e.indexer.clear(),e.lazyLoad||(S=m?.getMutations(),w=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:$},te)=>{$&&e.indexer.getDataForNodePath(te)!==void 0&&$.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:x,treeFilterFunction:I,filterValue:M,filterTypes:F}=e,v=!!x||!!I||Array.isArray(M)&&M.length,D=e.filterMode==="local"&&!e.lazyLoad,E=v&&D,P=Ht(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),A=c||P,N=Ht(n,e,["sortInfo"]),_=c||P||N,O=D&&(A||!e.lastFilterDataArray),z=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),se=y,Z=Ht(n,e,["rowDisabledState","isRowDisabled"]),Ee=Ht(n,e,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ge=Ht(n,e,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),xe=c||_||Ht(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Ke=c||_||Ht(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Oe=Ht(n,e,["rowInfoReducers"]),we=G&&(xe||!e.lastGroupDataArray||a.groupBy)||Ee||Z||Oe,Fe=se&&(Ke||a.tree||!e.lastTreeDataArray)||ge||Z||Oe,ce=Date.now(),ee=e.originalDataArray;if(se&&Fe){let $={marker:i?yt(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=Nr($,ee).treePaths}if(v||(e.unfilteredCount=ee.length),E){e.unfilteredCount=ee.length;let $=ce;O?(e.devToolsDetected&&($=Date.now()),ee=lg({marker:i?yt(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:I,dataArray:ee,toPrimaryKey:p,filterTypes:F,filterFunction:x,filterValue:M}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-$)):ee=e.lastFilterDataArray,e.lastFilterDataArray=ee,e.filteredAt=ce}if(e.filteredCount=(e.lazyLoad&&K.length?ng(e.originalLazyGroupData):void 0)??ee.length,e.lazyLoad&&(e.unfilteredCount=og(e.originalLazyGroupData,K.length>0)??e.filteredCount),e.postFilterDataArray=ee,d){let $=Bt.knownTypes;if(Bt.knownTypes={...$,...e.sortTypes},z){let te=ce;if(e.devToolsDetected&&(te=Date.now()),i&&(t=yt(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:ee.length}]})),e.sortFunction?(ee=e.sortFunction(l,[...ee]),t&&(t.end(),t=void 0)):y?ee=_i(l,ee,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):ee=Bt(l,[...ee],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let ve=Date.now()-te;e.debugTimings.set("sort",ve)}}else ee=e.lastSortDataArray;Bt.knownTypes=$,e.lastSortDataArray=ee,e.sortedAt=ce}e.postSortDataArray=ee;let H=e.dataArray,q=e.rowSelection instanceof De?e.rowSelection:void 0,J=e.treeExpandState instanceof ot?e.treeExpandState:void 0,oe=e.cellSelection instanceof He?e.cellSelection:void 0;q&&(q.getConfig=nt(e)),q?.xcache();let re=e.selectionMode==="single-row"?$=>$.id===e.rowSelection:e.selectionMode==="multi-row"?$=>{let te=q;return $.isGroupRow?te.getGroupRowSelectionState($.groupKeys):te.isRowSelected($.id,$.dataSourceHasGrouping?$.groupKeys:void 0)}:void 0,ye=e.isRowDisabled||Ta;e.isRowSelected&&e.selectionMode==="multi-row"&&(re=$=>e.isRowSelected($,q,e.selectionMode));let be;e.isNodeExpanded&&(be=$=>e.isNodeExpanded($,J)),e.isNodeCollapsed&&(be=$=>!e.isNodeExpanded($,J)),be||(be=te=>J.isNodeExpanded(te.nodePath));let ie=e.rowInfoReducers;if(G){if(we){let $=ce;e.devToolsDetected&&($=Date.now());let te=e.aggregationReducers,ve=e.lazyLoad?Nl({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:te,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?yt(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):Jo({groupBy:K,pivot:B,reducers:te,marker:i?yt(i).track.DataSource.label.Group.start():void 0},ee);e.groupDeepMap=ve.deepMap,q&&(q.getConfig=nt(e));let _e=Object.keys(ie||{}),Te=Ei(ie),ze={reducers:ie,results:Te,reducerKeys:_e,rowInfo:{}},$e=Te?Ue=>{ze.rowInfo=Ue,Mi(ze)}:void 0,fe=oe?Ue=>{Ue.isCellSelected=g=>oe.isCellSelected(Ue.id,g)}:void 0,mt=$e||fe?pa($e,fe):void 0,rt=Vl({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:ve,lazyLoad:!!e.lazyLoad,reducers:te,toPrimaryKey:p,isRowSelected:re,rowSelectionState:q,withRowInfo:mt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=rt.data,e.rowInfoReducerResults=Fi({reducers:ie,results:Te,array:H}),e.groupRowsIndexesInDataArray=rt.groupRowsIndexes,e.reducerResults=ve.reducerResults;let Rt=B?bd({deepMap:ve.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=Rt?.columns,e.pivotColumnGroups=Rt?.columnGroups;let Mt=Dd(H,l,e.pivotColumns,e.sortTypes);Mt!==H&&(H=Mt,e.groupRowsIndexesInDataArray=H.map((Ue,g)=>Ue.isGroupRow?g:-1).filter(Ue=>Ue>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-$)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ce}else if(se){if(Fe){let $=ce;e.devToolsDetected&&($=Date.now());let te=e.aggregationReducers,ve={marker:i?yt(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:te},_e=Nr(ve,ee);e.treeDeepMap=_e.deepMap,e.treePaths=_e.treePaths;let Te=e.selectionMode==="multi-row"?fd(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=Te;let ze=Object.keys(ie||{}),$e=Ei(ie),fe={reducers:ie,results:$e,reducerKeys:ze,rowInfo:{}},mt=$e?R=>{fe.rowInfo=R,Mi(fe)}:void 0,rt=oe?R=>{R.isCellSelected=L=>oe.isCellSelected(R.id,L)}:void 0,Rt=mt||rt?pa(mt,rt):void 0,Mt=e.selectionMode==="single-row"?R=>R.id===e.treeSelection:e.selectionMode==="multi-row"?R=>Te.isNodeSelected(R.nodePath):void 0,Ue=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=zl({marker:i?yt(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:_e,treeParams:ve,dataArray:ee,reducers:te,toPrimaryKey:p,isNodeSelected:Mt,isNodeExpanded:be,treeSelectionState:Te,withRowInfo:Rt,repeatWrappedGroupRows:Ue,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=Fi({reducers:ie,results:$e,array:H}),e.reducerResults=_e.reducerResults,e.totalLeafNodesCount=_e.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ce,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-$)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||xe||Ee||Z||Oe){let te=Object.keys(ie||{}),ve=Ei(ie),_e={reducers:ie,results:ve,reducerKeys:te,rowInfo:{}};H=ee.map((Te,ze)=>{let $e=ig(Te,Te?p(Te):ze,ze,re,ye,oe);return ve&&(_e.rowInfo=$e,Mi(_e)),$e}),e.rowInfoReducerResults=Fi({reducers:ie,results:ve,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ce),e.dataArray=H,e.reducedAt=ce,e.selectionMode==="multi-row"){let $=e.rowSelection instanceof De&&!e.rowSelection.onlyUsePrimaryKeys;if(G&&e.lazyLoad&&!$){i&&(t=yt(i).track.DataSource.label.ComputeSelectionCountLazy.start());let te=!0,ve=!1;e.dataArray.forEach(Te=>{if(!Te.isTreeNode&&Te.isGroupRow&&Te.groupKeys.length===1){let{rowSelected:ze}=Te;ze!==!0&&(te=!1),(ze===!0||ze===null)&&(ve=!0)}});let{rowSelection:_e}=e;_e instanceof De&&_e.getLazyHiddenRowsCount([])&&(_e.defaultSelection?ve=!0:te=!1),e.allRowsSelected=te,e.someRowsSelected=ve,i&&(t?.end(),t=void 0)}else{i&&(t=yt(i).track.DataSource.label.ComputeSelectionCount.start());let te=e.isTree?e.treeSelectionState?.getSelectionCountFor([]):e.rowSelection.getSelectionCountFor([]);te?(e.allRowsSelected=te.deselectedCount===0,e.someRowsSelected=te.selectedCount>0):(e.allRowsSelected=e.totalLeafNodesCount===0,e.someRowsSelected=!1),i&&(t?.end(),t=void 0)}}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ce,mutations:S?.size?S:void 0,treeMutations:w?.size?w:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?yt(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||z||we||Fe?{name:"Performed operations",value:[O?"filter":null,z?"sort":null,we?"group":null,Fe?"tree":null].filter(Yn).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(Yn)}),e}function sg(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function Ed(o){return Object.entries(o).reduce((t,[e,n])=>{let i=e,r=sg(i,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return t[i]=r,t},{})}function ug(o){return{message:o.join(""),type:"warning"}}function dg(o){return{message:o.join(""),type:"error"}}var cg=Ed({DS001:ug`The "data" prop of your DataSource seems to be updating too frequently.
|
|
21
|
+
Make sure you don't pass a new reference on every render.`}),fg=Ed({CSS001_CSS:dg`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),Md={...cg,...fg};var Fd=new Map;var pg=o=>{let t=o.type==="error"?an(o.debugId):rn(o.debugId),e=o.type==="error"?El:_l,n=o.debugId?`${o.code}-${o.debugId}`:o.code,i=o.message;o.debugId&&(i=`${i}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},ha=o=>{let{debugId:t,key:e}=o,n=Rd[e];if(n&&(ng({...n,debugId:t}),t&&e)){let i=xd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),og(t))}};globalThis.logDevToolsWarning=ha;var og=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=xd.get(o);e&&t(o,e)};var _i=require("vue"),Pd=Symbol("DataSourceMasterDetail");function Dd(o){(0,_i.provide)(Pd,o)}var ig=()=>{};function Mi(){return(0,_i.inject)(Pd,ig)}var ga=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","multiRowSelectionTarget","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","sortMode","filterMode","groupMode","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],Xn=Symbol("DataSource");function Jn(){return(0,Le.inject)(Xn)}var{useManagedComponent:rg}=En({debugName:"DataSource",initSetupState:gd,forwardProps:bd,concludeReducer:id,mapPropsToState:Cd,onPropChange:Td,cleanup:yd,interceptActions:wd(),mappedCallbacks:Sd()});function Ei(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};(0,Le.onMounted)(()=>i(o())),(0,Le.watch)(o,i,{flush:"post"})}function ag(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;Ei(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new $});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||dd({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:en(a,{wait:s})}),l.fn},d=null;Ei(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,a(m)}))}),(0,Le.watch)(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{d?.(),d=null})}function lg(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=(0,Le.shallowRef)({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});(0,Le.onBeforeUnmount)(()=>{a()});let l=null;(0,Le.watch)(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;(0,Le.watch)(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),(0,Le.watch)(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=sd(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:S,cursorId:w}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:S?w:null}},f={current:!1};ag({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];Ei(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=ca(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&ha({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&Yn(p.data,p,n,void 0,h)}),Ei(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){if(y=!!p.cursorId,p.filterValue&&e().filterMode==="local")return;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:S}=ca(C,e);if(b&&!S)return;let w=e();if(typeof w.data=="function"){if(f.current&&!y&&ud(w))return;Yn(w.data,w,n,{append:y},C)}}),(0,Le.onMounted)(()=>{let p=e(),h=Gt(p,void 0,i());n.dataParams=h})}function sg(o){let t=Mi(),e=!!t(),{contextValue:n}=rg(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Zu({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return(0,Le.provide)(Xn,u),(0,Le.onMounted)(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),lg({state:i,getDataSourceState:a,dataSourceActions:r}),(0,Le.watch)(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),(0,Le.onMounted)(()=>{i.value.onReady?.(l)}),(0,Le.onBeforeUnmount)(()=>{let d=a();d.onCleanup(d)}),u}var Fi=(0,Le.defineComponent)({name:"DataSource",props:[...ga],setup(o,{slots:t}){let e=sg(o);return()=>t.default?.(e.state.value)??null}});var X=require("vue");var Ad=require("vue");function Yt(o,t,e){let n=null,i;return(0,Ad.computed)(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Qn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?en(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var Oi=class Oi{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??Oi.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};Oi.DEFAULT_SIZE=10;var Ni=Oi;var ya=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},ki=class{constructor(t){this.storage=new Ni(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},ba=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},Li=class{constructor(t){this.cacheStorage=t===!1?new ya:t===!0?new ba:typeof t=="number"?new ki(t):new ki(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var bt=class extends Un{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var _d=po(Kn());var Ca=(o,t)=>o-t,Zt={horizontal:!0,vertical:!0};function zi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var Vi={start:0,end:0},Ta=o=>{o()},Sa=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},Md=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},Fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function ug(o){return o.horizontalChange||o.verticalChange}var xn=class extends ft{constructor(e){let n=Zn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Vi;this.verticalExtendRangeBy=Vi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{Fo(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?Ta:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?Ta:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Zt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Zt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=Zt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,_d.default)(a,e,Ca);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Sa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Zt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,S=l!=null,w=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let x=e.rowspan!=null,R=e.colspan!=null,E=x&&e.rowspan!=this.rowspan,N=R&&e.colspan!=this.colspan;E&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let v=C||T||f||N,P=y||w||m||E;(n||ug)({horizontalChange:v,verticalChange:P,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:w,heightChanged:m,rowspanChanged:E})&&this.updateRenderCount({horizontal:v,vertical:P})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Zt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Zt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?Ta:Fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=zi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{Fo(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Vi,this.verticalExtendRangeBy=Vi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var dg={scrollLeft:0,scrollTop:0},No=class{constructor(){this.scrollPosition=dg;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:cg}=He,Pt=`${cg}ColumnCell`;function Ed(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}var Fd=require("vue");function Nd(o){return(t,e)=>(0,Fd.h)(o,{key:t.id,rowInfo:t,cache:e})}var Oo=class extends xn{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=zi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,S=C&&r!==this.rowHeight,w=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||f,x=y||w||c||T;(x||T)&&this.updateRenderCount({horizontal:x,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Zt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Ke(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var wa=po(Kn());function Od(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function kd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function ko(o,t){for(let e of o)if(t(e))return e}var Gi=(o,t)=>o-t,Ki=class extends ft{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new $;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=ko(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=ko(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Gi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(Gi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,wa.default)(n,e,Gi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,wa.default)(n,e,Gi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return ko(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return ko(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Ld=po(Kn());var Bi=class extends ft{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Ld.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var zd=!0,Pn=U(j.y),Vd=U(j.scrollTop),xx=U(j.columnOffsetAtIndex),va=U(j.columnOffsetAtIndexWhileReordering),eo=class extends ft{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(Pn,r?`calc( ${i}px + var(${Vd}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${Pn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Te.columnOffsets.get(i),c=`${va}-${i}`,f=u?`calc( ${a}px + var(${Vd}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(Pn,f));let m=`translate3d(var(${c}, ${s}), var(${Pn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Ke(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,zd){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,zd&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(_=>{let A=r.getRowIndex(_);if(A!=null){let D=this.brain.getItemOffsetFor(A,"vertical");if(D==null)return;let O=_.getElement();if(!O)return;this.setDetailTransform(O,A,{y:D,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&Ws(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[S,w]=y;function T(_,A,D){let O=i.getCellAt([_,A]);if(O==null)return;let L=n.getCellOffset(_,A),K=O.getElement();K&&L&&D(_,A,K,L)}let x=(_,A,D,{x:O,y:L})=>{this.setTransform(D,_,A,{x:O,y:L,scrollLeft:!0},u-A)},R=(_,A,D,O)=>{this.setTransform(D,_,A,{x:O.x,y:O.y,scrollTop:!0},s-_)},E=(_,A,D,{y:O})=>{let L=m[A];this.setTransform(D,_,A,{x:L,y:O,scrollLeft:!0},a-A)},N=(_,A,D,O)=>{this.setTransform(D,_,A,{x:O.x,y:p[_],scrollTop:!0},l-_)},v=(_,A,D,{x:O,y:L})=>{this.setTransform(D,_,A,{x:O,scrollLeft:!0,y:L,scrollTop:!0},1e5)},P=(_,A,D,{x:O})=>{this.setTransform(D,_,A,{x:O,scrollLeft:!0,y:p[_],scrollTop:!0},2e5)},F=(_,A,D,O)=>{this.setTransform(D,_,A,{x:m[A],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(_,A,D)=>{this.setTransform(D,_,A,{x:m[A],y:p[_],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let _=C;_<S;_++){for(let A=0;A<u;A++)T(_,A,x);if(d){let A=a-d;for(let D=A;D<a;D++)T(_,D,E)}}if(s||c)for(let _=b;_<w;_++){for(let A=0;A<s;A++)T(A,_,R);if(c){let A=l-c;for(let D=A;D<l;D++)T(D,_,N)}}if(u&&s)for(let _=0;_<s;_++)for(let A=0;A<u;A++)T(_,A,v);if(u&&c){let _=l-c;for(let A=_;A<l;A++)for(let D=0;D<u;D++)T(A,D,P)}if(d&&s){let _=a-d;for(let A=0;A<s;A++)for(let D=_;D<a;D++)T(A,D,F)}if(d&&c){let _=l-c,A=a-d;for(let D=_;D<l;D++)for(let O=A;O<a;O++)T(D,O,M)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new Ki(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new Bi(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ke(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=Hr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let v=e.start[1],P=e.end[1];p.forEach(F=>{v<=F&&F<P||m.push({start:[e.start[0],F],end:[e.end[0],F+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([v,P])=>{h.set(`${v}:${P}`,!0)});let C=m.reduce((v,P)=>v+Sa(P),0),b=i?m.reduce((v,P)=>v+Md(P),0):0,S=this.brain.getRowCount(),w=this.brain.getColCount();c.detachCellsStartingAt([S,w]);let T=Math.min(S*w,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let x=Od(...m.map(v=>c.getCellsOutsideRenderRange(v)));x=kd(x,v=>{let P=c.getCellPosition(v);return!(P&&h.has(`${P[0]}:${P[1]}`))}),c.detachCells(x),c.poolSize=T;let R=new Map,E=new Map;m.forEach(v=>{let{start:P,end:F}=v,[M,_]=P,[A,D]=F;for(let O=M;O<A;O++){for(let K=_;K<D;K++){let B=`${O}:${K}`;if(R.has(B))continue;R.set(B,!0);let{rendered:G,mapped:se}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===M||K===_){let Me=this.isCellCovered(O,K);if(Me&&h.has(`${Me[0]}:${Me[1]}`)){let ge=c.getCellAt([O,K]);ge!=null&&c.detachCell(ge);continue}}if(G&&!r&&se)continue;let Z;G?Z=c.getCellAt([O,K]):Z=c.getCellFor([O,K],d?"row":"column"),Z==null&&(Z=c.getDetachedCell()),this.renderCellAt(O,K,Z,n)}!i||E.has(O)||(E.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([v,P])=>{let{rendered:F,mapped:M}=this.isCellRenderedAndMappedCorrectly(v,P);if(F){if(r||!M){let A=[v,P],D=c.getCellAt(A);this.renderCellAt(v,P,D,n)}return}let _=c.getCellFor([v,P],d?"row":"column");_!=null&&this.renderCellAt(v,P,_,n)});let N=c.getAllCells().map(v=>v.getNode());return i&&s.getAllRows().forEach(v=>{N.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let x=T.getElement();x&&(x.style.position="absolute",x.style.left="0px",x.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,w=this.brain.isHorizontalLayoutBrain;if(!b){w?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],S),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Hi=class extends eo{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Ae.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Te.columnOffsets.get(l.colIndex),m=`${va}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(Pn,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${Pn})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};var Bd=require("vue");var it=require("vue");function Gd(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Gd(e,t);return}if((0,it.isVNode)(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var pn=(0,it.defineComponent)({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=(0,it.shallowRef)(o.updater.get()??null),e=null;(0,it.watch)(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),(0,it.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),(0,it.onMounted)(()=>o.afterCommit?.()),(0,it.onUpdated)(()=>o.afterCommit?.());let n=(0,it.getCurrentInstance)();return()=>{let i=t.value;return Gd(i,n),i??null}}});var to=class to extends ft{constructor(e){super(e);this.cellRemoveSubscription=he();this.cellAttachmentChangeSubscription=he();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=to.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/to.POOL_SIZE_INCREMENT)*to.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};to.POOL_SIZE_INCREMENT=1;var Wi=to;var Kd=new Map,fg=()=>{},Ia=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=he();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=Kd.get(t)??0,i=`${t}:GridCellVue:${n}`;Kd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=he(),this.node=(0,Bd.h)(pn,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=fg,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},ji=class extends Wi{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new Ia(this.cellDebugId)}};var Wd=require("vue");var no=class no extends ft{constructor(e){super(e);this.rowRemoveSubscription=he();this.rowAttachmentChangeSubscription=he();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=no.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/no.POOL_SIZE_INCREMENT)*no.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};no.POOL_SIZE_INCREMENT=1;var $i=no;var Hd=new Map,pg=()=>{},Ra=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=he();let e=Hd.get(t)??0,n=`${t}:ListRowVue:${e}`;Hd.set(t,e+1),this.debugId=n,this.updater=he(),this.node=(0,Wd.h)(pn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=pg,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Ui=class extends $i{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new Ra(this.rowDebugId)}};function jd(o){return{cellPool:new ji(o),rowPool:new Ui(o)}}function Lo(o){let t=o.isHorizontalLayoutBrain?new Hi(o,`${o.name}:VueHorizontalLayoutTableRenderer`,jd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new eo(o,`${o.name}:VueHeadlessTableRenderer`,jd(`${o.name}:VueHeadlessTableRenderer`)),e=he();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function Dn(){return{current:null}}var $d={};function xa(o){return`.${Pt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Pa(o,t){let e=Zn(o),n=t?new Oo(e,{isHeader:!1}):new xn(e),i=`${e}:header`,r=t?new Oo(i,{isHeader:!0,masterBrain:n}):new xn(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Lo(n),{renderer:u,onRenderUpdater:d}=Lo(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function Ud({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=Pa(o,!!t),d=Dn(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=xa(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:Dn(),editingValueRef:Dn(),scrollerDOMRef:Dn(),portalDOMRef:Dn(),focusDetectDOMRef:Dn(),activeCellIndicatorDOMRef:Dn(),onColumnMenuClick:he(),cellContextMenu:he(),contextMenu:he(),onFilterOperatorMenuClick:he(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:he(),onRowHeightCSSVarChange:he(),onRowDetailHeightCSSVarChange:he(),onColumnHeaderHeightCSSVarChange:he(),cellClick:he(),cellMouseDown:he(),keyDown:he(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new No,pinnedEndScrollListener:new No,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var qd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new Li(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??$d,columnGroupVisibility:t=>t??$d,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function mg(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Yd=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Zd(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var qi=new WeakMap;function Xd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Jd=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?Ed(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=mg({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=qi.get(c);y||(y=Nd(c),qi.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof bt)&&(d=new bt(d)),d=d||new bt({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=qi.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&qi.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Ae.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=fa.get(e.debugId);y&&(h={...h,...y})}return h};function Qd(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function ec(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var hg=10;function tc(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${Lt} > .${pi}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${Tn}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...Tt.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=ze().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+hg}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let S=ze().getComputedStyle(C);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var nc="InfiniteTable";var mn=require("vue");var oc=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Xt=require("vue");var ic="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",rc=Ie({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var ac="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",lc=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Yi=`${ht}-expand-collapse`,An=(0,Xt.defineComponent)(o=>{let t=()=>o.expanded!==void 0,e=(0,Xt.ref)(o.expanded??o.defaultExpanded??!1);(0,Xt.watch)(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return(0,Xt.h)("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:te(o.className,ic,rc({direction:a||"start",expanded:e.value,disabled:l}),`${ht}`,`${Yi}`,`${Yi}--${i}`,`${Yi}--${a==="end"?"end":"start"}`,l?`${Yi}--disabled`:"")},[(0,Xt.h)("path",{d:ac})])}},{name:"ExpandCollapseIcon",props:[...lc]});var oo=require("vue");var sc="_16lm1iwb _16lm1iw1d _16lm1iwk";var uc="164.93361431346415 56.97787143782138",dc={margin:"auto",display:"block",shapeRendering:"auto"},cc=Object.keys({size:1,style:1,className:1,viewBox:1});var fc=(0,oo.defineComponent)(o=>()=>(0,oo.h)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...dc,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:te(o.className,sc,"InfiniteIcon","InfiniteIcon-loading")},[(0,oo.h)("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":uc},[(0,oo.h)("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...cc]});var pc=Ie({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),mc="_7pupv00",hc=Ie({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function gc(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function yc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var gg=U(j.columnZIndexAtIndex),yg=U(j.columnVisibilityAtIndex);function bc({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(Ae.components.Row.groupNesting)]:e}}function bg({rowInfo:o}){return{[U(Ae.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Da(o,t){return o?typeof o=="function"?o(t):o:void 0}function Aa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function Cc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:S,cellSelected:w,cellSelection:T,getData:x,computedVisibleColumns:R,visibleColumnIds:E,computedColumnOrder:N,columnReorderInPageIndex:v}=o,P=E??R.map(Oe=>Oe.id),F=N,M,_={...s,visibleColumnIds:P,allColumnIds:F,rowIndex:n,get rowHasSelectedCells(){return M===void 0&&(M=e.hasSelectedCells(P)),M}},A=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),D=typeof m=="function"?m(_):m,O;c?.className&&(O=Da(c.className,d)),h&&(O=te(O,Da(h,d))),t.className&&(O=te(O,Da(t.className,d))),A&&(O=te(O,hc({align:l})));let L;e.dataSourceHasGrouping&&t.groupByForColumn&&(L=bc({rowInfo:e,column:t})),A&&(L=bg({rowInfo:e})),f&&(L=typeof f=="function"?{...L,...f(_)}:{...L,...f}),p&&(L=Aa(L,p,d)),c?.style&&(L=Aa(L,c.style,d)),t.style&&(L=Aa(L,t.style,d)),L=L||{},L.height=i,L.zIndex=`var(${gg}-${t.computedVisibleIndex})`,L.visibility=`var(${yg}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,se=!1,Z=!1,Me=!1;if(T&&w){let Oe=x(),Se=Oe[e.indexInAll-1],Fe=Oe[e.indexInAll+1],ce=R[t.computedVisibleIndex+1],ee=R[t.computedVisibleIndex-1];G=Se?!T.isCellSelected(Se.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?se=!0:se=ee?!T.isCellSelected(e.id,ee.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Z=!0:Z=ce?!T.isCellSelected(e.id,ce.id):!0,Me=Fe?!T.isCellSelected(Fe.id,t.id):!0}let ge=T&&w?{top:G,left:se,right:Z,bottom:Me}:null,xe=v!=null?a!==v:!1,Ge=te(ge?Tu(ge):"",li(t,[Pt,Lt],Cu,{dragging:!1,insideDisabledDraggingPage:xe,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:w,rowSelected:S,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,D);return{style:L,className:Ge,cellSelectionBorders:ge,zebra:B,columnIsTree:A}}function Cg({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=te(ei.flex,r.align==="end"?Mr.rowReverse:Mr.row,Ll.center,`${Pt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?pc({align:a}):null);return c?r.field?(0,mn.h)("div",{class:f},[d,(0,mn.h)("div",{class:Tt},[l??null])]):d?(0,mn.h)("div",{class:f},[d]):null:(0,mn.h)("div",{class:f},[u,d,(0,mn.h)("div",{class:Tt},[l??null])])}}function Tg({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return oc(s)?m=(0,mn.h)(fc):p&&(m=(0,mn.h)(An,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function Tc(){return{getGroupColumnRender:Cg,getGroupColumnRenderGroupIcon:Tg}}function Sc(o,t,e){return gc(o,t,e,Tc())}function wc(o,t,e){return yc(o,t,e,Tc())}function vc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=Sc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=wc({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?Cn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function Ic(o){return typeof o.field=="string"}function Rc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Kt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=io({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),w=lt(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:w,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}}function xc(o){return Dc(o.column,o.rowInfo)}function Pc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=Rc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=io(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Sg({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function Sg(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:S}=C,w=Rc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,x=S?.isCellSelected(n.id,t.id)??!1,R={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:x,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:w,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function wg(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function Dc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:Ic(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&Ic(o)&&(a=wg(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function vg(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function io(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=Dc(t,e),a=vg(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function _a(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function Ac(o,t){let e=_a(o,t);return e===-1?null:Kt({...o,rowIndex:e,columnId:t.columnId})}function zo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function Ma(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Zi(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function Ea(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function _c(o,t,e){if(Ea(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let S=h;S<=y;S++){let w=b*n+S;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:w,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:w,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:w,colIndex:T})}return C}function Ig(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var Fa=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??fn(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Be(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=fn(l,this.getDataSourceState),y=fn(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[S,w]=Zi({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=S.rowIndex;T<=w.rowIndex;T++)for(let x=S.colIndex;x<=w.colIndex;x++){let R={rowIndex:T,colIndex:x},[E,N]=this.getCellSelectionPosition(R);n?a.selectCell(E,N):a.deselectCell(E,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=Si(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Ig(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Be(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Be(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Be:new Be(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Be(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Be(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Be(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function Mc(o){return new Fa(o)}function Ec(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new bt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new bt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function hn(o,t,e){return Math.min(Math.max(o,t),e)}function Xi(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return hn(a,i,r)}function Rg(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,S={ArrowDown:()=>{f=Xi(n,f,1)},ArrowUp:()=>{f=Xi(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let x=c.rowsPerPage;f-x>=C?f=f-x:S.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let x=c.rowsPerPage;f+x<=b?f=f+x:S.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},w=S[l];return w?(w(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function Na(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),S=C-h-1,w=b-y-1,T=r().dataArray.length-1,x=i().computedVisibleColumns.length-1,R=0,E=0;m=hn(m,0,T),p=hn(p,0,x);let N={ArrowDown:()=>{m=hn(m+1,R,T)},ArrowUp:()=>{m=hn(m-1,R,T)},ArrowLeft:()=>{if(p===E)if(m!==R&&(p=x),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;m-P>=R?m=m-P:N.ArrowUp()}else N.ArrowUp();else p=hn(p-1,E,x)},ArrowRight:()=>{if(p===x)if(m!==T&&(p=E),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;m+P<=T?m=m+P:N.ArrowDown()}else N.ArrowDown();else p=hn(p+1,E,x)},Enter:()=>{let P=d[m];return P&&P.isGroupRow?e.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&e.rowDetailApi.isRowDetailEnabledForRow(P.id)?e.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{u?p=Math.min(p+w,x):m=Math.min(m+S,T)},PageUp:()=>{u?p=Math.max(p-w,E):m=Math.max(m-S,R)},End:()=>{u?p=x:m=T},Home:()=>{u?p=E:m=R}},v=N[l];return v?(v(),[m,p]):!1}function xg(o,t){let e=Na(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var Pg={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Fc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!Pg[e]?!1:r!=null&&l==="row"?Rg(o,t):a!=null&&l==="cell"?xg(o,t):!1}var Oa=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Xi(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=Na(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function Nc(o){return new Oa(o)}function Oc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var ka=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=_a({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Kt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Kt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Kt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=lt(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=io({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new St(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new St(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[sn,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||Yn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=$.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=qt())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=Nl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=Nc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=Ec({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=Mc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Ma(e),t?.()),setTimeout(()=>{this.isDestroyed()||(Ma(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??xc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Kt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(qn);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Ut){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let S=C?Cn(p,C):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[Ut]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!Oc(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:Oc(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(qn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function kc(o){return new ka(o)}function Lc(o,t){return o<t?[o,t]:[t,o]}var Ji=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=Lc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=Lc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var Qi=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!Ea(t,e,i)){_c(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=Zi(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};var Jt=require("vue");var zc=on("CSSVariableWatch"),Vc=nn("CSSVariableWatch"),Gc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var Vo=(0,Jt.defineComponent)({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return(0,Jt.onMounted)(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,Vc(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):zc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Qn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),(0,Jt.onBeforeUnmount)(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return(0,Jt.h)("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Gc},[(0,Jt.h)("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var La=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function Kc(o,t){za(o,t),Ag(o,t),t.detail===2&&Dg(o,t),o.getState().onCellClick?.(o,t)}function Dg(o,t){if(Io(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Ag(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Be(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let S=!!n().wrapRowsHorizontally;c.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:S})}else c.resetClick(b);l.cellSelection=C}function za(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:d}=i(),s=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=s;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(d&&!t.key)return!1;let{rowSelection:y}=s;if(y=l(y),u.rowSelectionState=y,y&&typeof y=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=y,!0}else if(c==="single-row"){let C=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(C):a.rowSelectionApi.selectRow(C)}return!1}function Bc(o,t){t.detail!==2&&void 0}var _g={Enter:!0," ":!0,a:!0};function Hc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:d,ctrlKey:s,metaKey:c}=t;if(!_g[d])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:y,keyboardSelection:C}=f,{selectionMode:b,groupBy:S,rowSelection:w,treeSelectionState:T,isTree:x}=m;if(C===!1)return!1;let R=y==="row"&&p!=null?p:y==="cell"&&h!=null?h[0]:null,E=R!=null?m.dataArray[R]:null;if(!E||R==null)return!1;if(b==="single-row"&&d===" ")return r.rowSelectionApi.toggleRowSelection(E.id),!0;if(b!=="multi-row")return!1;if(d==="a"&&(s||c)){if(x&&T){let v=u(T);return v.selectAll(),i.treeSelection=v,!0}let N=l(w);return N.selectAll(),i.rowSelection=N,!0}if(d===" "){if(S.length)return E.isGroupRow&&E.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(E.groupKeys):r.rowSelectionApi.toggleRowSelection(E.id),!0;if(x){if(E.isTreeNode&&E.nodePath)return a.treeApi.toggleNodeSelection(E.nodePath),!0}else{let N={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(N.metaKey=!1,N.ctrlKey=!0),za({...o,rowIndex:R},N)}}return!1}var Wc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),jc=o=>Array.from(o.querySelectorAll(Wc)).filter(e=>!!e.offsetParent),Va=o=>o.querySelector(Wc);var Uc=po(Kn());async function $c(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Mg=10,Eg=(o,t)=>o-t;function Ga(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=lt(f.id,t);return f.contentFocusable({column:f,...io({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function qc(o,t,e){let n=e.getState().editingCell;return Fg(o,t,e,{isCellFocusable:Ga,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Yc(o,t,e){let n=(0,Uc.default)(e,o+t,Eg);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Yc;function Fg(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:Yc(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function Zc([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Mg,l=null,u=!1;function d(s=0){s++,yn(l),l=Ke(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await $c(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var Ng=`.${Pt}`;function Xc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:Vn(n,Ng),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&Ga({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:qc({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=jc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return Zc([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;Va(s)?.focus()}),!0}var Jc={control:"ctrl"},Qc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},Og={esc:"escape"},tf={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},nf=Object.keys(tf),Ka=new Set(nf),kg=new Set(["shift","alt"]);function of(o,t){return Array.isArray(t)?t.some(e=>ef(o,e)):ef(o,t)}function ef(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>Qc[f]),r=n.map(f=>Jc[f]||Qc[f]||Og[f]||f),a=r.filter(f=>Ka.has(f)),l=r.filter(f=>!Ka.has(f)),u=nf.reduce((f,m)=>(f[m]=tf[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!kg.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Ka.has(e)||e==="meta"||Jc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function rf(o,t){let e={...o,cloneRowSelection:a=>Qo(a,o.getDataSourceState),cloneTreeSelection:a=>vi(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Hc(e,t)&&t.preventDefault(),(Xc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&Fc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!of(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}var nr=require("vue");var Ne=require("vue");var er="__is_infinite_menu_component";function Ba(o){return!!o.tagName}function sf(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ee.from(Ba(t)?t.getBoundingClientRect():t),a=Ee.from(Ba(e)?e.getBoundingClientRect():e),l=n?Ee.from(Ba(n)?n.getBoundingClientRect():n):null;if(!l)return{...af({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=af({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function af(o){let t=Ee.from(o.targetRect),e=Ee.from(o.anchorRect),n=o.constrainRect?Ee.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=lf(t,r),u=lf(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function lf(o,t){return t==="TopLeft"?Je.from({top:o.top,left:o.left}):t==="TopCenter"?Je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?Je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?Je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?Je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?Je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?Je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function Lg(o){return o&&typeof o.then=="function"||o instanceof Promise}function df(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function uf(o){return typeof o=="function"&&(o=o()),Lg(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&df(o)&&(o=o.getBoundingClientRect()),o?Ee.from(o):null}async function cf(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),df(n)&&(i=n),i||null}return e(await t)}async function Ha(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await uf(e)||void 0,a=n?await uf(n):void 0,l=Ee.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=sf({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var zg=(0,Ne.defineComponent)({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Ha(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Ha(t,a)})};return(0,Ne.onMounted)(()=>i(o.handle)),(0,Ne.watch)(()=>o.handle,i),(0,Ne.onBeforeUnmount)(()=>{n?.()}),()=>(0,Ne.h)("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function Vg(o){return(0,Ne.isVNode)(o)?o.props?.id||o.key:null}function Gg(o,t,e){if((0,Ne.isVNode)(o)&&o.type?.[er]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),(0,Ne.cloneVNode)(o,n)}return o}function Dt(o){let t=o,e=new Map,n=(0,Ne.shallowRef)(e),i=()=>(0,Ne.triggerRef)(n),r=(d,s)=>{let f=`${s.id||Vg(d)||qt()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return Gg(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let S=p(C);Object.assign(m,{children:S}),i(),!!b?.skipRealign||(0,Ne.nextTick)(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:he()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:(0,Ne.defineComponent)({name:"OverlayPortal",setup(){let d=(0,Ne.shallowRef)(null),{portalContainer:s}=t;return s&&(async()=>{let c=await cf(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push((0,Ne.h)(zg,{handle:m,key:m.key}));return s?d.value?(0,Ne.h)(Ne.Teleport,{to:d.value},c):null:s===null||s===!1?c:(0,Ne.h)("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}var If=require("vue");var We=require("vue");var ff="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",pf=Ie({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),mf="db3arf1",hf="db3arfd";var gf="submenu",Kg="-";function yf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:qt(),focused:!1,destroyed:!1,domRef:{current:null}}}function bf(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Bg=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===Kg?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},Hg=[{name:"label"}],Cf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||Hg],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>Bg(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==gf)&&c.push({name:gf,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function Tf(o,t){let e=Sf(o,t);if(!e.length)return null;let n=Ee.from(e[0]?.getBoundingClientRect()),i=Ee.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function Sf(o,t){let e=Vn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function wf(o,t){let e=Sf(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var Go=class extends zn{constructor(t){super(t.slice(0,3))}};var Wg=250;function jg(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Ke(r)};Ke(()=>{r()})})}var $g=ze(),tr=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||Wg;this.getPointerMoveTarget=()=>document.documentElement||$g;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new Je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new Go([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Go([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,jg(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new Je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var Ug={renderSeparator:()=>(0,We.h)("hr",{class:hf}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?(0,We.h)("div",o,[(0,We.h)(An,{expanded:!1})]):(0,We.h)("div",o))},{useManagedComponent:qg}=En({initSetupState:yf,forwardProps:()=>bf(),mapPropsToState:o=>Cf(o,Ug),debugName:"Menu"}),Yg=(0,We.defineComponent)({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=(0,We.ref)(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=(0,We.h)("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:te(pf({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):(0,We.h)("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return(0,We.h)("div",{class:mf},[u])}}}),At=(0,We.defineComponent)({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=qg(o),n=e.state,i=e.componentActions,r=()=>n.value,a=P=>{i.keyboardActiveItemKey=P},l=P=>{i.activeItemKey=P},u=!1,d=()=>u,s=null,c=P=>{s=P},{showOverlay:f,portal:m,clearAll:p}=Dt({portalContainer:!1}),h=()=>{let P=r();P.onHideIntent?.(P)},y=()=>{i.focused=!0,setTimeout(()=>{let P=r().domRef.current;b&&P&&P===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,S={hideMenu:h,focus:()=>{let P=r().domRef.current;P&&(P.focus(),setTimeout(()=>{let F=r().domRef.current;F&&F!==document.activeElement&&F.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},w=(P,F)=>{a(F.key),l(F.key),F.originalMenuItem.onClick&&F.originalMenuItem.onClick(P);let M={key:F.key,item:F.originalMenuItem,hideMenu:h};F.originalMenuItem.onAction&&F.originalMenuItem.onAction(M);let{onAction:_}=r();_&&_(M),F.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:x}=new tr({parentMenuId:r().parentMenuId,onItemActivate:P=>{d()&&l(P)},itemHasSubMenu:P=>!!r().runtimeItems.filter(M=>M.type==="item"&&M.key===P&&M.menu)[0],getMenuRectFor:P=>{let F=`[data-submenu-for="${P}"]`,M=document.querySelector(F);if(M)return Ee.from(M.getBoundingClientRect())}}).getHandlers(),R=P=>{let F=r().menuId,M=`${F}-submenu`,_=P.menu;return _?(typeof _=="function"&&(_=_()),(0,We.h)(At,{key:M,parentMenuItemKey:P.key,parentMenuId:F,constrainTo:r().constrainTo,..._,autoFocus:!1,onShow:(A,D)=>{_?.onShow?.(A,D),c(D)},onHideIntent:A=>{_?.onHideIntent?.(A),h()},onHide:A=>{A.focused&&(l(null),a(P.key),S.focus())}})):null};(0,We.watch)(()=>n.value.activeItemKey,P=>{let{runtimeItems:F,menuId:M,constrainTo:_}=r(),A=F.filter(O=>O.type==="item"&&P===O.key)[0];if(!A||!A.menu){c(null),p();return}let D=Tf(M,A.key);D&&f(()=>R(A),{id:`${M}-submenu`,alignTo:D,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:_})},{flush:"post"});function E(P){let{runtimeItems:F,runtimeSelectableItems:M,keyboardActiveItemKey:_}=r(),A=F.findIndex(B=>B.type==="item"&&B.key===_),D=_,O=F[A],L={ArrowUp:()=>{let B=F.slice(0,A).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(D=B.key)},ArrowDown:()=>{let B=F.slice(A+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(D=B.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{D=M[0].key},PageDown:()=>{D=M[M.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Ke(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){L.ArrowLeft();return}l(O.key)}else w(P,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||w(P,O);let B=wf(r().menuId,O.key);B&&B.click()},Escape:()=>{L.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=L[P.key];K&&(K(),P.preventDefault()),D!=_&&a(D)}let N=!1,v=P=>{let F=P??null;F&&!N?(N=!0,r().domRef.current=F,u=!0,r().onShow?.(r(),S),r().autoFocus&&S.focus()):!F&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):F&&(r().domRef.current=F)};return(0,We.onBeforeUnmount)(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let P=r(),{columns:F,runtimeItems:M,menuId:_,activeItemKey:A,keyboardActiveItemKey:D,destroyed:O,wrapLabels:L,parentMenuItemKey:K}=P;if(O)return null;let B=M.map((Z,Me)=>(0,We.h)(Yg,{key:Z.type==="item"?Z.key:Me,columns:F,item:Z,index:Me,active:Z.type==="item"&&Z.key===A,keyboardActive:Z.type==="item"&&Z.key===D,onItemEnter:(ge,xe)=>T(ge.key,xe),onItemLeave:(ge,xe)=>x(ge.key,xe),onItemClick:w})),G=F.map(Z=>Z.width||(typeof Z.flex=="number"?`${Z.flex}fr`:Z.flex)||"auto").join(" "),se={...t.style,gridTemplateColumns:G,gridTemplateRows:M.map(()=>"auto").join(" ")};return L||(se.whiteSpace="nowrap"),(0,We.h)("div",{class:ei.contents},[(0,We.h)("div",{...t,"data-menu-id":_,"data-submenu-for":K,tabindex:0,ref:v,onKeydown:E,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:te(ff,t.class,"InfiniteMenu"),style:se},B),(0,We.h)(m)])}}});At[er]=!0;var Wa=require("vue");function vf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||dn,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=vo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Wa.h)(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=vo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Wa.h)(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function Rf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??At,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:lt(u.id,t),...t},s=vf([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:(0,If.h)(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function Zg(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${Ru}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>Rf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function xf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return(0,nr.watch)([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),Zg({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),(0,nr.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var ir=require("vue");var Ko=require("vue");function Pf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??At,m=n().computedColumnsMap.get(o);if(!m)return null;let p=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(R=>{let E=R.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===E:E===C.defaultOperator,v=R.components?.Icon??Nn;return{key:E,icon:(0,Ko.h)(v),label:R.label??R.name,onAction:()=>{d.setColumnFilterOperator(o,E)},checked:N?(0,Ko.h)(yu,{size:16}):null}}),w=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:(0,Ko.h)(bu),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},x=c?c(w,T):w;return(0,Ko.h)(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:x,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:R=>{h(R),e?.()}})}var or=10;function Df(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ee.from(m.getBoundingClientRect());p.top-=or,p.left-=or,p.width+=2*or,p.height+=2*or,r(()=>Pf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return(0,ir.watch)(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,ir.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var ro=require("vue");var Bo=require("vue");function rr(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function ja(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function Af(o,t,e){if(!o)return null;let n=he();return o.then(i=>{let{items:r,columns:a}=rr(i);r&&r.length&&n((0,Bo.h)(e,{...t,items:r||[],columns:a}))}),(0,Bo.h)(pn,{updater:n})}function _f(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??At,{computedColumnsMap:c}=a(),f=c.get(n),m={...Kt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=ja({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:Af(h,p,s),preventDefault:y};let{items:C,columns:b}=rr(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:(0,Bo.h)(s,{...p,columns:b,items:C}),cellContext:m}}function Mf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??At,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Kt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=ja({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:Af(f,c,l),preventDefault:m};let{items:p,columns:h}=rr(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:(0,Bo.h)(l,{...c,columns:h,items:p}),cellContext:s}}var ar=5,Ef=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Ff(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=Dt({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=_f(s,t,f),y=Ee.fromPoint({top:c.clientY,left:c.clientX});y.width+=ar,y.height+=ar,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Ef}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return(0,ro.watch)(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),(0,ro.onBeforeUnmount)(()=>{d()}),{MenuPortal:l}}function Nf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=Mf(d,t,c),h={top:s.clientY,left:s.clientX},y=Ee.fromPoint(h);y.width+=ar,y.height+=ar,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Ef}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return(0,ro.watch)(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,ro.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var Ye=require("vue");var Of="mlx2t3";var lr=require("vue"),kf=(0,lr.defineComponent)({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>(0,lr.h)("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Lf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},zf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Vf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Gf="_1ueijco1",Kf="_1ueijco0 _16lm1iw0";var Bt=require("vue");var Bf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Lf[`${o}`]:t=te(zf[`${o.horizontal}`],Vf[`${o.vertical}`]),t};var Xg="InfiniteVirtualScrollContainer",Hf=(0,Bt.defineComponent)({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=(0,Bt.ref)(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return(0,Bt.onMounted)(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),(0,Bt.onBeforeUnmount)(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>(0,Bt.h)("div",{...e,ref:n,tabindex:o.tabIndex,class:te(e.class,Xg,Kf,Bf(o.scrollable))},t.default?.())}});var ut=require("vue");var sr=(0,ut.defineComponent)({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=(0,ut.computed)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Lo(o.brain));(0,ut.watchEffect)(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),(0,ut.watchEffect)(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return(0,ut.onMounted)(n),(0,ut.watch)(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),(0,ut.onBeforeUnmount)(()=>{e?.(),e=null}),()=>(0,ut.h)(pn,{name:o.name,updater:t.value.onRenderUpdater})}});var ur=[Su,`${Ve}DetachedCell`];var dt=require("vue");var Wf=Ie({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),dr="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:Jg}=He,Qg=`${Jg}-ActiveCellIndicator`,ey=U(j.columnZIndexAtIndex),jf=(0,dt.defineComponent)({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=(0,dt.ref)(null),e=(0,dt.ref)(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Gn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return(0,dt.onMounted)(()=>{r(o.brain),n()}),(0,dt.watch)(()=>o.brain,r),(0,dt.watch)([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),(0,dt.onBeforeUnmount)(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return(0,dt.h)("div",{class:dr,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${ey}-${o.activeCellIndex[1]})`}:void 0},[(0,dt.h)("div",{"data-name":"active-cell-indicator",class:`${Qg} ${Wf({visible:a})}`})])}}});var ct=require("vue");var $f=Ie({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:ty}=He,ny=`${ty}-ActiveRowIndicator`,oy=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,iy={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${oy}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Ae.runtime.totalVisibleColumnsWidthVar},Uf=(0,ct.defineComponent)({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=(0,ct.ref)(null),e=(0,ct.ref)(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Ae.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Gn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Gn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return(0,ct.onMounted)(()=>{l(o.brain),n()}),(0,ct.watch)(()=>o.brain,l),(0,ct.watch)([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),(0,ct.onBeforeUnmount)(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return(0,ct.h)("div",{class:dr,"data-name":"active-row"},[(0,ct.h)("div",{ref:t,"data-name":"active-row-indicator",class:`${ny} ${$f({active:u})}`,style:u?iy:void 0})])}}});var ry=te(Of,Gf),qf=(0,Ye.defineComponent)({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=(0,Ye.ref)(null),n=(0,Ye.shallowRef)({width:0,height:0});(0,Ye.watch)(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=Qn(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return(0,Ye.onMounted)(()=>{u(o.brain),d()}),(0,Ye.watch)(()=>o.brain,s=>{u(s),d()}),(0,Ye.watch)(()=>o.wrapRowsHorizontally,()=>{d()}),(0,Ye.onBeforeUnmount)(()=>{a?.(),l?.()}),()=>(0,Ye.h)(Hf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[(0,Ye.h)("div",{ref:e,class:ry,"data-name":"scroll-transform-target"},[(0,Ye.h)(sr,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:ur}),o.activeCellIndex!=null?(0,Ye.h)(jf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?(0,Ye.h)(Uf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,(0,Ye.h)(kf,{width:n.value.width,height:n.value.height})]})}});var Yf="_16lm1iw1 _16lm1iw1c _16lm1iwe";var ke=require("vue"),tp=require("vue");var Xf=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Jf(o){return typeof o=="function"}function Zf(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return Xf;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function Qf(o,t,e){let n=Zf(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=Zf(o,t);i!==Xf&&(Object.is(i,n)||(n=i,e()))})}var cr=require("vue");function $a(){let{api:o,getState:t}=qe(),e=ao(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var ep=(0,cr.defineComponent)({name:"InfiniteTableColumnEditor",setup(){let{state:o}=qe(),t=$a(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,(0,cr.h)("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:te(kl,Hl.none),type:"text"}))}});var ay=U(j.columnWidthAtIndex),ly=U(j.columnReorderEffectDurationAtIndex),qa=Symbol("InfiniteColumnCell");function ao(){return(0,tp.inject)(qa)}var sy=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return(0,ke.h)(An,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},uy={display:"inline-block",visibility:"visible"},Ua=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return(0,ke.h)(An,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:uy,expanded:n,onChange:e})},dy=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,d=l?.CheckBox||dn;return(0,ke.h)(d,{domProps:{class:fi},disabled:t.isTreeNode?!u(t):!1,onChange:s=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,s??!1);return}if(t.isGroupRow){i();return}s?e():n()},checked:t.rowSelected})},cy=(0,ke.defineComponent)({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return(0,ke.provide)(qa,(0,ke.computed)(()=>o.renderParam)),()=>o.content}});function _t(o,t){let e=o(t);return e==null?e:(0,ke.h)(cy,{renderParam:t,content:e})}var np=(0,ke.defineComponent)({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=(0,ke.shallowRef)(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;(0,ke.watch)([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=(0,ke.shallowRef)(0),a=null;(0,ke.watch)([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,Jf(s)&&(a=Qf(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),(0,ke.onBeforeUnmount)(()=>{i?.(),i=null,a?.(),a=null});let l=(0,ke.shallowRef)(null);(0,ke.provide)(qa,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return(0,ke.h)("div",{ref:e,style:{display:"none"}});let{getState:S,getDataSourceState:w}=h,{activeRowIndex:T,keyboardNavigation:x,columnReorderInPageIndex:R}=S(),E=c===T&&x==="row",N=b.rowDisabled,{rowSelected:v}=b,P=o.getComputedVisibleColumns().map(W=>W.id),F=Pc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:P,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:M,renderParams:_,formattedValueContext:A,renderFunctions:D,groupByColumnReference:O,inEdit:L}=F,{align:K,verticalAlign:B}=_,G=_;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:se}=w(),Z=G.cellSelected,Me=w().cellSelection??null,ge=null;if(!m&&!L){if(D.renderGroupIcon&&(G.renderBag.groupIcon=_t(D.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),D.renderSelectionCheckBox&&se=="multi-row"&&(G.renderBag.selectionCheckBox=_t(dy,G),D.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=_t(D.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:Pe}=b,ve;ve=(Pe?D.renderTreeIconForParentNode:D.renderTreeIconForLeafNode)||typeof D.renderTreeIcon=="function"?D.renderTreeIcon:Pe&&D.renderTreeIcon===!0?Ua:void 0,ve===!0?ve=Ua:ve&&(G.renderBag.treeIcon=_t(Ua,G)),ve&&(G.renderBag.treeIcon=_t(ve,{...G,renderBag:{...G.renderBag}}))}D.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=_t(sy,{...G,renderBag:{...G.renderBag}}),typeof D.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=_t(D.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),D.renderValue&&(G.renderBag.value=_t(D.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&D.renderGroupValue&&(G.renderBag.value=_t(D.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&D.renderLeafValue&&(G.renderBag.value=_t(D.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let W=G.renderBag.value;W instanceof Date&&(W=W.toLocaleDateString());let re=G.renderBag,we=[K!=="end"?re.treeIcon:null,K!=="end"?re.groupIcon:null,K!=="end"?re.rowDetailsIcon:null,K!=="end"?re.selectionCheckBox:null,W,K==="end"?re.selectionCheckBox:null,K==="end"?re.rowDetailsIcon:null,K==="end"?re.groupIcon:null,K==="end"?re.treeIcon:null];ge=s.render?_t(s.render,{...G,renderBag:{...G.renderBag,all:we}}):we}let{style:xe,className:Ge}=Cc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:M,formattedValueContext:A,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:E,rowDisabled:N,rowSelected:v,cellSelected:Z,cellSelection:Me,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:R}),Oe=s.computedVisibleIndex,Se=s.cssEllipsis??!0,Fe={width:`var(${ay}-${Oe})`,transition:`transform var(${ly}-${Oe}, 0s)`,...xe,height:typeof xe.height=="number"?`${xe.height}px`:xe.height},{onRowMouseEnter:ce,onRowMouseLeave:ee}=o.renderingContext.getState(),H=ce||o.onMouseEnter?W=>{ce?.({...A,rowIndex:c},W),o.onMouseEnter?.(W)}:void 0,q=ee||o.onMouseLeave?W=>{ee?.({...A,rowIndex:c,rowInfo:b},W),o.onMouseLeave?.(W)}:void 0,J={ref:e,style:Fe,"data-column-id":s.id,"data-z-index":Fe.zIndex,"data-row-id":`${b.id}`,class:te(Ge,Lt,di),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:q},ne=(0,ke.h)("div",{class:te(`${Lt}_content`,Se?Tt:ti.hidden)},[ge]),ie=s.components?.Editor??ep,ye=L?(0,ke.h)(ie):null,be=ye?[ne,ye]:[ne],oe=s.components?.ColumnCell;return oe?(0,ke.h)(oe,J,{default:()=>be}):(0,ke.h)("div",J,be)}}});var gn=require("vue");var op=Ie({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function fy(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function py(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=vd(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function ip(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function rp(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:Ft(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}fy(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&py(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:my}=He,hy=`${my}RowDetail`,fr=(0,gn.defineComponent)({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=Jn(),{getState:n}=qe(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=ip(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:rp({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=(0,gn.shallowRef)(i());(0,gn.watch)(()=>o.rowInfo.id,()=>{r.value=i()}),Dd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,(0,gn.h)("div",{ref:a,class:te(hy,op({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Ya=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function gy(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function ap(o){let t=new Ya;return{computedRowHeight:gy(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}var et=require("vue");function lp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,S,w=C;for(;b;){let T=t[b];if(T){h.add(b);let x=[f,...h];S=y.has(b)?r.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(x,S),r.set(b,S)),S.columnItems.push(C),S.uniqueGroupId.push(C.id),w&&!y.has(w.id)&&S.children.push(w),w=S,b=T.columnGroup}else break}});let l=[],u=new $,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&sp(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function sp(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&sp(e.children),t+=n})}var lo=require("vue");var _n=require("vue");var{rootClassName:yy}=He,by=`${yy}HeaderCell_ResizeHandle`,up=(0,_n.defineComponent)({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=(0,_n.ref)(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=Fu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((S,w)=>S+w.computedWidth-w.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Ae.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return(0,_n.h)("div",{ref:d=>{t.current=d??null},class:`${by} ${mi} ${gi({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[(0,_n.h)("div",{style:{...u,...o.draggerStyle},class:hi({constrained:e.value})})])}}});var dp=`${Ve}HeaderGroup`,cp=U(j.columnWidthAtIndex),Cy=U(j.columnZIndexAtIndex),fp=(0,lo.defineComponent)({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=qe(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...d[S.id],flex:S.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return Ts({availableSize:Qr(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(S=>`var(${cp}-${S.computedVisibleIndex})`).join(" + ")+" )":`var(${cp}-${m.computedVisibleIndex})`,h=`calc(var(${Cy}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(S=>S.computedResizable)?(0,lo.h)(up,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return(0,lo.h)("div",{ref:i,"data-group-id":l.uniqueGroupId,class:te(ss,dp),style:y,"data-z-index":h},[(0,lo.h)("div",{class:te(`${dp}__header-content`,Tt)},[c]),b])}}});var{rootClassName:Ty}=He,pp=`${Ty}Header`,Sy=[],wy=os({overflow:!1}),mp=(0,et.defineComponent)({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=qe(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=(0,et.computed)(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=(0,et.computed)(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=Yt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return lp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");(0,et.watchEffect)(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),S=a.value,w=l.value,T=u.value,x=p.showColumnFilters,R=p.columnHeaderHeight,E=({rowIndex:P,colIndex:F})=>{let M=h[F],_=1,A=1;if(!M||!T)return{rowspan:_,colspan:A};let D=T.pathsToCells.get([P,F]);if(!D)return{rowspan:_,colspan:A};if(D.type==="column")return{colspan:A,rowspan:S-D.depth};let O=D.columnItems.findIndex(L=>L.id===M.id);return{rowspan:_,colspan:O===0?D.columnItems.length:1}},N=P=>x?P<S-1?R:2*R:R,v=o.headerBrain;(y.length||C.length)&&v.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),v.update({colWidth:b,rowHeight:N,rows:S,cols:h.length,height:w,rowspan:({rowIndex:P,colIndex:F})=>E({rowIndex:P,colIndex:F}).rowspan,colspan:({rowIndex:P,colIndex:F})=>E({rowIndex:P,colIndex:F}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;(0,et.watch)(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),(0,et.onBeforeUnmount)(()=>{f?.(),f=null});let m=Yt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,S=u.value,w=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:x,someRowsSelected:R,selectionMode:E}=h;return N=>{let{rowIndex:v,colIndex:P,domRef:F,height:M,widthWithColspan:_,heightWithRowspan:A,hidden:D}=N,O=y[P];if(!O||D)return null;let L=b.isHorizontalLayoutBrain?b.getPageIndexForRow(v):null,K=S?S.pathsToCells.get([v,P]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Z=>Z.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Z=>Z.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?(0,et.h)(fp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:L,columnGroupsMaxDepth:w,domRef:F,columns:B,width:_,height:M,columnGroup:G}):null}return(0,et.h)(Lu,{key:O.id,domRef:F,column:O,columnsMap:C,horizontalLayoutPageIndex:L,headerOptions:T,width:_,height:A,allRowsSelected:x,someRowsSelected:R,selectionMode:E})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=(0,et.h)("div",{ref:c,class:te(pp,`${pp}--virtualized`,wy),style:{height:`${p}px`}},[(0,et.h)(sr,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:Sy,cellDetachedClassNames:ur})]),b=h.vertical&&Ot()?(0,et.h)("div",{class:ds,style:{zIndex:1e3,width:`${Ot()}px`}}):null;return(0,et.h)("div",{class:`${Br} ${ms}`,style:{height:`${p}px`}},[C,b])}}});var so=require("vue");var hp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},gp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",yp="qy58ya4";var{rootClassName:vy}=He,Za=`${vy}-LoadMask`,pr=(0,so.defineComponent)({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>(0,so.h)("div",{class:`${hp[o.visible?"visible":"hidden"]} ${Za}`},[(0,so.h)("div",{class:`${gp} ${Za}-Overlay`}),(0,so.h)("div",{class:`${yp} ${Za}-Text`},t.default?t.default():"Loading")])}});var bp=o=>`--infinite-${o}`;var Cp=40,Tp=bp(Gs);var vp=He.rootClassName,Xa=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:Iy,injectionKey:Ry}=En({initSetupState:Ud,forwardProps:qd,mapPropsToState:Jd,cleanup:Yd,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Xd(),getParentState:()=>{let o=(0,X.inject)(Xn,null);return o?o.state:null},debugName:"InfiniteTable"});function Sp(o){return t=>o[t]?.computedWidth??0}function wp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var mr=(0,X.defineComponent)({name:"InfiniteTable",props:[...Xa],setup(o,{attrs:t}){let e=Jn();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,I,z){let k=Reflect.get(g,I,z);return I==="rowHeight"?k??Cp:I==="columnHeaderHeight"?k??Tp:I==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=Iy(n);(0,X.provide)(Ry,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{M.toggleGroupRow(g)};(0,X.watch)([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,I=u.value,{columns:z,groupColumnIds:k}=vc({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:I.groupBy,pivotBy:I.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:I.selectionMode});a.columnsWhenGrouping=z;let Y=r.value.columnOrder;if(k.length&&Array.isArray(Y)){let V=new Set(Y),Q=!1;k.forEach(pe=>{V.has(pe)||(Q=!0,Y=[pe,...Y])}),Q&&(a.columnOrder=Y)}},{immediate:!0}),(0,X.watch)(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),(0,X.watch)(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=(0,X.ref)(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};(0,X.watch)(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),(0,X.onBeforeUnmount)(()=>{m?.()}),(0,X.watch)([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:I,domRef:z}=r.value,k,Y,V=!0;typeof I=="object"&&(I.columnsToResize&&(k=new Set(I.columnsToResize)),I.columnsToSkip&&(Y=new Set(I.columnsToSkip)),V=I.includeHeader??V),f=g;let Q=tc(z,{includeHeader:V,columnsToResize:k,columnsToSkip:Y}),pe=Object.keys(Q);if(!pe.length)return;let ue=r.value.columnSizing,me={...ue},le=!1;pe.forEach(Ce=>{me[Ce]={width:Q[Ce]},le=le||me[Ce].width!==ue[Ce]?.width}),le&&(a.columnSizing=me)},{immediate:!0,flush:"post"});let h=(0,X.computed)(()=>Zd(u.value.groupBy));(0,X.watch)([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,I=u.value;if(g.groupRenderStrategy!=="multi-column")return;let z=h.value,k=Qd(g.computedColumns,z),Y=ec({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:I.groupRowsIndexesInDataArray,dataArray:I.dataArray,groupBy:I.groupBy,groupByMap:z});an(g.columnVisibility,Y)||(a.columnVisibility=Y)},{immediate:!0}),(0,X.watch)([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,I=h.value,z=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:Y,hideColumnWhenGrouped:V,computedColumns:Q}=g,pe={...k},ue={...Y},me=!1,le=new Set,Ce=new Set;Object.keys(Q).forEach(De=>{let ae=Q[De];if(ae.defaultHiddenWhenGroupedBy||V!=null)if(ae.defaultHiddenWhenGroupedBy==="*"&&z||(ae.defaultHiddenWhenGroupedBy===!0||V)&&ae.field&&I.get(ae.field)||typeof ae.defaultHiddenWhenGroupedBy=="string"&&I.get(ae.defaultHiddenWhenGroupedBy)||typeof ae.defaultHiddenWhenGroupedBy=="object"&&Object.keys(ae.defaultHiddenWhenGroupedBy).reduce((Ht,Wt)=>Ht||I.has(Wt),!1)){if(ue[De]!==!1){if(k[De]===!1)return;ue[De]=!1,me=!0,le.add(De)}}else ue[De]===!1&&(delete ue[De],me=!0,Ce.add(De))}),me&&(a.columnVisibilityForGrouping=ue,Ce.forEach(De=>{delete pe[De]}),le.forEach(De=>{pe[De]=!1}),a.columnVisibility=pe)},{immediate:!0});let y=Yt(()=>{let g=r.value,I=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,I.filterValue,I.filterTypes,g.sortable,I.sortInfo,I.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,I.groupBy]},()=>{let g=r.value,I=u.value;return xs({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:I.filterValue,filterTypes:I.filterTypes,sortable:g.sortable,sortInfo:I.sortInfo??void 0,multiSort:I.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:I.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:S}=e,w=new Ji({isRowDisabledAt:g=>b().dataArray[g]?.rowDisabled??!1,getIdForIndex:g=>b().dataArray[g]?.id??-1}),T=new Qi({getPrimaryKeyByIndex:S.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),x=(0,X.shallowRef)({vertical:!1,horizontal:!1}),R=null;(0,X.watch)(()=>r.value.brain,g=>{R?.(),R=g.onRenderCountChange(()=>{let{scrollTopMax:I,scrollLeftMax:z}=g,k=I>0,Y=z>0,V=x.value;(V.vertical!==k||V.horizontal!==Y)&&(x.value={vertical:k,horizontal:Y})})},{immediate:!0}),(0,X.watch)(x,g=>{let I=b(),{onScrollbarsChange:z}=l();z&&I.updatedAt&&I.dataArray.length&&z(g),I.notifyScrollbarsChange(g)});let E=null,N=()=>{let g=l(),I=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!E||E.deps.some((z,k)=>z!==I[k]))&&(E={deps:I,value:ap({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),E.value},v=()=>N().computedRowHeight,P=()=>{let g=y.value,I=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,z=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:x.value,multiRowSelector:w,multiCellSelector:T,computedRowHeight:v(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:wp(g.computedVisibleColumns,b),computedPinnedStartOverflow:I?g.computedPinnedStartColumnsWidth>I:!1,computedPinnedEndOverflow:z?g.computedPinnedEndColumnsWidth>z:!1,toggleGroupRow:k=>M.toggleGroupRow(k),columnSize:k=>Sp(g.computedVisibleColumns)(k)}},F=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,M=kc({getComputed:P,getState:l,getDataSourceState:b,getDataSourceMasterContext:F,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:S}),_={getState:l,getDataSourceState:b,getDataSourceMasterContext:F,actions:a,dataSourceActions:e.dataSourceActions,api:M,dataSourceApi:S},A={getComputed:P,getDataSourceMasterContext:F,dataSourceApi:S,api:M,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>vi(g,b),cloneRowSelection:g=>Qo(g,b)},D=l().keyDown.onChange(g=>{rf(A,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,Y=P().computedVisibleColumns[k],V=lt(Y.id,A);I.key="",Kc({...A,rowIndex:z,colIndex:k,column:Y,columnApi:V},I)}),L=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,Y=P().computedVisibleColumns[k],V=lt(Y.id,A);Bc({...A,rowIndex:z,colIndex:k,column:Y,columnApi:V},I)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let I=g?g*1:null;I!=null&&!isNaN(I)&&(a.flashingDurationCSSVarValue=I)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=xf({context:A,state:r}),{MenuPortal:G}=Ff({context:A,state:r}),{MenuPortal:se}=Nf({context:A,state:r}),{MenuPortal:Z}=Df({context:A,state:r}),Me=g=>{let I=l(),z=g.target,k=Vs(z,xa(),I.domRef.current),Y,V,Q,pe;k&&(V=Number(k.dataset.colIndex),pe=Number(k.dataset.rowIndex),Y=P().computedVisibleColumns[V].id,Q=S.getRowInfoArray()[pe].id);let ue={columnId:Y,colIndex:V,rowId:Q,rowIndex:pe,event:g,target:k??g.target};k&&I.cellContextMenu(ue),I.contextMenu(ue)},ge=La(g=>{a.focused=g}),xe=La(g=>{a.focusedWithin=g}),Ge=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(I.focused)return;ge(!0),I.onSelfFocus?.(g),I.focusedWithin&&(xe(!1),I.onBlurWithin?.(g));return}I.focusedWithin||(xe(!0),I.onFocusWithin?.(g))},Oe=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(!I.focused)return;ge(!1),I.onSelfBlur?.(g),I.focusedWithin&&(xe(!1),I.onBlurWithin?.(g));return}I.domRef.current?.contains(g.relatedTarget)||(xe(!1),I.onBlurWithin?.(g))},Se=10,Fe=(g,I)=>{let z=!1,k=null;return(0,X.watch)([g,()=>u.value.dataArray.length],([Y],[V]=[void 0,void 0])=>{if(Y!=null&&Y!==V&&(z=!1,k!=null&&cancelAnimationFrame(k)),Y==null||z)return;let Q=(pe=0)=>{pe++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{z=I(Y),!z&&pe<Se&&Q(pe)})};Q()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ce=Fe(()=>r.value.activeRowIndex,g=>M.scrollRowIntoView(g,{offset:0})),ee=Fe(()=>r.value.activeCellIndex,g=>M.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>Ac({getComputed:P,getState:l,getDataSourceState:b,getDataSourceMasterContext:F,actions:a,dataSourceActions:e.dataSourceActions,api:M,dataSourceApi:S},l().editingCell);(0,X.watch)([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,I,z,k,Y],[V,Q,pe,ue,me])=>{if(g&&g!==V){let le=l().editingCell,{onEditCancelled:Ce}=l();if(Ce){let De=H();De?Ce({...De,initialValue:le.initialValue}):zo("onEditCancelled",le)}}if(I&&I!==Q){let le=l().editingCell,{onEditRejected:Ce}=l();if(Ce){let De=H();De?Ce({...De,value:le.value,error:I,initialValue:le.initialValue}):zo("onEditRejected",le)}}if(z&&z!==pe){let le=l().editingCell,{value:Ce,initialValue:De}=le,{onEditAccepted:ae}=l();if(ae){let Ct=H();Ct?ae({...Ct,value:Ce,initialValue:De}):zo("onEditAccepted",le)}M.persistEdit({value:Ce})}if(k&&k!==ue){let le=l().editingCell;if(le){let Ce=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[Ce]){let De=H();if(!De)zo(Ce,le);else{let ae={...De,value:le.value,initialValue:le.initialValue};k instanceof Error?l().onEditPersistError?.({...ae,error:k}):l().onEditPersistSuccess?.(ae)}}}}!Y&&me&&M.focus()}),(0,X.watchEffect)(()=>{let g=r.value,I=u.value,{computedVisibleColumns:z,computedPinnedStartColumns:k,computedPinnedEndColumns:Y}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:Y.length});let Q=v();V.update({colWidth:Sp(z),rowHeight:Q,rows:I.dataArray.length,cols:z.length,rowspan:wp(z,d)})}),(0,X.watch)(()=>r.value.wrapRowsHorizontally,(g,I)=>{if(I===g)return;let{brain:z,headerBrain:k,renderer:Y,onRenderUpdater:V}=l();z.destroy(),k.destroy(),Y.destroy(),V.destroy();let Q=Pa(nc,!!g);a.brain=Q.brain,a.headerBrain=Q.headerBrain,a.renderer=Q.renderer,a.onRenderUpdater=Q.onRenderUpdater,a.headerRenderer=Q.headerRenderer,a.headerOnRenderUpdater=Q.headerOnRenderUpdater},{flush:"post"});let q=null,J=null,ne=()=>{q&&(clearTimeout(q),q=null),J?.(),J=null};(0,X.watch)([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,I,z,k,Y])=>{ne();let V=e.dataSourceActions;if(!I){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let Q=()=>{let{rowsPerPage:pe,repeatWrappedGroupRows:ue}=d(),me=!1,le=g.rowsPerPage,Ce=(z&&z.length>0||k)&&le>0?le:null;return pe!=Ce&&(V.rowsPerPage=Ce,me=!0),ue!=Y&&(V.repeatWrappedGroupRows=Y??!1,me=!0),me};Q(),J=g.onVerticalRenderRangeChange(()=>{Q()&&(q=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),(0,X.onBeforeUnmount)(ne),(0,X.watch)(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),(0,X.watch)(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,M,{dataSourceApi:e.dataSourceApi});let{onReady:I}=l();I&&I({api:M,dataSourceApi:S})},{immediate:!0,flush:"post"}),(0,X.watch)(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let ie=null,ye=null;(0,X.watch)(()=>r.value.brain,g=>{ie?.(),ie=g.onVerticalRenderRangeChange(I=>{d().notifyRenderRangeChange({renderStartIndex:I[0],renderEndIndex:I[1]})}),ye?.(),ye=g.onRenderRangeChange(I=>{l().onRenderRangeChange?.(I)})},{immediate:!0});let be=1,oe=0,W=null,re=null;(0,X.watch)(()=>r.value.brain,g=>{W?.(),re?.(),W=g.onRenderCountChange(()=>{oe=g.scrollTopMax}),re=g.onScrollStop(I=>{let{scrollTop:z,scrollLeft:k}=I,{onScrollToTop:Y,onScrollToBottom:V,onScrollStop:Q}=l();z===0&&Y?.();let pe=l().scrollToBottomOffset??be;if(z+pe>=oe){V?.();let{livePagination:me,livePaginationCursor:le,dataArray:Ce}=d();me&&(e.dataSourceActions.cursorId=le!==void 0?Date.now():Ce.length)}if(Q){let me=g.getRenderRange();Q({scrollTop:z,scrollLeft:k,renderRange:me,viewportSize:l().bodySize,firstVisibleRowIndex:me.start[0],lastVisibleRowIndex:me.end[0],firstVisibleColIndex:me.start[1],lastVisibleColIndex:me.end[1]})}})},{immediate:!0});let we=null,Pe=null,ve=g=>{we=g,r.value.scrollerDOMRef.current=g,Pe?.(),Pe=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},Pe=Qn(g,I=>{a.bodySize={width:Math.round(I.width),height:Math.round(I.height)}},{debounce:50}))};(0,X.onMounted)(()=>{we&&(a.bodySize={width:we.clientWidth,height:we.clientHeight})}),(0,X.onBeforeUnmount)(()=>{Pe?.(),ie?.(),ye?.(),D(),O(),L(),ce(),ee()});let Xe=()=>b().dataArray,je=()=>y.value.computedColumnOrder,fe=[mc,`${Pt}--hovered`],mt=Yt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let I=[];return g.rowHoverClassName&&(I=I.concat(g.rowHoverClassName)),I=I.concat(fe),I.join(" ").split(" ").map(z=>z.trim()).filter(Boolean)},"hoverClassNames"),rt=Yt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),vt=Yt(()=>{let g=r.value,I=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,I.rowInfoStore,rt.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:I,fieldsToColumn:z}=y.value,k=l(),Y=k.showZebraRows,V=b().rowInfoStore,Q=rt.value;return pe=>{let{rowIndex:ue,colIndex:me,domRef:le,hidden:Ce,width:De,heightWithRowspan:ae,onMouseEnter:Ct,onMouseLeave:Ht}=pe,Wt=Xe()[ue],Et=g[me];if(!Wt||!Et)return null;let Ue=!1,jt=k.isRowDetailEnabled,$t=k.isRowDetailExpanded;!jt||typeof jt=="function"&&!jt(Wt)?Ue=!1:$t&&(Ue=$t(Wt)?"expanded":"collapsed");let fo=M.isEditorVisibleForCell({rowIndex:ue,columnId:Et.id});return(0,X.h)(np,{key:`${ue}:${Et.id}`,rowIndex:ue,rowHeight:ae,width:De,hidden:Ce,domRef:le,column:Et,columnsMap:I,fieldsToColumn:z,showZebraRows:Y,rowDetailState:Ue,inEditMode:fo,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(ue):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(ue):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:Et.repaintCellsKey!==void 0?Et.repaintCellsKey:k.repaintCellsKey,getData:Xe,rowInfoStore:V,renderingContext:_,getComputedVisibleColumns:C,getComputedColumnOrder:je,dataSourceStatePartial:Q,onMouseEnter:Ct,onMouseLeave:Ht})}},"body.renderCell"),Mt=Yt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),I=g.isRowDetailExpanded,z=g.rowDetailRenderer;if(!I||!z)return;let k=g.rowDetailCache;return Y=>{let{rowIndex:V,domRef:Q}=Y,ue=Xe()[V],me=N().computedRowSizeCacheForDetails;if(!ue||!I(ue)||!me)return(0,X.h)("div",{ref:Q,class:Ul.hidden});let{rowDetailHeight:le,rowHeight:Ce}=me.getSize(V);return(0,X.h)(fr,{rowInfo:ue,rowDetailsCache:k,rowIndex:V,domRef:Q,detailOffset:Ce,rowDetailHeight:le,rowDetailRenderer:z})}});return(0,X.provide)(Bn,{state:r,getState:l,actions:a,api:M,getComputed:P,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,I=y.value,z=Js({computedVisibleColumns:I.computedVisibleColumns,computedPinnedStartColumns:I.computedPinnedStartColumns,computedPinnedEndColumns:I.computedPinnedEndColumns,computedPinnedStartColumnsWidth:I.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:I.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:I.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:x.value}),k=g.focused,Y=g.focusedWithin,V=I.computedPinnedStartWidth??I.computedPinnedStartColumnsWidth,Q=I.computedPinnedEndWidth??I.computedPinnedEndColumnsWidth,pe=V?I.computedPinnedStartColumnsWidth>V:!1,ue=Q?I.computedPinnedEndColumnsWidth>Q:!1,{autoFocus:me,tabIndex:le,className:Ce,class:De,style:ae,onKeyDown:Ct,onKeydown:Ht,...Wt}=g.domProps??{},Et=te(t.class,Ce,De,Ve,Fs,g.wrapRowsHorizontally?`${Ve}--horizontal-layout`:null,I.computedPinnedStartColumnsWidth?`${Ve}--has-pinned-start ${Os}`:null,I.computedPinnedEndColumnsWidth?`${Ve}--has-pinned-end ${Ns}`:null,k?`${Ve}--focused`:null,Y?`${Ve}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,Y&&g.focusedWithinClassName?g.focusedWithinClassName:null,pe?`${Ve}--has-pinned-start-overflow`:null,ue?`${Ve}--has-pinned-end-overflow`:null,ks({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!I.computedPinnedStartColumnsWidth,hasPinnedEnd:!!I.computedPinnedEndColumnsWidth,focused:k,focusedWithin:Y})),Ue={...t.style,...ae,...z};k&&g.focusedStyle&&Object.assign(Ue,g.focusedStyle),Y&&g.focusedWithinStyle&&Object.assign(Ue,g.focusedWithinStyle);let jt=Ht??Ct,$t=jt?Qt=>{K(Qt),jt(Qt)}:K,fo=u.value.loading;return(0,X.h)("div",{...t,...Wt,ref:Qt=>{g.domRef.current=Qt??null},"data-debug-id":g.debugId,class:Et,style:Ue,onKeydown:$t,onFocusin:Ge,onFocusout:Oe},[g.header?(0,X.h)(mp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,(0,X.h)("div",{class:te(Yf,Kr),onContextmenu:Me},[(0,X.h)(qf,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:vt.value,renderDetailRow:Mt.value,cellHoverClassNames:mt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:ve,tabIndex:le??0,autoFocus:!!me,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||v()}),(0,X.h)(pr,{visible:!!fo},()=>g.loadingText)]),(0,X.h)("div",{ref:Qt=>{g.portalDOMRef.current=Qt??null},class:te(`${Ve}Portal`,ql[1e7],Wl.absolute,jl[0],Bl[0])},[(0,X.h)(B),(0,X.h)(G),(0,X.h)(se),(0,X.h)(Z)]),g.rowHeightCSSVar?(0,X.h)(Vo,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,(0,X.h)(Vo,{key:"flashing-duration",allowInts:!0,varName:Ae.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?(0,X.h)(Vo,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?(0,X.h)(Vo,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});var uo=require("vue");var Ip=U(j.currentFlashingDuration),xy=({children:o})=>o,Rp=1e3,xp={up:ci({direction:"up"}).split(" "),down:ci({direction:"down"}).split(" "),neutral:ci({direction:"neutral"}).split(" ")},Ja=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=xy}=o;return(0,uo.defineComponent)({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=ao(),u=qe(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=xp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Ip),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:S}=u.getState(),w=typeof S=="number"?S??t??Rp:t??Rp,T=typeof y=="number"?y>C?"up":"down":"neutral",x=xp[T];b.style.setProperty(Ip,`${w}`),b.classList.add(...e?[e,...x]:x),m=T,f=setTimeout(p,w)};return(0,uo.watch)(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,S,w]=y,[T,x]=C??[];if(!(b===T&&S===x)){p(),d=!0,s=null,c=w;return}w!==c&&(d=!1,s=c,c=w,h(w,s))},{flush:"post"}),()=>{let y=l.value;return(0,uo.h)("div",{...r,class:te(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},Pp=Ja();var co=require("vue");var Qa=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Qe(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var Dp=(0,co.defineComponent)({name:"TreeGrid",props:[...Xa],setup(o,{slots:t}){return()=>(0,co.h)(mr,{...o},t)}}),Ap=(0,co.defineComponent)({name:"TreeDataSource",props:[...ga],setup(o,{slots:t}){return()=>(0,co.h)(Fi,{...o,nodesKey:o.nodesKey??"children"},t)}});var Py={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},_p={instantEdit:Py};var Dy={CheckBox:dn,LoadMask:pr,MenuIcon:_o};0&&(module.exports={CellSelectionState,DataSource,DataSourceInjectionKeyForVue,DeepMap,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableDetailRow,InfiniteTableInjectionKeyForVue,Menu,NumberFilterEditor,RowDetailState,RowSelectionState,StringFilterEditor,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,components,createFlashingColumnCellComponent,debounce,defaultFilterTypes,flatten,group,keyboardShortcuts,toTreeDataArray,useDataSourceContext,useGetMasterDetailContextForVue,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfiniteTableContext,useOverlay,withSelectedLeafNodesOnly});
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},Sa=o=>{let{debugId:t,key:e}=o,n=Md[e];if(n&&(pg({...n,debugId:t}),t&&e)){let i=Fd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),mg(t))}};globalThis.logDevToolsWarning=Sa;var mg=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=Fd.get(o);e&&t(o,e)};var Ni=require("vue"),Nd=Symbol("DataSourceMasterDetail");function Od(o){(0,Ni.provide)(Nd,o)}var hg=()=>{};function Oi(){return(0,Ni.inject)(Nd,hg)}var wa=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","multiRowSelectionTarget","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],Zn=Symbol("DataSource");function Xn(){return(0,Le.inject)(Zn)}var{useManagedComponent:gg}=Mn({debugName:"DataSource",initSetupState:ud,forwardProps:cd,concludeReducer:_d,mapPropsToState:pd,onPropChange:md,cleanup:dd,interceptActions:gd(),mappedCallbacks:hd()});function ki(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};(0,Le.onMounted)(()=>i(o())),(0,Le.watch)(o,i,{flush:"post"})}function yg(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;ki(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new W});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||od({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:nn(a,{wait:s})}),l.fn},d=null;ki(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,a(m)}))}),(0,Le.watch)(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{d?.(),d=null})}function bg(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=(0,Le.shallowRef)({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});(0,Le.onBeforeUnmount)(()=>{a()});let l=null;(0,Le.watch)(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;(0,Le.watch)(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),(0,Le.watch)(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),(0,Le.onBeforeUnmount)(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=td(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:S,cursorId:w}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:S?w:null}},f={current:!1};yg({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];ki(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=sa(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&Sa({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&jn(p.data,p,n,void 0,h)}),ki(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){y=!!p.cursorId;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:S}=sa(C,e);if(b&&!S)return;let w=e();if(typeof w.data=="function"){if(f.current&&!y&&nd(w))return;jn(w.data,w,n,{append:y},C)}}),(0,Le.onMounted)(()=>{let p=e(),h=Kt(p,void 0,i());n.dataParams=h})}function Cg(o){let t=Oi(),e=!!t(),{contextValue:n}=gg(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Rd({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return(0,Le.provide)(Zn,u),(0,Le.onMounted)(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),bg({state:i,getDataSourceState:a,dataSourceActions:r}),(0,Le.watch)(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),(0,Le.onMounted)(()=>{i.value.onReady?.(l)}),(0,Le.onBeforeUnmount)(()=>{let d=a();d.onCleanup(d)}),u}var Li=(0,Le.defineComponent)({name:"DataSource",props:[...wa],setup(o,{slots:t}){let e=Cg(o);return()=>t.default?.(e.state.value)??null}});var X=require("vue");var kd=require("vue");function Xt(o,t,e){let n=null,i;return(0,kd.computed)(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var Jn=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?nn(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var Vi=class Vi{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??Vi.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};Vi.DEFAULT_SIZE=10;var zi=Vi;var va=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},Gi=class{constructor(t){this.storage=new zi(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},Ra=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},Ki=class{constructor(t){this.cacheStorage=t===!1?new va:t===!0?new Ra:typeof t=="number"?new Gi(t):new Gi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var bt=class extends $n{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var Ld=fo(Gn());var Ia=(o,t)=>o-t,Jt={horizontal:!0,vertical:!0};function Bi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var Hi={start:0,end:0},xa=o=>{o()},Pa=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},zd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},Mo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Tg(o){return o.horizontalChange||o.verticalChange}var xn=class extends ft{constructor(e){let n=qn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Hi;this.verticalExtendRangeBy=Hi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{Mo(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?xa:Mo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?xa:Mo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Jt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Jt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=Jt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,Ld.default)(a,e,Ia);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Pa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Jt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,S=l!=null,w=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let x=e.rowspan!=null,I=e.colspan!=null,M=x&&e.rowspan!=this.rowspan,F=I&&e.colspan!=this.colspan;M&&(this.rowspan=e.rowspan),F&&(this.colspan=e.colspan);let v=C||T||f||F,D=y||w||m||M;(n||Tg)({horizontalChange:v,verticalChange:D,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:F,rowsChanged:y,rowHeightChanged:w,heightChanged:m,rowspanChanged:M})&&this.updateRenderCount({horizontal:v,vertical:D})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Jt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Jt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?xa:Mo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=Bi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{Mo(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Hi,this.verticalExtendRangeBy=Hi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Sg={scrollLeft:0,scrollTop:0},Fo=class{constructor(){this.scrollPosition=Sg;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:wg}=We,Dt=`${wg}ColumnCell`;function Vd(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}var Gd=require("vue");function Kd(o){return(t,e)=>(0,Gd.h)(o,{key:t.id,rowInfo:t,cache:e})}var No=class extends xn{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=Bi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,S=C&&r!==this.rowHeight,w=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||f,x=y||w||c||T;(x||T)&&this.updateRenderCount({horizontal:x,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Jt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Be(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Da=fo(Gn());function Bd(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function Hd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function Oo(o,t){for(let e of o)if(t(e))return e}var Wi=(o,t)=>o-t,ji=class extends ft{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new W;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=Oo(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=Oo(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Wi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(Wi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,Da.default)(n,e,Wi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,Da.default)(n,e,Wi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return Oo(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return Oo(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Wd=fo(Gn());var $i=class extends ft{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Wd.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var jd=!0,Pn=U(j.y),$d=U(j.scrollTop),$x=U(j.columnOffsetAtIndex),Aa=U(j.columnOffsetAtIndexWhileReordering),Qn=class extends ft{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(Pn,r?`calc( ${i}px + var(${$d}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${Pn}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Se.columnOffsets.get(i),c=`${Aa}-${i}`,f=u?`calc( ${a}px + var(${$d}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(Pn,f));let m=`translate3d(var(${c}, ${s}), var(${Pn}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Be(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,jd){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,jd&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(A=>{let N=r.getRowIndex(A);if(N!=null){let _=this.brain.getItemOffsetFor(N,"vertical");if(_==null)return;let O=A.getElement();if(!O)return;this.setDetailTransform(O,N,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&Zs(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[S,w]=y;function T(A,N,_){let O=i.getCellAt([A,N]);if(O==null)return;let z=n.getCellOffset(A,N),K=O.getElement();K&&z&&_(A,N,K,z)}let x=(A,N,_,{x:O,y:z})=>{this.setTransform(_,A,N,{x:O,y:z,scrollLeft:!0},u-N)},I=(A,N,_,O)=>{this.setTransform(_,A,N,{x:O.x,y:O.y,scrollTop:!0},s-A)},M=(A,N,_,{y:O})=>{let z=m[N];this.setTransform(_,A,N,{x:z,y:O,scrollLeft:!0},a-N)},F=(A,N,_,O)=>{this.setTransform(_,A,N,{x:O.x,y:p[A],scrollTop:!0},l-A)},v=(A,N,_,{x:O,y:z})=>{this.setTransform(_,A,N,{x:O,scrollLeft:!0,y:z,scrollTop:!0},1e5)},D=(A,N,_,{x:O})=>{this.setTransform(_,A,N,{x:O,scrollLeft:!0,y:p[A],scrollTop:!0},2e5)},E=(A,N,_,O)=>{this.setTransform(_,A,N,{x:m[N],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},P=(A,N,_)=>{this.setTransform(_,A,N,{x:m[N],y:p[A],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let A=C;A<S;A++){for(let N=0;N<u;N++)T(A,N,x);if(d){let N=a-d;for(let _=N;_<a;_++)T(A,_,M)}}if(s||c)for(let A=b;A<w;A++){for(let N=0;N<s;N++)T(N,A,I);if(c){let N=l-c;for(let _=N;_<l;_++)T(_,A,F)}}if(u&&s)for(let A=0;A<s;A++)for(let N=0;N<u;N++)T(A,N,v);if(u&&c){let A=l-c;for(let N=A;N<l;N++)for(let _=0;_<u;_++)T(N,_,D)}if(d&&s){let A=a-d;for(let N=0;N<s;N++)for(let _=A;_<a;_++)T(N,_,E)}if(d&&c){let A=l-c,N=a-d;for(let _=A;_<l;_++)for(let O=N;O<a;O++)T(_,O,P)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new ji(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new $i(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Be(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=qr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let v=e.start[1],D=e.end[1];p.forEach(E=>{v<=E&&E<D||m.push({start:[e.start[0],E],end:[e.end[0],E+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([v,D])=>{h.set(`${v}:${D}`,!0)});let C=m.reduce((v,D)=>v+Pa(D),0),b=i?m.reduce((v,D)=>v+zd(D),0):0,S=this.brain.getRowCount(),w=this.brain.getColCount();c.detachCellsStartingAt([S,w]);let T=Math.min(S*w,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let x=Bd(...m.map(v=>c.getCellsOutsideRenderRange(v)));x=Hd(x,v=>{let D=c.getCellPosition(v);return!(D&&h.has(`${D[0]}:${D[1]}`))}),c.detachCells(x),c.poolSize=T;let I=new Map,M=new Map;m.forEach(v=>{let{start:D,end:E}=v,[P,A]=D,[N,_]=E;for(let O=P;O<N;O++){for(let K=A;K<_;K++){let B=`${O}:${K}`;if(I.has(B))continue;I.set(B,!0);let{rendered:G,mapped:se}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===P||K===A){let Ee=this.isCellCovered(O,K);if(Ee&&h.has(`${Ee[0]}:${Ee[1]}`)){let ge=c.getCellAt([O,K]);ge!=null&&c.detachCell(ge);continue}}if(G&&!r&&se)continue;let Z;G?Z=c.getCellAt([O,K]):Z=c.getCellFor([O,K],d?"row":"column"),Z==null&&(Z=c.getDetachedCell()),this.renderCellAt(O,K,Z,n)}!i||M.has(O)||(M.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([v,D])=>{let{rendered:E,mapped:P}=this.isCellRenderedAndMappedCorrectly(v,D);if(E){if(r||!P){let N=[v,D],_=c.getCellAt(N);this.renderCellAt(v,D,_,n)}return}let A=c.getCellFor([v,D],d?"row":"column");A!=null&&this.renderCellAt(v,D,A,n)});let F=c.getAllCells().map(v=>v.getNode());return i&&s.getAllRows().forEach(v=>{F.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(F),F}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let x=T.getElement();x&&(x.style.position="absolute",x.style.left="0px",x.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,w=this.brain.isHorizontalLayoutBrain;if(!b){w?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],S),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ui=class extends Qn{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Ae.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Se.columnOffsets.get(l.colIndex),m=`${Aa}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(Pn,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${Pn})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};var Yd=require("vue");var it=require("vue");function Ud(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Ud(e,t);return}if((0,it.isVNode)(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var pn=(0,it.defineComponent)({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=(0,it.shallowRef)(o.updater.get()??null),e=null;(0,it.watch)(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),(0,it.onBeforeUnmount)(()=>{e!=null&&cancelAnimationFrame(e)}),(0,it.onMounted)(()=>o.afterCommit?.()),(0,it.onUpdated)(()=>o.afterCommit?.());let n=(0,it.getCurrentInstance)();return()=>{let i=t.value;return Ud(i,n),i??null}}});var eo=class eo extends ft{constructor(e){super(e);this.cellRemoveSubscription=he();this.cellAttachmentChangeSubscription=he();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=eo.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/eo.POOL_SIZE_INCREMENT)*eo.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};eo.POOL_SIZE_INCREMENT=1;var qi=eo;var qd=new Map,vg=()=>{},_a=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=he();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=qd.get(t)??0,i=`${t}:GridCellVue:${n}`;qd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=he(),this.node=(0,Yd.h)(pn,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=vg,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Yi=class extends qi{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new _a(this.cellDebugId)}};var Xd=require("vue");var to=class to extends ft{constructor(e){super(e);this.rowRemoveSubscription=he();this.rowAttachmentChangeSubscription=he();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=to.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/to.POOL_SIZE_INCREMENT)*to.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};to.POOL_SIZE_INCREMENT=1;var Zi=to;var Zd=new Map,Rg=()=>{},Ea=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=he();let e=Zd.get(t)??0,n=`${t}:ListRowVue:${e}`;Zd.set(t,e+1),this.debugId=n,this.updater=he(),this.node=(0,Xd.h)(pn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Rg,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Xi=class extends Zi{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new Ea(this.rowDebugId)}};function Jd(o){return{cellPool:new Yi(o),rowPool:new Xi(o)}}function ko(o){let t=o.isHorizontalLayoutBrain?new Ui(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Jd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new Qn(o,`${o.name}:VueHeadlessTableRenderer`,Jd(`${o.name}:VueHeadlessTableRenderer`)),e=he();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function Dn(){return{current:null}}var Qd={};function Ma(o){return`.${Dt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Fa(o,t){let e=qn(o),n=t?new No(e,{isHeader:!1}):new xn(e),i=`${e}:header`,r=t?new No(i,{isHeader:!0,masterBrain:n}):new xn(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ko(n),{renderer:u,onRenderUpdater:d}=ko(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function ec({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=Fa(o,!!t),d=Dn(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=Ma(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:Dn(),editingValueRef:Dn(),scrollerDOMRef:Dn(),portalDOMRef:Dn(),focusDetectDOMRef:Dn(),activeCellIndicatorDOMRef:Dn(),onColumnMenuClick:he(),cellContextMenu:he(),contextMenu:he(),onFilterOperatorMenuClick:he(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:he(),onRowHeightCSSVarChange:he(),onRowDetailHeightCSSVarChange:he(),onColumnHeaderHeightCSSVarChange:he(),cellClick:he(),cellMouseDown:he(),keyDown:he(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Fo,pinnedEndScrollListener:new Fo,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var tc=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new Ki(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??Qd,columnGroupVisibility:t=>t??Qd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function Ig(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var nc=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function oc(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Ji=new WeakMap;function ic(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var rc=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?Vd(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=Ig({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=Ji.get(c);y||(y=Kd(c),Ji.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof bt)&&(d=new bt(d)),d=d||new bt({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=Ji.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&Ji.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Ae.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=da.get(e.debugId);y&&(h={...h,...y})}return h};function ac(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function lc(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var xg=10;function sc(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${zt} > .${pi}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${Tn}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...St.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=Ve().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+xg}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let S=Ve().getComputedStyle(C);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var uc="InfiniteTable";var mn=require("vue");var dc=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Qt=require("vue");var cc="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",fc=Re({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var pc="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",mc=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Qi=`${ht}-expand-collapse`,An=(0,Qt.defineComponent)(o=>{let t=()=>o.expanded!==void 0,e=(0,Qt.ref)(o.expanded??o.defaultExpanded??!1);(0,Qt.watch)(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return(0,Qt.h)("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:ne(o.className,cc,fc({direction:a||"start",expanded:e.value,disabled:l}),`${ht}`,`${Qi}`,`${Qi}--${i}`,`${Qi}--${a==="end"?"end":"start"}`,l?`${Qi}--disabled`:"")},[(0,Qt.h)("path",{d:pc})])}},{name:"ExpandCollapseIcon",props:[...mc]});var no=require("vue");var hc="_16lm1iwb _16lm1iw1d _16lm1iwk";var gc="164.93361431346415 56.97787143782138",yc={margin:"auto",display:"block",shapeRendering:"auto"},bc=Object.keys({size:1,style:1,className:1,viewBox:1});var Cc=(0,no.defineComponent)(o=>()=>(0,no.h)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...yc,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:ne(o.className,hc,"InfiniteIcon","InfiniteIcon-loading")},[(0,no.h)("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":gc},[(0,no.h)("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...bc]});var Tc=Re({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Sc="_7pupv00",wc=Re({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function vc(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function Rc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var Pg=U(j.columnZIndexAtIndex),Dg=U(j.columnVisibilityAtIndex);function Ic({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(Ae.components.Row.groupNesting)]:e}}function Ag({rowInfo:o}){return{[U(Ae.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Na(o,t){return o?typeof o=="function"?o(t):o:void 0}function Oa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function xc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:S,cellSelected:w,cellSelection:T,getData:x,computedVisibleColumns:I,visibleColumnIds:M,computedColumnOrder:F,columnReorderInPageIndex:v}=o,D=M??I.map(Oe=>Oe.id),E=F,P,A={...s,visibleColumnIds:D,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return P===void 0&&(P=e.hasSelectedCells(D)),P}},N=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(A):m,O;c?.className&&(O=Na(c.className,d)),h&&(O=ne(O,Na(h,d))),t.className&&(O=ne(O,Na(t.className,d))),N&&(O=ne(O,wc({align:l})));let z;e.dataSourceHasGrouping&&t.groupByForColumn&&(z=Ic({rowInfo:e,column:t})),N&&(z=Ag({rowInfo:e})),f&&(z=typeof f=="function"?{...z,...f(A)}:{...z,...f}),p&&(z=Oa(z,p,d)),c?.style&&(z=Oa(z,c.style,d)),t.style&&(z=Oa(z,t.style,d)),z=z||{},z.height=i,z.zIndex=`var(${Pg}-${t.computedVisibleIndex})`,z.visibility=`var(${Dg}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,se=!1,Z=!1,Ee=!1;if(T&&w){let Oe=x(),we=Oe[e.indexInAll-1],Fe=Oe[e.indexInAll+1],ce=I[t.computedVisibleIndex+1],ee=I[t.computedVisibleIndex-1];G=we?!T.isCellSelected(we.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?se=!0:se=ee?!T.isCellSelected(e.id,ee.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Z=!0:Z=ce?!T.isCellSelected(e.id,ce.id):!0,Ee=Fe?!T.isCellSelected(Fe.id,t.id):!0}let ge=T&&w?{top:G,left:se,right:Z,bottom:Ee}:null,xe=v!=null?a!==v:!1,Ke=ne(ge?xu(ge):"",li(t,[Dt,zt],Iu,{dragging:!1,insideDisabledDraggingPage:xe,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:w,rowSelected:S,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:z,className:Ke,cellSelectionBorders:ge,zebra:B,columnIsTree:N}}function _g({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=ne(ei.flex,r.align==="end"?kr.rowReverse:kr.row,Hl.center,`${Dt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?Tc({align:a}):null);return c?r.field?(0,mn.h)("div",{class:f},[d,(0,mn.h)("div",{class:St},[l??null])]):d?(0,mn.h)("div",{class:f},[d]):null:(0,mn.h)("div",{class:f},[u,d,(0,mn.h)("div",{class:St},[l??null])])}}function Eg({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return dc(s)?m=(0,mn.h)(Cc):p&&(m=(0,mn.h)(An,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function Pc(){return{getGroupColumnRender:_g,getGroupColumnRenderGroupIcon:Eg}}function Dc(o,t,e){return vc(o,t,e,Pc())}function Ac(o,t,e){return Rc(o,t,e,Pc())}function _c(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=Dc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=Ac({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?Cn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function Ec(o){return typeof o.field=="string"}function Mc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Wt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=oo({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),w=lt(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:w,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}}function Fc(o){return Oc(o.column,o.rowInfo)}function Nc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=Mc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=oo(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Mg({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function Mg(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:S}=C,w=Mc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,x=S?.isCellSelected(n.id,t.id)??!1,I={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:x,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:w,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),I}function Fg(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function Oc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:Ec(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&Ec(o)&&(a=Fg(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function Ng(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function oo(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=Oc(t,e),a=Ng(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function ka(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function kc(o,t){let e=ka(o,t);return e===-1?null:Wt({...o,rowIndex:e,columnId:t.columnId})}function Lo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function La(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function er(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function za(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function Lc(o,t,e){if(za(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let S=h;S<=y;S++){let w=b*n+S;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:w,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:w,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:w,colIndex:T})}return C}function Og(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var Va=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??fn(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new He(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=fn(l,this.getDataSourceState),y=fn(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[S,w]=er({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=S.rowIndex;T<=w.rowIndex;T++)for(let x=S.colIndex;x<=w.colIndex;x++){let I={rowIndex:T,colIndex:x},[M,F]=this.getCellSelectionPosition(I);n?a.selectCell(M,F):a.deselectCell(M,F)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=Pi(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Og(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new He(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new He(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new He:new He(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new He(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new He(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new He(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function zc(o){return new Va(o)}function Vc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new bt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new bt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new bt(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function hn(o,t,e){return Math.min(Math.max(o,t),e)}function tr(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return hn(a,i,r)}function kg(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,S={ArrowDown:()=>{f=tr(n,f,1)},ArrowUp:()=>{f=tr(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let x=c.rowsPerPage;f-x>=C?f=f-x:S.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let x=c.rowsPerPage;f+x<=b?f=f+x:S.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},w=S[l];return w?(w(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function Ga(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),S=C-h-1,w=b-y-1,T=r().dataArray.length-1,x=i().computedVisibleColumns.length-1,I=0,M=0;m=hn(m,0,T),p=hn(p,0,x);let F={ArrowDown:()=>{m=hn(m+1,I,T)},ArrowUp:()=>{m=hn(m-1,I,T)},ArrowLeft:()=>{if(p===M)if(m!==I&&(p=x),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m-D>=I?m=m-D:F.ArrowUp()}else F.ArrowUp();else p=hn(p-1,M,x)},ArrowRight:()=>{if(p===x)if(m!==T&&(p=M),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m+D<=T?m=m+D:F.ArrowDown()}else F.ArrowDown();else p=hn(p+1,M,x)},Enter:()=>{let D=d[m];return D&&D.isGroupRow?e.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&e.rowDetailApi.isRowDetailEnabledForRow(D.id)?e.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{u?p=Math.min(p+w,x):m=Math.min(m+S,T)},PageUp:()=>{u?p=Math.max(p-w,M):m=Math.max(m-S,I)},End:()=>{u?p=x:m=T},Home:()=>{u?p=M:m=I}},v=F[l];return v?(v(),[m,p]):!1}function Lg(o,t){let e=Ga(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var zg={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Gc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!zg[e]?!1:r!=null&&l==="row"?kg(o,t):a!=null&&l==="cell"?Lg(o,t):!1}var Ka=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=tr(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=Ga(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function Kc(o){return new Ka(o)}function Bc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var Ba=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=ka({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Wt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Wt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Wt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=lt(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=oo({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new wt(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new wt(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[Tt,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||jn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=W.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=Gt())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=Gl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=Kc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=Vc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=zc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(La(e),t?.()),setTimeout(()=>{this.isDestroyed()||(La(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??Fc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Wt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(Yn);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Zt){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let S=C?Cn(p,C):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[Zt]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!Bc(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:Bc(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(Yn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Hc(o){return new Ba(o)}function Wc(o,t){return o<t?[o,t]:[t,o]}var nr=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=Wc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=Wc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var or=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!za(t,e,i)){Lc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=er(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};var en=require("vue");var jc=an("CSSVariableWatch"),$c=rn("CSSVariableWatch"),Uc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var zo=(0,en.defineComponent)({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return(0,en.onMounted)(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,$c(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):jc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=Jn(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),(0,en.onBeforeUnmount)(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return(0,en.h)("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Uc},[(0,en.h)("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var Ha=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function qc(o,t){Wa(o,t),Gg(o,t),t.detail===2&&Vg(o,t),o.getState().onCellClick?.(o,t)}function Vg(o,t){if(vo(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Gg(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new He(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let S=!!n().wrapRowsHorizontally;c.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:S})}else c.resetClick(b);l.cellSelection=C}function Wa(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:d}=i(),s=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=s;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(d&&!t.key)return!1;let{rowSelection:y}=s;if(y=l(y),u.rowSelectionState=y,y&&typeof y=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=y,!0}else if(c==="single-row"){let C=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(C):a.rowSelectionApi.selectRow(C)}return!1}function Yc(o,t){t.detail!==2&&void 0}var Kg={Enter:!0," ":!0,a:!0};function Zc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:d,ctrlKey:s,metaKey:c}=t;if(!Kg[d])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:y,keyboardSelection:C}=f,{selectionMode:b,groupBy:S,rowSelection:w,treeSelectionState:T,isTree:x}=m;if(C===!1)return!1;let I=y==="row"&&p!=null?p:y==="cell"&&h!=null?h[0]:null,M=I!=null?m.dataArray[I]:null;if(!M||I==null)return!1;if(b==="single-row"&&d===" ")return r.rowSelectionApi.toggleRowSelection(M.id),!0;if(b!=="multi-row")return!1;if(d==="a"&&(s||c)){if(x&&T){let v=u(T);return v.selectAll(),i.treeSelection=v,!0}let F=l(w);return F.selectAll(),i.rowSelection=F,!0}if(d===" "){if(S.length)return M.isGroupRow&&M.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(M.groupKeys):r.rowSelectionApi.toggleRowSelection(M.id),!0;if(x){if(M.isTreeNode&&M.nodePath)return a.treeApi.toggleNodeSelection(M.nodePath),!0}else{let F={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(F.metaKey=!1,F.ctrlKey=!0),Wa({...o,rowIndex:I},F)}}return!1}var Xc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Jc=o=>Array.from(o.querySelectorAll(Xc)).filter(e=>!!e.offsetParent),ja=o=>o.querySelector(Xc);var ef=fo(Gn());async function Qc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Bg=10,Hg=(o,t)=>o-t;function $a(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=lt(f.id,t);return f.contentFocusable({column:f,...oo({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function tf(o,t,e){let n=e.getState().editingCell;return Wg(o,t,e,{isCellFocusable:$a,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function nf(o,t,e){let n=(0,ef.default)(e,o+t,Hg);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=nf;function Wg(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:nf(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function of([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Bg,l=null,u=!1;function d(s=0){s++,yn(l),l=Be(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await Qc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var jg=`.${Dt}`;function rf(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:zn(n,jg),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&$a({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:tf({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=Jc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return of([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;ja(s)?.focus()}),!0}var af={control:"ctrl"},lf={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},$g={esc:"escape"},uf={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},df=Object.keys(uf),Ua=new Set(df),Ug=new Set(["shift","alt"]);function cf(o,t){return Array.isArray(t)?t.some(e=>sf(o,e)):sf(o,t)}function sf(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>lf[f]),r=n.map(f=>af[f]||lf[f]||$g[f]||f),a=r.filter(f=>Ua.has(f)),l=r.filter(f=>!Ua.has(f)),u=df.reduce((f,m)=>(f[m]=uf[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!Ug.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Ua.has(e)||e==="meta"||af[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function ff(o,t){let e={...o,cloneRowSelection:a=>Qo(a,o.getDataSourceState),cloneTreeSelection:a=>Ai(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Zc(e,t)&&t.preventDefault(),(rf(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&Gc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!cf(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}var ar=require("vue");var Ne=require("vue");var ir="__is_infinite_menu_component";function qa(o){return!!o.tagName}function hf(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Me.from(qa(t)?t.getBoundingClientRect():t),a=Me.from(qa(e)?e.getBoundingClientRect():e),l=n?Me.from(qa(n)?n.getBoundingClientRect():n):null;if(!l)return{...pf({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=pf({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function pf(o){let t=Me.from(o.targetRect),e=Me.from(o.anchorRect),n=o.constrainRect?Me.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=mf(t,r),u=mf(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function mf(o,t){return t==="TopLeft"?Je.from({top:o.top,left:o.left}):t==="TopCenter"?Je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?Je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?Je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?Je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?Je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?Je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function qg(o){return o&&typeof o.then=="function"||o instanceof Promise}function yf(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function gf(o){return typeof o=="function"&&(o=o()),qg(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&yf(o)&&(o=o.getBoundingClientRect()),o?Me.from(o):null}async function bf(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),yf(n)&&(i=n),i||null}return e(await t)}async function Ya(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await gf(e)||void 0,a=n?await gf(n):void 0,l=Me.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=hf({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var Yg=(0,Ne.defineComponent)({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Ya(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Ya(t,a)})};return(0,Ne.onMounted)(()=>i(o.handle)),(0,Ne.watch)(()=>o.handle,i),(0,Ne.onBeforeUnmount)(()=>{n?.()}),()=>(0,Ne.h)("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function Zg(o){return(0,Ne.isVNode)(o)?o.props?.id||o.key:null}function Xg(o,t,e){if((0,Ne.isVNode)(o)&&o.type?.[ir]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),(0,Ne.cloneVNode)(o,n)}return o}function At(o){let t=o,e=new Map,n=(0,Ne.shallowRef)(e),i=()=>(0,Ne.triggerRef)(n),r=(d,s)=>{let f=`${s.id||Zg(d)||Gt()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return Xg(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let S=p(C);Object.assign(m,{children:S}),i(),!!b?.skipRealign||(0,Ne.nextTick)(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:he()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:(0,Ne.defineComponent)({name:"OverlayPortal",setup(){let d=(0,Ne.shallowRef)(null),{portalContainer:s}=t;return s&&(async()=>{let c=await bf(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push((0,Ne.h)(Yg,{handle:m,key:m.key}));return s?d.value?(0,Ne.h)(Ne.Teleport,{to:d.value},c):null:s===null||s===!1?c:(0,Ne.h)("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}var Ef=require("vue");var je=require("vue");var Cf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Tf=Re({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Sf="db3arf1",wf="db3arfd";var vf="submenu",Jg="-";function Rf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Gt(),focused:!1,destroyed:!1,domRef:{current:null}}}function If(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Qg=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===Jg?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},ey=[{name:"label"}],xf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||ey],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>Qg(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==vf)&&c.push({name:vf,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function Pf(o,t){let e=Df(o,t);if(!e.length)return null;let n=Me.from(e[0]?.getBoundingClientRect()),i=Me.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function Df(o,t){let e=zn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function Af(o,t){let e=Df(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var Vo=class extends Ln{constructor(t){super(t.slice(0,3))}};var ty=250;function ny(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Be(r)};Be(()=>{r()})})}var oy=Ve(),rr=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||ty;this.getPointerMoveTarget=()=>document.documentElement||oy;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new Je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new Vo([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Vo([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,ny(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new Je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var iy={renderSeparator:()=>(0,je.h)("hr",{class:wf}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?(0,je.h)("div",o,[(0,je.h)(An,{expanded:!1})]):(0,je.h)("div",o))},{useManagedComponent:ry}=Mn({initSetupState:Rf,forwardProps:()=>If(),mapPropsToState:o=>xf(o,iy),debugName:"Menu"}),ay=(0,je.defineComponent)({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=(0,je.ref)(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=(0,je.h)("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:ne(Tf({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):(0,je.h)("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return(0,je.h)("div",{class:Sf},[u])}}}),_t=(0,je.defineComponent)({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=ry(o),n=e.state,i=e.componentActions,r=()=>n.value,a=D=>{i.keyboardActiveItemKey=D},l=D=>{i.activeItemKey=D},u=!1,d=()=>u,s=null,c=D=>{s=D},{showOverlay:f,portal:m,clearAll:p}=At({portalContainer:!1}),h=()=>{let D=r();D.onHideIntent?.(D)},y=()=>{i.focused=!0,setTimeout(()=>{let D=r().domRef.current;b&&D&&D===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,S={hideMenu:h,focus:()=>{let D=r().domRef.current;D&&(D.focus(),setTimeout(()=>{let E=r().domRef.current;E&&E!==document.activeElement&&E.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},w=(D,E)=>{a(E.key),l(E.key),E.originalMenuItem.onClick&&E.originalMenuItem.onClick(D);let P={key:E.key,item:E.originalMenuItem,hideMenu:h};E.originalMenuItem.onAction&&E.originalMenuItem.onAction(P);let{onAction:A}=r();A&&A(P),E.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:x}=new rr({parentMenuId:r().parentMenuId,onItemActivate:D=>{d()&&l(D)},itemHasSubMenu:D=>!!r().runtimeItems.filter(P=>P.type==="item"&&P.key===D&&P.menu)[0],getMenuRectFor:D=>{let E=`[data-submenu-for="${D}"]`,P=document.querySelector(E);if(P)return Me.from(P.getBoundingClientRect())}}).getHandlers(),I=D=>{let E=r().menuId,P=`${E}-submenu`,A=D.menu;return A?(typeof A=="function"&&(A=A()),(0,je.h)(_t,{key:P,parentMenuItemKey:D.key,parentMenuId:E,constrainTo:r().constrainTo,...A,autoFocus:!1,onShow:(N,_)=>{A?.onShow?.(N,_),c(_)},onHideIntent:N=>{A?.onHideIntent?.(N),h()},onHide:N=>{N.focused&&(l(null),a(D.key),S.focus())}})):null};(0,je.watch)(()=>n.value.activeItemKey,D=>{let{runtimeItems:E,menuId:P,constrainTo:A}=r(),N=E.filter(O=>O.type==="item"&&D===O.key)[0];if(!N||!N.menu){c(null),p();return}let _=Pf(P,N.key);_&&f(()=>I(N),{id:`${P}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:A})},{flush:"post"});function M(D){let{runtimeItems:E,runtimeSelectableItems:P,keyboardActiveItemKey:A}=r(),N=E.findIndex(B=>B.type==="item"&&B.key===A),_=A,O=E[N],z={ArrowUp:()=>{let B=E.slice(0,N).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=E.slice(N+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{z.PageUp()},End:()=>{z.PageDown()},PageUp:()=>{_=P[0].key},PageDown:()=>{_=P[P.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Be(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){z.ArrowLeft();return}l(O.key)}else w(D,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||w(D,O);let B=Af(r().menuId,O.key);B&&B.click()},Escape:()=>{z.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=z[D.key];K&&(K(),D.preventDefault()),_!=A&&a(_)}let F=!1,v=D=>{let E=D??null;E&&!F?(F=!0,r().domRef.current=E,u=!0,r().onShow?.(r(),S),r().autoFocus&&S.focus()):!E&&F?(F=!1,r().onHide?.(r()),r().domRef.current=null):E&&(r().domRef.current=E)};return(0,je.onBeforeUnmount)(()=>{u=!1,F&&(F=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let D=r(),{columns:E,runtimeItems:P,menuId:A,activeItemKey:N,keyboardActiveItemKey:_,destroyed:O,wrapLabels:z,parentMenuItemKey:K}=D;if(O)return null;let B=P.map((Z,Ee)=>(0,je.h)(ay,{key:Z.type==="item"?Z.key:Ee,columns:E,item:Z,index:Ee,active:Z.type==="item"&&Z.key===N,keyboardActive:Z.type==="item"&&Z.key===_,onItemEnter:(ge,xe)=>T(ge.key,xe),onItemLeave:(ge,xe)=>x(ge.key,xe),onItemClick:w})),G=E.map(Z=>Z.width||(typeof Z.flex=="number"?`${Z.flex}fr`:Z.flex)||"auto").join(" "),se={...t.style,gridTemplateColumns:G,gridTemplateRows:P.map(()=>"auto").join(" ")};return z||(se.whiteSpace="nowrap"),(0,je.h)("div",{class:ei.contents},[(0,je.h)("div",{...t,"data-menu-id":A,"data-submenu-for":K,tabindex:0,ref:v,onKeydown:M,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:ne(Cf,t.class,"InfiniteMenu"),style:se},B),(0,je.h)(m)])}}});_t[ir]=!0;var Za=require("vue");function _f(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||cn,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=wo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Za.h)(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=wo(p,t,"column-menu");f.push({key:h,label:y,check:(0,Za.h)(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function Mf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??_t,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:lt(u.id,t),...t},s=_f([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:(0,Ef.h)(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function ly(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${Eu}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>Mf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Ff(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return(0,ar.watch)([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),ly({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),(0,ar.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var sr=require("vue");var Go=require("vue");function Nf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??_t,m=n().computedColumnsMap.get(o);if(!m)return null;let p=I=>{I.__insideMenu=!0},h=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(I=>{let M=I.name,F=m.computedFilterValue?m.computedFilterValue.filter.operator===M:M===C.defaultOperator,v=I.components?.Icon??Fn;return{key:M,icon:(0,Go.h)(v),label:I.label??I.name,onAction:()=>{d.setColumnFilterOperator(o,M)},checked:F?(0,Go.h)(vu,{size:16}):null}}),w=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:(0,Go.h)(Ru),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},x=c?c(w,T):w;return(0,Go.h)(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:x,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:I=>{h(I),e?.()}})}var lr=10;function Of(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Me.from(m.getBoundingClientRect());p.top-=lr,p.left-=lr,p.width+=2*lr,p.height+=2*lr,r(()=>Nf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return(0,sr.watch)(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,sr.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var io=require("vue");var Ko=require("vue");function ur(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function Xa(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function kf(o,t,e){if(!o)return null;let n=he();return o.then(i=>{let{items:r,columns:a}=ur(i);r&&r.length&&n((0,Ko.h)(e,{...t,items:r||[],columns:a}))}),(0,Ko.h)(pn,{updater:n})}function Lf(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??_t,{computedColumnsMap:c}=a(),f=c.get(n),m={...Wt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=Xa({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:kf(h,p,s),preventDefault:y};let{items:C,columns:b}=ur(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:(0,Ko.h)(s,{...p,columns:b,items:C}),cellContext:m}}function zf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??_t,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Wt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=Xa({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:kf(f,c,l),preventDefault:m};let{items:p,columns:h}=ur(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:(0,Ko.h)(l,{...c,columns:h,items:p}),cellContext:s}}var dr=5,Vf=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Gf(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=At({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=Lf(s,t,f),y=Me.fromPoint({top:c.clientY,left:c.clientX});y.width+=dr,y.height+=dr,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Vf}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return(0,io.watch)(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),(0,io.onBeforeUnmount)(()=>{d()}),{MenuPortal:l}}function Kf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=At({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=zf(d,t,c),h={top:s.clientY,left:s.clientX},y=Me.fromPoint(h);y.width+=dr,y.height+=dr,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Vf}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return(0,io.watch)(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),(0,io.onBeforeUnmount)(()=>{u()}),{MenuPortal:a}}var Ze=require("vue");var Bf="mlx2t3";var cr=require("vue"),Hf=(0,cr.defineComponent)({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>(0,cr.h)("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Wf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},jf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},$f={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Uf="_1ueijco1",qf="_1ueijco0 _16lm1iw0";var jt=require("vue");var Yf=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Wf[`${o}`]:t=ne(jf[`${o.horizontal}`],$f[`${o.vertical}`]),t};var sy="InfiniteVirtualScrollContainer",Zf=(0,jt.defineComponent)({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=(0,jt.ref)(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return(0,jt.onMounted)(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),(0,jt.onBeforeUnmount)(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>(0,jt.h)("div",{...e,ref:n,tabindex:o.tabIndex,class:ne(e.class,sy,qf,Yf(o.scrollable))},t.default?.())}});var ut=require("vue");var fr=(0,ut.defineComponent)({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=(0,ut.computed)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:ko(o.brain));(0,ut.watchEffect)(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),(0,ut.watchEffect)(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return(0,ut.onMounted)(n),(0,ut.watch)(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),(0,ut.onBeforeUnmount)(()=>{e?.(),e=null}),()=>(0,ut.h)(pn,{name:o.name,updater:t.value.onRenderUpdater})}});var pr=[Pu,`${Ge}DetachedCell`];var dt=require("vue");var Xf=Re({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),mr="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:uy}=We,dy=`${uy}-ActiveCellIndicator`,cy=U(j.columnZIndexAtIndex),Jf=(0,dt.defineComponent)({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=(0,dt.ref)(null),e=(0,dt.ref)(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Vn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return(0,dt.onMounted)(()=>{r(o.brain),n()}),(0,dt.watch)(()=>o.brain,r),(0,dt.watch)([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),(0,dt.onBeforeUnmount)(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return(0,dt.h)("div",{class:mr,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${cy}-${o.activeCellIndex[1]})`}:void 0},[(0,dt.h)("div",{"data-name":"active-cell-indicator",class:`${dy} ${Xf({visible:a})}`})])}}});var ct=require("vue");var Qf=Re({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:fy}=We,py=`${fy}-ActiveRowIndicator`,my=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,hy={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${my}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Ae.runtime.totalVisibleColumnsWidthVar},ep=(0,ct.defineComponent)({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=(0,ct.ref)(null),e=(0,ct.ref)(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Ae.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Vn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Vn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return(0,ct.onMounted)(()=>{l(o.brain),n()}),(0,ct.watch)(()=>o.brain,l),(0,ct.watch)([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),(0,ct.onBeforeUnmount)(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return(0,ct.h)("div",{class:mr,"data-name":"active-row"},[(0,ct.h)("div",{ref:t,"data-name":"active-row-indicator",class:`${py} ${Qf({active:u})}`,style:u?hy:void 0})])}}});var gy=ne(Bf,Uf),tp=(0,Ze.defineComponent)({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=(0,Ze.ref)(null),n=(0,Ze.shallowRef)({width:0,height:0});(0,Ze.watch)(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=Jn(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return(0,Ze.onMounted)(()=>{u(o.brain),d()}),(0,Ze.watch)(()=>o.brain,s=>{u(s),d()}),(0,Ze.watch)(()=>o.wrapRowsHorizontally,()=>{d()}),(0,Ze.onBeforeUnmount)(()=>{a?.(),l?.()}),()=>(0,Ze.h)(Zf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[(0,Ze.h)("div",{ref:e,class:gy,"data-name":"scroll-transform-target"},[(0,Ze.h)(fr,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:pr}),o.activeCellIndex!=null?(0,Ze.h)(Jf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?(0,Ze.h)(ep,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,(0,Ze.h)(Hf,{width:n.value.width,height:n.value.height})]})}});var np="_16lm1iw1 _16lm1iw1c _16lm1iwe";var ke=require("vue"),sp=require("vue");var ip=Symbol("REPAINT_CELLS_KEY_NO_ROW");function rp(o){return typeof o=="function"}function op(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return ip;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function ap(o,t,e){let n=op(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=op(o,t);i!==ip&&(Object.is(i,n)||(n=i,e()))})}var hr=require("vue");function Ja(){let{api:o,getState:t}=Ye(),e=ro(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var lp=(0,hr.defineComponent)({name:"InfiniteTableColumnEditor",setup(){let{state:o}=Ye(),t=Ja(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,(0,hr.h)("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:ne(Bl,Yl.none),type:"text"}))}});var yy=U(j.columnWidthAtIndex),by=U(j.columnReorderEffectDurationAtIndex),el=Symbol("InfiniteColumnCell");function ro(){return(0,sp.inject)(el)}var Cy=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return(0,ke.h)(An,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},Ty={display:"inline-block",visibility:"visible"},Qa=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return(0,ke.h)(An,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:Ty,expanded:n,onChange:e})},Sy=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,d=l?.CheckBox||cn;return(0,ke.h)(d,{domProps:{class:fi},disabled:t.isTreeNode?!u(t):!1,onChange:s=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,s??!1);return}if(t.isGroupRow){i();return}s?e():n()},checked:t.rowSelected})},wy=(0,ke.defineComponent)({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return(0,ke.provide)(el,(0,ke.computed)(()=>o.renderParam)),()=>o.content}});function Et(o,t){let e=o(t);return e==null?e:(0,ke.h)(wy,{renderParam:t,content:e})}var up=(0,ke.defineComponent)({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=(0,ke.shallowRef)(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;(0,ke.watch)([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=(0,ke.shallowRef)(0),a=null;(0,ke.watch)([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,rp(s)&&(a=ap(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),(0,ke.onBeforeUnmount)(()=>{i?.(),i=null,a?.(),a=null});let l=(0,ke.shallowRef)(null);(0,ke.provide)(el,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return(0,ke.h)("div",{ref:e,style:{display:"none"}});let{getState:S,getDataSourceState:w}=h,{activeRowIndex:T,keyboardNavigation:x,columnReorderInPageIndex:I}=S(),M=c===T&&x==="row",F=b.rowDisabled,{rowSelected:v}=b,D=o.getComputedVisibleColumns().map($=>$.id),E=Nc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:D,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:P,renderParams:A,formattedValueContext:N,renderFunctions:_,groupByColumnReference:O,inEdit:z}=E,{align:K,verticalAlign:B}=A,G=A;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:se}=w(),Z=G.cellSelected,Ee=w().cellSelection??null,ge=null;if(!m&&!z){if(_.renderGroupIcon&&(G.renderBag.groupIcon=Et(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&se=="multi-row"&&(G.renderBag.selectionCheckBox=Et(Sy,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=Et(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:_e}=b,Te;Te=(_e?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:_e&&_.renderTreeIcon===!0?Qa:void 0,Te===!0?Te=Qa:Te&&(G.renderBag.treeIcon=Et(Qa,G)),Te&&(G.renderBag.treeIcon=Et(Te,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=Et(Cy,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=Et(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=Et(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=Et(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=Et(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let $=G.renderBag.value;$ instanceof Date&&($=$.toLocaleDateString());let te=G.renderBag,ve=[K!=="end"?te.treeIcon:null,K!=="end"?te.groupIcon:null,K!=="end"?te.rowDetailsIcon:null,K!=="end"?te.selectionCheckBox:null,$,K==="end"?te.selectionCheckBox:null,K==="end"?te.rowDetailsIcon:null,K==="end"?te.groupIcon:null,K==="end"?te.treeIcon:null];ge=s.render?Et(s.render,{...G,renderBag:{...G.renderBag,all:ve}}):ve}let{style:xe,className:Ke}=xc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:P,formattedValueContext:N,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:M,rowDisabled:F,rowSelected:v,cellSelected:Z,cellSelection:Ee,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:I}),Oe=s.computedVisibleIndex,we=s.cssEllipsis??!0,Fe={width:`var(${yy}-${Oe})`,transition:`transform var(${by}-${Oe}, 0s)`,...xe,height:typeof xe.height=="number"?`${xe.height}px`:xe.height},{onRowMouseEnter:ce,onRowMouseLeave:ee}=o.renderingContext.getState(),H=ce||o.onMouseEnter?$=>{ce?.({...N,rowIndex:c},$),o.onMouseEnter?.($)}:void 0,q=ee||o.onMouseLeave?$=>{ee?.({...N,rowIndex:c,rowInfo:b},$),o.onMouseLeave?.($)}:void 0,J={ref:e,style:Fe,"data-column-id":s.id,"data-z-index":Fe.zIndex,"data-row-id":`${b.id}`,class:ne(Ke,zt,di),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:q},oe=(0,ke.h)("div",{class:ne(`${zt}_content`,we?St:ti.hidden)},[ge]),re=s.components?.Editor??lp,ye=z?(0,ke.h)(re):null,be=ye?[oe,ye]:[oe],ie=s.components?.ColumnCell;return ie?(0,ke.h)(ie,J,{default:()=>be}):(0,ke.h)("div",J,be)}}});var gn=require("vue");var dp=Re({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function vy(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function Ry(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=yd(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function cp(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function fp(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:Nt(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}vy(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&Ry(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:Iy}=We,xy=`${Iy}RowDetail`,gr=(0,gn.defineComponent)({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=Xn(),{getState:n}=Ye(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=cp(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:fp({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=(0,gn.shallowRef)(i());(0,gn.watch)(()=>o.rowInfo.id,()=>{r.value=i()}),Od(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,(0,gn.h)("div",{ref:a,class:ne(xy,dp({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var tl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function Py(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function pp(o){let t=new tl;return{computedRowHeight:Py(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}var et=require("vue");function mp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,S,w=C;for(;b;){let T=t[b];if(T){h.add(b);let x=[f,...h];S=y.has(b)?r.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(x,S),r.set(b,S)),S.columnItems.push(C),S.uniqueGroupId.push(C.id),w&&!y.has(w.id)&&S.children.push(w),w=S,b=T.columnGroup}else break}});let l=[],u=new W,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&hp(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function hp(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&hp(e.children),t+=n})}var ao=require("vue");var _n=require("vue");var{rootClassName:Dy}=We,Ay=`${Dy}HeaderCell_ResizeHandle`,gp=(0,_n.defineComponent)({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=(0,_n.ref)(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=Vu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((S,w)=>S+w.computedWidth-w.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Ae.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return(0,_n.h)("div",{ref:d=>{t.current=d??null},class:`${Ay} ${mi} ${gi({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[(0,_n.h)("div",{style:{...u,...o.draggerStyle},class:hi({constrained:e.value})})])}}});var yp=`${Ge}HeaderGroup`,bp=U(j.columnWidthAtIndex),_y=U(j.columnZIndexAtIndex),Cp=(0,ao.defineComponent)({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=Ye(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...d[S.id],flex:S.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return xs({availableSize:ia(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(S=>`var(${bp}-${S.computedVisibleIndex})`).join(" + ")+" )":`var(${bp}-${m.computedVisibleIndex})`,h=`calc(var(${_y}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(S=>S.computedResizable)?(0,ao.h)(gp,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return(0,ao.h)("div",{ref:i,"data-group-id":l.uniqueGroupId,class:ne(ms,yp),style:y,"data-z-index":h},[(0,ao.h)("div",{class:ne(`${yp}__header-content`,St)},[c]),b])}}});var{rootClassName:Ey}=We,Tp=`${Ey}Header`,My=[],Fy=us({overflow:!1}),Sp=(0,et.defineComponent)({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=Ye(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=(0,et.computed)(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=(0,et.computed)(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=Xt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return mp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");(0,et.watchEffect)(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),S=a.value,w=l.value,T=u.value,x=p.showColumnFilters,I=p.columnHeaderHeight,M=({rowIndex:D,colIndex:E})=>{let P=h[E],A=1,N=1;if(!P||!T)return{rowspan:A,colspan:N};let _=T.pathsToCells.get([D,E]);if(!_)return{rowspan:A,colspan:N};if(_.type==="column")return{colspan:N,rowspan:S-_.depth};let O=_.columnItems.findIndex(z=>z.id===P.id);return{rowspan:A,colspan:O===0?_.columnItems.length:1}},F=D=>x?D<S-1?I:2*I:I,v=o.headerBrain;(y.length||C.length)&&v.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),v.update({colWidth:b,rowHeight:F,rows:S,cols:h.length,height:w,rowspan:({rowIndex:D,colIndex:E})=>M({rowIndex:D,colIndex:E}).rowspan,colspan:({rowIndex:D,colIndex:E})=>M({rowIndex:D,colIndex:E}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;(0,et.watch)(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),(0,et.onBeforeUnmount)(()=>{f?.(),f=null});let m=Xt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,S=u.value,w=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:x,someRowsSelected:I,selectionMode:M}=h;return F=>{let{rowIndex:v,colIndex:D,domRef:E,height:P,widthWithColspan:A,heightWithRowspan:N,hidden:_}=F,O=y[D];if(!O||_)return null;let z=b.isHorizontalLayoutBrain?b.getPageIndexForRow(v):null,K=S?S.pathsToCells.get([v,D]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Z=>Z.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Z=>Z.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?(0,et.h)(Cp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:z,columnGroupsMaxDepth:w,domRef:E,columns:B,width:A,height:P,columnGroup:G}):null}return(0,et.h)(Hu,{key:O.id,domRef:E,column:O,columnsMap:C,horizontalLayoutPageIndex:z,headerOptions:T,width:A,height:N,allRowsSelected:x,someRowsSelected:I,selectionMode:M})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=(0,et.h)("div",{ref:c,class:ne(Tp,`${Tp}--virtualized`,Fy),style:{height:`${p}px`}},[(0,et.h)(fr,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:My,cellDetachedClassNames:pr})]),b=h.vertical&&kt()?(0,et.h)("div",{class:gs,style:{zIndex:1e3,width:`${kt()}px`}}):null;return(0,et.h)("div",{class:`${Ur} ${Ts}`,style:{height:`${p}px`}},[C,b])}}});var lo=require("vue");var wp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},vp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Rp="qy58ya4";var{rootClassName:Ny}=We,nl=`${Ny}-LoadMask`,yr=(0,lo.defineComponent)({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>(0,lo.h)("div",{class:`${wp[o.visible?"visible":"hidden"]} ${nl}`},[(0,lo.h)("div",{class:`${vp} ${nl}-Overlay`}),(0,lo.h)("div",{class:`${Rp} ${nl}-Text`},t.default?t.default():"Loading")])}});var Ip=o=>`--infinite-${o}`;var xp=40,Pp=Ip($s);var _p=We.rootClassName,ol=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:Oy,injectionKey:ky}=Mn({initSetupState:ec,forwardProps:tc,mapPropsToState:rc,cleanup:nc,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:ic(),getParentState:()=>{let o=(0,X.inject)(Zn,null);return o?o.state:null},debugName:"InfiniteTable"});function Dp(o){return t=>o[t]?.computedWidth??0}function Ap(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var br=(0,X.defineComponent)({name:"InfiniteTable",props:[...ol],setup(o,{attrs:t}){let e=Xn();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,R,L){let k=Reflect.get(g,R,L);return R==="rowHeight"?k??xp:R==="columnHeaderHeight"?k??Pp:R==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=Oy(n);(0,X.provide)(ky,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{P.toggleGroupRow(g)};(0,X.watch)([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,R=u.value,{columns:L,groupColumnIds:k}=_c({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:R.groupBy,pivotBy:R.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:R.selectionMode});a.columnsWhenGrouping=L;let Y=r.value.columnOrder;if(k.length&&Array.isArray(Y)){let V=new Set(Y),Q=!1;k.forEach(pe=>{V.has(pe)||(Q=!0,Y=[pe,...Y])}),Q&&(a.columnOrder=Y)}},{immediate:!0}),(0,X.watch)(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),(0,X.watch)(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),(0,X.watch)(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=(0,X.ref)(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};(0,X.watch)(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),(0,X.onBeforeUnmount)(()=>{m?.()}),(0,X.watch)([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:R,domRef:L}=r.value,k,Y,V=!0;typeof R=="object"&&(R.columnsToResize&&(k=new Set(R.columnsToResize)),R.columnsToSkip&&(Y=new Set(R.columnsToSkip)),V=R.includeHeader??V),f=g;let Q=sc(L,{includeHeader:V,columnsToResize:k,columnsToSkip:Y}),pe=Object.keys(Q);if(!pe.length)return;let ue=r.value.columnSizing,me={...ue},le=!1;pe.forEach(Ce=>{me[Ce]={width:Q[Ce]},le=le||me[Ce].width!==ue[Ce]?.width}),le&&(a.columnSizing=me)},{immediate:!0,flush:"post"});let h=(0,X.computed)(()=>oc(u.value.groupBy));(0,X.watch)([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,R=u.value;if(g.groupRenderStrategy!=="multi-column")return;let L=h.value,k=ac(g.computedColumns,L),Y=lc({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:R.groupRowsIndexesInDataArray,dataArray:R.dataArray,groupBy:R.groupBy,groupByMap:L});sn(g.columnVisibility,Y)||(a.columnVisibility=Y)},{immediate:!0}),(0,X.watch)([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,R=h.value,L=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:Y,hideColumnWhenGrouped:V,computedColumns:Q}=g,pe={...k},ue={...Y},me=!1,le=new Set,Ce=new Set;Object.keys(Q).forEach(Pe=>{let ae=Q[Pe];if(ae.defaultHiddenWhenGroupedBy||V!=null)if(ae.defaultHiddenWhenGroupedBy==="*"&&L||(ae.defaultHiddenWhenGroupedBy===!0||V)&&ae.field&&R.get(ae.field)||typeof ae.defaultHiddenWhenGroupedBy=="string"&&R.get(ae.defaultHiddenWhenGroupedBy)||typeof ae.defaultHiddenWhenGroupedBy=="object"&&Object.keys(ae.defaultHiddenWhenGroupedBy).reduce(($t,Ut)=>$t||R.has(Ut),!1)){if(ue[Pe]!==!1){if(k[Pe]===!1)return;ue[Pe]=!1,me=!0,le.add(Pe)}}else ue[Pe]===!1&&(delete ue[Pe],me=!0,Ce.add(Pe))}),me&&(a.columnVisibilityForGrouping=ue,Ce.forEach(Pe=>{delete pe[Pe]}),le.forEach(Pe=>{pe[Pe]=!1}),a.columnVisibility=pe)},{immediate:!0});let y=Xt(()=>{let g=r.value,R=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,R.filterValue,R.filterTypes,g.sortable,R.sortInfo,R.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,R.groupBy]},()=>{let g=r.value,R=u.value;return Ms({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:R.filterValue,filterTypes:R.filterTypes,sortable:g.sortable,sortInfo:R.sortInfo??void 0,multiSort:R.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:R.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:S}=e,w=new nr({isRowDisabledAt:g=>b().dataArray[g]?.rowDisabled??!1,getIdForIndex:g=>b().dataArray[g]?.id??-1}),T=new or({getPrimaryKeyByIndex:S.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),x=(0,X.shallowRef)({vertical:!1,horizontal:!1}),I=null;(0,X.watch)(()=>r.value.brain,g=>{I?.(),I=g.onRenderCountChange(()=>{let{scrollTopMax:R,scrollLeftMax:L}=g,k=R>0,Y=L>0,V=x.value;(V.vertical!==k||V.horizontal!==Y)&&(x.value={vertical:k,horizontal:Y})})},{immediate:!0}),(0,X.watch)(x,g=>{let R=b(),{onScrollbarsChange:L}=l();L&&R.updatedAt&&R.dataArray.length&&L(g),R.notifyScrollbarsChange(g)});let M=null,F=()=>{let g=l(),R=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!M||M.deps.some((L,k)=>L!==R[k]))&&(M={deps:R,value:pp({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),M.value},v=()=>F().computedRowHeight,D=()=>{let g=y.value,R=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,L=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:x.value,multiRowSelector:w,multiCellSelector:T,computedRowHeight:v(),computedRowSizeCacheForDetails:F().computedRowSizeCacheForDetails,rowspan:Ap(g.computedVisibleColumns,b),computedPinnedStartOverflow:R?g.computedPinnedStartColumnsWidth>R:!1,computedPinnedEndOverflow:L?g.computedPinnedEndColumnsWidth>L:!1,toggleGroupRow:k=>P.toggleGroupRow(k),columnSize:k=>Dp(g.computedVisibleColumns)(k)}},E=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,P=Hc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:S}),A={getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:S},N={getComputed:D,getDataSourceMasterContext:E,dataSourceApi:S,api:P,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>Ai(g,b),cloneRowSelection:g=>Qo(g,b)},_=l().keyDown.onChange(g=>{ff(N,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:R,rowIndex:L,colIndex:k}=g,Y=D().computedVisibleColumns[k],V=lt(Y.id,N);R.key="",qc({...N,rowIndex:L,colIndex:k,column:Y,columnApi:V},R)}),z=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:R,rowIndex:L,colIndex:k}=g,Y=D().computedVisibleColumns[k],V=lt(Y.id,N);Yc({...N,rowIndex:L,colIndex:k,column:Y,columnApi:V},R)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let R=g?g*1:null;R!=null&&!isNaN(R)&&(a.flashingDurationCSSVarValue=R)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=Ff({context:N,state:r}),{MenuPortal:G}=Gf({context:N,state:r}),{MenuPortal:se}=Kf({context:N,state:r}),{MenuPortal:Z}=Of({context:N,state:r}),Ee=g=>{let R=l(),L=g.target,k=js(L,Ma(),R.domRef.current),Y,V,Q,pe;k&&(V=Number(k.dataset.colIndex),pe=Number(k.dataset.rowIndex),Y=D().computedVisibleColumns[V].id,Q=S.getRowInfoArray()[pe].id);let ue={columnId:Y,colIndex:V,rowId:Q,rowIndex:pe,event:g,target:k??g.target};k&&R.cellContextMenu(ue),R.contextMenu(ue)},ge=Ha(g=>{a.focused=g}),xe=Ha(g=>{a.focusedWithin=g}),Ke=g=>{let R=l();if(g.target===R.domRef.current||g.target===R.scrollerDOMRef.current){if(R.focused)return;ge(!0),R.onSelfFocus?.(g),R.focusedWithin&&(xe(!1),R.onBlurWithin?.(g));return}R.focusedWithin||(xe(!0),R.onFocusWithin?.(g))},Oe=g=>{let R=l();if(g.target===R.domRef.current||g.target===R.scrollerDOMRef.current){if(!R.focused)return;ge(!1),R.onSelfBlur?.(g),R.focusedWithin&&(xe(!1),R.onBlurWithin?.(g));return}R.domRef.current?.contains(g.relatedTarget)||(xe(!1),R.onBlurWithin?.(g))},we=10,Fe=(g,R)=>{let L=!1,k=null;return(0,X.watch)([g,()=>u.value.dataArray.length],([Y],[V]=[void 0,void 0])=>{if(Y!=null&&Y!==V&&(L=!1,k!=null&&cancelAnimationFrame(k)),Y==null||L)return;let Q=(pe=0)=>{pe++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{L=R(Y),!L&&pe<we&&Q(pe)})};Q()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ce=Fe(()=>r.value.activeRowIndex,g=>P.scrollRowIntoView(g,{offset:0})),ee=Fe(()=>r.value.activeCellIndex,g=>P.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>kc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:E,actions:a,dataSourceActions:e.dataSourceActions,api:P,dataSourceApi:S},l().editingCell);(0,X.watch)([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,R,L,k,Y],[V,Q,pe,ue,me])=>{if(g&&g!==V){let le=l().editingCell,{onEditCancelled:Ce}=l();if(Ce){let Pe=H();Pe?Ce({...Pe,initialValue:le.initialValue}):Lo("onEditCancelled",le)}}if(R&&R!==Q){let le=l().editingCell,{onEditRejected:Ce}=l();if(Ce){let Pe=H();Pe?Ce({...Pe,value:le.value,error:R,initialValue:le.initialValue}):Lo("onEditRejected",le)}}if(L&&L!==pe){let le=l().editingCell,{value:Ce,initialValue:Pe}=le,{onEditAccepted:ae}=l();if(ae){let Ct=H();Ct?ae({...Ct,value:Ce,initialValue:Pe}):Lo("onEditAccepted",le)}P.persistEdit({value:Ce})}if(k&&k!==ue){let le=l().editingCell;if(le){let Ce=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[Ce]){let Pe=H();if(!Pe)Lo(Ce,le);else{let ae={...Pe,value:le.value,initialValue:le.initialValue};k instanceof Error?l().onEditPersistError?.({...ae,error:k}):l().onEditPersistSuccess?.(ae)}}}}!Y&&me&&P.focus()}),(0,X.watchEffect)(()=>{let g=r.value,R=u.value,{computedVisibleColumns:L,computedPinnedStartColumns:k,computedPinnedEndColumns:Y}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:Y.length});let Q=v();V.update({colWidth:Dp(L),rowHeight:Q,rows:R.dataArray.length,cols:L.length,rowspan:Ap(L,d)})}),(0,X.watch)(()=>r.value.wrapRowsHorizontally,(g,R)=>{if(R===g)return;let{brain:L,headerBrain:k,renderer:Y,onRenderUpdater:V}=l();L.destroy(),k.destroy(),Y.destroy(),V.destroy();let Q=Fa(uc,!!g);a.brain=Q.brain,a.headerBrain=Q.headerBrain,a.renderer=Q.renderer,a.onRenderUpdater=Q.onRenderUpdater,a.headerRenderer=Q.headerRenderer,a.headerOnRenderUpdater=Q.headerOnRenderUpdater},{flush:"post"});let q=null,J=null,oe=()=>{q&&(clearTimeout(q),q=null),J?.(),J=null};(0,X.watch)([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,R,L,k,Y])=>{oe();let V=e.dataSourceActions;if(!R){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let Q=()=>{let{rowsPerPage:pe,repeatWrappedGroupRows:ue}=d(),me=!1,le=g.rowsPerPage,Ce=(L&&L.length>0||k)&&le>0?le:null;return pe!=Ce&&(V.rowsPerPage=Ce,me=!0),ue!=Y&&(V.repeatWrappedGroupRows=Y??!1,me=!0),me};Q(),J=g.onVerticalRenderRangeChange(()=>{Q()&&(q=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),(0,X.onBeforeUnmount)(oe),(0,X.watch)(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),(0,X.watch)(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,P,{dataSourceApi:e.dataSourceApi});let{onReady:R}=l();R&&R({api:P,dataSourceApi:S})},{immediate:!0,flush:"post"}),(0,X.watch)(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let re=null,ye=null;(0,X.watch)(()=>r.value.brain,g=>{re?.(),re=g.onVerticalRenderRangeChange(R=>{d().notifyRenderRangeChange({renderStartIndex:R[0],renderEndIndex:R[1]})}),ye?.(),ye=g.onRenderRangeChange(R=>{l().onRenderRangeChange?.(R)})},{immediate:!0});let be=1,ie=0,$=null,te=null;(0,X.watch)(()=>r.value.brain,g=>{$?.(),te?.(),$=g.onRenderCountChange(()=>{ie=g.scrollTopMax}),te=g.onScrollStop(R=>{let{scrollTop:L,scrollLeft:k}=R,{onScrollToTop:Y,onScrollToBottom:V,onScrollStop:Q}=l();L===0&&Y?.();let pe=l().scrollToBottomOffset??be;if(L+pe>=ie){V?.();let{livePagination:me,livePaginationCursor:le,dataArray:Ce}=d();me&&(e.dataSourceActions.cursorId=le!==void 0?Date.now():Ce.length)}if(Q){let me=g.getRenderRange();Q({scrollTop:L,scrollLeft:k,renderRange:me,viewportSize:l().bodySize,firstVisibleRowIndex:me.start[0],lastVisibleRowIndex:me.end[0],firstVisibleColIndex:me.start[1],lastVisibleColIndex:me.end[1]})}})},{immediate:!0});let ve=null,_e=null,Te=g=>{ve=g,r.value.scrollerDOMRef.current=g,_e?.(),_e=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},_e=Jn(g,R=>{a.bodySize={width:Math.round(R.width),height:Math.round(R.height)}},{debounce:50}))};(0,X.onMounted)(()=>{ve&&(a.bodySize={width:ve.clientWidth,height:ve.clientHeight})}),(0,X.onBeforeUnmount)(()=>{_e?.(),re?.(),ye?.(),_(),O(),z(),ce(),ee()});let ze=()=>b().dataArray,$e=()=>y.value.computedColumnOrder,fe=[Sc,`${Dt}--hovered`],mt=Xt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let R=[];return g.rowHoverClassName&&(R=R.concat(g.rowHoverClassName)),R=R.concat(fe),R.join(" ").split(" ").map(L=>L.trim()).filter(Boolean)},"hoverClassNames"),rt=Xt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),Rt=Xt(()=>{let g=r.value,R=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,R.rowInfoStore,rt.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:R,fieldsToColumn:L}=y.value,k=l(),Y=k.showZebraRows,V=b().rowInfoStore,Q=rt.value;return pe=>{let{rowIndex:ue,colIndex:me,domRef:le,hidden:Ce,width:Pe,heightWithRowspan:ae,onMouseEnter:Ct,onMouseLeave:$t}=pe,Ut=ze()[ue],Ft=g[me];if(!Ut||!Ft)return null;let qe=!1,qt=k.isRowDetailEnabled,Yt=k.isRowDetailExpanded;!qt||typeof qt=="function"&&!qt(Ut)?qe=!1:Yt&&(qe=Yt(Ut)?"expanded":"collapsed");let co=P.isEditorVisibleForCell({rowIndex:ue,columnId:Ft.id});return(0,X.h)(up,{key:`${ue}:${Ft.id}`,rowIndex:ue,rowHeight:ae,width:Pe,hidden:Ce,domRef:le,column:Ft,columnsMap:R,fieldsToColumn:L,showZebraRows:Y,rowDetailState:qe,inEditMode:co,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(ue):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(ue):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:Ft.repaintCellsKey!==void 0?Ft.repaintCellsKey:k.repaintCellsKey,getData:ze,rowInfoStore:V,renderingContext:A,getComputedVisibleColumns:C,getComputedColumnOrder:$e,dataSourceStatePartial:Q,onMouseEnter:Ct,onMouseLeave:$t})}},"body.renderCell"),Mt=Xt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),R=g.isRowDetailExpanded,L=g.rowDetailRenderer;if(!R||!L)return;let k=g.rowDetailCache;return Y=>{let{rowIndex:V,domRef:Q}=Y,ue=ze()[V],me=F().computedRowSizeCacheForDetails;if(!ue||!R(ue)||!me)return(0,X.h)("div",{ref:Q,class:Ql.hidden});let{rowDetailHeight:le,rowHeight:Ce}=me.getSize(V);return(0,X.h)(gr,{rowInfo:ue,rowDetailsCache:k,rowIndex:V,domRef:Q,detailOffset:Ce,rowDetailHeight:le,rowDetailRenderer:L})}});return(0,X.provide)(Kn,{state:r,getState:l,actions:a,api:P,getComputed:D,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,R=y.value,L=iu({computedVisibleColumns:R.computedVisibleColumns,computedPinnedStartColumns:R.computedPinnedStartColumns,computedPinnedEndColumns:R.computedPinnedEndColumns,computedPinnedStartColumnsWidth:R.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:R.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:R.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:x.value}),k=g.focused,Y=g.focusedWithin,V=R.computedPinnedStartWidth??R.computedPinnedStartColumnsWidth,Q=R.computedPinnedEndWidth??R.computedPinnedEndColumnsWidth,pe=V?R.computedPinnedStartColumnsWidth>V:!1,ue=Q?R.computedPinnedEndColumnsWidth>Q:!1,{autoFocus:me,tabIndex:le,className:Ce,class:Pe,style:ae,onKeyDown:Ct,onKeydown:$t,...Ut}=g.domProps??{},Ft=ne(t.class,Ce,Pe,Ge,Vs,g.wrapRowsHorizontally?`${Ge}--horizontal-layout`:null,R.computedPinnedStartColumnsWidth?`${Ge}--has-pinned-start ${Ks}`:null,R.computedPinnedEndColumnsWidth?`${Ge}--has-pinned-end ${Gs}`:null,k?`${Ge}--focused`:null,Y?`${Ge}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,Y&&g.focusedWithinClassName?g.focusedWithinClassName:null,pe?`${Ge}--has-pinned-start-overflow`:null,ue?`${Ge}--has-pinned-end-overflow`:null,Bs({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!R.computedPinnedStartColumnsWidth,hasPinnedEnd:!!R.computedPinnedEndColumnsWidth,focused:k,focusedWithin:Y})),qe={...t.style,...ae,...L};k&&g.focusedStyle&&Object.assign(qe,g.focusedStyle),Y&&g.focusedWithinStyle&&Object.assign(qe,g.focusedWithinStyle);let qt=$t??Ct,Yt=qt?tn=>{K(tn),qt(tn)}:K,co=u.value.loading;return(0,X.h)("div",{...t,...Ut,ref:tn=>{g.domRef.current=tn??null},"data-debug-id":g.debugId,class:Ft,style:qe,onKeydown:Yt,onFocusin:Ke,onFocusout:Oe},[g.header?(0,X.h)(Sp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,(0,X.h)("div",{class:ne(np,$r),onContextmenu:Ee},[(0,X.h)(tp,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:Rt.value,renderDetailRow:Mt.value,cellHoverClassNames:mt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:Te,tabIndex:le??0,autoFocus:!!me,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:F().computedRowSizeCacheForDetails?.getRowHeight||v()}),(0,X.h)(yr,{visible:!!co},()=>g.loadingText)]),(0,X.h)("div",{ref:tn=>{g.portalDOMRef.current=tn??null},class:ne(`${Ge}Portal`,es[1e7],Zl.absolute,Xl[0],ql[0])},[(0,X.h)(B),(0,X.h)(G),(0,X.h)(se),(0,X.h)(Z)]),g.rowHeightCSSVar?(0,X.h)(zo,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,(0,X.h)(zo,{key:"flashing-duration",allowInts:!0,varName:Ae.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?(0,X.h)(zo,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?(0,X.h)(zo,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});var so=require("vue");var Ep=U(j.currentFlashingDuration),Ly=({children:o})=>o,Mp=1e3,Fp={up:ci({direction:"up"}).split(" "),down:ci({direction:"down"}).split(" "),neutral:ci({direction:"neutral"}).split(" ")},il=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=Ly}=o;return(0,so.defineComponent)({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=ro(),u=Ye(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=Fp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Ep),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:S}=u.getState(),w=typeof S=="number"?S??t??Mp:t??Mp,T=typeof y=="number"?y>C?"up":"down":"neutral",x=Fp[T];b.style.setProperty(Ep,`${w}`),b.classList.add(...e?[e,...x]:x),m=T,f=setTimeout(p,w)};return(0,so.watch)(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,S,w]=y,[T,x]=C??[];if(!(b===T&&S===x)){p(),d=!0,s=null,c=w;return}w!==c&&(d=!1,s=c,c=w,h(w,s))},{flush:"post"}),()=>{let y=l.value;return(0,so.h)("div",{...r,class:ne(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},Np=il();var uo=require("vue");var rl=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Qe(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var Op=(0,uo.defineComponent)({name:"TreeGrid",props:[...ol],setup(o,{slots:t}){return()=>(0,uo.h)(br,{...o},t)}}),kp=(0,uo.defineComponent)({name:"TreeDataSource",props:[...wa],setup(o,{slots:t}){return()=>(0,uo.h)(Li,{...o,nodesKey:o.nodesKey??"children"},t)}});var zy={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},Lp={instantEdit:zy};var Vy={CheckBox:cn,LoadMask:yr,MenuIcon:Ao};0&&(module.exports={CellSelectionState,DataSource,DataSourceInjectionKeyForVue,DeepMap,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableDetailRow,InfiniteTableInjectionKeyForVue,Menu,NumberFilterEditor,RowDetailState,RowSelectionState,StringFilterEditor,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,components,createFlashingColumnCellComponent,debounce,defaultFilterFunction,defaultFilterTypes,defaultTreeFilterFunction,flatten,group,keyboardShortcuts,multisort,multisortNested,toTreeDataArray,useDataSourceContext,useGetMasterDetailContextForVue,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfiniteTableContext,useOverlay,withSelectedLeafNodesOnly});
|
|
28
28
|
//!collapsed || lazyLoad;
|