@infinite-table/infinite-vue 10.1.0 → 10.1.1

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.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var qp=Object.create;var jo=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)jo(o,e,{get:t[e],enumerable:!0})},ul=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zp(t))!Jp.call(o,i)&&i!==e&&jo(o,i,{get:()=>t[i],enumerable:!(n=Yp(t,i))||n.enumerable});return o};var ho=(o,t,e)=>(e=o!=null?qp(Xp(o)):{},ul(t||!o||!o.__esModule?jo(e,"default",{value:o,enumerable:!0}):e,o)),tm=o=>ul(jo({},"__esModule",{value:!0}),o);var Kn=Qp((eS,iu)=>{"use strict";iu.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 Hy={};em(Hy,{CellSelectionState:()=>He,DataSource:()=>ki,DataSourceInjectionKeyForVue:()=>Qn,DeepMap:()=>W,FlashingColumnCell:()=>Np,GroupRowsState:()=>wt,InfiniteTable:()=>br,InfiniteTableClassName:()=>_p,InfiniteTableDetailRow:()=>gr,InfiniteTableInjectionKeyForVue:()=>Hn,Menu:()=>At,NumberFilterEditor:()=>bi,RowDetailState:()=>bt,RowSelectionState:()=>De,StringFilterEditor:()=>Wn,TreeDataSource:()=>kp,TreeExpandState:()=>ot,TreeGrid:()=>Op,TreeSelectionState:()=>Je,components:()=>By,createFlashingColumnCellComponent:()=>ol,debounce:()=>tn,defaultFilterFunction:()=>la,defaultFilterTypes:()=>On,defaultTreeFilterFunction:()=>vi,flatten:()=>Ol,group:()=>ei,keyboardShortcuts:()=>Lp,multisort:()=>Kt,multisortNested:()=>Ai,toTreeDataArray:()=>ga,useDataSourceContext:()=>eo,useGetMasterDetailContextForVue:()=>Ni,useInfiniteColumnCell:()=>so,useInfiniteColumnEditor:()=>Xa,useInfiniteColumnFilterEditor:()=>jn,useInfiniteHeaderCell:()=>Mo,useInfiniteTableContext:()=>Ye,useOverlay:()=>Dt,withSelectedLeafNodesOnly:()=>il});module.exports=tm(Hy);function tn(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 dl(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 go(o){return o!==void 0}function yo(o,t){let e=t[o];return go(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=yo(i,t)?t[i]:t[`default${wr(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function cl(o,t,e){let{fn:n,propertyReads:i}=dl(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function fl(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=cl(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function pl(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=cl(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 ml(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 S=[p],T=`on${wr(c)}Change`;if(l&&l[f]){let I=l[f](p,y);T=I.callbackName||T,S=I.callbackParams}u(h,T,S)}let b=i[f];typeof b=="function"&&(p=b(p));let w=!!r?.[f];yo(c,h)&&!w||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function hl(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++,yo(p,t)||yo(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 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=fl({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=pl(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=om(a?(T,...I)=>a.emit(T,...I):void 0),w=ml({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,I)=>{let x=T.props,F=I.props,N=T.parentState!==I.parentState,{newMappedState:R,newMappedStateCount:A,updatedPropsToState:E,updatedPropsToStateCount:P,rawUpdatedProps:D,rawUpdatedPropsCount:M}=hl({currentProps:x,prevProps:F,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(P>0||A>0){let O={payload:{mappedState:A?R:null,updatedPropsToState:P?E:null}},z=p.value;if(C(O),_=!0,o.onPropChange){for(let K in D)if(D.hasOwnProperty(K)){let{newValue:B,oldValue:G}=D[K];o.onPropChange({name:K,newValue:B,oldValue:G},x,w,z)}}o.onPropsChange&&M&&o.onPropsChange(D,x,w,z)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:w,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 gl=(o,t)=>o-t;var $o=(o,t)=>gl(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($o).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($o).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort($o).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=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($o);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 qo=["#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"],yl=Symbol("color"),Uo=new WeakMap,Rr=he();function Ir(o=qo){Uo.set(o,o.map(t=>0))}Ir();var im=(o=qo)=>{let t=[];Uo.has(o)?t=Uo.get(o):(t=o.map(n=>0),Uo.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]??qo[0]},Co=":",xr="*",bl="-",rm=",",am="debug",lm="diffdebug",Tl=!1,bo=new W,To=new Map;function Pr(o,t){let e=o.split(Co),n=new W;n.set(e,!0);let i=t.split(Co),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(Co)):!0}}function Sl(o,t){let e=`channel=${o}_permissions=${t}`;if(To.has(e))return To.get(e);let n=t.split(rm);function i(l){return To.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(bl);if(d&&(u=u.substring(bl.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))??`${Tl}`,Ar="",wl=Tl;function _r(o){wl=`${sm()}`=="true",Ar!==o&&(Ar=o,To.clear())}function vl(o){_r(Dr()),typeof Ve()<"u"&&Ve().addEventListener&&Ve().addEventListener("storage",function(){_r(Dr())});function t(e,n){let i=n?`${n}${Co}${e}`:e,r=i.split(Co),a=bo.get(r);if(a)return a;let l=bo.get(r.slice(0,-1)),u=(l?l.logFn:at.logFn)??Rl,d=u,s,c=0,f=()=>s??Sl(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&&wl){let S=C-c;d(`%c[${i}]`,`color: ${m}`,`+${S}ms:`)}c=C;let b=[],w;if(h.forEach(S=>{if(S[yl])w===void 0&&(w=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){w=!1;return}b.push(`${S}%s`)}}),w){let S=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...S)}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[yl]=!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:()=>{bo.delete(r)}}});return bo.set(r,p),p}return t(o)}var Rl=console.log.bind(console),Cl;Object.defineProperty(vl,"enable",{get:()=>Cl,set:o=>{Cl=o,_r(Dr())}});var at=vl;at.colors=qo;at.logFn=Rl;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=Sl;at.destroyAll=()=>{Ir(),Ir(at.colors),bo.clear(),To.clear()};var dm=at("IT:InfiniteTable"),cm="#dc3545",fm="#eb9316";var xl="Warn",Pl="Error",pm="Info",mm="Success",hm="Logs",Yo=dm.extend(hm),Cb=Yo.extend(pm),gm=Yo.extend(xl),ym=Yo.extend(Pl),Tb=Yo.extend(mm);var bm=fm,Cm=cm;var Tm=(o,t)=>{t=t?t.extend?t.extend(xl):t:gm,t(typeof t.color=="function"?t.color(bm,o):o)},Sm=(o,t)=>{t=t?t.extend?t.extend(Pl):t:ym,t(typeof t.color=="function"?t.color(Cm,o):o)};var Il=new W,Dl=(o,...t)=>{Il.has(t)||(Il.set(t,!0),o())};var Al=(o,t=o,e)=>{Dl(()=>Tm(o,e),t,"warn")},_l=(o,t=o,e)=>{Dl(()=>Sm(o,e),t,"error")};function So(o){return o}function nn(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||So)(l,o);return e.push(u),e},[])}var Zo="____not_loaded_yet____";function Er(o){return typeof o=="string"&&o.startsWith(Zo)}var wm=new W,El=new WeakMap;function Xo(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return wm;let i=El.get(t);if(i&&i.groupBy===e)return i.groups;let r=new W,a=e.length,l=[];return t.forEach(u=>{let d=nn(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))}}),El.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?nn(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?Xo(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=nn(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 Xo(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()?Xo(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(Xo(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)}),this.xcache()}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)}),this.xcache()}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 on=o=>{let t=at(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},rn=o=>{let t=at(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},wo=()=>wo;wo.extend=()=>wo;var ft=class{constructor(t){this.debug=wo,this.error=wo}};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},an=Pm;var Be=Ve().requestAnimationFrame||(o=>setTimeout(o,16)),gn=Ve().cancelAnimationFrame||(o=>clearTimeout(o));function ln(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(Nt)}function Nt(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]=Nt(o[e]));return t}var yn=Object.seal({data:null,field:null});var Tt="____root____";function sn(){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 Jo(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 Fl(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,w,S=0,T=[]){let I=!w.length||S===w.length-1,x=b[d?.values||"values"]||{};for(let F in x)if(x.hasOwnProperty(F)){let N=F;T.push(N),f.set(T,!0),C.set(T,{reducerResults:x[F][d?.totals||"totals"]||{},items:[]}),I||c(C,x[F],w,S+1,T),T.pop()}}let f=i?new W:void 0,m=[],p=Fr(n),h=Nt(p);t.visitDepthFirst((C,b,w,S)=>{let[T,...I]=b,x=C.children,F=s.get(I);if(F&&(F.cache=C.cache,F.childrenLoading=C.childrenLoading,F.childrenAvailable=C.childrenAvailable,F.error=C.error),I.length==r.length&&r.length){if(F){F.items=x;for(let R=0,A=I.length;R<A;R++){let E=I.slice(0,R),P=s.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(x))}x=a.indexArray(x,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return S?.()}for(let N=0,R=x.length;N<R;N++){if(!x[N]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...I,`${Zo}${N}`],D);continue}let A=x[N].data,E=x[N].keys||[];if(E.length){let D=E[E.length-1];I.push(D)}let P={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:A,totalChildrenCount:x[N].totalChildrenCount,totalChildrenCountUnfiltered:x[N].totalChildrenCountUnfiltered,reducerResults:x[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(I,P),i){let D=P.pivotDeepMap=new W,M=x[N].pivot;c(D,M,i,0,m)}E.length&&I.pop()}S?.()});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 Ml(o,t,e,n,i,r,a,l,u,d=So){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Jo(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&&(yn.data=n,yn.field=h,b=y(yn));let w=(C||d)(b,n);e.push(w),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Nt(u),items:[]}));let{reducerResults:S,items:T}=f.get(e);T.push(n),a&&Jo(n,i,a,S,t)}e.length=0}}function Nl(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 w=n.slice(0,C),S=t.get(w),{reducerResults:T,items:I}=S;I.push(i),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Jo(i,r,a,T,w)}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 w=y[C];Nl(o,t,e,f,w,C,a,l)}a&&vo(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=Nt(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++)Nl(o,a,l,[],t[d],d,e,i);e&&vo(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function ei(o,t){let{marker:e,groupBy:n,defaultToKey:i=So,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=Nt(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(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 w=0;w<l;w++){let{field:S,groupField:T,valueGetter:I,toKey:x}=n[w],F=S?C[S]:null;I&&(yn.data=C,yn.field=S,F=I(yn));let N=(x||i)(F,C);if(b[S||T]=N,s.push(N),!d.has(s)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(f)};r&&(R.pivotDeepMap=new W),d.set(s,R)}Ml(d,s,c,C,h,r,a,u,f,i)}l||Ml(d,s,c,C,h,r,a,u,f,i),a&&Jo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{vo(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:w,reducerResults:S},T,I,x)=>{vo(a,S,w),x?.()}),b?.()}),vo(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 Ol(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 S=r[b].field;S&&(m[S]=d[b]),S&&f[S]==null&&(f[S]=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(Zo)&&(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:sn,hasSelectedCells:sn,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 Qo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function vo(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 kl(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,w=o.length,S=e[e.length-1],T=S?S.nodeExpanded:!0;for(let I=0;I<w;I++){let x=o[I],F=d(x,I),N=[...t,F];if(l(x)){let _={id:F,nodePath:N,isGroupRow:!1,data:x,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,I],indexInParent:I,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=Qo(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let E=b.get(N)?.totalLeafNodesCount??0,P={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:F,data:x,indexInAll:r.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,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 D=!0;if(p&&(P.selfExpanded=D=p(P)),T||(D=!1),P.nodeExpanded=D,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(Qo(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let M=u(x);Array.isArray(M)&&kl(M,N,[...e,P],P.indexInParentNodes,i,r)}return r}function Ll(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return kl(t,[],[],[],o,n),e&&e.end(),{data:n}}function zl(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(I=>I.field).join(", ")}]});let b=[],w=[],S=[],T=[];return h.visitDepthFirst((I,x,F,N)=>{let R=I.items,A=x.length,E=u?.isGroupRowCollapsed(x)??!1;T.push(F);let P=Dm({lazyLoad:e,groupBy:C,parents:Array.from(S),reducers:m,indexInGroup:F,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:x,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!E&&!I.childrenAvailable)&&e,childrenAvailable:I.childrenAvailable,directChildrenCount:x.length===C.length?I.items.length:h.getDirectChildrenSizeFor(x),directChildrenLoadedCount:0},I);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 D=S[S.length-1],M=D?.collapsed??!1;M&&(E=!0),P.collapsed=E;let _=f||E;if(M&&(_=!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(Qo(se,z+G,B)),G++,P.indexInAll++)})}}b.push(P),w.push(b.length-1)}P.collapsedChildrenCount=0,S.forEach(z=>{z.deepRowInfoArray.push(P),z.collapsedGroupsCount+=E?1:0}),D&&P.selfLoaded&&e&&(D.directChildrenLoadedCount+=1),a&&a(P),S.push(P);let O=!0;if(O){if(N)N();else if(!y){let z=b.length;E||(b.length+=R.length);let K=0;for(let B=0,G=R.length;B<G;B++){let se=R[B];if(!E&&r&&i!=null&&i>0){let xe=z+B+K;if(xe%i===0){let Ke=xe/i;S.forEach(Oe=>{if(typeof r=="function"&&r(Oe)!==!0)return;let we=z+B+K;b[we]=Qo(Oe,we,Ke),K++,b.length++})}}let Z=z+B+K,ge={id:se?l(se,Z):`${x}-${B}`,data:se,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!se,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:E,groupKeys:x,parents:Array.from(S),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:A+1,groupCount:P.groupCount};s&&(ge.rowSelected=s(ge)),d&&(ge.rowDisabled=d(ge)),a&&a(ge),S.forEach((xe,Ke)=>{Ke===S.length-1&&se&&(xe.directChildrenLoadedCount+=1),E&&(xe.collapsedChildrenCount+=1),xe.deepRowInfoArray.push(ge)}),E||(b[z+B+K]=ge)}}}S.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:w}}function Mn(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 Vl(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?nn(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?nn(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?nn(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 Gl(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=ln(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){rn(`${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 $n=require("vue");var Ie=require("vue");var ne=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Kl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Bl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var St="_16lm1iw3b _16lm1iw3c _16lm1iw35",Hl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},ti={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Wl={1:"_16lm1iw1c",none:"_16lm1iw1d"},kr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var jl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},$l={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ul={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ql={none:"_16lm1iwd"},ni={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Yl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Zl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Xl={none:"_16lm1iw1x"};var Jl={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 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 es(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 ts(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?es(Object(e),!0).forEach(function(n){Fm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):es(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function ns(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=ts(ts({},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 ns(o.variantClassNames,e=>ns(e,n=>n.split(" ")[0]))}},t};var os="_1eexc2a6";var is=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:[]}),rs="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",as=Re({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ls=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"]]}),ss=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"]]}),us="_12zfob12u _16lm1iw22 _16lm1iw1z";var ds="_12zfob17",cs="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",fs=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:[]}),ps="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",ms=Re({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),hs="_12zfob1b _16lm1iw2",gs="_16lm1iw1",ys="_12zfob16",bs=Re({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Cs="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var ht="InfiniteIcon";var Ts="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Ss={transition:"width 0.25s, opacity 0.25s"},ws=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={...Ss,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,Ts,`${ht}-filter`)},[a?(0,pt.h)("div",{"data-name":"index",class:ds},`${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:[...ws]});var oi=Object.freeze({}),Om={string:oi,number:{}};function Nn(o,t){let e=t.default||oi;return o.type===void 0?e:o.type===null?oi:typeof o.type=="string"?t[o.type]||Om[o.type]||oi: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((x,F)=>{let N=x.maxSize??i??void 0,R=x.minSize??n??void 0;u.push(R),d.push(N),x.size!=null&&(N!=null&&x.size>N&&(x.size=N),R!=null&&x.size<R&&(x.size=R));let A=x.flex==0?null:x.flex;if(x.size==null&&A==null)throw`Items must specify either a size or a flex property. Item at index ${F} doesn't have either of those.`;A!=null&&(l+=1),a+=A??0,r+=x.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((x,F)=>{if(x.flex!=null){let N=c*x.flex,R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=!1,P=0;R!=null&&N>R&&(f[F]=!0,E=!0,P=R),A!=null&&N<A&&(m[F]=!0,E=!0,P=A),E&&(p+=1,l-=1,a-=x.flex,s-=P)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,w=0,S=0,T=[];return{items:e.map((x,F)=>{let N={...x},R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=0,P=f[F],D=m[F],M=P||D,_=x.size??0;if(x.flex!=null){if(M)D&&(E=A),P&&(E=R);else{y+=1;let O=z=>(R!=null&&z>R&&(z=R),A!=null&&z<A&&(z=A),z);y===l?E=O(C):(E=O(Math.round(x.flex*c)),S+=E,C=s-S,b-=x.flex,c=C/b)}_=E,N.flexSize=E}return h.push(E),T.push(_),N.computedSize=_,w+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-w)}};function ii(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 Rs(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 Ro(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((A,E)=>(A[E]={...o.columnSizing[E]},A),{});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=Rs(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,w=u?zr(u,c):"width",S=!1,T=!1,I=i>0?1:-1,{value:x,clamped:F,diff:N}=ii(Math.round(f+i),m,p,I);if(o.shareSpaceOnResize){if(u==null)return n[d]=Ro(n[d],h,x),T=F==="min",S=F==="max",{adjustedDiff:x-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:S,constrained:T||S};let{value:A,clamped:E,diff:P}=ii(Math.round(y-i),C,b,I);if(F&&E&&(Math.abs(N)>Math.abs(P)?E=!1:F=!1),!(!F&&!E)){if(F){let D=ii(Math.round(y-i-N),C,b,I);A=D.value,E=D.clamped,P=D.diff}else if(E){let D=ii(Math.round(f+i+P),m,p,I);x=D.value,F=D.clamped,N=D.diff}}n[d]=Ro(n[d],h,x),n[s]=Ro(n[s],w,A),T=F==="min"||E==="min",S=F==="max"||E==="max"}else n[d]=Ro(n[d],h,x),T=F==="min",S=F==="max";let R=x-f;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-R),columnSizing:n,minReached:T,maxReached:S,constrained:T||S}};function vs(o,t){return o+t}function km(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var Is=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,w)=>(b[w]={...o.columnSizing[w]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,w)=>o.dragHandlePositionAfter-w).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=Rs(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(vs,0)+i-s,0)}),f=a.map((b,w)=>c[w]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,w)=>{let S=a[w];if(!S.resizable){y.push(0);return}let T=d[w],I=l[w],x=km(n),{maxReached:F,minReached:N,constrained:R,adjustedDiff:A}=Gr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[w],shareSpaceOnResize:!1,items:o.items,columnSizing:x});n[S.id]=Ro(x[S.id],T,Math.round(I+A)),y.push(A),F||(p=!1),N||(m=!1),R||(h=!1)});let C=y.reduce(vs,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var ri;function Ot(){if(ri!=null)return ri;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),ri=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),ri}var xs=["start",void 0,"end"],Ps=(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:xs.indexOf(i)-xs.indexOf(r)}),o);function Ds(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 Ds(e=>e!=null,o,...t)}function As(o,t,...e){return Ds((n,i)=>!(i in o),t,...e)}var ai=!0,Lm=!0,zm=!0,_s="string",Yt="unknown";var Vm=rn("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 bn(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:_s}function Bm(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Yt];let l=bn(t,a);if(!l)return[Yt];let u=Km(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Yt)?Yt: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??ai}var Es=({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:w,columnDefaultDraggable:S,columnOrder:T,columnPinning:I,editable:x,columnDefaultEditable:F,columnDefaultFilterable:N,columnDefaultGroupable:R,columnDefaultSortable:A,columnSizing:E,columnTypes:P,columnVisibility:D,columnVisibilityAssumeVisible:M,groupBy:_})=>{let O=0,z={};_.forEach((g,v)=>{g.field&&(z[g.field]=v)});let K=(f||[]).reduce((g,v)=>{let{id:L,field:k}=v;return k&&(g[k]=v),L&&(g[L]=v),g},{}),B=Ps(T===!0?Object.keys(o):T,I),G=B.filter(g=>o[g]?Gm(D,M,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,v)=>{let L=o[g];return se.set(g,v),L}),Ee=(p??[]).reduce((g,v,L)=>(v.id?g[v.id]={sortInfo:v,index:L}:v.field&&(g[v.field]={sortInfo:v,index:L}),g),{});function ge(g){let v=o[g],L=Nn(v,P),k={minWidth:L?.minWidth,maxWidth:L?.maxWidth,width:L?.defaultWidth,flex:L?.defaultFlex},Y={width:v?.defaultWidth,flex:v?.defaultFlex,minWidth:v?.minWidth,maxWidth:v?.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??v?.minWidth??n,me=Q.maxWidth??v?.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??Ot()),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,v)=>{let L=G[v],k=Ke[v],Y=$[v]=Br(L,I);Y==="start"?te+=k:Y==="end"?_e+=k:ve+=k});let Te=e.width-_e,ze=[],$e=new Map;G.forEach((g,v)=>{let L=Z[v];$e.set(g,L)});let fe=[];Object.keys(o).forEach(g=>{let v=o[g];fe.push(g),$e.has(g)||$e.set(g,v)});let mt=new Map;$e.forEach((g,v)=>{let L=se.get(v);L==null&&(L=-1);let k=L!=-1,Y=G[L+1],V=Nn(g,P),Q=L,pe=Ee[v]?Ee[v]: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(v),Ct=k?Ke[L]:ae.size||0,jt=k&&Oe[L]||null,$t=k?we[L]||0:ae.minSize||0,Mt=k?Fe[L]||1e4:ae.maxSize||1e4,qe=k?Br(v,I):!1,Ut=k?L===G.length-1:!1,qt=Q,mo=k?qe==="start"?ye:qe==="end"?be:O-ye:0;qe=="start"?qt=k?Q:-1:qe==="end"?qt=k?Q-(ce.length+H.length):-1:qt=k?Q-ce.length:-1;let en=k?qe==="start"||qe===!1?O:Te+be:-1,zp=k?qe!==ie:!1,Vp=k?Ut||qe!==Br(Y,I):!1,rl=g.cssEllipsis??V.cssEllipsis??u,Gp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??rl,Wo=k&&(K[v]||g.field||g.groupByForColumn)&&(K[v]||K[g.field||g.groupByForColumn])||null,Kp=g.defaultFilterable??V.defaultFilterable??N??!0,Bp=x??g.defaultEditable??V.defaultEditable??F??!1,Cr=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||_s,Hp=g.sortType||V.sortType||Cr,al=g.filterType||V.filterType||Cr,ll=!1;if(Wo!=null&&!Wo.disabled){let Sr=y[al];Sr&&(!Sr.emptyValues||!Sr.emptyValues.includes(Wo.filter.value))&&(ll=!0)}let _n=g.field??V.field,Wp=g.valueGetter??V.valueGetter,Tr=g.defaultGroupable??V.defaultGroupable??R??!!_n;_n||(Tr=!1),g.groupByForColumn&&(Tr=!1);let sl=_n?z[_n]!==void 0:!1,jp=sl?z[_n]:void 0,$p=Hr(g,{colType:V,sortable:m,columnDefaultSortable:A}),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:_n,...g,components:{...V.components,...g.components},computedResizable:Up,computedMinWidth:$t,computedMaxWidth:Mt,computedFlex:jt,computedDataType:Cr,computedEditable:Bp,computedSortType:Hp,computedFilterType:al,cssEllipsis:rl,headerCssEllipsis:Gp,computedFilterValue:Wo,computedFiltered:ll,computedFilterable:Kp,computedGroupable:Tr,computedGroupedBy:sl,computedGroupedByIndex:jp,computedWidth:Ct,computedAbsoluteOffset:en,computedPinningOffset:mo,computedVisibleIndexInCategory:qt,computedOffset:O,computedSortable:$p,computedSortInfo:ue,computedSortIndex:Pe,computedMultiSort:h,computedSorted:me,computedSortedAsc:le,computedSortedDesc:Ce,computedVisibleIndex:Q,computedPinned:qe,computedDraggable:w??g.defaultDraggable??S??zm,computedFirstInCategory:zp,computedLastInCategory:Vp,computedFirst:L===0,computedLast:Ut,id:v,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=Ms(g,{fieldsToColumn:mt,userColumns:t,columnTypes:P,sortable:m,columnDefaultSortable:A})});let rt=new Map;fe.forEach(g=>{let v=oe.get(g);v&&rt.set(g,v)}),oe.forEach(g=>{rt.has(g.id)||rt.set(g.id,g)});let Rt=s!=null?Math.min(s,ye):ye,Et=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:Et,computedPinnedStartWidth:Rt,renderSelectionCheckBox:q.reduce((g,v)=>g||!!v.renderSelectionCheckBox,!1),fieldsToColumn:mt}};function Ms(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??ai,d=o.sortType??o.colType.sortType;return d!=null&&d!==Yt&&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 w=n.get(C),S=w?m.getColumnApi(w.id):void 0;if(w&&S)b=S.isSortable();else{let T=bn(r,C);if(T){let I=Hr(T,{colType:Nn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ai},!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 Io(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 li=`${Ge}HeaderCell__filter`,Wr=`${Ge}HeaderCell__filterOperator`,Fs=`${li}__input`;var de=require("vue");function U(o){return o.slice(4,-1)}function si(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 du=require("vue");var Qe=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 Ns(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function Os(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function Hm(o,t,e){let n=Ns(o,e),i=Ns(t,e);return n===i?Os(e,t)-Os(e,o):n-i}function ks(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=ks(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 Ls(o,t){if(Wm(o))return jm(o,t);o=ks(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 Ls(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(Qe.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(Qe.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function zn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var zs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Vs="_1yeub2vs",Gs="_1yeub2vr",Ks=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 _T=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`,Bs=o=>o.querySelector(`.${$r}`);var Cn=`${Ge}HeaderCell`,Ur=`${Ge}HeaderWrapper`,Hs=o=>Array.from(o.querySelectorAll(`.${Ur}`));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 Ws(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)"}}},js="column-header-height";var $s=`.${We.rootClassName}`;function qr(o){return Vn(o,$s)}var Us=U(j.scrollLeft),qm=U(j.scrollTop),Ym=U(j.columnWidthAtIndex),Yr=U(j.columnOffsetAtIndex),qs=U(j.columnReorderEffectDurationAtIndex),Zm=U(j.columnOffsetAtIndexWhileReordering),Xm=U(j.columnVisibilityAtIndex),Jm=U(j.columnZIndexAtIndex);function kt(o,t,e){let n=e?qr(e):document.querySelector($s);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 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 Zr(o,t,e){kt(`${Yr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Us}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Xr(o,t,e){kt(`${Jm}-${o}`,`${t}`,e)}function xo(o,t,e){kt(`${Zm}-${o}`,typeof t=="number"?`calc( var(${Yr}-${o}) + ${t}px )`:t,e)}function Po(o,t,e){kt(`${Xm}-${o}`,t,e)}function ui(o,t,e){kt(`${qs}-${o}`,e??"",t)}function Jr(o,t){let e=`${qs}-${o}`;kt(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,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`${Yr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,kt(this.varName.get(o),t,e)}}};function Ys(o,t){Gn({[Us]:`${o.scrollLeft}px`,[qm]:`${o.scrollTop}px`},t)}var Do={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),Zs=U(j.scrollbarWidthVertical),th=U(j.columnWidthAtIndex),nh=U(j.columnZIndexAtIndex),Xs=U(j.scrollLeft),oh=U(j.activeCellColWidth),Js=U(j.activeCellColOffset),nu=U(j.baseZIndexForCells),ih=U(j.pinnedStartWidth),Qs=U(j.bodyWidth),rh=U(j.bodyHeight),eu=U(j.pinnedEndOffset),tu=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(${nu}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function ou(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[Se.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Se.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Xs}) )`:h.computedPinned==="end"?`calc( var(${eu}) ${f.length?"+":""} ${f.map(b=>Se.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Xs}) )`:`${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[Do.browserScrollbarWidth.name]=`${Ot()}px`),m[Do.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[Do.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[Do.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${th}-${h})`).join(" + ")})`,m[Do.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[Js]=h?`calc( ${Ae.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Js]=p}return m[ah]=t.length,m[eh]=s.horizontal?`${c}px`:"0px",m[Zs]=s.vertical?`${c}px`:"0px",m[ih]="calc( "+e.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[tu]="calc( "+n.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[nu]=t.length*10,m[eu]=`calc( var(${Qs}) - var(${tu}) - var(${Zs}) )`,m[Qs]=`${l.width}px`,m[rh]=`${l.height}px`,m}var Ao=(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 Ao(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return Ao(n,s,d)}return t}var su=ho(Kn());function di(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=>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 un("+",di(o)),ru=(...o)=>new un("-",di(o)),uh=(...o)=>new un("*",di(o)),dh=(...o)=>new un("/",di(o)),_o={add:sh,subtract:ru,minus:ru,multiply:uh,divide:dh};var au=o=>{let t=null,e=null;return{stop(){t!==null&&gn(t),e!=null&&gn(e)},scroll(n){t!==null&&gn(t),e!=null&&gn(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 lu=10,ch=U(j.pinnedStartWidth);function uu(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 w(H){let q=H==="start"?z:K;return M===O?q:O===H?q+P.computedWidth:M===H?q-P.computedWidth:q}function S(H){if(H.columnIndex===D||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+w("start")&&oe+q.computedWidth<=J+s.width-w("end")}let T=(H,q)=>{let{restrictToParentGroup:J,dragColumn:oe}=q,re=[];if(H.forEach(be=>{if(be.computedVisibleIndex===D)return;let ie={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};S(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},x=i.length,F={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:F.clientX-s.left-(F.clientX-u.left)+lu,top:F.clientY-s.top-(F.clientY-u.top)+lu},R=l.getScrollPosition(),A=t.map(H=>H.computedVisibleIndex),E=A,P=e.get(r),D=P.computedVisibleIndex,M=P?.computedPinned,_=D,O=M,z=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=F,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-R.scrollLeft;return G.x=B.clientX-F.clientX,G.y=B.clientY-F.clientY,Z=G.x+re,se=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Me.from(u).shift({left:G.x,top:G.y})}function ge(H){let q=0;M?M==="start"&&H.forEach((J,oe)=>{q||t[J]?.computedPinned!=="start"&&(q=oe)}):H.forEach((J,oe)=>{t[J]?.computedPinned==="start"&&(q=oe+1)}),x=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}kt(ch,`${oe}px`,a)}}function Ke(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Po(D,"",a),p(!1)),_=H,H===-1){Oe(D);return}let q=Ao(A,D,_>D?_-1:_);x=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:x}}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=_o.minus(Se.columnOffsets.get(oe),Se.columnWidths.get(H)).done()),xo(oe,ye,a)}),Po(H,"hidden",a),p(!0)}function we(H){t.forEach(q=>{let J=q.computedVisibleIndex;H.has(J)?Jr(J,a):ui(J,a);let oe=J===D,re=se===-1?J<_||J>D:J<D||J>=_,ye="";se===-1?ye=oe?Se.columnOffsets.get(_):re?Se.columnOffsets.get(J):_o.add(Se.columnOffsets.get(J),Se.columnWidths.get(D)).done():ye=re?Se.columnOffsets.get(J):oe?_o.add(Se.columnOffsets.get(_-1),Se.columnWidths.get(_-1)).minus(Se.columnWidths.get(D)).done():_o.minus(Se.columnOffsets.get(J),Se.columnWidths.get(D)).done(),xo(J,ye,a)})}let Fe=s.left+w("start"),ce=s.right-w("end"),ee=au({scrollOffsetStart:Fe,scrollOffsetEnd:ce});return Ee(F),{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,su.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===D+1&&(re=D),Ke(re);let ye={};n.forEach(ie=>{ye[ie.id]="end"});for(let ie=0;ie<x;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:ln(o,t)},mh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function cu(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&&zn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:w,computedVisibleColumnsMap:S,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedPinnedEndColumns:x}=d(),F=S.get(t);if(!F||!F.computedDraggable){f(p);return}let N=n.current,R=N.getBoundingClientRect(),A=y.current.getBoundingClientRect(),E=C.getAvailableSize(),P=F.computedVisibleIndex,D=C.getVirtualColIndex(F.computedVisibleIndex,{pageIndex:h||0}),M=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,z=y.current,K=Me.from(Bs(z).getBoundingClientRect()),B=Hs(z).map(we=>Me.from(we.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),se=uu({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:M,draggableColumnsRestrictTo:b,computedPinnedEndColumns:x,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedVisibleColumns:w,computedVisibleColumnsMap:S,dragColumnHeaderTargetRect:R,dragColumnId:t,getCurrentDragSourceAndTarget:mh,api:c,infiniteDOMNode:y.current,setProxyPosition:we=>{a.value=we},setDragColumnOutside:we=>{l.value=we},tableRect:A,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(D),H=Fe.keepColumnRendered(D);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=F.id,h!=null&&(s.columnReorderInPageIndex=h),Xr(P,`calc( var(${fh}) + 10000 )`,y.current),y.current?.classList.add(jr),N.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?.(),N.style.cursor=_,N.hasPointerCapture?.(Fe)&&N.releasePointerCapture(Fe),N.removeEventListener("pointermove",Ke),N.removeEventListener("pointerup",Oe),a.value=null;let H=c.getColumnApi(F.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(F.id,{multiSortBehavior:ce==="replace"&&(we.ctrlKey||we.metaKey)?"append":ce}),Z?xe(Z):O&&r&&c.setVisibilityForColumn(F.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await(0,du.nextTick)(),w.forEach(q=>{ui(q.computedVisibleIndex,ee),Po(q.computedVisibleIndex,"",ee),xo(q.computedVisibleIndex,"",ee)}),Xr(P,Qr(F,{pinnedStartColsCount:T.length,visibleColsCount:w.length}),ee)})};N.addEventListener("pointermove",Ke),N.addEventListener("pointerup",Oe),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&zn(p.target)||f(p)}}}var Tn=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 fu=(0,Tn.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,Tn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,Tn.h)("path",{d:n})))}}});function It(o,t){let e=n=>(0,Tn.h)(fu,{...n,paths:t});return e.displayName=o,e}var pu=It("IncludesOperatorIcon",gt.includesOperator),mu=It("StartsWithOperatorIcon",gt.startsWithOperator),hu=It("EndsWithOperatorIcon",gt.endsWithOperator),gu=It("EqualOperatorIcon",gt.eqOperator),yu=It("NotEqualOperatorIcon",gt.neqOperator),bu=It("GTOperatorIcon",gt.gtOperator),Cu=It("GTEOperatorIcon",gt.gteOperator),Tu=It("LTOperatorIcon",gt.ltOperator),Su=It("LTEOperatorIcon",gt.lteOperator),wu=It("DoneIcon",gt.done),vu=It("ClearIcon",gt.clear),ta=o=>(0,Tn.h)(fu,{...o,viewBox:"0 -960 960 960",paths:gt.hidden});ta.displayName="HiddenIcon";var ci="_1eexc2a7 _1eexc2a6",Ru=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"]]}),Iu=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 xu="_1eexc2a5",fi=Re({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Bn="_1eexc2a8";var xt=require("vue");var Pu="qz8ht90 _16lm1iwk";var dn=(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",Pu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var Sn=require("vue");function Du(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var Au=Du({"data-name":""}),na={[Au["data-name"]]:"menu-icon"},_u=`[${Au["data-name"]}="${na["data-name"]}"]`;var hh={width:"100%",pointerEvents:"none"},oa=`${ht}-menu`,Eo=(0,Sn.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,Sn.h)("div",{class:oa,style:e}),(0,Sn.h)("div",{class:oa,style:e}),(0,Sn.h)("div",{class:oa,style:e})];return(0,Sn.h)("div",{...o.domProps,style:o.style,...na,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ne(o.className,ms({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),ht,`${ht}-menu`)},n)}}});var st=require("vue");var Eu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Mu={transition:"width 0.25s, opacity 0.25s"},Fu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var Nu=(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={...Mu,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,Eu,`${ht}-sort`)},[d?(0,st.h)("div",{"data-name":"index",style:p,class:ys},`${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:[...Fu]});var{rootClassName:Ou}=We,Lt=`${Ou}Cell`,pi=`${Ou}Cell_content`;function ia(o){return Math.max(o.width-Ot(),0)}function ku(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 wn=require("vue");function Lu(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 zu(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 Vu=require("vue"),Hn=Symbol("InfiniteTable");function Ye(){return(0,Vu.inject)(Hn)}var{rootClassName:gh}=We,yh=`${gh}HeaderCell_ResizeHandle`,Gu=(0,wn.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,wn.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"}),I=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),I()}}h.setPointerCapture(m);let C=Lu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:I}={})=>{d&&(T=T/(d+1),I&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:x,constrained:F}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==F&&(i.value=F),C.resize(x),x},w=T=>{b(Math.round(T.clientX-p))},S=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",S);let I=Math.round(T.clientX-p),x=b(I,{done:!0});y(),C.resize(0),o.onResize({diff:x,shareSpaceOnResize:f})};h.addEventListener("pointermove",w),h.addEventListener("pointerup",S)};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,wn.h)("div",{ref:c=>{n.current=c??null},class:`${yh} ${mi} ${gi({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[(0,wn.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),Ku=Symbol("InfiniteHeaderCell");function Mo(){return(0,de.inject)(Ku)}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||dn;return(0,de.h)(u,{domProps:{class:Bn},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function vn(o,t){return o(t)}var ra=()=>(0,de.h)("div",{class:Wl[1]}),Bu=(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=R=>{let A=R&&R.$el!==void 0?R.$el:R;s.current=A??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 R=o.column.id,A=l().filterDelay,E=`${R}:${A}`;if(!p||p.key!==E){let P=D=>{e.setColumnFilter(R,D)};p={key:E,fn:A>0?tn(P,{wait:A}):P}}return p.fn},y=(0,de.ref)(null),C=(0,de.ref)(!1),{onPointerDown:b}=cu({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),w=(0,de.computed)(()=>t.state.value.columnMenuVisibleForColumnId),S=(0,de.computed)(()=>t.state.value.columnReorderDragColumnId),T=(0,de.computed)(()=>t.state.value.columnReorderInPageIndex),I=(0,de.computed)(()=>t.state.value.showColumnFilters),x=(0,de.computed)(()=>t.state.value.columnHeaderHeight),F=(0,de.computed)(()=>t.state.value.components),N=(0,de.computed)(()=>a.state.value.filterTypes);return()=>{let{column:R,columnsMap:A,horizontalLayoutPageIndex:E,headerOptions:P}=o,{allRowsSelected:D,someRowsSelected:M,selectionMode:_}=o,O=R.computedSortInfo,z=R.header,K=m(),B=K.isSortable(),G=P.alwaysReserveSpaceForSortIcon,se=R.headerAlign??R.align,Z=(typeof se=="function"?se({isHeader:!0,column:R}):se)??"start",Ee=(typeof R.verticalAlign=="function"?R.verticalAlign({isHeader:!0,column:R}):R.verticalAlign)??"center",ge=B&&(R.computedSorted||G)?(0,de.h)(Nu,{index:R.computedMultiSort?R.computedSortIndex+1:void 0,style:{marginInlineStart:Ae.spacing[2],marginInlineEnd:Ae.spacing[2]},className:`${Cn}__sort-icon ${gs} ${bs({align:Z})}`,direction:R.computedSorted?R.computedSortedAsc?1:-1:0}):null,Ke=R.computedFilterable&&R.computedFiltered?(0,de.h)(Fn):null,Oe=R.headerCssEllipsis??R.cssEllipsis??!0,we=w.value,Fe=S.value,ce=T.value,ee=Fe===R.id,H=ce!=null?E!==ce:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:we===R.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=R.components?.MenuIcon||F.value?.MenuIcon||Eo,oe=(0,de.h)(J,q),re=I.value,ye=N.value,be=R.computedFilterType,ie=ye[be],$=R.computedFilterable?R.computedFilterValue?.filter.operator??ie?.defaultOperator:void 0,te=R.computedFilterable&&ie?ie.operators.find(ae=>ae.name===$):void 0,ve=te?.components?.FilterEditor||ie?.components?.FilterEditor||R.components?.FilterEditor||Wn,_e=ie?.components?.FilterOperatorSwitch||R.components?.FilterOperatorSwitch||Wu,Te=R.computedFilterable?(0,de.h)(Hu,{filterProps:{horizontalLayoutPageIndex:E,filterEditor:ve,filterOperatorSwitch:_e,operator:te,filterTypes:ye,onChange:h(),columnFilterType:be,columnLabel:R.field||R.name||R.id,columnFilterValue:R.computedFilterValue,columnHeaderHeight:x.value}}):(0,de.h)(ju),ze={horizontalLayoutPageIndex:E,dragging:ee,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:R,columnsMap:A,columnSortInfo:O,columnFilterValue:R.computedFilterValue,filtered:R.computedFiltered,someRowsSelected:M,allRowsSelected:D,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:ge,filterIcon:Ke,menuIcon:oe,menuIconProps:q,selectionCheckBox:null,header:R.header&&typeof R.header!="function"?R.header:R.name}},$e=ze;$e.renderBag.filterEditor=Te,f.value=$e;let fe={...ze,renderBag:{...ze.renderBag}};if(R.renderSortIcon&&(fe.renderBag.sortIcon=vn(R.renderSortIcon,{...fe,renderBag:{...fe.renderBag}})),R.renderFilterIcon&&(fe.renderBag.filterIcon=vn(R.renderFilterIcon,{...fe,renderBag:{...fe.renderBag}})),typeof R.renderMenuIcon=="function"){let ae=vn(R.renderMenuIcon,{...fe,renderBag:{...fe.renderBag}});fe.renderBag.menuIcon=ae?ae.type===J||ae.type===Eo?ae:(0,de.h)(J,q,()=>ae):null}if(R.renderSelectionCheckBox&&_==="multi-row"){fe.renderBag.selectionCheckBox=vn(wh,{...fe,renderBag:{...fe.renderBag}});let ae=R.renderHeaderSelectionCheckBox??R.renderSelectionCheckBox;ae&&ae!==!0&&(fe.renderBag.selectionCheckBox=vn(ae,{...fe,renderBag:{...fe.renderBag}}))}z instanceof Function&&(fe.renderBag.header=vn(z,{...fe,renderBag:{...fe.renderBag}}));let mt=Oe?(0,de.h)("div",{class:St},[fe.renderBag.header]):fe.renderBag.header,rt=R.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],Et=R.renderHeader?vn(R.renderHeader,{...fe,renderBag:{...fe.renderBag,all:Rt}}):Rt,Ue={height:`${o.height}px`};R.headerStyle&&(Ue=typeof R.headerStyle=="function"?{...Ue,...R.headerStyle($e)||{}}:{...Ue,...R.headerStyle});let g=typeof R.headerClassName=="function"?R.headerClassName($e):R.headerClassName,v=`var(${Th}-${R.computedVisibleIndex})`;Ue.zIndex=v,Ue.visibility=`var(${Sh}-${R.computedVisibleIndex}, visible)`,Ue.width=`var(${bh}-${R.computedVisibleIndex})`,Ue.transition=`transform var(${Ch}-${R.computedVisibleIndex}, 0s)`;let L={filtered:R.computedFiltered,verticalAlign:Ee,align:Z},k={"data-field":`${R.field||""}`,"data-column-id":R.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":R.computedSortedAsc?"asc":R.computedSortedDesc?"desc":"none","data-sort-index":`${R.computedSortIndex??-1}`},Y=ne(Cn,Xl.none,B?Hl.pointer:"",g,si(R,[Cn,Lt],ls,{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}),os,Lt,ci),V=(0,de.h)("div",{class:ne(pi,Oe?St:ni.hidden,is(L),$l[Z]),style:re?{height:`${o.height/2}px`}:void 0},[Et]),Q=ae=>ku({context:{getState:i,getComputed:r},column:R,diff:ae.diff,shareSpaceOnResize:ae.shareSpaceOnResize}),pe=R.computedResizable?(0,de.h)(Gu,{horizontalLayoutPageIndex:E,columns:r().computedVisibleColumns,columnIndex:R.computedVisibleIndex,computeResize:Q,onResize:ae=>{let{columnSizing:Ct,reservedWidth:jt}=Q(ae);ae.shareSpaceOnResize||(n.viewportReservedWidth=jt),n.columnSizing=Ct}}):null,ue=[re?Te:null,pe],me={ref:c,...k,"data-z-index":v,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:R.id,class:`${Cn}Proxy ${rs}`,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:as({visible:C.value})},[(0,de.h)(ta,{size:16})]),fe.renderBag.header])]));let Pe=R.components?.HeaderCell;return Pe?[(0,de.h)(Pe,me,{default:()=>[V,ue]}),le]:[(0,de.h)("div",me,[V,ue]),le]}}});var $u=Symbol("InfiniteColumnHeaderFilter"),yi=o=>o.stopPropagation(),Hu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=Ye(),e=Mo(),n=(0,Ie.shallowRef)(o.filterProps);(0,Ie.provide)($u,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:`${li} ${Lr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Ie.h)(c),(0,Ie.h)(s)])}}}),Wu=(0,Ie.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=jn();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,cs,t?`${Wr}--disabled`:"")},[(0,Ie.h)(n,{size:20,className:`${fs({disabled:!!t})}`})])}}}),ju=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Ie.h)("div",{onPointerup:yi,onPointerdown:yi,class:`${li} ${Lr({active:!1})} ${jl["50%"]}`})}});function jn(){let o=Ye(),t=Mo(),e=(0,Ie.inject)($u),{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:w,filterTypes:S}=e.value;return S[w]}),m=(0,Ie.ref)(e.value.columnFilterValue?.filter.value??"");(0,Ie.watch)(()=>e.value.columnFilterValue?.filter.value,w=>{if(e.value.columnFilterValue)m.value!==w&&(m.value=w);else{let S=f.value;if(S){let T=[...S.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=w=>{m.value=w,e.value.onChange(w)},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 ${Io(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:`${us} ${Fs}`}}var Wn=(0,$n.defineComponent)({name:"StringFilterEditor",setup(){let o=jn();return()=>(0,$n.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,$n.defineComponent)({name:"NumberFilterEditor",setup(){let o=jn();return()=>(0,$n.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 Uu(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 On=Uu({StringFilterEditor:Wn,NumberFilterEditor:bi,icons:{includes:pu,eq:gu,neq:yu,startsWith:mu,endsWith:hu,gt:bu,gte:Cu,lt:Tu,lte:Su}});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,w=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(w&&w.length){for(let S=0,T=w.length;S<T;S++){let I=w[S];if(I.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),I.type==="update"&&!h&&(p={...p,...I.data},c[m]=p),I.type==="update-children"&&!h){let x=I.children(p[l],p);p={...p},x!==void 0?p[l]=x:delete p[l],c[m]=p}I.type==="insert"&&(I.position==="before"?(c.splice(m,0,I.data),m--):c.splice(m+1,0,I.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let S=a(p),T=S?null:r(p);!S&&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 qu=new WeakMap;function wi(o,t){if(!o||!o.length)return[];let e=qu.get(o);e||(e=new WeakMap,qu.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",Yu="group-by-";function Zu(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=Zu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Yu)){let r=i.id.slice(Yu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Zu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function Vt(){let o=Ve().performance?.now();return`${Date.now()}:${o}`}var Xu=!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 Gt(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=Qu(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 Un(o,t,e,n,i){let r=Gt(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:Xu,totalCount:0}),e.originalLazyGroupDataChangeDetect=Vt()}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);if(c.length&&f&&!f.childrenAvailable)f.childrenLoading=!1,f.cache=!1,f.error=m,e.originalLazyGroupDataChangeDetect=Vt();else{let p=t.lazyLoadCacheOfLoadedBatches,h=[...c,r.lazyLoadStartIndex??0];p.has(h)&&p.set(h,"failed"),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,w){let S=[Tt,...C],T=b.data,I={cache:b.cache??Xu,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??T.length,totalCountUnfiltered:b.totalCountUnfiltered,totalChildrenCount:b.totalChildrenCount,totalChildrenCountUnfiltered:b.totalChildrenCountUnfiltered,children:T,error:b.error},x=[];if(r.lazyLoadBatchSize&&!w){let N=h.get(S),R=!N,A=As({children:!0},N||{},I);R&&(A.chidren=[]),A.children.length=A.totalCount;let E=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,E+r.lazyLoadBatchSize);for(let D=E;D<P;D++){let M=I.children[D-E];if(!M)throw`lazily loaded item not found at index ${D-E}`;A.children[D]=M,M.dataset&&x.push({keys:M.keys,dataset:M.dataset})}R&&h.set(S,A)}else I.children.forEach(N=>{N&&N.dataset&&x.push({keys:N.keys,dataset:N.dataset})}),I.children.length=I.totalCount,h.set(S,I);let F=!1;if(!C||!C.length){let N=h.get([Tt]);e.originalDataArray=[...N.children],F=!0}if(F||(e.originalLazyGroupDataChangeDetect=Vt()),x.length){let N=C;x.forEach(({keys:R,dataset:A})=>{y(R,A,N)})}};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 Qu(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(Ju):(Si(o,t)||[]).map(Ju)}function Ju(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function ed(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=Qu(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 td(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 nd(o){for(let[t,e]of o.entries())e==="failed"&&o.delete(t)}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 w=b.length?b:f,S=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},I=y.groupKeys,x=c.get(I);if(!x?.[y.id]){let F=!x;x=x||{},x[y.id]||(x[y.id]=T),F&&c.set(I,x)}}if(!C&&i!=null){let T=c.get(w),I=Math.floor(S/i)*i,x=S-I,F=u[y.indexInAll-x].indexInAll,N=d(F),R=u[F].id;if(N||T?.[R])continue;let A=!T;T=T||{};let E={lazyLoadStartIndex:I,lazyLoadBatchSize:i,groupKeys:b,append:s};T[R]||(T[R]=E),A&&c.set(w,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(()=>Un(...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 qn=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 qn{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=[],w=l();for(let S of w){let T=p[S],I=f[S];if(I===void 0){b.push(S);continue}Vh(T,I)||b.push(S)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let S=0,T=b.length;S<T;S++){let I=b[S],x=t.get(I);if(x)for(let F of x)F()}if(C)for(let S of Array.from(e))S()}),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,Je=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 cn(o,t){return t().dataArray[o]}function Pi(o){return o().dataArray}function Zn(o,t){return new Je(o,Yn(t))}function Yn(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 Je))throw"Invalid tree selection";let a=new Je(i,Yn(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?cn(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 Je))throw"Invalid node selection";let n=new Je(t,Yn(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 Je))throw"Invalid node selection";let n=new Je(t,Yn(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 Je))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 Xn(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:on(`${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],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",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?Gl(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=>({...an,...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"),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}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.
1
+ "use strict";var qp=Object.create;var jo=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)jo(o,e,{get:t[e],enumerable:!0})},ul=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zp(t))!Jp.call(o,i)&&i!==e&&jo(o,i,{get:()=>t[i],enumerable:!(n=Yp(t,i))||n.enumerable});return o};var ho=(o,t,e)=>(e=o!=null?qp(Xp(o)):{},ul(t||!o||!o.__esModule?jo(e,"default",{value:o,enumerable:!0}):e,o)),tm=o=>ul(jo({},"__esModule",{value:!0}),o);var Kn=Qp((eS,iu)=>{"use strict";iu.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 Hy={};em(Hy,{CellSelectionState:()=>He,DataSource:()=>ki,DataSourceInjectionKeyForVue:()=>Qn,DeepMap:()=>W,FlashingColumnCell:()=>Np,GroupRowsState:()=>wt,InfiniteTable:()=>br,InfiniteTableClassName:()=>_p,InfiniteTableDetailRow:()=>gr,InfiniteTableInjectionKeyForVue:()=>Hn,Menu:()=>At,NumberFilterEditor:()=>bi,RowDetailState:()=>bt,RowSelectionState:()=>De,StringFilterEditor:()=>Wn,TreeDataSource:()=>kp,TreeExpandState:()=>ot,TreeGrid:()=>Op,TreeSelectionState:()=>Je,components:()=>By,createFlashingColumnCellComponent:()=>ol,debounce:()=>tn,defaultFilterFunction:()=>la,defaultFilterTypes:()=>On,defaultTreeFilterFunction:()=>vi,flatten:()=>Ol,group:()=>ei,keyboardShortcuts:()=>Lp,multisort:()=>Kt,multisortNested:()=>Ai,toTreeDataArray:()=>ga,useDataSourceContext:()=>eo,useGetMasterDetailContextForVue:()=>Ni,useInfiniteColumnCell:()=>so,useInfiniteColumnEditor:()=>Xa,useInfiniteColumnFilterEditor:()=>jn,useInfiniteHeaderCell:()=>Mo,useInfiniteTableContext:()=>Ye,useOverlay:()=>Dt,withSelectedLeafNodesOnly:()=>il});module.exports=tm(Hy);function tn(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 dl(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 go(o){return o!==void 0}function yo(o,t){let e=t[o];return go(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=yo(i,t)?t[i]:t[`default${wr(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function cl(o,t,e){let{fn:n,propertyReads:i}=dl(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function fl(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=cl(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function pl(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=cl(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 ml(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 S=[p],T=`on${wr(c)}Change`;if(l&&l[f]){let I=l[f](p,y);T=I.callbackName||T,S=I.callbackParams}u(h,T,S)}let b=i[f];typeof b=="function"&&(p=b(p));let w=!!r?.[f];yo(c,h)&&!w||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function hl(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++,yo(p,t)||yo(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 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=fl({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=pl(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=om(a?(T,...I)=>a.emit(T,...I):void 0),w=ml({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,I)=>{let x=T.props,F=I.props,N=T.parentState!==I.parentState,{newMappedState:R,newMappedStateCount:A,updatedPropsToState:E,updatedPropsToStateCount:P,rawUpdatedProps:D,rawUpdatedPropsCount:M}=hl({currentProps:x,prevProps:F,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(P>0||A>0){let O={payload:{mappedState:A?R:null,updatedPropsToState:P?E:null}},z=p.value;if(C(O),_=!0,o.onPropChange){for(let K in D)if(D.hasOwnProperty(K)){let{newValue:B,oldValue:G}=D[K];o.onPropChange({name:K,newValue:B,oldValue:G},x,w,z)}}o.onPropsChange&&M&&o.onPropsChange(D,x,w,z)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),(0,tt.onBeforeUnmount)(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:w,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 gl=(o,t)=>o-t;var $o=(o,t)=>gl(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($o).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($o).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort($o).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=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($o);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 qo=["#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"],yl=Symbol("color"),Uo=new WeakMap,Rr=he();function Ir(o=qo){Uo.set(o,o.map(t=>0))}Ir();var im=(o=qo)=>{let t=[];Uo.has(o)?t=Uo.get(o):(t=o.map(n=>0),Uo.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]??qo[0]},Co=":",xr="*",bl="-",rm=",",am="debug",lm="diffdebug",Tl=!1,bo=new W,To=new Map;function Pr(o,t){let e=o.split(Co),n=new W;n.set(e,!0);let i=t.split(Co),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(Co)):!0}}function Sl(o,t){let e=`channel=${o}_permissions=${t}`;if(To.has(e))return To.get(e);let n=t.split(rm);function i(l){return To.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(bl);if(d&&(u=u.substring(bl.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))??`${Tl}`,Ar="",wl=Tl;function _r(o){wl=`${sm()}`=="true",Ar!==o&&(Ar=o,To.clear())}function vl(o){_r(Dr()),typeof Ve()<"u"&&Ve().addEventListener&&Ve().addEventListener("storage",function(){_r(Dr())});function t(e,n){let i=n?`${n}${Co}${e}`:e,r=i.split(Co),a=bo.get(r);if(a)return a;let l=bo.get(r.slice(0,-1)),u=(l?l.logFn:at.logFn)??Rl,d=u,s,c=0,f=()=>s??Sl(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&&wl){let S=C-c;d(`%c[${i}]`,`color: ${m}`,`+${S}ms:`)}c=C;let b=[],w;if(h.forEach(S=>{if(S[yl])w===void 0&&(w=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){w=!1;return}b.push(`${S}%s`)}}),w){let S=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...S)}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[yl]=!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:()=>{bo.delete(r)}}});return bo.set(r,p),p}return t(o)}var Rl=console.log.bind(console),Cl;Object.defineProperty(vl,"enable",{get:()=>Cl,set:o=>{Cl=o,_r(Dr())}});var at=vl;at.colors=qo;at.logFn=Rl;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=Sl;at.destroyAll=()=>{Ir(),Ir(at.colors),bo.clear(),To.clear()};var dm=at("IT:InfiniteTable"),cm="#dc3545",fm="#eb9316";var xl="Warn",Pl="Error",pm="Info",mm="Success",hm="Logs",Yo=dm.extend(hm),Cb=Yo.extend(pm),gm=Yo.extend(xl),ym=Yo.extend(Pl),Tb=Yo.extend(mm);var bm=fm,Cm=cm;var Tm=(o,t)=>{t=t?t.extend?t.extend(xl):t:gm,t(typeof t.color=="function"?t.color(bm,o):o)},Sm=(o,t)=>{t=t?t.extend?t.extend(Pl):t:ym,t(typeof t.color=="function"?t.color(Cm,o):o)};var Il=new W,Dl=(o,...t)=>{Il.has(t)||(Il.set(t,!0),o())};var Al=(o,t=o,e)=>{Dl(()=>Tm(o,e),t,"warn")},_l=(o,t=o,e)=>{Dl(()=>Sm(o,e),t,"error")};function So(o){return o}function nn(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||So)(l,o);return e.push(u),e},[])}var Zo="____not_loaded_yet____";function Er(o){return typeof o=="string"&&o.startsWith(Zo)}var wm=new W,El=new WeakMap;function Xo(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return wm;let i=El.get(t);if(i&&i.groupBy===e)return i.groups;let r=new W,a=e.length,l=[];return t.forEach(u=>{let d=nn(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))}}),El.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?nn(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?Xo(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=nn(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 Xo(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()?Xo(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(Xo(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)}),this.xcache()}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)}),this.xcache()}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 on=o=>{let t=at(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},rn=o=>{let t=at(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},wo=()=>wo;wo.extend=()=>wo;var ft=class{constructor(t){this.debug=wo,this.error=wo}};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},an=Pm;var Be=Ve().requestAnimationFrame||(o=>setTimeout(o,16)),gn=Ve().cancelAnimationFrame||(o=>clearTimeout(o));function ln(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(Nt)}function Nt(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]=Nt(o[e]));return t}var yn=Object.seal({data:null,field:null});var Tt="____root____";function sn(){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 Jo(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 Fl(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,w,S=0,T=[]){let I=!w.length||S===w.length-1,x=b[d?.values||"values"]||{};for(let F in x)if(x.hasOwnProperty(F)){let N=F;T.push(N),f.set(T,!0),C.set(T,{reducerResults:x[F][d?.totals||"totals"]||{},items:[]}),I||c(C,x[F],w,S+1,T),T.pop()}}let f=i?new W:void 0,m=[],p=Fr(n),h=Nt(p);t.visitDepthFirst((C,b,w,S)=>{let[T,...I]=b,x=C.children,F=s.get(I);if(F&&(F.cache=C.cache,F.childrenLoading=C.childrenLoading,F.childrenAvailable=C.childrenAvailable,F.error=C.error),I.length==r.length&&r.length){if(F){F.items=x;for(let R=0,A=I.length;R<A;R++){let E=I.slice(0,R),P=s.get(E);P&&(P.items=P.items||[],P.items=P.items.concat(x))}x=a.indexArray(x,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return S?.()}for(let N=0,R=x.length;N<R;N++){if(!x[N]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...I,`${Zo}${N}`],D);continue}let A=x[N].data,E=x[N].keys||[];if(E.length){let D=E[E.length-1];I.push(D)}let P={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:A,totalChildrenCount:x[N].totalChildrenCount,totalChildrenCountUnfiltered:x[N].totalChildrenCountUnfiltered,reducerResults:x[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(I,P),i){let D=P.pivotDeepMap=new W,M=x[N].pivot;c(D,M,i,0,m)}E.length&&I.pop()}S?.()});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 Ml(o,t,e,n,i,r,a,l,u,d=So){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Jo(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&&(yn.data=n,yn.field=h,b=y(yn));let w=(C||d)(b,n);e.push(w),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Nt(u),items:[]}));let{reducerResults:S,items:T}=f.get(e);T.push(n),a&&Jo(n,i,a,S,t)}e.length=0}}function Nl(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 w=n.slice(0,C),S=t.get(w),{reducerResults:T,items:I}=S;I.push(i),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Jo(i,r,a,T,w)}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 w=y[C];Nl(o,t,e,f,w,C,a,l)}a&&vo(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=Nt(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++)Nl(o,a,l,[],t[d],d,e,i);e&&vo(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function ei(o,t){let{marker:e,groupBy:n,defaultToKey:i=So,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=Nt(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(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 w=0;w<l;w++){let{field:S,groupField:T,valueGetter:I,toKey:x}=n[w],F=S?C[S]:null;I&&(yn.data=C,yn.field=S,F=I(yn));let N=(x||i)(F,C);if(b[S||T]=N,s.push(N),!d.has(s)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Nt(f)};r&&(R.pivotDeepMap=new W),d.set(s,R)}Ml(d,s,c,C,h,r,a,u,f,i)}l||Ml(d,s,c,C,h,r,a,u,f,i),a&&Jo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{vo(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:w,reducerResults:S},T,I,x)=>{vo(a,S,w),x?.()}),b?.()}),vo(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 Ol(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 S=r[b].field;S&&(m[S]=d[b]),S&&f[S]==null&&(f[S]=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(Zo)&&(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:sn,hasSelectedCells:sn,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 Qo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function vo(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 kl(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,w=o.length,S=e[e.length-1],T=S?S.nodeExpanded:!0;for(let I=0;I<w;I++){let x=o[I],F=d(x,I),N=[...t,F];if(l(x)){let _={id:F,nodePath:N,isGroupRow:!1,data:x,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,I],indexInParent:I,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=Qo(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let E=b.get(N)?.totalLeafNodesCount??0,P={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:F,data:x,indexInAll:r.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:sn,hasSelectedCells:sn,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 D=!0;if(p&&(P.selfExpanded=D=p(P)),T||(D=!1),P.nodeExpanded=D,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(Qo(B,_+K,z)),K++,P.indexInAll++)})}}T&&(r[P.indexInAll]=P);let M=u(x);Array.isArray(M)&&kl(M,N,[...e,P],P.indexInParentNodes,i,r)}return r}function Ll(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return kl(t,[],[],[],o,n),e&&e.end(),{data:n}}function zl(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(I=>I.field).join(", ")}]});let b=[],w=[],S=[],T=[];return h.visitDepthFirst((I,x,F,N)=>{let R=I.items,A=x.length,E=u?.isGroupRowCollapsed(x)??!1;T.push(F);let P=Dm({lazyLoad:e,groupBy:C,parents:Array.from(S),reducers:m,indexInGroup:F,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:x,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!E&&!I.childrenAvailable)&&e,childrenAvailable:I.childrenAvailable,directChildrenCount:x.length===C.length?I.items.length:h.getDirectChildrenSizeFor(x),directChildrenLoadedCount:0},I);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 D=S[S.length-1],M=D?.collapsed??!1;M&&(E=!0),P.collapsed=E;let _=f||E;if(M&&(_=!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(Qo(se,z+G,B)),G++,P.indexInAll++)})}}b.push(P),w.push(b.length-1)}P.collapsedChildrenCount=0,S.forEach(z=>{z.deepRowInfoArray.push(P),z.collapsedGroupsCount+=E?1:0}),D&&P.selfLoaded&&e&&(D.directChildrenLoadedCount+=1),a&&a(P),S.push(P);let O=!0;if(O){if(N)N();else if(!y){let z=b.length;E||(b.length+=R.length);let K=0;for(let B=0,G=R.length;B<G;B++){let se=R[B];if(!E&&r&&i!=null&&i>0){let xe=z+B+K;if(xe%i===0){let Ke=xe/i;S.forEach(Oe=>{if(typeof r=="function"&&r(Oe)!==!0)return;let we=z+B+K;b[we]=Qo(Oe,we,Ke),K++,b.length++})}}let Z=z+B+K,ge={id:se?l(se,Z):`${x}-${B}`,data:se,isCellSelected:sn,hasSelectedCells:sn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!se,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:E,groupKeys:x,parents:Array.from(S),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:A+1,groupCount:P.groupCount};s&&(ge.rowSelected=s(ge)),d&&(ge.rowDisabled=d(ge)),a&&a(ge),S.forEach((xe,Ke)=>{Ke===S.length-1&&se&&(xe.directChildrenLoadedCount+=1),E&&(xe.collapsedChildrenCount+=1),xe.deepRowInfoArray.push(ge)}),E||(b[z+B+K]=ge)}}}S.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:w}}function Mn(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 Vl(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?nn(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?nn(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?nn(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 Gl(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=ln(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){rn(`${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 $n=require("vue");var Ie=require("vue");var ne=(...o)=>o.filter(t=>!!`${t}`).join(" ");var Kl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Bl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var St="_16lm1iw3b _16lm1iw3c _16lm1iw35",Hl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},ti={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Wl={1:"_16lm1iw1c",none:"_16lm1iw1d"},kr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var jl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},$l={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Ul={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ql={none:"_16lm1iwd"},ni={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Yl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Zl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Xl={none:"_16lm1iw1x"};var Jl={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 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 es(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 ts(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?es(Object(e),!0).forEach(function(n){Fm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):es(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function ns(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=ts(ts({},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 ns(o.variantClassNames,e=>ns(e,n=>n.split(" ")[0]))}},t};var os="_1eexc2a6";var is=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:[]}),rs="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",as=Re({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),ls=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"]]}),ss=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"]]}),us="_12zfob12u _16lm1iw22 _16lm1iw1z";var ds="_12zfob17",cs="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",fs=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:[]}),ps="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",ms=Re({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),hs="_12zfob1b _16lm1iw2",gs="_16lm1iw1",ys="_12zfob16",bs=Re({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Cs="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var ht="InfiniteIcon";var Ts="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Ss={transition:"width 0.25s, opacity 0.25s"},ws=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={...Ss,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,Ts,`${ht}-filter`)},[a?(0,pt.h)("div",{"data-name":"index",class:ds},`${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:[...ws]});var oi=Object.freeze({}),Om={string:oi,number:{}};function Nn(o,t){let e=t.default||oi;return o.type===void 0?e:o.type===null?oi:typeof o.type=="string"?t[o.type]||Om[o.type]||oi: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((x,F)=>{let N=x.maxSize??i??void 0,R=x.minSize??n??void 0;u.push(R),d.push(N),x.size!=null&&(N!=null&&x.size>N&&(x.size=N),R!=null&&x.size<R&&(x.size=R));let A=x.flex==0?null:x.flex;if(x.size==null&&A==null)throw`Items must specify either a size or a flex property. Item at index ${F} doesn't have either of those.`;A!=null&&(l+=1),a+=A??0,r+=x.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((x,F)=>{if(x.flex!=null){let N=c*x.flex,R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=!1,P=0;R!=null&&N>R&&(f[F]=!0,E=!0,P=R),A!=null&&N<A&&(m[F]=!0,E=!0,P=A),E&&(p+=1,l-=1,a-=x.flex,s-=P)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,w=0,S=0,T=[];return{items:e.map((x,F)=>{let N={...x},R=x.maxSize??i??void 0,A=x.minSize??n??void 0,E=0,P=f[F],D=m[F],M=P||D,_=x.size??0;if(x.flex!=null){if(M)D&&(E=A),P&&(E=R);else{y+=1;let O=z=>(R!=null&&z>R&&(z=R),A!=null&&z<A&&(z=A),z);y===l?E=O(C):(E=O(Math.round(x.flex*c)),S+=E,C=s-S,b-=x.flex,c=C/b)}_=E,N.flexSize=E}return h.push(E),T.push(_),N.computedSize=_,w+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-w)}};function ii(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 Rs(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 Ro(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((A,E)=>(A[E]={...o.columnSizing[E]},A),{});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=Rs(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,w=u?zr(u,c):"width",S=!1,T=!1,I=i>0?1:-1,{value:x,clamped:F,diff:N}=ii(Math.round(f+i),m,p,I);if(o.shareSpaceOnResize){if(u==null)return n[d]=Ro(n[d],h,x),T=F==="min",S=F==="max",{adjustedDiff:x-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:S,constrained:T||S};let{value:A,clamped:E,diff:P}=ii(Math.round(y-i),C,b,I);if(F&&E&&(Math.abs(N)>Math.abs(P)?E=!1:F=!1),!(!F&&!E)){if(F){let D=ii(Math.round(y-i-N),C,b,I);A=D.value,E=D.clamped,P=D.diff}else if(E){let D=ii(Math.round(f+i+P),m,p,I);x=D.value,F=D.clamped,N=D.diff}}n[d]=Ro(n[d],h,x),n[s]=Ro(n[s],w,A),T=F==="min"||E==="min",S=F==="max"||E==="max"}else n[d]=Ro(n[d],h,x),T=F==="min",S=F==="max";let R=x-f;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-R),columnSizing:n,minReached:T,maxReached:S,constrained:T||S}};function vs(o,t){return o+t}function km(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var Is=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,w)=>(b[w]={...o.columnSizing[w]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,w)=>o.dragHandlePositionAfter-w).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=Rs(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(vs,0)+i-s,0)}),f=a.map((b,w)=>c[w]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,w)=>{let S=a[w];if(!S.resizable){y.push(0);return}let T=d[w],I=l[w],x=km(n),{maxReached:F,minReached:N,constrained:R,adjustedDiff:A}=Gr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[w],shareSpaceOnResize:!1,items:o.items,columnSizing:x});n[S.id]=Ro(x[S.id],T,Math.round(I+A)),y.push(A),F||(p=!1),N||(m=!1),R||(h=!1)});let C=y.reduce(vs,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var ri;function Ot(){if(ri!=null)return ri;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),ri=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),ri}var xs=["start",void 0,"end"],Ps=(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:xs.indexOf(i)-xs.indexOf(r)}),o);function Ds(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 Ds(e=>e!=null,o,...t)}function As(o,t,...e){return Ds((n,i)=>!(i in o),t,...e)}var ai=!0,Lm=!0,zm=!0,_s="string",Yt="unknown";var Vm=rn("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 bn(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:_s}function Bm(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Yt];let l=bn(t,a);if(!l)return[Yt];let u=Km(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Yt)?Yt: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??ai}var Es=({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:w,columnDefaultDraggable:S,columnOrder:T,columnPinning:I,editable:x,columnDefaultEditable:F,columnDefaultFilterable:N,columnDefaultGroupable:R,columnDefaultSortable:A,columnSizing:E,columnTypes:P,columnVisibility:D,columnVisibilityAssumeVisible:M,groupBy:_})=>{let O=0,z={};_.forEach((g,v)=>{g.field&&(z[g.field]=v)});let K=(f||[]).reduce((g,v)=>{let{id:L,field:k}=v;return k&&(g[k]=v),L&&(g[L]=v),g},{}),B=Ps(T===!0?Object.keys(o):T,I),G=B.filter(g=>o[g]?Gm(D,M,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,v)=>{let L=o[g];return se.set(g,v),L}),Ee=(p??[]).reduce((g,v,L)=>(v.id?g[v.id]={sortInfo:v,index:L}:v.field&&(g[v.field]={sortInfo:v,index:L}),g),{});function ge(g){let v=o[g],L=Nn(v,P),k={minWidth:L?.minWidth,maxWidth:L?.maxWidth,width:L?.defaultWidth,flex:L?.defaultFlex},Y={width:v?.defaultWidth,flex:v?.defaultFlex,minWidth:v?.minWidth,maxWidth:v?.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??v?.minWidth??n,me=Q.maxWidth??v?.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??Ot()),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,v)=>{let L=G[v],k=Ke[v],Y=$[v]=Br(L,I);Y==="start"?te+=k:Y==="end"?_e+=k:ve+=k});let Te=e.width-_e,ze=[],$e=new Map;G.forEach((g,v)=>{let L=Z[v];$e.set(g,L)});let fe=[];Object.keys(o).forEach(g=>{let v=o[g];fe.push(g),$e.has(g)||$e.set(g,v)});let mt=new Map;$e.forEach((g,v)=>{let L=se.get(v);L==null&&(L=-1);let k=L!=-1,Y=G[L+1],V=Nn(g,P),Q=L,pe=Ee[v]?Ee[v]: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(v),Ct=k?Ke[L]:ae.size||0,jt=k&&Oe[L]||null,$t=k?we[L]||0:ae.minSize||0,Mt=k?Fe[L]||1e4:ae.maxSize||1e4,qe=k?Br(v,I):!1,Ut=k?L===G.length-1:!1,qt=Q,mo=k?qe==="start"?ye:qe==="end"?be:O-ye:0;qe=="start"?qt=k?Q:-1:qe==="end"?qt=k?Q-(ce.length+H.length):-1:qt=k?Q-ce.length:-1;let en=k?qe==="start"||qe===!1?O:Te+be:-1,zp=k?qe!==ie:!1,Vp=k?Ut||qe!==Br(Y,I):!1,rl=g.cssEllipsis??V.cssEllipsis??u,Gp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??rl,Wo=k&&(K[v]||g.field||g.groupByForColumn)&&(K[v]||K[g.field||g.groupByForColumn])||null,Kp=g.defaultFilterable??V.defaultFilterable??N??!0,Bp=x??g.defaultEditable??V.defaultEditable??F??!1,Cr=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||_s,Hp=g.sortType||V.sortType||Cr,al=g.filterType||V.filterType||Cr,ll=!1;if(Wo!=null&&!Wo.disabled){let Sr=y[al];Sr&&(!Sr.emptyValues||!Sr.emptyValues.includes(Wo.filter.value))&&(ll=!0)}let _n=g.field??V.field,Wp=g.valueGetter??V.valueGetter,Tr=g.defaultGroupable??V.defaultGroupable??R??!!_n;_n||(Tr=!1),g.groupByForColumn&&(Tr=!1);let sl=_n?z[_n]!==void 0:!1,jp=sl?z[_n]:void 0,$p=Hr(g,{colType:V,sortable:m,columnDefaultSortable:A}),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:_n,...g,components:{...V.components,...g.components},computedResizable:Up,computedMinWidth:$t,computedMaxWidth:Mt,computedFlex:jt,computedDataType:Cr,computedEditable:Bp,computedSortType:Hp,computedFilterType:al,cssEllipsis:rl,headerCssEllipsis:Gp,computedFilterValue:Wo,computedFiltered:ll,computedFilterable:Kp,computedGroupable:Tr,computedGroupedBy:sl,computedGroupedByIndex:jp,computedWidth:Ct,computedAbsoluteOffset:en,computedPinningOffset:mo,computedVisibleIndexInCategory:qt,computedOffset:O,computedSortable:$p,computedSortInfo:ue,computedSortIndex:Pe,computedMultiSort:h,computedSorted:me,computedSortedAsc:le,computedSortedDesc:Ce,computedVisibleIndex:Q,computedPinned:qe,computedDraggable:w??g.defaultDraggable??S??zm,computedFirstInCategory:zp,computedLastInCategory:Vp,computedFirst:L===0,computedLast:Ut,id:v,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=Ms(g,{fieldsToColumn:mt,userColumns:t,columnTypes:P,sortable:m,columnDefaultSortable:A})});let rt=new Map;fe.forEach(g=>{let v=oe.get(g);v&&rt.set(g,v)}),oe.forEach(g=>{rt.has(g.id)||rt.set(g.id,g)});let Rt=s!=null?Math.min(s,ye):ye,Et=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:Et,computedPinnedStartWidth:Rt,renderSelectionCheckBox:q.reduce((g,v)=>g||!!v.renderSelectionCheckBox,!1),fieldsToColumn:mt}};function Ms(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??ai,d=o.sortType??o.colType.sortType;return d!=null&&d!==Yt&&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 w=n.get(C),S=w?m.getColumnApi(w.id):void 0;if(w&&S)b=S.isSortable();else{let T=bn(r,C);if(T){let I=Hr(T,{colType:Nn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??ai},!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 Io(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 li=`${Ge}HeaderCell__filter`,Wr=`${Ge}HeaderCell__filterOperator`,Fs=`${li}__input`;var de=require("vue");function U(o){return o.slice(4,-1)}function si(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===null?i.push(...t.map(l=>`${l}--row-partially-selected`)):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 du=require("vue");var Qe=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 Ns(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function Os(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function Hm(o,t,e){let n=Ns(o,e),i=Ns(t,e);return n===i?Os(e,t)-Os(e,o):n-i}function ks(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=ks(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 Ls(o,t){if(Wm(o))return jm(o,t);o=ks(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 Ls(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(Qe.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(Qe.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function zn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var zs="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Vs="_1yeub2vs",Gs="_1yeub2vr",Ks=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 _T=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`,Bs=o=>o.querySelector(`.${$r}`);var Cn=`${Ge}HeaderCell`,Ur=`${Ge}HeaderWrapper`,Hs=o=>Array.from(o.querySelectorAll(`.${Ur}`));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 Ws(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)"}}},js="column-header-height";var $s=`.${We.rootClassName}`;function qr(o){return Vn(o,$s)}var Us=U(j.scrollLeft),qm=U(j.scrollTop),Ym=U(j.columnWidthAtIndex),Yr=U(j.columnOffsetAtIndex),qs=U(j.columnReorderEffectDurationAtIndex),Zm=U(j.columnOffsetAtIndexWhileReordering),Xm=U(j.columnVisibilityAtIndex),Jm=U(j.columnZIndexAtIndex);function kt(o,t,e){let n=e?qr(e):document.querySelector($s);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 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 Zr(o,t,e){kt(`${Yr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${Us}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Xr(o,t,e){kt(`${Jm}-${o}`,`${t}`,e)}function xo(o,t,e){kt(`${Zm}-${o}`,typeof t=="number"?`calc( var(${Yr}-${o}) + ${t}px )`:t,e)}function Po(o,t,e){kt(`${Xm}-${o}`,t,e)}function ui(o,t,e){kt(`${qs}-${o}`,e??"",t)}function Jr(o,t){let e=`${qs}-${o}`;kt(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,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`${Yr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,kt(this.varName.get(o),t,e)}}};function Ys(o,t){Gn({[Us]:`${o.scrollLeft}px`,[qm]:`${o.scrollTop}px`},t)}var Do={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),Zs=U(j.scrollbarWidthVertical),th=U(j.columnWidthAtIndex),nh=U(j.columnZIndexAtIndex),Xs=U(j.scrollLeft),oh=U(j.activeCellColWidth),Js=U(j.activeCellColOffset),nu=U(j.baseZIndexForCells),ih=U(j.pinnedStartWidth),Qs=U(j.bodyWidth),rh=U(j.bodyHeight),eu=U(j.pinnedEndOffset),tu=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(${nu}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function ou(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[Se.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Se.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Xs}) )`:h.computedPinned==="end"?`calc( var(${eu}) ${f.length?"+":""} ${f.map(b=>Se.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Xs}) )`:`${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[Do.browserScrollbarWidth.name]=`${Ot()}px`),m[Do.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[Do.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[Do.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${th}-${h})`).join(" + ")})`,m[Do.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[Js]=h?`calc( ${Ae.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Js]=p}return m[ah]=t.length,m[eh]=s.horizontal?`${c}px`:"0px",m[Zs]=s.vertical?`${c}px`:"0px",m[ih]="calc( "+e.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[tu]="calc( "+n.map(p=>Se.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[nu]=t.length*10,m[eu]=`calc( var(${Qs}) - var(${tu}) - var(${Zs}) )`,m[Qs]=`${l.width}px`,m[rh]=`${l.height}px`,m}var Ao=(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 Ao(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return Ao(n,s,d)}return t}var su=ho(Kn());function di(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=>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 un("+",di(o)),ru=(...o)=>new un("-",di(o)),uh=(...o)=>new un("*",di(o)),dh=(...o)=>new un("/",di(o)),_o={add:sh,subtract:ru,minus:ru,multiply:uh,divide:dh};var au=o=>{let t=null,e=null;return{stop(){t!==null&&gn(t),e!=null&&gn(e)},scroll(n){t!==null&&gn(t),e!=null&&gn(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 lu=10,ch=U(j.pinnedStartWidth);function uu(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 w(H){let q=H==="start"?z:K;return M===O?q:O===H?q+P.computedWidth:M===H?q-P.computedWidth:q}function S(H){if(H.columnIndex===D||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+w("start")&&oe+q.computedWidth<=J+s.width-w("end")}let T=(H,q)=>{let{restrictToParentGroup:J,dragColumn:oe}=q,re=[];if(H.forEach(be=>{if(be.computedVisibleIndex===D)return;let ie={columnId:be.id,columnIndex:be.computedVisibleIndex,offsetX:be.computedOffset+Math.round(be.computedWidth/2)};S(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},x=i.length,F={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:F.clientX-s.left-(F.clientX-u.left)+lu,top:F.clientY-s.top-(F.clientY-u.top)+lu},R=l.getScrollPosition(),A=t.map(H=>H.computedVisibleIndex),E=A,P=e.get(r),D=P.computedVisibleIndex,M=P?.computedPinned,_=D,O=M,z=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=F,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-R.scrollLeft;return G.x=B.clientX-F.clientX,G.y=B.clientY-F.clientY,Z=G.x+re,se=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Me.from(u).shift({left:G.x,top:G.y})}function ge(H){let q=0;M?M==="start"&&H.forEach((J,oe)=>{q||t[J]?.computedPinned!=="start"&&(q=oe)}):H.forEach((J,oe)=>{t[J]?.computedPinned==="start"&&(q=oe+1)}),x=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}kt(ch,`${oe}px`,a)}}function Ke(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Po(D,"",a),p(!1)),_=H,H===-1){Oe(D);return}let q=Ao(A,D,_>D?_-1:_);x=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:x}}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=_o.minus(Se.columnOffsets.get(oe),Se.columnWidths.get(H)).done()),xo(oe,ye,a)}),Po(H,"hidden",a),p(!0)}function we(H){t.forEach(q=>{let J=q.computedVisibleIndex;H.has(J)?Jr(J,a):ui(J,a);let oe=J===D,re=se===-1?J<_||J>D:J<D||J>=_,ye="";se===-1?ye=oe?Se.columnOffsets.get(_):re?Se.columnOffsets.get(J):_o.add(Se.columnOffsets.get(J),Se.columnWidths.get(D)).done():ye=re?Se.columnOffsets.get(J):oe?_o.add(Se.columnOffsets.get(_-1),Se.columnWidths.get(_-1)).minus(Se.columnWidths.get(D)).done():_o.minus(Se.columnOffsets.get(J),Se.columnWidths.get(D)).done(),xo(J,ye,a)})}let Fe=s.left+w("start"),ce=s.right-w("end"),ee=au({scrollOffsetStart:Fe,scrollOffsetEnd:ce});return Ee(F),{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,su.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===D+1&&(re=D),Ke(re);let ye={};n.forEach(ie=>{ye[ie.id]="end"});for(let ie=0;ie<x;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:ln(o,t)},mh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function cu(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&&zn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:w,computedVisibleColumnsMap:S,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedPinnedEndColumns:x}=d(),F=S.get(t);if(!F||!F.computedDraggable){f(p);return}let N=n.current,R=N.getBoundingClientRect(),A=y.current.getBoundingClientRect(),E=C.getAvailableSize(),P=F.computedVisibleIndex,D=C.getVirtualColIndex(F.computedVisibleIndex,{pageIndex:h||0}),M=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,z=y.current,K=Me.from(Bs(z).getBoundingClientRect()),B=Hs(z).map(we=>Me.from(we.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),se=uu({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:M,draggableColumnsRestrictTo:b,computedPinnedEndColumns:x,computedPinnedStartColumns:T,computedUnpinnedColumns:I,computedVisibleColumns:w,computedVisibleColumnsMap:S,dragColumnHeaderTargetRect:R,dragColumnId:t,getCurrentDragSourceAndTarget:mh,api:c,infiniteDOMNode:y.current,setProxyPosition:we=>{a.value=we},setDragColumnOutside:we=>{l.value=we},tableRect:A,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(D),H=Fe.keepColumnRendered(D);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=F.id,h!=null&&(s.columnReorderInPageIndex=h),Xr(P,`calc( var(${fh}) + 10000 )`,y.current),y.current?.classList.add(jr),N.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?.(),N.style.cursor=_,N.hasPointerCapture?.(Fe)&&N.releasePointerCapture(Fe),N.removeEventListener("pointermove",Ke),N.removeEventListener("pointerup",Oe),a.value=null;let H=c.getColumnApi(F.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(F.id,{multiSortBehavior:ce==="replace"&&(we.ctrlKey||we.metaKey)?"append":ce}),Z?xe(Z):O&&r&&c.setVisibilityForColumn(F.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await(0,du.nextTick)(),w.forEach(q=>{ui(q.computedVisibleIndex,ee),Po(q.computedVisibleIndex,"",ee),xo(q.computedVisibleIndex,"",ee)}),Xr(P,Qr(F,{pinnedStartColsCount:T.length,visibleColsCount:w.length}),ee)})};N.addEventListener("pointermove",Ke),N.addEventListener("pointerup",Oe),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&zn(p.target)||f(p)}}}var Tn=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 fu=(0,Tn.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,Tn.h)("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>(0,Tn.h)("path",{d:n})))}}});function It(o,t){let e=n=>(0,Tn.h)(fu,{...n,paths:t});return e.displayName=o,e}var pu=It("IncludesOperatorIcon",gt.includesOperator),mu=It("StartsWithOperatorIcon",gt.startsWithOperator),hu=It("EndsWithOperatorIcon",gt.endsWithOperator),gu=It("EqualOperatorIcon",gt.eqOperator),yu=It("NotEqualOperatorIcon",gt.neqOperator),bu=It("GTOperatorIcon",gt.gtOperator),Cu=It("GTEOperatorIcon",gt.gteOperator),Tu=It("LTOperatorIcon",gt.ltOperator),Su=It("LTEOperatorIcon",gt.lteOperator),wu=It("DoneIcon",gt.done),vu=It("ClearIcon",gt.clear),ta=o=>(0,Tn.h)(fu,{...o,viewBox:"0 -960 960 960",paths:gt.hidden});ta.displayName="HiddenIcon";var ci="_1eexc2a7 _1eexc2a6",Ru=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"]]}),Iu=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 xu="_1eexc2a5",fi=Re({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Bn="_1eexc2a8";var xt=require("vue");var Pu="qz8ht90 _16lm1iwk";var dn=(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",Pu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});var Sn=require("vue");function Du(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var Au=Du({"data-name":""}),na={[Au["data-name"]]:"menu-icon"},_u=`[${Au["data-name"]}="${na["data-name"]}"]`;var hh={width:"100%",pointerEvents:"none"},oa=`${ht}-menu`,Eo=(0,Sn.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,Sn.h)("div",{class:oa,style:e}),(0,Sn.h)("div",{class:oa,style:e}),(0,Sn.h)("div",{class:oa,style:e})];return(0,Sn.h)("div",{...o.domProps,style:o.style,...na,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ne(o.className,ms({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),ht,`${ht}-menu`)},n)}}});var st=require("vue");var Eu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Mu={transition:"width 0.25s, opacity 0.25s"},Fu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var Nu=(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={...Mu,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,Eu,`${ht}-sort`)},[d?(0,st.h)("div",{"data-name":"index",style:p,class:ys},`${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:[...Fu]});var{rootClassName:Ou}=We,Lt=`${Ou}Cell`,pi=`${Ou}Cell_content`;function ia(o){return Math.max(o.width-Ot(),0)}function ku(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 wn=require("vue");function Lu(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 zu(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 Vu=require("vue"),Hn=Symbol("InfiniteTable");function Ye(){return(0,Vu.inject)(Hn)}var{rootClassName:gh}=We,yh=`${gh}HeaderCell_ResizeHandle`,Gu=(0,wn.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,wn.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"}),I=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),I()}}h.setPointerCapture(m);let C=Lu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:I}={})=>{d&&(T=T/(d+1),I&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:x,constrained:F}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==F&&(i.value=F),C.resize(x),x},w=T=>{b(Math.round(T.clientX-p))},S=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",S);let I=Math.round(T.clientX-p),x=b(I,{done:!0});y(),C.resize(0),o.onResize({diff:x,shareSpaceOnResize:f})};h.addEventListener("pointermove",w),h.addEventListener("pointerup",S)};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,wn.h)("div",{ref:c=>{n.current=c??null},class:`${yh} ${mi} ${gi({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[(0,wn.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),Ku=Symbol("InfiniteHeaderCell");function Mo(){return(0,de.inject)(Ku)}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||dn;return(0,de.h)(u,{domProps:{class:Bn},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function vn(o,t){return o(t)}var ra=()=>(0,de.h)("div",{class:Wl[1]}),Bu=(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=R=>{let A=R&&R.$el!==void 0?R.$el:R;s.current=A??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 R=o.column.id,A=l().filterDelay,E=`${R}:${A}`;if(!p||p.key!==E){let P=D=>{e.setColumnFilter(R,D)};p={key:E,fn:A>0?tn(P,{wait:A}):P}}return p.fn},y=(0,de.ref)(null),C=(0,de.ref)(!1),{onPointerDown:b}=cu({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),w=(0,de.computed)(()=>t.state.value.columnMenuVisibleForColumnId),S=(0,de.computed)(()=>t.state.value.columnReorderDragColumnId),T=(0,de.computed)(()=>t.state.value.columnReorderInPageIndex),I=(0,de.computed)(()=>t.state.value.showColumnFilters),x=(0,de.computed)(()=>t.state.value.columnHeaderHeight),F=(0,de.computed)(()=>t.state.value.components),N=(0,de.computed)(()=>a.state.value.filterTypes);return()=>{let{column:R,columnsMap:A,horizontalLayoutPageIndex:E,headerOptions:P}=o,{allRowsSelected:D,someRowsSelected:M,selectionMode:_}=o,O=R.computedSortInfo,z=R.header,K=m(),B=K.isSortable(),G=P.alwaysReserveSpaceForSortIcon,se=R.headerAlign??R.align,Z=(typeof se=="function"?se({isHeader:!0,column:R}):se)??"start",Ee=(typeof R.verticalAlign=="function"?R.verticalAlign({isHeader:!0,column:R}):R.verticalAlign)??"center",ge=B&&(R.computedSorted||G)?(0,de.h)(Nu,{index:R.computedMultiSort?R.computedSortIndex+1:void 0,style:{marginInlineStart:Ae.spacing[2],marginInlineEnd:Ae.spacing[2]},className:`${Cn}__sort-icon ${gs} ${bs({align:Z})}`,direction:R.computedSorted?R.computedSortedAsc?1:-1:0}):null,Ke=R.computedFilterable&&R.computedFiltered?(0,de.h)(Fn):null,Oe=R.headerCssEllipsis??R.cssEllipsis??!0,we=w.value,Fe=S.value,ce=T.value,ee=Fe===R.id,H=ce!=null?E!==ce:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:we===R.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=R.components?.MenuIcon||F.value?.MenuIcon||Eo,oe=(0,de.h)(J,q),re=I.value,ye=N.value,be=R.computedFilterType,ie=ye[be],$=R.computedFilterable?R.computedFilterValue?.filter.operator??ie?.defaultOperator:void 0,te=R.computedFilterable&&ie?ie.operators.find(ae=>ae.name===$):void 0,ve=te?.components?.FilterEditor||ie?.components?.FilterEditor||R.components?.FilterEditor||Wn,_e=ie?.components?.FilterOperatorSwitch||R.components?.FilterOperatorSwitch||Wu,Te=R.computedFilterable?(0,de.h)(Hu,{filterProps:{horizontalLayoutPageIndex:E,filterEditor:ve,filterOperatorSwitch:_e,operator:te,filterTypes:ye,onChange:h(),columnFilterType:be,columnLabel:R.field||R.name||R.id,columnFilterValue:R.computedFilterValue,columnHeaderHeight:x.value}}):(0,de.h)(ju),ze={horizontalLayoutPageIndex:E,dragging:ee,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:R,columnsMap:A,columnSortInfo:O,columnFilterValue:R.computedFilterValue,filtered:R.computedFiltered,someRowsSelected:M,allRowsSelected:D,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:ge,filterIcon:Ke,menuIcon:oe,menuIconProps:q,selectionCheckBox:null,header:R.header&&typeof R.header!="function"?R.header:R.name}},$e=ze;$e.renderBag.filterEditor=Te,f.value=$e;let fe={...ze,renderBag:{...ze.renderBag}};if(R.renderSortIcon&&(fe.renderBag.sortIcon=vn(R.renderSortIcon,{...fe,renderBag:{...fe.renderBag}})),R.renderFilterIcon&&(fe.renderBag.filterIcon=vn(R.renderFilterIcon,{...fe,renderBag:{...fe.renderBag}})),typeof R.renderMenuIcon=="function"){let ae=vn(R.renderMenuIcon,{...fe,renderBag:{...fe.renderBag}});fe.renderBag.menuIcon=ae?ae.type===J||ae.type===Eo?ae:(0,de.h)(J,q,()=>ae):null}if(R.renderSelectionCheckBox&&_==="multi-row"){fe.renderBag.selectionCheckBox=vn(wh,{...fe,renderBag:{...fe.renderBag}});let ae=R.renderHeaderSelectionCheckBox??R.renderSelectionCheckBox;ae&&ae!==!0&&(fe.renderBag.selectionCheckBox=vn(ae,{...fe,renderBag:{...fe.renderBag}}))}z instanceof Function&&(fe.renderBag.header=vn(z,{...fe,renderBag:{...fe.renderBag}}));let mt=Oe?(0,de.h)("div",{class:St},[fe.renderBag.header]):fe.renderBag.header,rt=R.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],Et=R.renderHeader?vn(R.renderHeader,{...fe,renderBag:{...fe.renderBag,all:Rt}}):Rt,Ue={height:`${o.height}px`};R.headerStyle&&(Ue=typeof R.headerStyle=="function"?{...Ue,...R.headerStyle($e)||{}}:{...Ue,...R.headerStyle});let g=typeof R.headerClassName=="function"?R.headerClassName($e):R.headerClassName,v=`var(${Th}-${R.computedVisibleIndex})`;Ue.zIndex=v,Ue.visibility=`var(${Sh}-${R.computedVisibleIndex}, visible)`,Ue.width=`var(${bh}-${R.computedVisibleIndex})`,Ue.transition=`transform var(${Ch}-${R.computedVisibleIndex}, 0s)`;let L={filtered:R.computedFiltered,verticalAlign:Ee,align:Z},k={"data-field":`${R.field||""}`,"data-column-id":R.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":R.computedSortedAsc?"asc":R.computedSortedDesc?"desc":"none","data-sort-index":`${R.computedSortIndex??-1}`},Y=ne(Cn,Xl.none,B?Hl.pointer:"",g,si(R,[Cn,Lt],ls,{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}),os,Lt,ci),V=(0,de.h)("div",{class:ne(pi,Oe?St:ni.hidden,is(L),$l[Z]),style:re?{height:`${o.height/2}px`}:void 0},[Et]),Q=ae=>ku({context:{getState:i,getComputed:r},column:R,diff:ae.diff,shareSpaceOnResize:ae.shareSpaceOnResize}),pe=R.computedResizable?(0,de.h)(Gu,{horizontalLayoutPageIndex:E,columns:r().computedVisibleColumns,columnIndex:R.computedVisibleIndex,computeResize:Q,onResize:ae=>{let{columnSizing:Ct,reservedWidth:jt}=Q(ae);ae.shareSpaceOnResize||(n.viewportReservedWidth=jt),n.columnSizing=Ct}}):null,ue=[re?Te:null,pe],me={ref:c,...k,"data-z-index":v,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:R.id,class:`${Cn}Proxy ${rs}`,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:as({visible:C.value})},[(0,de.h)(ta,{size:16})]),fe.renderBag.header])]));let Pe=R.components?.HeaderCell;return Pe?[(0,de.h)(Pe,me,{default:()=>[V,ue]}),le]:[(0,de.h)("div",me,[V,ue]),le]}}});var $u=Symbol("InfiniteColumnHeaderFilter"),yi=o=>o.stopPropagation(),Hu=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=Ye(),e=Mo(),n=(0,Ie.shallowRef)(o.filterProps);(0,Ie.provide)($u,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:`${li} ${Lr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[(0,Ie.h)(c),(0,Ie.h)(s)])}}}),Wu=(0,Ie.defineComponent)({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=jn();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,cs,t?`${Wr}--disabled`:"")},[(0,Ie.h)(n,{size:20,className:`${fs({disabled:!!t})}`})])}}}),ju=(0,Ie.defineComponent)({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>(0,Ie.h)("div",{onPointerup:yi,onPointerdown:yi,class:`${li} ${Lr({active:!1})} ${jl["50%"]}`})}});function jn(){let o=Ye(),t=Mo(),e=(0,Ie.inject)($u),{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:w,filterTypes:S}=e.value;return S[w]}),m=(0,Ie.ref)(e.value.columnFilterValue?.filter.value??"");(0,Ie.watch)(()=>e.value.columnFilterValue?.filter.value,w=>{if(e.value.columnFilterValue)m.value!==w&&(m.value=w);else{let S=f.value;if(S){let T=[...S.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=w=>{m.value=w,e.value.onChange(w)},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 ${Io(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:`${us} ${Fs}`}}var Wn=(0,$n.defineComponent)({name:"StringFilterEditor",setup(){let o=jn();return()=>(0,$n.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,$n.defineComponent)({name:"NumberFilterEditor",setup(){let o=jn();return()=>(0,$n.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 Uu(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 On=Uu({StringFilterEditor:Wn,NumberFilterEditor:bi,icons:{includes:pu,eq:gu,neq:yu,startsWith:mu,endsWith:hu,gt:bu,gte:Cu,lt:Tu,lte:Su}});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,w=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(w&&w.length){for(let S=0,T=w.length;S<T;S++){let I=w[S];if(I.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),I.type==="update"&&!h&&(p={...p,...I.data},c[m]=p),I.type==="update-children"&&!h){let x=I.children(p[l],p);p={...p},x!==void 0?p[l]=x:delete p[l],c[m]=p}I.type==="insert"&&(I.position==="before"?(c.splice(m,0,I.data),m--):c.splice(m+1,0,I.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let S=a(p),T=S?null:r(p);!S&&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 qu=new WeakMap;function wi(o,t){if(!o||!o.length)return[];let e=qu.get(o);e||(e=new WeakMap,qu.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",Yu="group-by-";function Zu(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=Zu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Yu)){let r=i.id.slice(Yu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Zu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function Vt(){let o=Ve().performance?.now();return`${Date.now()}:${o}`}var Xu=!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 Gt(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=Qu(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 Un(o,t,e,n,i){let r=Gt(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:Xu,totalCount:0}),e.originalLazyGroupDataChangeDetect=Vt()}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);if(c.length&&f&&!f.childrenAvailable)f.childrenLoading=!1,f.cache=!1,f.error=m,e.originalLazyGroupDataChangeDetect=Vt();else{let p=t.lazyLoadCacheOfLoadedBatches,h=[...c,r.lazyLoadStartIndex??0];p.has(h)&&p.set(h,"failed"),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,w){let S=[Tt,...C],T=b.data,I={cache:b.cache??Xu,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??T.length,totalCountUnfiltered:b.totalCountUnfiltered,totalChildrenCount:b.totalChildrenCount,totalChildrenCountUnfiltered:b.totalChildrenCountUnfiltered,children:T,error:b.error},x=[];if(r.lazyLoadBatchSize&&!w){let N=h.get(S),R=!N,A=As({children:!0},N||{},I);R&&(A.chidren=[]),A.children.length=A.totalCount;let E=r.lazyLoadStartIndex??0,P=Math.min(b.totalCount??T.length,E+r.lazyLoadBatchSize);for(let D=E;D<P;D++){let M=I.children[D-E];if(!M)throw`lazily loaded item not found at index ${D-E}`;A.children[D]=M,M.dataset&&x.push({keys:M.keys,dataset:M.dataset})}R&&h.set(S,A)}else I.children.forEach(N=>{N&&N.dataset&&x.push({keys:N.keys,dataset:N.dataset})}),I.children.length=I.totalCount,h.set(S,I);let F=!1;if(!C||!C.length){let N=h.get([Tt]);e.originalDataArray=[...N.children],F=!0}if(F||(e.originalLazyGroupDataChangeDetect=Vt()),x.length){let N=C;x.forEach(({keys:R,dataset:A})=>{y(R,A,N)})}};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 Qu(o,{filterTypes:t,filterMode:e}){return e==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(Ju):(Si(o,t)||[]).map(Ju)}function Ju(o){if(!o.valueGetter)return o;let t={...o};return delete t.valueGetter,t}function ed(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=Qu(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 td(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 nd(o){for(let[t,e]of o.entries())e==="failed"&&o.delete(t)}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 w=b.length?b:f,S=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},I=y.groupKeys,x=c.get(I);if(!x?.[y.id]){let F=!x;x=x||{},x[y.id]||(x[y.id]=T),F&&c.set(I,x)}}if(!C&&i!=null){let T=c.get(w),I=Math.floor(S/i)*i,x=S-I,F=u[y.indexInAll-x].indexInAll,N=d(F),R=u[F].id;if(N||T?.[R])continue;let A=!T;T=T||{};let E={lazyLoadStartIndex:I,lazyLoadBatchSize:i,groupKeys:b,append:s};T[R]||(T[R]=E),A&&c.set(w,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(()=>Un(...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 qn=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 qn{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=[],w=l();for(let S of w){let T=p[S],I=f[S];if(I===void 0){b.push(S);continue}Vh(T,I)||b.push(S)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let S=0,T=b.length;S<T;S++){let I=b[S],x=t.get(I);if(x)for(let F of x)F()}if(C)for(let S of Array.from(e))S()}),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,Je=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 cn(o,t){return t().dataArray[o]}function Pi(o){return o().dataArray}function Zn(o,t){return new Je(o,Yn(t))}function Yn(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 Je))throw"Invalid tree selection";let a=new Je(i,Yn(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?cn(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 Je))throw"Invalid node selection";let n=new Je(t,Yn(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 Je))throw"Invalid node selection";let n=new Je(t,Yn(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 Je))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 Xn(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:on(`${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],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",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?Gl(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=>({...an,...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"),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}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
2
 
3
3
 
4
4
  `);let n=Yn(e);if(o instanceof Je)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Uh,r=e.propsCache.get("treeSelection"),a=r.get(i);return a&&a.setConfig(n),a=a??new Je(i,n),r.set(i,a),a}function pd(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=go(t.sortInfo),a=go(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((P,D)=>{let M=l[D].operators;P[D]=P[D]||{};let _=P[D];return M.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 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 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=e.propsCache.get("cellSelection"),D=P.get(p)??new He(p);P.set(p,D),f=D}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=e.propsCache.get("treeExpandState"),D=P.get(C)??new ot(C);P.set(C,D),C=D}C=C||new ot({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof wt)){let P=e.propsCache.get("groupRowsState"),D=P.get(b)??new wt(b);P.set(b,D),b=D}b=b||new wt(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let w=$h(t.shouldReloadData||{}),S=typeof t.data=="function"&&!!t.lazyLoad,T=!!t.livePagination,I={sortInfo:w.sortInfo??(S||T),filterValue:w.filterValue??(S||T),groupBy:w.groupBy??S,pivotBy:w.pivotBy??S},x=t.sortFunction?"local":I.sortInfo?"remote":"local",N=(typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function")&&!t.lazyLoad?"local":I.filterValue||t.lazyLoad?"remote":"local",R=e.rowDisabledState,A=t.isRowDisabled;if(!A&&R){let P=e.propsCache.get("isRowDisabled"),D=P.get(R);D?A=D:(A=M=>R.isRowDisabled(M.id),P.set(R,A))}let E={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:I,isRowDisabled:A,rowSelection:c,cellSelection:f,sortMode:x,filterMode:N,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,D=typeof t.livePaginationCursor=="function"?P?jh(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;E.livePaginationCursor=D}if(e.devToolsDetected&&e.debugId){let P=ca.get(e.debugId);P&&(E={...E,...P})}return E}var qh=on("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=Gt(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=Gt(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=Gt(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=Gt(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=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})=>ln(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(on(Xn(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=Ft(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],w=p.slice(0,-1).join("/");if(!c){let S=w;w=p.join("/");let T=p[p.length-1];d[w]=ha({header:`${T}`,columnGroup:S,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((S,T)=>{let I=c?`${p[p.length-1]}`:S.name||S.id,x=ma({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:S,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:w,header:I,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[S.id]:null}),F=`${S.id}:${p.join("/")}`;u[F]=x})}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 w=t[p.length-1],S=b.length?b.join("/"):void 0;if(!c){let T=S;S=`total:${p.join("/")}`,d[S]=ha({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:w,pivotGroupKey:p[p.length-1]})}l.forEach((T,I)=>{let x=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,F=ma({columnGroup:S,header:x,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:w,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("/")}`]=F})}}(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=Ft(()=>{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 Kt=(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},Ai=(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};Kt.knownTypes=an;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=Kt.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Kt.knownTypes).join(", ")}`)}return i||(i=an.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"),Rn=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=>cn(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?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??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 _i(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 Ei(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 Mi(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||an.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={...an,...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 Fo={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(Fo).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:Fo[n].track,label:r.label}),get label(){let r=Fo[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=Fo[n];return t.markerDetails.track=r.track,i}}),e},{})}};function yt(o){return Ca.create(o)}function Jn(o){if(o==null)return!1;let t=o;return!0}var Bt=(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=Ft(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.