@infinite-table/infinite-vue 9.1.5 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +95 -6
- package/index.js +7 -7
- package/index.mjs +7 -7
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Kp=Object.create;var za=Object.defineProperty;var Bp=Object.getOwnPropertyDescriptor;var Hp=Object.getOwnPropertyNames;var Wp=Object.getPrototypeOf,jp=Object.prototype.hasOwnProperty;var $p=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var Up=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hp(t))!jp.call(o,i)&&i!==e&&za(o,i,{get:()=>t[i],enumerable:!(n=Bp(t,i))||n.enumerable});return o};var zn=(o,t,e)=>(e=o!=null?Kp(Wp(o)):{},Up(t||!o||!o.__esModule?za(e,"default",{value:o,enumerable:!0}):e,o));var Sn=$p((Uw,Is)=>{"use strict";Is.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}});function Zt(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}import{defineComponent as Vg,inject as Gg,onBeforeUnmount as li,onMounted as si,provide as Kg,shallowRef as Bg,watch as An}from"vue";import{getCurrentInstance as Yp,inject as Xp,isRef as Zp,onBeforeUnmount as Jp,provide as Qp,shallowRef as em,unref as tm,watch as nm}from"vue";function Va(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 ji=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Vn(o){return o!==void 0}function Gn(o,t){let e=t[o];return Vn(e)}var $i=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function qp(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=Gn(i,t)?t[i]:t[`default${ji(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function Ga(o,t,e){let{fn:n,propertyReads:i}=Va(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function Ka(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=qp(n,t,e));let u={...e,...l};if(r){let d=Ga(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function Ba(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=Ga(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 Ha(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=$i}=o,d=e();return Object.keys(d).reduce((s,c)=>{let f=c;return Object.defineProperty(s,c,{set:p=>{let h=n(),y=e(),C=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:s,state:y})===!1&&(C=!1),C){let w=[p],T=`on${ji(c)}Change`;if(l&&l[f]){let P=l[f](p,y);T=P.callbackName||T,w=P.callbackParams}u(h,T,w)}let b=i[f];typeof b=="function"&&(p=b(p));let S=!!r?.[f];Gn(c,h)&&!S||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Wa(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++,Gn(p,t)||Gn(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($i(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 fn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=Yp(),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:Zp(c)?tm(c)??null:typeof c=="function"?c()??null:c,m=Ka({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=em(m),h=()=>m,y=l,C=T=>{m=Ba(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=om(a?(T,...P)=>a.emit(T,...P):void 0),S=Ha({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return nm(()=>({props:l(),parentState:f()}),(T,P)=>{let R=T.props,E=P.props,N=T.parentState!==P.parentState,{newMappedState:v,newMappedStateCount:D,updatedPropsToState:M,updatedPropsToStateCount:A,rawUpdatedProps:x,rawUpdatedPropsCount:F}=Wa({currentProps:R,prevProps:E,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(A>0||D>0){let O={payload:{mappedState:D?v:null,updatedPropsToState:A?M:null}},L=p.value;if(C(O),_=!0,o.onPropChange){for(let K in x)if(x.hasOwnProperty(K)){let{newValue:B,oldValue:G}=x[K];o.onPropChange({name:K,newValue:B,oldValue:G},R,S,L)}}o.onPropsChange&&F&&o.onPropsChange(x,R,S,L)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),Jp(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:S,getComponentState:h,replaceState:T=>{C({type:"REPLACE_STATE",payload:T})},assignState:T=>{C({type:"ASSIGN_STATE",payload:T})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return Qp(t,a.contextValue),a}function i(){return Xp(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function pe(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 bt(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var ja=(o,t)=>o-t;var wo=(o,t)=>ja(o.revision,t.revision),U=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),d=!a;if(r!==void 0){if(r<0)return;r--}let s=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!d)return;let y=h?[]:[...t,f],C=p?()=>this.visitWithNext(y,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let b=e(m.value,y,l,C,m);if(n&&b===!0)return!0;l++}else C?.()};u&&(s(void 0,this.emptyKey),d=!1,l=0);for(let[c,f]of i){let m=s(f,c);if(n&&m===!0)return m}};this.fill(t)}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,d)=>{!d.map&&d.hasOwnProperty("value")&&(i?r.push(d):a.push(e(d)))},n),i?r.sort(wo).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},d=this.map,s,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(s=d.get(p),!s||!s.map)if(c=!0,f===m-1){c=!0;break}else return[];d=s.map}else if(!n&&d.has(this.emptyKey))return[[]];return s&&s.value!==void 0&&(n||(u({...s,keys:t}),c=!0)),c?r?a.sort(wo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(wo).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let d=0,s=t.length;d<s;d++){let c=t[d];if(l=a.get(c),!l||!l.map)if(u=!0,d===s-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(d,s,c,f,m)=>{e(s,d,{...m,keys:s}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0}delete(t){let e=this.map;t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],d=a===l-1,s=e.get(u);if(d){s&&(s.hasOwnProperty("value")&&(delete s.value,delete s.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),s.map&&s.map.size===0&&delete s.map,s.map||e.delete(u));break}else{if(!s||!s.map){r=!1;break}i.push(s),e=s.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],d=t[t.length-1],s=u?.get(d);s&&(delete s.map,s.hasOwnProperty("value")||u.delete(d))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],d=bt(()=>{if(l)for(let[s]of l){let c=this.visitKey(s,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let s=i(a,u,d);if(r&&s===!0)return!0}d()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(wo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=U;function Ee(){return globalThis}var Io=["#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"],$a=Symbol("color"),vo=new WeakMap,Ui=pe();function qi(o=Io){vo.set(o,o.map(t=>0))}qi();var im=(o=Io)=>{let t=[];vo.has(o)?t=vo.get(o):(t=o.map(n=>0),vo.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]??Io[0]},Bn=":",Yi="*",Ua="-",rm=",",am="debug",lm="diffdebug",Ya=!1,Kn=new U,Hn=new Map;function Xi(o,t){let e=o.split(Bn),n=new U;n.set(e,!0);let i=t.split(Bn),r=new Set(i).has(Yi),a=i.indexOf(Yi),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(Bn)):!0}}function Xa(o,t){let e=`channel=${o}_permissions=${t}`;if(Hn.has(e))return Hn.get(e);let n=t.split(rm);function i(l){return Hn.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(Yi)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(Ua);if(d&&(u=u.substring(Ua.length)),Xi(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)),Xi(o,u))return i(!d)}return i(!1)}var Zi=()=>Xe.enable??(Ee()&&Ee().localStorage?.getItem(am))??"",sm=()=>Xe.diffenable??(Ee()&&Ee().localStorage?.getItem(lm))??`${Ya}`,Ji="",Za=Ya;function Qi(o){Za=`${sm()}`=="true",Ji!==o&&(Ji=o,Hn.clear())}function Ja(o){Qi(Zi()),typeof Ee()<"u"&&Ee().addEventListener&&Ee().addEventListener("storage",function(){Qi(Zi())});function t(e,n){let i=n?`${n}${Bn}${e}`:e,r=i.split(Bn),a=Kn.get(r);if(a)return a;let l=Kn.get(r.slice(0,-1)),u=(l?l.logFn:Xe.logFn)??Qa,d=u,s,c=0,f=()=>s??Xa(i,Ji),m=im(Xe.colors),p=Object.defineProperties((...h)=>{let y=Ui.getListenersCount(),C;if(y>0&&(C=C??Date.now(),Ui({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&Za){let w=C-c;d(`%c[${i}]`,`color: ${m}`,`+${w}ms:`)}c=C;let b=[],S;if(h.forEach(w=>{if(w[$a])S===void 0&&(S=!0),b.push(...w);else{if(typeof w!="string"&&typeof w!="number"){S=!1;return}b.push(`${w}%s`)}}),S){let w=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...w)}else d(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...y)=>{let C=[`%c${y.join(" ")}%c%s`,`color: ${h}`,""];return C.toString=()=>y.join(" "),C[$a]=!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:()=>{Kn.delete(r)}}});return Kn.set(r,p),p}return t(o)}var Qa=console.log.bind(console),qa;Object.defineProperty(Ja,"enable",{get:()=>qa,set:o=>{qa=o,Qi(Zi())}});var Xe=Ja;Xe.colors=Io;Xe.logFn=Qa;var um=(o,t)=>Ui.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;Xi(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});Xe.onLogIntent=um;Xe.isChannelEnabled=Xa;Xe.destroyAll=()=>{qi(),qi(Xe.colors),Kn.clear(),Hn.clear()};var dm=Xe("IT:InfiniteTable"),cm="#dc3545",fm="#eb9316";var tl="Warn",nl="Error",pm="Info",mm="Success",hm="Logs",Ro=dm.extend(hm),IT=Ro.extend(pm),gm=Ro.extend(tl),ym=Ro.extend(nl),RT=Ro.extend(mm);var bm=fm,Cm=cm;var Tm=(o,t)=>{t=t?t.extend?t.extend(tl):t:gm,t(typeof t.color=="function"?t.color(bm,o):o)},Sm=(o,t)=>{t=t?t.extend?t.extend(nl):t:ym,t(typeof t.color=="function"?t.color(Cm,o):o)};var el=new U,ol=(o,...t)=>{el.has(t)||(el.set(t,!0),o())};var pn=(o,t=o,e)=>{ol(()=>Tm(o,e),t,"warn")},il=(o,t=o,e)=>{ol(()=>Sm(o,e),t,"error")};function Wn(o){return o}function mn(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||Wn)(l,o);return e.push(u),e},[])}var De=class o{constructor(t,e,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new U;this.deselectedMap=new U;this.onlyUsePrimaryKeys=!1;this.selectionCache=new U;this.selectionCountCache=new U;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?mn(i,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(t){if(t.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(t);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(t){let{groupDeepMap:e}=this.getConfig();return e?.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(t){let{groupDeepMap:e}=this.getConfig();if(!t.length)return(e?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(r=>this.getAllPrimaryKeysInsideGroup(r)).flat();let n=e?.get(t);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(t,e,n){return new o(t,e,n)}update(t){this.selectedRows=t.selectedRows||null,this.deselectedRows=t.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=t.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>r?a.pop():a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){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}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let d=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,d),d}if(i&&this.onlyUsePrimaryKeys){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}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;if(this.getConfig().lazyLoad&&!r.length){let d=this.getConfig().groupDeepMap?.get(t)?.totalChildrenCount||0;e?(a=d,l=this.deselectedMap.getAllChildrenSizeFor(t),l===d&&(a=0)):(l=d,a=this.selectedMap.getAllChildrenSizeFor(t),a===d&&(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 Gt=o=>{let t=Xe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},Kt=o=>{let t=Xe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},jn=()=>jn;jn.extend=()=>jn;var et=class{constructor(t){this.debug=jn,this.error=jn}};var wm=function(o,t){return o-t},vm=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},Im=function(o,t){return o-t},Rm={number:wm,string:vm,date:Im},Bt=Rm;var Oe=Ee().requestAnimationFrame||(o=>setTimeout(o,16)),Jt=Ee().cancelAnimationFrame||(o=>clearTimeout(o));function Ht(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 xo(o,t){return new De(o,Ze(t))}function Ze(o){return()=>{let t=typeof o=="function"?o():o;return{lazyLoad:!!t.lazyLoad,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:t.unfilteredCount}}}function rl(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,Ze(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,Ze(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?mn(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?mn(c,d):[]}let s=new De(a,Ze(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?mn(c,d):[]}let s=new De(l,Ze(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,Ze(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,Ze(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,Ze(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new De(r,Ze(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,Ze(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 er=new WeakMap,xm=o=>o;function al(o,t=50,e){er.set(o,{lastCallTime:0,lastCallArg:null});let n=e??xm;return i=>{let{lastCallTime:r,lastCallArg:a}=er.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=Ht(n(a),n(i));u<t&&d||(er.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var Pm="*",Ge=class{constructor(t){this.wildcard=Pm;this.cache=new U;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){Kt(`${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}}};import{defineComponent as gu,h as yu}from"vue";import{computed as wt,defineComponent as Rr,h as wn,inject as Bh,provide as Hh,ref as mu,shallowRef as Wh,watch as jh}from"vue";var ee=(...o)=>o.filter(t=>!!`${t}`).join(" ");var ll="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",sl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var at="_16lm1iw3b _16lm1iw3c _16lm1iw35",ul={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Po={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var dl={1:"_16lm1iw1c",none:"_16lm1iw1d"},tr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var cl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},fl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},pl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ml={none:"_16lm1iwd"},Do={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var hl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var gl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var yl={none:"_16lm1iw1x"};var bl={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Cl={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};import{defineComponent as Em,h as $n,onBeforeUnmount as Fm,onMounted as Nm,ref as Om}from"vue";function Dm(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 Am(o){var t=Dm(o,"string");return typeof t=="symbol"?t:String(t)}function _m(o,t,e){return t=Am(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function Tl(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 Sl(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Tl(Object(e),!0).forEach(function(n){_m(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):Tl(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function wl(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var Mm=(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},Se=o=>{var t=e=>{var n=o.defaultClassName,i=Sl(Sl({},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)Mm(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 wl(o.variantClassNames,e=>wl(e,n=>n.split(" ")[0]))}},t};var vl="_1eexc2a6";var Il=Se({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:[]}),Rl="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",xl=Se({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Pl=Se({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"]]}),Dl=Se({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"]]}),Al="_12zfob12u _16lm1iw22 _16lm1iw1z";var _l="_12zfob17",Ml="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",El=Se({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),nr=Se({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Fl="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Nl=Se({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Ol="_12zfob1b _16lm1iw2",kl="_16lm1iw1",Ll="_12zfob16",zl=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Vl="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var nt="InfiniteIcon";var Gl="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Kl={transition:"width 0.25s, opacity 0.25s"},Bl=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var hn=Em(o=>{let t=Om(0),e=null;return Nm(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),Fm(()=>{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={...Kl,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return $n("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:ee(i,nt,Gl,`${nt}-filter`)},[a?$n("div",{"data-name":"index",class:_l},`${r}`):null,$n("div",{style:{width:`${d[0]}px`,...s}}),$n("div",{style:{width:`${d[1]}px`,...s}}),$n("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...Bl]});var Ao=Object.freeze({}),km={string:Ao,number:{}};function gn(o,t){let e=t.default||Ao;return o.type===void 0?e:o.type===null?Ao:typeof o.type=="string"?t[o.type]||km[o.type]||Ao:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var ir=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],d=[];e.forEach((R,E)=>{let N=R.maxSize??i??void 0,v=R.minSize??n??void 0;u.push(v),d.push(N),R.size!=null&&(N!=null&&R.size>N&&(R.size=N),v!=null&&R.size<v&&(R.size=v));let D=R.flex==0?null:R.flex;if(R.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${E} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,r+=R.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((R,E)=>{if(R.flex!=null){let N=c*R.flex,v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=!1,A=0;v!=null&&N>v&&(f[E]=!0,M=!0,A=v),D!=null&&N<D&&(m[E]=!0,M=!0,A=D),M&&(p+=1,l-=1,a-=R.flex,s-=A)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,S=0,w=0,T=[];return{items:e.map((R,E)=>{let N={...R},v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=0,A=f[E],x=m[E],F=A||x,_=R.size??0;if(R.flex!=null){if(F)x&&(M=D),A&&(M=v);else{y+=1;let O=L=>(v!=null&&L>v&&(L=v),D!=null&&L<D&&(L=D),L);y===l?M=O(C):(M=O(Math.round(R.flex*c)),w+=M,C=s-w,b-=R.flex,c=C/b)}_=M,N.flexSize=M}return h.push(M),T.push(_),N.computedSize=_,S+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-S)}};function _o(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 Wl(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 or(o,t){return o.computedFlex&&!t?"flex":"width"}function Un(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var rr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((D,M)=>(D[M]={...o.columnSizing[M]},D),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],d=l.id,s=u?.id,c=Wl(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=or(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,S=u?or(u,c):"width",w=!1,T=!1,P=i>0?1:-1,{value:R,clamped:E,diff:N}=_o(Math.round(f+i),m,p,P);if(o.shareSpaceOnResize){if(u==null)return n[d]=Un(n[d],h,R),T=E==="min",w=E==="max",{adjustedDiff:R-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:w,constrained:T||w};let{value:D,clamped:M,diff:A}=_o(Math.round(y-i),C,b,P);if(E&&M&&(Math.abs(N)>Math.abs(A)?M=!1:E=!1),!(!E&&!M)){if(E){let x=_o(Math.round(y-i-N),C,b,P);D=x.value,M=x.clamped,A=x.diff}else if(M){let x=_o(Math.round(f+i+A),m,p,P);R=x.value,E=x.clamped,N=x.diff}}n[d]=Un(n[d],h,R),n[s]=Un(n[s],S,D),T=E==="min"||M==="min",w=E==="max"||M==="max"}else n[d]=Un(n[d],h,R),T=E==="min",w=E==="max";let v=R-f;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-v),columnSizing:n,minReached:T,maxReached:w,constrained:T||w}};function Hl(o,t){return o+t}function Lm(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var jl=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=Wl(o.items,t,e),d=a.map(b=>or(b,u)),s=0,{computedSizes:c}=ir({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(Hl,0)+i-s,0)}),f=a.map((b,S)=>c[S]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,S)=>{let w=a[S];if(!w.resizable){y.push(0);return}let T=d[S],P=l[S],R=Lm(n),{maxReached:E,minReached:N,constrained:v,adjustedDiff:D}=rr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[S],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[w.id]=Un(R[w.id],T,Math.round(P+D)),y.push(D),E||(p=!1),N||(m=!1),v||(h=!1)});let C=y.reduce(Hl,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var Mo;function Ct(){if(Mo!=null)return Mo;let o=Ee().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),Mo=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),Mo}var $l=["start",void 0,"end"],Ul=(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:$l.indexOf(i)-$l.indexOf(r)}),o);function ql(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 ar(o,...t){return ql(e=>e!=null,o,...t)}function Yl(o,t,...e){return ql((n,i)=>!(i in o),t,...e)}var Eo=!0,zm=!0,Vm=!0,Xl="string",Nt="unknown";var Gm=Kt("getComputedVisibleColumns"),Km=(o,t,e)=>o[e]!==!1,lr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function Qt(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function Bm(o,t){let e=gn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:Xl}function Hm(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Nt];let l=Qt(t,a);if(!l)return[Nt];let u=Bm(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Nt)?Nt:i.length===1?i[0]:i}function sr(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??Eo}var Zl=({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=qn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:w,columnOrder:T,columnPinning:P,editable:R,columnDefaultEditable:E,columnDefaultFilterable:N,columnDefaultGroupable:v,columnDefaultSortable:D,columnSizing:M,columnTypes:A,columnVisibility:x,columnVisibilityAssumeVisible:F,groupBy:_})=>{let O=0,L={};_.forEach((g,I)=>{g.field&&(L[g.field]=I)});let K=(f||[]).reduce((g,I)=>{let{id:z,field:k}=I;return k&&(g[k]=I),z&&(g[z]=I),g},{}),B=Ul(T===!0?Object.keys(o):T,P),G=B.filter(g=>o[g]?Km(x,F,g):(Gm(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),le=new Map,Y=G.map((g,I)=>{let z=o[g];return le.set(g,I),z}),xe=(p??[]).reduce((g,I,z)=>(I.id?g[I.id]={sortInfo:I,index:z}:I.field&&(g[I.field]={sortInfo:I,index:z}),g),{});function me(g){let I=o[g],z=gn(I,A),k={minWidth:z?.minWidth,maxWidth:z?.maxWidth,width:z?.defaultWidth,flex:z?.defaultFlex},q={width:I?.defaultWidth,flex:I?.defaultFlex,minWidth:I?.minWidth,maxWidth:I?.maxWidth},V=M[g];V?.width!=null&&V.flex==null&&delete q.flex,V?.flex!=null&&V.width==null&&delete q.width;let J=ar(q,V);J.width!=null&&delete k.flex,J.flex!=null&&delete k.width,J=ar(k,J);let ce=J.flex??void 0,se=J.minWidth??I?.minWidth??n,fe=J.maxWidth??I?.maxWidth??i,ae=ce!=null?void 0:J.width??(a?void 0:r);return!ae&&ce==null&&(a?ce=a:ae=se),{size:ae,flex:ce,minSize:se,maxSize:fe}}let we=ir({availableSize:Math.max(e.width-(C??0)-(l??Ct()),0),maxSize:i,minSize:n,items:G.map(me)}),{computedSizes:Ne,flexSizes:Me,minSizes:Te,maxSizes:_e}=we,ue=[],Q=[],H=[],X=[];X.length=G.length;let Z=new Map,ne=new Map,ie=0,he=0,ge=0,oe=null,W=[],te=0,be=0,Re=0;Y.forEach((g,I)=>{let z=G[I],k=Ne[I],q=W[I]=lr(z,P);q==="start"?te+=k:q==="end"?Re+=k:be+=k});let Pe=e.width-Re,We=[],Le=new Map;G.forEach((g,I)=>{let z=Y[I];Le.set(g,z)});let de=[];Object.keys(o).forEach(g=>{let I=o[g];de.push(g),Le.has(g)||Le.set(g,I)});let tt=new Map;Le.forEach((g,I)=>{let z=le.get(I);z==null&&(z=-1);let k=z!=-1,q=G[z+1],V=gn(g,A),J=z,ce=xe[I]?xe[I]:g.field?xe[g.field]??null:null,se=ce?.sortInfo??null,fe=!!se,ae=fe&&se.dir===1,ye=fe&&!ae,ve=ce?.index??-1,re=k?{}:me(I),rt=k?Ne[z]:re.size||0,_t=k&&Me[z]||null,Mt=k?Te[z]||0:re.minSize||0,yt=k?_e[z]||1e4:re.maxSize||1e4,Ve=k?lr(I,P):!1,Et=k?z===G.length-1:!1,Ft=J,Ln=k?Ve==="start"?he:Ve==="end"?ge:O-he:0;Ve=="start"?Ft=k?J:-1:Ve==="end"?Ft=k?J-(ue.length+H.length):-1:Ft=k?J-ue.length:-1;let Vt=k?Ve==="start"||Ve===!1?O:Pe+ge:-1,Mp=k?Ve!==oe:!1,Ep=k?Et||Ve!==lr(q,P):!1,Na=g.cssEllipsis??V.cssEllipsis??u,Fp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??Na,So=k&&(K[I]||g.field||g.groupByForColumn)&&(K[I]||K[g.field||g.groupByForColumn])||null,Np=g.defaultFilterable??V.defaultFilterable??N??!0,Op=R??g.defaultEditable??V.defaultEditable??E??!1,Bi=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||Xl,kp=g.sortType||V.sortType||Bi,Oa=g.filterType||V.filterType||Bi,ka=!1;if(So!=null&&!So.disabled){let Wi=y[Oa];Wi&&(!Wi.emptyValues||!Wi.emptyValues.includes(So.filter.value))&&(ka=!0)}let cn=g.field??V.field,Lp=g.valueGetter??V.valueGetter,Hi=g.defaultGroupable??V.defaultGroupable??v??!!cn;cn||(Hi=!1),g.groupByForColumn&&(Hi=!1);let La=cn?L[cn]!==void 0:!1,zp=La?L[cn]:void 0,Vp=sr(g,{colType:V,sortable:m,columnDefaultSortable:D}),Gp=g.resizable??V.resizable??b??zm,Ke={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Lp,valueFormatter:V.valueFormatter,renderValue:V.renderValue,render:V.render,style:V.style,className:V.className,contentFocusable:V.contentFocusable,renderMenuIcon:V.renderMenuIcon,renderSortIcon:V.renderSortIcon,renderRowDetailIcon:V.renderRowDetailIcon,renderSelectionCheckBox:V.renderSelectionCheckBox,renderHeaderSelectionCheckBox:V.renderHeaderSelectionCheckBox,headerStyle:V.headerStyle,headerClassName:V.headerClassName,columnGroup:V.columnGroup,getValueToEdit:V.getValueToEdit,getValueToPersist:V.getValueToPersist,shouldAcceptEdit:V.shouldAcceptEdit,field:cn,...g,components:{...V.components,...g.components},computedResizable:Gp,computedMinWidth:Mt,computedMaxWidth:yt,computedFlex:_t,computedDataType:Bi,computedEditable:Op,computedSortType:kp,computedFilterType:Oa,cssEllipsis:Na,headerCssEllipsis:Fp,computedFilterValue:So,computedFiltered:ka,computedFilterable:Np,computedGroupable:Hi,computedGroupedBy:La,computedGroupedByIndex:zp,computedWidth:rt,computedAbsoluteOffset:Vt,computedPinningOffset:Ln,computedVisibleIndexInCategory:Ft,computedOffset:O,computedSortable:Vp,computedSortInfo:se,computedSortIndex:ve,computedMultiSort:h,computedSorted:fe,computedSortedAsc:ae,computedSortedDesc:ye,computedVisibleIndex:J,computedPinned:Ve,computedDraggable:S??g.defaultDraggable??w??Vm,computedFirstInCategory:Mp,computedLastInCategory:Ep,computedFirst:z===0,computedLast:Et,id:I,header:g.header??V.header??g.name??g.field};k&&(O+=rt,Z.set(Ke.id,Ke),X[z]=Ke,Ve==="start"&&(ue.push(Ke),he+=Ke.computedWidth),Ve==="end"&&(Q.push(Ke),ge+=Ke.computedWidth),Ve||(H.push(Ke),ie+=Ke.computedWidth),oe=Ve),Ke.groupByForColumn&&(Ke.computedSortType=g.sortType||V.sortType||Hm(Ke.groupByForColumn,t,A),We.push(Ke)),ne.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!tt.has(Ke.field)&&tt.set(Ke.field,Ke)}),We.forEach(g=>{g.computedSortable=Jl(g,{fieldsToColumn:tt,userColumns:t,columnTypes:A,sortable:m,columnDefaultSortable:D})});let Ye=new Map;de.forEach(g=>{let I=ne.get(g);I&&Ye.set(g,I)}),ne.forEach(g=>{Ye.has(g.id)||Ye.set(g.id,g)});let dt=s!=null?Math.min(s,he):he,gt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(te+Re+be),computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:ie,computedColumnOrder:B,computedPinnedStartColumns:ue,computedPinnedEndColumns:Q,computedUnpinnedOffset:he,computedPinnedEndOffset:he+ie,computedUnpinnedColumns:H,computedVisibleColumns:X,computedColumnsMap:ne,computedColumnsMapInInitialOrder:Ye,computedVisibleColumnsMap:Z,computedPinnedEndWidth:gt,computedPinnedStartWidth:dt,renderSelectionCheckBox:X.reduce((g,I)=>g||!!I.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function Jl(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??Eo,d=o.sortType??o.colType.sortType;return d!=null&&d!==Nt&&u?!0:c=>{let{column:f,api:m}=c,p=f.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((h,y)=>{if(!h)return!1;let C=y.field||y.groupField,b;if(C){let S=n.get(C),w=S?m.getColumnApi(S.id):void 0;if(S&&w)b=w.isSortable();else{let T=Qt(r,C);if(T){let P=sr(T,{colType:gn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof P=="boolean"?P:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??Eo},!0)}}function Je(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 Yn(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=Je(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 Fe="Infinite",ke={rootClassName:Fe};var Fo=`${Fe}HeaderCell__filter`,ur=`${Fe}HeaderCell__filterOperator`,Ql=`${Fo}__input`;import{computed as tn,defineComponent as Eh,h as $e,inject as Fh,provide as Nh,ref as su,shallowRef as Oh,Teleport as kh}from"vue";function $(o){return o.slice(4,-1)}function No(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(" ")}import{nextTick as ph}from"vue";var je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function es(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function ts(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function Wm(o,t,e){let n=es(o,e),i=es(t,e);return n===i?ts(e,t)-ts(e,o):n-i}function ns(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)=>Wm(n,i,e)),t}function jm(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 $m(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=ns(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 os(o,t){if(jm(o))return $m(o,t);o=ns(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(Um([e,r,a],t))return!0}return!1}function Um(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 yn=class{containsPoint(t){return os(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 bn=class o extends yn{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function qm(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 Ae({top:n,left:e,width:a-e,height:d-n})}var Ae=class o extends yn{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=qm(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 bn(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function Xn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var is="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",rs="_1yeub2vs",as="_1yeub2vr",ls=Se({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 dr="_1yeub2vp";var vw=Se({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 cr=`${Fe}Body`,ss=o=>o.querySelector(`.${cr}`);var en=`${Fe}HeaderCell`,fr=`${Fe}HeaderWrapper`,us=o=>Array.from(o.querySelectorAll(`.${fr}`));function Cn(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 ds(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 Ie={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)"}}},cs="column-header-height";var fs=`.${ke.rootClassName}`;function pr(o){return Cn(o,fs)}var ps=$(j.scrollLeft),Ym=$(j.scrollTop),Xm=$(j.columnWidthAtIndex),mr=$(j.columnOffsetAtIndex),ms=$(j.columnReorderEffectDurationAtIndex),Zm=$(j.columnOffsetAtIndexWhileReordering),Jm=$(j.columnVisibilityAtIndex),Qm=$(j.columnZIndexAtIndex);function Tt(o,t,e){let n=e?pr(e):document.querySelector(fs);eh(o,t,n)}function eh(o,t,e){if(e){let n=o,i=j[n]?$(j[n]):o;e.style.setProperty(i,`${t}`)}}function Tn(o,t){if(t)for(var e in o){let n=j[e]?$(j[e]):e,i=`${o[e]}`;t.style.setProperty(n,i)}}function hr(o,t,e){Tt(`${mr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${ps}))`:`${o.computedAbsoluteOffset+t}px`,e)}function gr(o,t,e){Tt(`${Qm}-${o}`,`${t}`,e)}function Zn(o,t,e){Tt(`${Zm}-${o}`,typeof t=="number"?`calc( var(${mr}-${o}) + ${t}px )`:t,e)}function Jn(o,t,e){Tt(`${Jm}-${o}`,t,e)}function Oo(o,t,e){Tt(`${ms}-${o}`,e??"",t)}function yr(o,t){let e=`${ms}-${o}`;Tt(e,Ie.components.Cell.reorderEffectDuration,t)}var Ce={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Xm}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Tt(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`${mr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,Tt(this.varName.get(o),t,e)}}};function hs(o,t){Tn({[ps]:`${o.scrollLeft}px`,[Ym]:`${o.scrollTop}px`},t)}var Qn={bodyWidth:{name:$(Ie.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:$(Ie.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:$(Ie.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:$(Ie.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:$(Ie.runtime.browserScrollbarWidth),value:""}},th=$(j.scrollbarWidthHorizontal),gs=$(j.scrollbarWidthVertical),nh=$(j.columnWidthAtIndex),oh=$(j.columnZIndexAtIndex),ys=$(j.scrollLeft),ih=$(j.activeCellColWidth),bs=$(j.activeCellColOffset),ws=$(j.baseZIndexForCells),rh=$(j.pinnedStartWidth),Cs=$(j.bodyWidth),ah=$(j.bodyHeight),Ts=$(j.pinnedEndOffset),Ss=$(j.pinnedEndWidth),lh=$(j.computedVisibleColumnsCount);function br(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(${ws}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function vs(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Ct(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[Ce.columnWidths.varName.get(y)]=h.computedWidth+"px",p[Ce.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${ys}) )`:h.computedPinned==="end"?`calc( var(${Ts}) ${f.length?"+":""} ${f.map(b=>Ce.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${ys}) )`:`${h.computedOffset}px`;let C=br(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${oh}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[Qn.browserScrollbarWidth.name]=`${Ct()}px`),m[Qn.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[Qn.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[Qn.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${nh}-${h})`).join(" + ")})`,m[Qn.visibleColumnsCount.name]=t.length,u!=null){m[ih]=Ce.columnWidths.get(u[1]);let p=Ce.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[bs]=h?`calc( ${Ie.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[bs]=p}return m[lh]=t.length,m[th]=s.horizontal?`${c}px`:"0px",m[gs]=s.vertical?`${c}px`:"0px",m[rh]="calc( "+e.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Ss]="calc( "+n.map(p=>Ce.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[ws]=t.length*10,m[Ts]=`calc( var(${Cs}) - var(${Ss}) - var(${gs}) )`,m[Cs]=`${l.width}px`,m[ah]=`${l.height}px`,m}var eo=(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 Cr(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 eo(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return eo(n,s,d)}return t}var Ds=zn(Sn());function ko(o){return o.map(t=>t instanceof Wt?t:new Wt(null,[t]))}var Wt=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=>sh(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 sh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var uh=(...o)=>new Wt("+",ko(o)),Rs=(...o)=>new Wt("-",ko(o)),dh=(...o)=>new Wt("*",ko(o)),ch=(...o)=>new Wt("/",ko(o)),to={add:uh,subtract:Rs,minus:Rs,multiply:dh,divide:ch};var xs=o=>{let t=null,e=null;return{stop(){t!==null&&Jt(t),e!=null&&Jt(e)},scroll(n){t!==null&&Jt(t),e!=null&&Jt(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=Oe(()=>{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=Oe(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var Ps=10,fh=$(j.pinnedStartWidth);function As(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:d,tableRect:s,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:y,horizontalLayoutPageIndex:C,pageWidth:b}=o;function S(H){let X=H==="start"?L:K;return F===O?X:O===H?X+A.computedWidth:F===H?X-A.computedWidth:X}function w(H){if(H.columnIndex===x||C!=null)return!0;let X=t[H.columnIndex];if(X.computedPinned)return!0;let Z=l.getScrollPosition().scrollLeft,ne=X.computedOffset+(C!=null&&b!=null?b*C:0);return ne>=Z+S("start")&&ne+X.computedWidth<=Z+s.width-S("end")}let T=(H,X)=>{let{restrictToParentGroup:Z,dragColumn:ne}=X,ie=[];if(H.forEach(ge=>{if(ge.computedVisibleIndex===x)return;let oe={columnId:ge.id,columnIndex:ge.computedVisibleIndex,offsetX:ge.computedOffset+Math.round(ge.computedWidth/2)};w(oe)&&ie.push(oe)}),Z){let oe=function(te,be,Re){let Pe=H[te];Pe&&(Pe.columnGroup!==ne.columnGroup&&Re.add(Pe.id),oe(te+be,be,Re))};var he=oe;let ge=ne.computedVisibleIndex,W=new Set;oe(ge-1,-1,W),oe(ge+1,1,W),ie=ie.filter(te=>!W.has(te.columnId))}return ie},R=i.length,E={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:E.clientX-s.left-(E.clientX-u.left)+Ps,top:E.clientY-s.top-(E.clientY-u.top)+Ps},v=l.getScrollPosition(),D=t.map(H=>H.computedVisibleIndex),M=D,A=e.get(r),x=A.computedVisibleIndex,F=A?.computedPinned,_=x,O=F,L=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=E,G={x:0,y:0},le=1,Y=0;function xe(H){let X=Math.round(H.clientX),Z=Math.round(H.clientY);if(X===B.clientX&&Z===B.clientY)return Ae.from(u).shift({left:G.x,top:G.y});B={clientX:X,clientY:Z};let ie=l.getScrollPosition().scrollLeft-v.scrollLeft;return G.x=B.clientX-E.clientX,G.y=B.clientY-E.clientY,Y=G.x+ie,le=Y<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ae.from(u).shift({left:G.x,top:G.y})}function me(H){let X=0;F?F==="start"&&H.forEach((Z,ne)=>{X||t[Z]?.computedPinned!=="start"&&(X=ne)}):H.forEach((Z,ne)=>{t[Z]?.computedPinned==="start"&&(X=ne+1)}),R=X,we("start",H,X)}function we(H,X,Z){if(H==="start"){let ne=0;for(let ie=0;ie<Z;ie++){let he=X[ie],ge=t[he];ne+=ge.computedWidth}Tt(fh,`${ne}px`,a)}}function Ne(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Jn(x,"",a),p(!1)),_=H,H===-1){Me(x);return}let X=eo(D,x,_>x?_-1:_);R=0;let ne=new Set;return X.forEach((ie,he)=>{let ge=M[he];ie!==ge&&ne.add(ie),me(X)}),M=X,Te(ne),{newColumnIndexes:X,indexesWithTransition:ne,pinnedStartCount:R}}function Me(H){M=M.filter(Z=>Z!==H),t.forEach(Z=>{let ne=Z.computedVisibleIndex,ie=ne>H;yr(ne,a);let he="";ie&&(he=to.minus(Ce.columnOffsets.get(ne),Ce.columnWidths.get(H)).done()),Zn(ne,he,a)}),Jn(H,"hidden",a),p(!0)}function Te(H){t.forEach(X=>{let Z=X.computedVisibleIndex;H.has(Z)?yr(Z,a):Oo(Z,a);let ne=Z===x,ie=le===-1?Z<_||Z>x:Z<x||Z>=_,he="";le===-1?he=ne?Ce.columnOffsets.get(_):ie?Ce.columnOffsets.get(Z):to.add(Ce.columnOffsets.get(Z),Ce.columnWidths.get(x)).done():he=ie?Ce.columnOffsets.get(Z):ne?to.add(Ce.columnOffsets.get(_-1),Ce.columnWidths.get(_-1)).minus(Ce.columnWidths.get(x)).done():to.minus(Ce.columnOffsets.get(Z),Ce.columnWidths.get(x)).done(),Zn(Z,he,a)})}let _e=s.left+S("start"),ue=s.right-S("end"),Q=xs({scrollOffsetStart:_e,scrollOffsetEnd:ue});return xe(E),{speedScroller:Q,stop(){Q.stop()},onMove(H){let X=xe(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(X.getCenter()))return f&&Ne(-1),null;Q.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(oe){y.scrollLeft=oe}});let Z=T(t,{dragColumn:A,restrictToParentGroup:d==="group"}),ne=le===-1?A.computedOffset+Y:A.computedOffset+A.computedWidth+Y,ie=(0,Ds.default)(Z,ne,({offsetX:oe},W)=>oe<W?-1:oe>W?1:0);ie<0&&(ie=~ie),Z.length?ie=Z[ie]?Z[ie].columnIndex:Z[Z.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),ie=0),ie===x+1&&(ie=x),Ne(ie);let he={};n.forEach(oe=>{he[oe.id]="end"});for(let oe=0;oe<R;oe++){let W=M[oe],te=t[W];he[te.id]="start"}let ge=M.map(oe=>t[oe].id);return{columnPinning:he,columnOrder:ge}}}}var mh=$(j.baseZIndexForCells),hh=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:Ht(o,t)},gh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function _s(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&&Xn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:S,computedVisibleColumnsMap:w,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedPinnedEndColumns:R}=d(),E=w.get(t);if(!E||!E.computedDraggable){f(p);return}let N=n.current,v=N.getBoundingClientRect(),D=y.current.getBoundingClientRect(),M=C.getAvailableSize(),A=E.computedVisibleIndex,x=C.getVirtualColIndex(E.computedVisibleIndex,{pageIndex:h||0}),F=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,L=y.current,K=Ae.from(ss(L).getBoundingClientRect()),B=us(L).map(Te=>Ae.from(Te.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),le=As({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:F,draggableColumnsRestrictTo:b,computedPinnedEndColumns:R,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedVisibleColumns:S,computedVisibleColumnsMap:w,dragColumnHeaderTargetRect:v,dragColumnId:t,getCurrentDragSourceAndTarget:gh,api:c,infiniteDOMNode:y.current,setProxyPosition:Te=>{a.value=Te},setDragColumnOutside:Te=>{l.value=Te},tableRect:D,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Y=null,xe,me;function we(Te){let{columnPinning:_e,columnOrder:ue}=Te;hh(u().columnPinning,_e)||(s.columnPinning=_e);let Q=d().computedColumnOrder;s.columnOrder=Cr({newColumnOrder:ue,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:Q,dragColumnId:t})}let Ne=Te=>{let{headerBrain:_e,brain:ue}=u();if(!O){O=!0;let Q=ue.keepColumnRendered(x),H=_e.keepColumnRendered(x);if(ue.isHorizontalLayoutBrain){let Z=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=_e.extendRenderRange({start:!0,end:!0,direction:"horizontal"});me=()=>{Z(),ne()}}xe=()=>{Q(),H()},s.columnReorderDragColumnId=E.id,h!=null&&(s.columnReorderInPageIndex=h),gr(A,`calc( var(${mh}) + 10000 )`,y.current),y.current?.classList.add(dr),N.style.cursor="grabbing"}Y=le.onMove(Te)},Me=Te=>{let _e=Te.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ue}=u(),Q=y.current;Q?.classList.remove(dr),le.stop(),C.update({...M}),xe?.(),me?.(),N.style.cursor=_,N.hasPointerCapture?.(_e)&&N.releasePointerCapture(_e),N.removeEventListener("pointermove",Ne),N.removeEventListener("pointerup",Me),a.value=null;let H=c.getColumnApi(E.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(E.id,{multiSortBehavior:ue==="replace"&&(Te.ctrlKey||Te.metaKey)?"append":ue}),Y?we(Y):O&&r&&c.setVisibilityForColumn(E.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await ph(),S.forEach(X=>{Oo(X.computedVisibleIndex,Q),Jn(X.computedVisibleIndex,"",Q),Zn(X.computedVisibleIndex,"",Q)}),gr(A,br(E,{pinnedStartColsCount:T.length,visibleColsCount:S.length}),Q)})};N.addEventListener("pointermove",Ne),N.addEventListener("pointerup",Me),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Xn(p.target)||f(p)}}}import{defineComponent as yh,h as Lo}from"vue";var ot={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 Ms=yh({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 Lo("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>Lo("path",{d:n})))}}});function ct(o,t){let e=n=>Lo(Ms,{...n,paths:t});return e.displayName=o,e}var Es=ct("IncludesOperatorIcon",ot.includesOperator),Fs=ct("StartsWithOperatorIcon",ot.startsWithOperator),Ns=ct("EndsWithOperatorIcon",ot.endsWithOperator),Os=ct("EqualOperatorIcon",ot.eqOperator),ks=ct("NotEqualOperatorIcon",ot.neqOperator),Ls=ct("GTOperatorIcon",ot.gtOperator),zs=ct("GTEOperatorIcon",ot.gteOperator),Vs=ct("LTOperatorIcon",ot.ltOperator),Gs=ct("LTEOperatorIcon",ot.lteOperator),Ks=ct("DoneIcon",ot.done),Bs=ct("ClearIcon",ot.clear),Tr=o=>Lo(Ms,{...o,viewBox:"0 -960 960 960",paths:ot.hidden});Tr.displayName="HiddenIcon";var zo="_1eexc2a7 _1eexc2a6",Hs=Se({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"]]}),Ws=Se({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 js="_1eexc2a5",Vo=Se({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Go="_1eexc2a8";import{defineComponent as bh,h as Ch,onMounted as Th,ref as Us,watch as Sh}from"vue";var $s="qz8ht90 _16lm1iwk";var jt=bh({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=Us(e===void 0?!1:e),i=Us(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};Th(r),Sh(()=>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 Ch("input",{...l,class:ee("InfiniteCheckBox",$s,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});import{defineComponent as wh,h as Ko}from"vue";function qs(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var Ys=qs({"data-name":""}),Sr={[Ys["data-name"]]:"menu-icon"},Xs=`[${Ys["data-name"]}="${Sr["data-name"]}"]`;var vh={width:"100%",pointerEvents:"none"},wr=`${nt}-menu`,no=wh({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={...vh,borderTop:`${Ie.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[Ko("div",{class:wr,style:e}),Ko("div",{class:wr,style:e}),Ko("div",{class:wr,style:e})];return Ko("div",{...o.domProps,style:o.style,...Sr,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ee(o.className,Nl({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),nt,`${nt}-menu`)},n)}}});import{defineComponent as Ih,h as oo,ref as eu,watch as Rh,onBeforeUnmount as xh}from"vue";var Zs="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Js={transition:"width 0.25s, opacity 0.25s"},Qs=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var tu=Ih(o=>{let t=eu(!0),e=eu(0),n=null;Rh(()=>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}),xh(()=>{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={...Js,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),oo("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:ee(l,nt,Zs,`${nt}-sort`)},[d?oo("div",{"data-name":"index",style:p,class:Ll},`${u}`):null,oo("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),oo("div",{style:{width:`${f[1]}px`,...m}}),oo("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...Qs]});var{rootClassName:nu}=ke,St=`${nu}Cell`,Bo=`${nu}Cell_content`;function vr(o){return Math.max(o.width-Ct(),0)}function ou(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 rr({shareSpaceOnResize:i,availableSize:vr(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}))})}import{defineComponent as Dh,h as au,ref as Ah}from"vue";function iu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){Ce.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;Ce.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?hr(l,r,n.current):Ce.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"){hr(d,r,n.current);continue}d.computedPinned!=="end"&&Ce.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||Ce.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function ru(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;Ce.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&Ce.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"&&Ce.columnOffsets.set(s,c.computedOffset+u,d)}}}}var Ho="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Wo=Se({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"]]}),jo=Se({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"]]});import{inject as Ph}from"vue";var io=Symbol("InfiniteTable");function Be(){return Ph(io)}var{rootClassName:_h}=ke,Mh=`${_h}HeaderCell_ResizeHandle`,lu=Dh({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=Be(),{getState:e}=t,n={current:null},i=Ah(!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"}),P=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),P()}}h.setPointerCapture(m);let C=iu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:P}={})=>{d&&(T=T/(d+1),P&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:R,constrained:E}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==E&&(i.value=E),C.resize(R),R},S=T=>{b(Math.round(T.clientX-p))},w=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",S),h.removeEventListener("pointerup",w);let P=Math.round(T.clientX-p),R=b(P,{done:!0});y(),C.resize(0),o.onResize({diff:R,shareSpaceOnResize:f})};h.addEventListener("pointermove",S),h.addEventListener("pointerup",w)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,d=a.computedLastInCategory,s=(l===!1||l==="start")&&d?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return au("div",{ref:c=>{n.current=c??null},class:`${Mh} ${Ho} ${jo({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[au("div",{style:s,class:Wo({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var Lh=$(j.columnWidthAtIndex),zh=$(j.columnReorderEffectDurationAtIndex),Vh=$(j.columnZIndexAtIndex),Gh=$(j.columnVisibilityAtIndex),uu=Symbol("InfiniteHeaderCell");function $o(){return Fh(uu)}var Kh=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||jt;return $e(u,{domProps:{class:Go},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function nn(o,t){return o(t)}var Ir=()=>$e("div",{class:dl[1]}),du=Eh({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=Be(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=v=>{let D=v&&v.$el!==void 0?v.$el:v;s.current=D??null,o.domRef(s.current)},f=Oh(null);Nh(uu,f);let m=()=>Je(o.column,{actions:n,api:e,dataSourceActions:d,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let v=o.column.id,D=l().filterDelay,M=`${v}:${D}`;if(!p||p.key!==M){let A=x=>{e.setColumnFilter(v,x)};p={key:M,fn:D>0?Zt(A,{wait:D}):A}}return p.fn},y=su(null),C=su(!1),{onPointerDown:b}=_s({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),S=tn(()=>t.state.value.columnMenuVisibleForColumnId),w=tn(()=>t.state.value.columnReorderDragColumnId),T=tn(()=>t.state.value.columnReorderInPageIndex),P=tn(()=>t.state.value.showColumnFilters),R=tn(()=>t.state.value.columnHeaderHeight),E=tn(()=>t.state.value.components),N=tn(()=>a.state.value.filterTypes);return()=>{let{column:v,columnsMap:D,horizontalLayoutPageIndex:M,headerOptions:A}=o,{allRowsSelected:x,someRowsSelected:F,selectionMode:_}=o,O=v.computedSortInfo,L=v.header,K=m(),B=K.isSortable(),G=A.alwaysReserveSpaceForSortIcon,le=v.headerAlign??v.align,Y=(typeof le=="function"?le({isHeader:!0,column:v}):le)??"start",xe=(typeof v.verticalAlign=="function"?v.verticalAlign({isHeader:!0,column:v}):v.verticalAlign)??"center",me=B&&(v.computedSorted||G)?$e(tu,{index:v.computedMultiSort?v.computedSortIndex+1:void 0,style:{marginInlineStart:Ie.spacing[2],marginInlineEnd:Ie.spacing[2]},className:`${en}__sort-icon ${kl} ${zl({align:Y})}`,direction:v.computedSorted?v.computedSortedAsc?1:-1:0}):null,Ne=v.computedFilterable&&v.computedFiltered?$e(hn):null,Me=v.headerCssEllipsis??v.cssEllipsis??!0,Te=S.value,_e=w.value,ue=T.value,Q=_e===v.id,H=ue!=null?M!==ue:!1,X={reserveSpaceWhenHidden:Y==="center",menuVisible:Te===v.id,style:Y==="end"?{marginInlineStart:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:Ie.spacing[2]}:{marginInlineEnd:`calc(${Ie.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:Ie.spacing[2]},domProps:{onMousedown:re=>{re.stopPropagation(),K.toggleContextMenu(re.target)}}},Z=v.components?.MenuIcon||E.value?.MenuIcon||no,ne=$e(Z,X),ie=P.value,he=N.value,ge=v.computedFilterType,oe=he[ge],W=v.computedFilterable?v.computedFilterValue?.filter.operator??oe?.defaultOperator:void 0,te=v.computedFilterable&&oe?oe.operators.find(re=>re.name===W):void 0,be=te?.components?.FilterEditor||oe?.components?.FilterEditor||v.components?.FilterEditor||ro,Re=oe?.components?.FilterOperatorSwitch||v.components?.FilterOperatorSwitch||fu,Pe=v.computedFilterable?$e(cu,{filterProps:{horizontalLayoutPageIndex:M,filterEditor:be,filterOperatorSwitch:Re,operator:te,filterTypes:he,onChange:h(),columnFilterType:ge,columnLabel:v.field||v.name||v.id,columnFilterValue:v.computedFilterValue,columnHeaderHeight:R.value}}):$e(pu),We={horizontalLayoutPageIndex:M,dragging:Q,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:v,columnsMap:D,columnSortInfo:O,columnFilterValue:v.computedFilterValue,filtered:v.computedFiltered,someRowsSelected:F,allRowsSelected:x,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:me,filterIcon:Ne,menuIcon:ne,menuIconProps:X,selectionCheckBox:null,header:v.header&&typeof v.header!="function"?v.header:v.name}},Le=We;Le.renderBag.filterEditor=Pe,f.value=Le;let de={...We,renderBag:{...We.renderBag}};if(v.renderSortIcon&&(de.renderBag.sortIcon=nn(v.renderSortIcon,{...de,renderBag:{...de.renderBag}})),v.renderFilterIcon&&(de.renderBag.filterIcon=nn(v.renderFilterIcon,{...de,renderBag:{...de.renderBag}})),typeof v.renderMenuIcon=="function"){let re=nn(v.renderMenuIcon,{...de,renderBag:{...de.renderBag}});de.renderBag.menuIcon=re?re.type===Z||re.type===no?re:$e(Z,X,()=>re):null}if(v.renderSelectionCheckBox&&_==="multi-row"){de.renderBag.selectionCheckBox=nn(Kh,{...de,renderBag:{...de.renderBag}});let re=v.renderHeaderSelectionCheckBox??v.renderSelectionCheckBox;re&&re!==!0&&(de.renderBag.selectionCheckBox=nn(re,{...de,renderBag:{...de.renderBag}}))}L instanceof Function&&(de.renderBag.header=nn(L,{...de,renderBag:{...de.renderBag}}));let tt=Me?$e("div",{class:at},[de.renderBag.header]):de.renderBag.header,Ye=v.renderMenuIcon===!1?null:de.renderBag.menuIcon,dt=[Y==="center"?Ir():null,de.renderBag.selectionCheckBox,tt,de.renderBag.sortIcon,de.renderBag.filterIcon,Y==="center"?Ir():null,Y!=="center"?Ir():null,Ye],gt=v.renderHeader?nn(v.renderHeader,{...de,renderBag:{...de.renderBag,all:dt}}):dt,ze={height:`${o.height}px`};v.headerStyle&&(ze=typeof v.headerStyle=="function"?{...ze,...v.headerStyle(Le)||{}}:{...ze,...v.headerStyle});let g=typeof v.headerClassName=="function"?v.headerClassName(Le):v.headerClassName,I=`var(${Vh}-${v.computedVisibleIndex})`;ze.zIndex=I,ze.visibility=`var(${Gh}-${v.computedVisibleIndex}, visible)`,ze.width=`var(${Lh}-${v.computedVisibleIndex})`,ze.transition=`transform var(${zh}-${v.computedVisibleIndex}, 0s)`;let z={filtered:v.computedFiltered,verticalAlign:xe,align:Y},k={"data-field":`${v.field||""}`,"data-column-id":v.id,"data-header-align":Y,"data-name":"HeaderCell","data-sort":v.computedSortedAsc?"asc":v.computedSortedDesc?"desc":"none","data-sort-index":`${v.computedSortIndex??-1}`},q=ee(en,yl.none,B?ul.pointer:"",g,No(v,[en,St],Pl,{dragging:Q,insideDisabledDraggingPage:H,align:Y,verticalAlign:xe,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),vl,St,zo),V=$e("div",{class:ee(Bo,Me?at:Do.hidden,Il(z),fl[Y]),style:ie?{height:`${o.height/2}px`}:void 0},[gt]),J=re=>ou({context:{getState:i,getComputed:r},column:v,diff:re.diff,shareSpaceOnResize:re.shareSpaceOnResize}),ce=v.computedResizable?$e(lu,{horizontalLayoutPageIndex:M,columns:r().computedVisibleColumns,columnIndex:v.computedVisibleIndex,computeResize:J,onResize:re=>{let{columnSizing:rt,reservedWidth:_t}=J(re);re.shareSpaceOnResize||(n.viewportReservedWidth=_t),n.columnSizing=rt}}):null,se=[ie?Pe:null,ce],fe={ref:c,...k,"data-z-index":I,style:ze,class:q,onPointerdown:b},ae=null,ye=i().portalDOMRef.current;Q&&y.value&&ye&&(ae=$e(kh,{to:ye},[$e("div",{key:v.id,class:`${en}Proxy ${Rl}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[$e("div",{class:xl({visible:C.value})},[$e(Tr,{size:16})]),de.renderBag.header])]));let ve=v.components?.HeaderCell;return ve?[$e(ve,fe,{default:()=>[V,se]}),ae]:[$e("div",fe,[V,se]),ae]}}});var hu=Symbol("InfiniteColumnHeaderFilter"),Uo=o=>o.stopPropagation(),cu=Rr({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=Be(),e=$o(),n=Wh(o.filterProps);Hh(hu,n);let i=mu(!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 wn("div",{onPointerup:Uo,onPointerdown:Uo,onFocusin:r,onFocusout:a,class:`${Fo} ${nr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[wn(c),wn(s)])}}}),fu=Rr({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=ao();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??hn;return wn("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:ee(ur,Ml,t?`${ur}--disabled`:"")},[wn(n,{size:20,className:`${El({disabled:!!t})}`})])}}}),pu=Rr({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>wn("div",{onPointerup:Uo,onPointerdown:Uo,class:`${Fo} ${nr({active:!1})} ${cl["50%"]}`})}});function ao(){let o=Be(),t=$o(),e=Bh(hu),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=wt(()=>t.value.column),f=wt(()=>{let{columnFilterType:S,filterTypes:w}=e.value;return w[S]}),m=mu(e.value.columnFilterValue?.filter.value??"");jh(()=>e.value.columnFilterValue?.filter.value,S=>{if(e.value.columnFilterValue)m.value!==S&&(m.value=S);else{let w=f.value;if(w){let T=[...w.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=S=>{m.value=S,e.value.onChange(S)},h=()=>{n.clearColumnFilter(c.value.id)},y=()=>{n.removeColumnFilter(c.value.id)},C={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:s,dataSourceApi:d},b=wt(()=>`Filter for ${Yn(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:wt(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:wt(()=>e.value.operator),operatorName:wt(()=>e.value.operator?.name),value:m,disabled:wt(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:wt(()=>e.value.filterTypes),filterTypeKey:wt(()=>e.value.columnFilterType),filtered:wt(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${Al} ${Ql}`}}var ro=gu({name:"StringFilterEditor",setup(){let o=ao();return()=>yu("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})}}),xr=gu({name:"NumberFilterEditor",setup(){let o=ao();return()=>yu("input",{"aria-label":o.ariaLabel.value,type:"number",disabled:o.disabled.value,value:o.value.value??"",onInput:t=>{let e=t.target,n=isNaN(e.valueAsNumber)?e.value:e.valueAsNumber;o.setValue(n)},class:o.className})}});var vt=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function bu(o={}){let{StringFilterEditor:t,NumberFilterEditor:e,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:t?{FilterEditor:t}:void 0,operators:[{name:"includes",...vt(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...vt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...vt(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...vt(n,"endsWith"),label:"Ends With",fn:({currentValue:i,filterValue:r})=>i.endsWith(r)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:e?{FilterEditor:e}:void 0,operators:[{label:"Equals",...vt(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...vt(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...vt(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...vt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...vt(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...vt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var qn=bu({StringFilterEditor:ro,NumberFilterEditor:xr,icons:{includes:Es,eq:Os,neq:ks,startsWith:Fs,endsWith:Ns,gt:Ls,gte:zs,lt:Vs,lte:Gs}});var qo=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 U(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 U(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 ft=class extends qo{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 Yo=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new U;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let d=n&&!n.isEmpty();if(d&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let s=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=s.length;c<f;c++){let m=s[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let s=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];d&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let y=i(p),C=u?[...f,y]:void 0,b=u&&!!C,S=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let w=0,T=S.length;w<T;w++){let P=S[w];if(P.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),P.type==="update"&&!h&&(p={...p,...P.data},c[m]=p),P.type==="update-children"&&!h){let R=P.children(p[l],p);p={...p},R!==void 0?p[l]=R:delete p[l],c[m]=p}P.type==="insert"&&(P.position==="before"?(c.splice(m,0,P.data),m--):c.splice(m+1,0,P.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let w=a(p),T=w?null:r(p);!w&&Array.isArray(T)&&(f.push(y),d&&(p[l]=T=T.concat()),s(T,f),f.pop())}else this.add(y,p)}}};s(t,[])}return t}}};function Pr(o){return o.map(It)}function It(o){if(Ee().structuredClone)return Ee().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Pr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Pr(Array.from(o)));if(o instanceof Map)return new Map(Pr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=It(o[e]));return t}var on=Object.seal({data:null,field:null});var vn="____root____",Tu="____not_loaded_yet____";function $t(){return!1}function Dr(o){if(!o||!Object.keys(o).length)return{};let t={};for(let e in o)if(o.hasOwnProperty(e)){let n=o[e].initialValue;t[e]=typeof n=="function"?n():n}return t}function Xo(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 Su(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 U;function c(C,b,S,w=0,T=[]){let P=!S.length||w===S.length-1,R=b[d?.values||"values"]||{};for(let E in R)if(R.hasOwnProperty(E)){let N=E;T.push(N),f.set(T,!0),C.set(T,{reducerResults:R[E][d?.totals||"totals"]||{},items:[]}),P||c(C,R[E],S,w+1,T),T.pop()}}let f=i?new U:void 0,m=[],p=Dr(n),h=It(p);t.visitDepthFirst((C,b,S,w)=>{let[T,...P]=b,R=C.children,E=s.get(P);if(E&&(E.cache=C.cache,E.childrenLoading=C.childrenLoading,E.childrenAvailable=C.childrenAvailable,E.error=C.error),P.length==r.length&&r.length){if(E){E.items=R;for(let v=0,D=P.length;v<D;v++){let M=P.slice(0,v),A=s.get(M);A&&(A.items=A.items||[],A.items=A.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return w?.()}for(let N=0,v=R.length;N<v;N++){if(!R[N]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...P,`${Tu}${N}`],x);continue}let D=R[N].data,M=R[N].keys||[];if(M.length){let x=M[M.length-1];P.push(x)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:R[N].totalChildrenCount,reducerResults:R[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(P,A),i){let x=A.pivotDeepMap=new U,F=R[N].pivot;c(x,F,i,0,m)}M.length&&P.pop()}w?.()});let y={deepMap:s,groupParams:o,initialData:t,reducerResults:h};return i&&(y.topLevelPivotColumns=f,y.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(C=>C.field).join(", ")}]}),y}function Cu(o,t,e,n,i,r,a,l,u,d=Wn){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Xo(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&&(on.data=n,on.field=h,b=y(on));let S=(C||d)(b,n);e.push(S),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:It(u),items:[]}));let{reducerResults:w,items:T}=f.get(e);T.push(n),a&&Xo(n,i,a,w,t)}e.length=0}}function wu(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:d,toKey:s}=o,c=s(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let C=0,b=n.length;C<=b;C++){let S=n.slice(0,C),w=t.get(S),{reducerResults:T,items:P}=w;P.push(i),w.leavesAvailableCount++,w.totalLeafNodesCount++,a&&Xo(i,r,a,T,S)}return}let p=It(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=d(i);if(!(!y||!Array.isArray(y))){for(let C=0,b=y.length;C<b;C++){let S=y[C];wu(o,t,e,f,S,C,a,l)}a&&lo(a,p,h)}}function Ar(o,t){let{reducers:e,marker:n}=o;if(n){let d=Object.keys(e??{});n.start({details:d.length>0?[{name:"Reducers",value:d.join(", ")}]:void 0})}let i=Dr(e),r=It(i),a=new U,l=new U;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++)wu(o,a,l,[],t[d],d,e,i);e&&lo(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function _r(o,t){let{marker:e,groupBy:n,defaultToKey:i=Wn,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new U:void 0,d=new U,s=[],c=[],f=Dr(a),m=It(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:It(f)};r&&(h.pivotDeepMap=new U),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let S=0;S<l;S++){let{field:w,groupField:T,valueGetter:P,toKey:R}=n[S],E=w?C[w]:null;P&&(on.data=C,on.field=w,E=P(on));let N=(R||i)(E,C);if(b[w||T]=N,s.push(N),!d.has(s)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:It(f)};r&&(v.pivotDeepMap=new U),d.set(s,v)}Cu(d,s,c,C,h,r,a,u,f,i)}l||Cu(d,s,c,C,h,r,a,u,f,i),a&&Xo(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{lo(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:w},T,P,R)=>{lo(a,w,S),R?.()}),b?.()}),lo(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 $h(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 Uh(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:d,pivotDeepMap:s,commonData:c}=t,f=c??null,m;if(Object.keys(d).length>0){f={...c},m={};for(let b in r)if(r.hasOwnProperty(b)){let w=r[b].field;w&&(m[w]=d[b]),w&&f[w]==null&&(f[w]=d[b])}}let p=!0,h=n[n.length-1],y=h;if(f!=null){let b=e[n.length-1];b&&b.field&&(y=f[b.field]),b&&b.toKey&&(y=b.toKey(y,f)),y=y??h}return typeof y=="string"&&y.startsWith(Tu)&&(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:$t,hasSelectedCells:$t,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 Zo(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function lo(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 vu(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:d,treeResult:s,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:y,rowsPerPage:C}=i,{deepMap:b}=s,S=o.length,w=e[e.length-1],T=w?w.nodeExpanded:!0;for(let P=0;P<S;P++){let R=o[P],E=d(R,P),N=[...t,E];if(l(R)){let _={id:E,nodePath:N,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,P],indexInParent:P,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 L=0,K=e.length;L<K;L++){let B=e[L];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=Zo(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let M=b.get(N)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:E,data:R,indexInAll:r.length,indexInParent:P,indexInParentNodes:[...n,P],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:$t,hasSelectedCells:$t,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(A.rowSelected=f(A),h)){let _=h.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=_.selectedCount,A.deselectedLeafNodesCount=_.deselectedCount}c&&(A.rowDisabled=c(A)),m&&m(A);let x=!0;if(p&&(A.selfExpanded=x=p(A)),T||(x=!1),A.nodeExpanded=x,T&&y&&C!=null&&C>0){let _=A.indexInAll,O=A.parentNodes;if(O.length>0&&_%C===0){let L=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(Zo(B,_+K,L)),K++,A.indexInAll++)})}}T&&(r[A.indexInAll]=A);let F=u(R);Array.isArray(F)&&vu(F,N,[...e,A],A.indexInParentNodes,i,r)}return r}function Iu(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return vu(t,[],[],[],o,n),e&&e.end(),{data:n}}function Ru(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(P=>P.field).join(", ")}]});let b=[],S=[],w=[],T=[];return h.visitDepthFirst((P,R,E,N)=>{let v=P.items,D=R.length,M=u?.isGroupRowCollapsed(R)??!1;T.push(E);let A=Uh({lazyLoad:e,groupBy:C,parents:Array.from(w),reducers:m,indexInGroup:E,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:R,error:P.error,totalChildrenCount:P.totalChildrenCount,childrenLoading:(P.childrenLoading||!M&&!P.childrenAvailable)&&e,childrenAvailable:P.childrenAvailable,directChildrenCount:R.length===C.length?P.items.length:h.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},P);if(s&&(A.rowSelected=s(A),c)){let L=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=L.selectedCount,A.deselectedChildredCount=L.deselectedCount}d&&(A.rowDisabled=d(A));let x=w[w.length-1],F=x?.collapsed??!1;F&&(M=!0),A.collapsed=M;let _=f||M;if(F&&(_=!1),_){if(r&&i!=null&&i>0){let L=A.indexInAll,K=A.parents;if(K.length>0&&L%i===0){let B=L/i,G=0;K.forEach(le=>{typeof r=="function"&&r(le)!==!0||(b.push(Zo(le,L+G,B)),G++,A.indexInAll++)})}}b.push(A),S.push(b.length-1)}A.collapsedChildrenCount=0,w.forEach(L=>{L.deepRowInfoArray.push(A),L.collapsedGroupsCount+=M?1:0}),x&&A.selfLoaded&&e&&(x.directChildrenLoadedCount+=1),a&&a(A),w.push(A);let O=!0;if(O){if(N)N();else if(!y){let L=b.length;M||(b.length+=v.length);let K=0;for(let B=0,G=v.length;B<G;B++){let le=v[B];if(!M&&r&&i!=null&&i>0){let we=L+B+K;if(we%i===0){let Ne=we/i;w.forEach(Me=>{if(typeof r=="function"&&r(Me)!==!0)return;let Te=L+B+K;b[Te]=Zo(Me,Te,Ne),K++,b.length++})}}let Y=L+B+K,me={id:le?l(le,Y):`${R}-${B}`,data:le,isCellSelected:$t,hasSelectedCells:$t,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:M,groupKeys:R,parents:Array.from(w),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Y,groupBy:C,groupNesting:D+1,groupCount:A.groupCount};s&&(me.rowSelected=s(me)),d&&(me.rowDisabled=d(me)),a&&a(me),w.forEach((we,Ne)=>{Ne===w.length-1&&le&&(we.directChildrenLoadedCount+=1),M&&(we.collapsedChildrenCount+=1),we.deepRowInfoArray.push(me)}),M||(b[L+B+K]=me)}}}w.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:S}}function Mr(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function Er(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 Fr(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 xu({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=bt(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=Er({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&s();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,y)=>{if(p=[...p],e==="end"&&y?.(),p.length===a){let C=t[p.length-1],S=p.slice(0,-1).join("/");if(!c){let w=S;S=p.join("/");let T=p[p.length-1];d[S]=Fr({header:`${T}`,columnGroup:w,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((w,T)=>{let P=c?`${p[p.length-1]}`:w.name||w.id,R=Er({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:w,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:S,header:P,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[w.id]:null}),E=`${w.id}:${p.join("/")}`;u[E]=R})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=Fr({columnGroup:b.length?b.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let S=t[p.length-1],w=b.length?b.join("/"):void 0;if(!c){let T=w;w=`total:${p.join("/")}`,d[w]=Fr({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:S,pivotGroupKey:p[p.length-1]})}l.forEach((T,P)=>{let R=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,E=Er({columnGroup:w,header:R,pivotAggregator:T,pivotAggregatorIndex:P,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:S,pivotIndex:p.length-1,pivotBy:t,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[T.id]:null});u[`total:${T.id}:${p.join("/")}`]=E})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var qh=()=>{};function Pu(o,t){let e=new U,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 Du(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=bt(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];Du(o,t,c,C)}});f?(d?.(n),u?.(n,qh)):(l?.(n,m,r(n)),u?.(n,m))}function Au(o,t,e){for(let n=0,i=e.length;n<i;n++)Du(o,t,[],e[n])}function _u(o){return o.map(e=>Array.isArray(e.field)?e.field.map((n,i)=>{let r=Array.isArray(e.type)?e.type[i]??e.type[0]:e.type;return typeof n=="function"?{...e,valueGetter:n,field:void 0,type:r}:{...e,type:r,field:n}}):e).flat()}var Ut=(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(Eu(_u(o),n)),i&&i.end(),t},Mu=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=Eu(_u(o),e.get),r=e.depthFirst??!1,a=e.inplace??!1;r||(a?t.sort(i):t=[...t].sort(i));let{nodesKey:l,toKey:u}=e,d=c=>c[l],s=c=>c[l]===void 0;return Au({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};Ut.knownTypes=Bt;var Yh=o=>{if(!o)return;let t=o.field,e=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let i=o.fn;if(!i&&o.type){let r=Array.isArray(o.type)?o.type[0]:o.type;i=Ut.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Ut.knownTypes).join(", ")}`)}return i||(i=Bt.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(Yh).filter(t=>t instanceof Function),Eu=(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 Fu=Symbol("CLEAR"),rn=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new U;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=Fu,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(Fu);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=()=>U.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:U.clone(t.nodePathToData),n}};function qt(o,t){return t().dataArray[o]}function Jo(o){return o().dataArray}var Qe=class{constructor(t){this.collapsedPathsMap=new U;this.expandedPathsMap=new U;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};var Zh=(o,t)=>o.length-t.length,Ue=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new U;this.cache=new U;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new U})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?Array.isArray(t)?new U(t.map(e=>[e,!0])):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:Array.isArray(e.treePaths)?new U(e.treePaths.map(n=>[n,!0])):e.treePaths,strictCheckPaths:e.strictCheckPaths??!0},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(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){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(Zh);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.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 ei(o,t){return new Ue(o,In(t))}function In(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var Qo=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 Ue))throw"Invalid tree selection";let a=new Ue(i,In(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 Qe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new Qe({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 Qe(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 Qe(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 Qe(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?qt(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 Ue))throw"Invalid node selection";let n=new Ue(t,In(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 Ue))throw"Invalid node selection";let n=new Ue(t,In(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 Ue))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 Rn=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 lt=class extends Rn{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 Nr=1e3;function Nu(o){return new Or(o)}var Or=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=()=>Jo(this.getState);this.getRowInfoByIndex=t=>qt(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?Nr:i;return isNaN(a)||(a=Nr),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 lt(n):new lt({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 lt({enabledRows:!0,disabledRows:[]});return}let e=new lt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new lt({disabledRows:!0,enabledRows:[]});return}let e=new lt(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 Qo({...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??Nr,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 Ou(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 ti(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 ni(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 oi(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var Jh="group-by",ku="group-by-";function Lu(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 ii(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===Jh){let r=Lu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(ku)){let r=i.id.slice(ku.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Lu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function zu(o){return"groupNesting"in o?o.groupNesting??0:0}function Vu(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 Qh(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||Bt.string)(o,t);return a===0?0:e.dir*a}function eg(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 tg(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=zu(n);for(;e.length&&zu(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 ng(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 Gu(o,t,e,n){let i=eg(t,e);if(!i.length||!o.length)return o;let r={...Bt,...n},a=tg(o),l=(d,s)=>{for(let c of i){let f=Qh(Vu(d.row,c),Vu(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),ng(a)}var so={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 kr=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(so).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:so[n].track,label:r.label}),get label(){let r=so[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=so[n];return t.markerDetails.track=r.track,i}}),e},{})}};function it(o){return kr.create(o)}function xn(o){if(o==null)return!1;let t=o;return!0}function zr(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Rt=(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 Lr(){return!1}function og(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:Lr,hasSelectedCells:Lr};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 ig=bt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
var Wp=Object.create;var Ga=Object.defineProperty;var jp=Object.getOwnPropertyDescriptor;var $p=Object.getOwnPropertyNames;var Up=Object.getPrototypeOf,qp=Object.prototype.hasOwnProperty;var Yp=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var Zp=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $p(t))!qp.call(o,i)&&i!==e&&Ga(o,i,{get:()=>t[i],enumerable:!(n=jp(t,i))||n.enumerable});return o};var zn=(o,t,e)=>(e=o!=null?Wp(Up(o)):{},Zp(t||!o||!o.__esModule?Ga(e,"default",{value:o,enumerable:!0}):e,o));var wn=Yp((sv,Ns)=>{"use strict";Ns.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}});function Qt(o,{wait:t}){let e=null;return function(...n){let i=this;e!==null&&clearTimeout(e),e=setTimeout(()=>{o.apply(i,n)},t)}}import{defineComponent as Wg,inject as jg,onBeforeUnmount as si,onMounted as ui,provide as $g,shallowRef as Ug,watch as An}from"vue";import{getCurrentInstance as Jp,inject as Qp,isRef as em,onBeforeUnmount as tm,provide as nm,shallowRef as om,unref as im,watch as rm}from"vue";function Ka(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 $i=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Vn(o){return o!==void 0}function Gn(o,t){let e=t[o];return Vn(e)}var Ui=(o,t,e)=>{let n=o[t];typeof n=="function"&&n(...e)};function Xp(o,t,e){let n={};for(let i in o)if(o.hasOwnProperty(i)){let r=o[i],a=Gn(i,t)?t[i]:t[`default${$i(i)}`];typeof r=="function"&&(a=r(a,e)),n[i]=a}return n}function Ba(o,t,e){let{fn:n,propertyReads:i}=Ka(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),r=n(t);return i.forEach(a=>e.add(a)),r}function Ha(o){let{props:t,initialSetupState:e,propsToForward:n,parentState:i,mapPropsToState:r,propsToStateSet:a}=o,l={};n&&(l=Xp(n,t,e));let u={...e,...l};if(r){let d=Ba(r,{props:t,state:u,oldState:null,parentState:i},a);return{...u,...d}}return u}function Wa(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=Ba(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 ja(o){let{dispatch:t,getState:e,getProps:n,propsToForward:i,allowedControlledPropOverrides:r,interceptedActions:a,mappedCallbacks:l,notify:u=Ui}=o,d=e();return Object.keys(d).reduce((s,c)=>{let f=c;return Object.defineProperty(s,c,{set:p=>{let h=n(),y=e(),C=!0;if(a&&typeof a[f]=="function"&&a[f](p,{actions:s,state:y})===!1&&(C=!1),C){let w=[p],T=`on${$i(c)}Change`;if(l&&l[f]){let P=l[f](p,y);T=P.callbackName||T,w=P.callbackParams}u(h,T,w)}let b=i[f];typeof b=="function"&&(p=b(p));let S=!!r?.[f];Gn(c,h)&&!S||t({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function $a(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++,Gn(p,t)||Gn(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 am(o){return(t,e,n)=>{if(Ui(t,e,n),o){let i=/^on([A-Z].*)Change$/.exec(e);if(i){let r=i[1].charAt(0).toLowerCase()+i[1].slice(1);o(`update:${r}`,n[0])}}}}function mn(o){let t=o.injectionKey??Symbol("managed-component-state");function e(r){let a=Jp(),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:em(c)?im(c)??null:typeof c=="function"?c()??null:c,m=Ha({props:l(),initialSetupState:u,propsToForward:s,parentState:f(),mapPropsToState:o.mapPropsToState,propsToStateSet:d}),p=om(m),h=()=>m,y=l,C=T=>{m=Wa(m,T,{getProps:y,getParentState:f,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:d}),p.value=m},b=am(a?(T,...P)=>a.emit(T,...P):void 0),S=ja({dispatch:C,getState:h,getProps:y,propsToForward:s,allowedControlledPropOverrides:o.allowedControlledPropOverrides,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks,notify:b});return rm(()=>({props:l(),parentState:f()}),(T,P)=>{let R=T.props,E=P.props,N=T.parentState!==P.parentState,{newMappedState:v,newMappedStateCount:D,updatedPropsToState:M,updatedPropsToStateCount:A,rawUpdatedProps:x,rawUpdatedPropsCount:F}=$a({currentProps:R,prevProps:E,state:p.value,propsToForward:s,propsToStateSet:d}),_=!1;if(A>0||D>0){let O={payload:{mappedState:D?v:null,updatedPropsToState:A?M:null}},L=p.value;if(C(O),_=!0,o.onPropChange){for(let K in x)if(x.hasOwnProperty(K)){let{newValue:B,oldValue:G}=x[K];o.onPropChange({name:K,newValue:B,oldValue:G},R,S,L)}}o.onPropsChange&&F&&o.onPropsChange(x,R,S,L)}N&&T.parentState!=null&&!_&&C({type:"PARENT_STATE_CHANGE",payload:{}})},{flush:"post"}),tm(()=>{o.cleanup?.(h())}),{contextValue:{state:p,componentActions:S,getComponentState:h,replaceState:T=>{C({type:"REPLACE_STATE",payload:T})},assignState:T=>{C({type:"ASSIGN_STATE",payload:T})},get componentState(){return p.value}},injectionKey:t}}function n(r){let a=e(r);return nm(t,a.contextValue),a}function i(){return Qp(t)}return{useManagedComponent:e,provideManagedComponent:n,useManagedComponentState:i,injectionKey:t}}function pe(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 bt(o){let t=!1,e=null;return(...i)=>(t||(t=!0,e=o(...i)),e)}var Ua=(o,t)=>o-t;var wo=(o,t)=>Ua(o.revision,t.revision),$=class o{constructor(t){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=t=>{this.map.forEach((e,n)=>this.visitKey(n,this.map,[],t,!1))};this.visitSome=t=>{this.visitWithNext([],t,!0)};this.visitDepthFirst=t=>{this.visitWithNext([],t,!1)};this.visitWithNext=(t,e,n,i=this.map,r,a)=>{if(!i)return;let l=0,u=i.has(this.emptyKey),d=!a;if(r!==void 0){if(r<0)return;r--}let s=(c,f)=>{let m=i.get(f);if(!m)return;let{map:p}=m,h=f===this.emptyKey;if(h&&!d)return;let y=h?[]:[...t,f],C=p?()=>this.visitWithNext(y,e,n,p,r!==void 0?r-1:void 0):void 0;if(m.hasOwnProperty("value")){let b=e(m.value,y,l,C,m);if(n&&b===!0)return!0;l++}else C?.()};u&&(s(void 0,this.emptyKey),d=!1,l=0);for(let[c,f]of i){let m=s(f,c);if(n&&m===!0)return m}};this.fill(t)}static clone(t){let e=new o;return t.visit((n,i)=>{e.set(i,n.value)}),e}fill(t){t&&t.forEach(e=>{let[n,i]=e;this.set(n,i)})}getValuesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push(r)},e),n}getEntriesStartingWith(t,e){let n=[];return this.getStartingWith(t,(i,r)=>{n.push([i,r])},e),n}getLeafNodesStartingWith(t,e,n){let{respectOrder:i=!1}=n||{},r=[],a=[];return this.getStartingWith(t,(l,u,d)=>{!d.map&&d.hasOwnProperty("value")&&(i?r.push(d):a.push(e(d)))},n),i?r.sort(wo).map(e):a}getKeysForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>n.keys,e)}getKeysAndValuesForLeafNodesStartingWith(t,e){return this.getLeafNodesStartingWith(t,n=>[n.keys,n.value],e)}getKeysOfFirstChildOnEachBranchStartingWith(t,e){let{excludeSelf:n,depthLimit:i,respectOrder:r=!0}=e||{},a=[],l=[],u=f=>{r?a.push(f):l.push(f.keys)},d=this.map,s,c=!1;if(t.length)for(let f=0,m=t.length;f<m;f++){let p=t[f];if(s=d.get(p),!s||!s.map)if(c=!0,f===m-1){c=!0;break}else return[];d=s.map}else if(!n&&d.has(this.emptyKey))return[[]];return s&&s.value!==void 0&&(n||(u({...s,keys:t}),c=!0)),c?r?a.sort(wo).map(f=>f.keys):l:(this.visitWithNext(t,(f,m,p,h,y)=>{u({...y,keys:m})},!1,d,i,n),r?a.sort(wo).map(f=>f.keys):l)}getKeysStartingWith(t,e){let n=[];return this.getStartingWith(t,i=>{n.push(i)},e),n}getStartingWith(t,e,n){let{excludeSelf:i,depthLimit:r}=n||{},a=this.map,l,u=!1;if(t.length)for(let d=0,s=t.length;d<s;d++){let c=t[d];if(l=a.get(c),!l||!l.map)if(u=!0,d===s-1){u=!0;break}else return;a=l.map}l&&l.value!==void 0&&(i||e(t,l.value,{...l,keys:t})),!u&&this.visitWithNext(t,(d,s,c,f,m)=>{e(s,d,{...m,keys:s}),f?.()},!1,a,r,i)}getMapAt(t){let e=this.map,n;if(!t.length)return this.map;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return;e=n.map}return e}getAllChildrenSizeFor(t){let e=this.map,n;if(!t.length)return this.length;for(let i=0,r=t.length;i<r;i++){let a=t[i];if(n=e.get(a),!n||!n.map)return 0;e=n.map}return n.length}getDirectChildrenSizeFor(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(!l||!l.map)return 0;if(e=l.map,a)return e?.size??0}return 0}set(t,e){let n=this.map;t.length||(t=[this.emptyKey]);for(let i=0,r=t.length;i<r;i++){let a=t[i],l=i===r-1,u=n.get(a)||{length:0};l?(u.revision=this.revision++,u.value=e,n.set(a,u),this.length++):(u.map||(u.map=new Map,n.set(a,u)),u.length++,n=u.map)}return this}get(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.value:void 0;if(!l||!l.map)return;e=l.map}}get size(){return this.length}clear(){let t=e=>{e.forEach((n,i)=>{let{map:r}=n;r&&t(r)}),e.clear()};t(this.map),this.length=0,this.revision=0}delete(t){let e=this.map;t.length?t=[...t]:t=[this.emptyKey];let n=[e],i=[],r=!1;for(let a=0,l=t.length;a<l;a++){let u=t[a],d=a===l-1,s=e.get(u);if(d){s&&(s.hasOwnProperty("value")&&(delete s.value,delete s.revision,r=!0,i.forEach(c=>{c.length--}),this.length--),s.map&&s.map.size===0&&delete s.map,s.map||e.delete(u));break}else{if(!s||!s.map){r=!1;break}i.push(s),e=s.map,n.push(e)}}for(;n.length;){let a=n.pop(),l=t.length;if(t.pop(),l>0&&a?.size===0){let u=n[n.length-1],d=t[t.length-1],s=u?.get(d);s&&(delete s.map,s.hasOwnProperty("value")||u.delete(d))}}return r}has(t){let e=this.map;t.length||(t=[this.emptyKey]);for(let n=0,i=t.length;n<i;n++){let r=t[n],a=n===i-1,l=e.get(r);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;e=l.map}return!1}visitKey(t,e,n,i,r){let a=e.get(t);if(!a)return;let{map:l}=a,u=t===this.emptyKey?[]:[...n,t],d=bt(()=>{if(l)for(let[s]of l){let c=this.visitKey(s,l,u,i,r);if(r&&c===!0)return!0}return!1});if(a.hasOwnProperty("value")){let s=i(a,u,d);if(r&&s===!0)return!0}d()}getArray(t){let e=[];return this.visit((n,i)=>{let r=t({...n,keys:i});i.length===0?e.splice(0,0,r):e.push(r)}),e}rawKeysAt(t){let e=this.getMapAt(t);return e?[...e.keys()]:[]}valuesAt(t){let e=this.getMapAt(t);if(!e)return[];let n=[];return e.forEach(i=>{i.value!==void 0&&n.push(i.value)}),n}values(){return this.sortedIterator(t=>t.value)}keys(){return this.sortedIterator(e=>e.keys)}entries(){return this.sortedIterator(t=>[t.keys,t.value])}topDownEntries(){return this.getArray(t=>[t.keys,t.value])}topDownKeys(){return this.getArray(t=>t.keys)}topDownValues(){return this.getArray(t=>t.value)}sortedIterator(t){let e=[];this.visit((i,r)=>{e.push({...i,keys:r})}),e.sort(wo);function*n(){for(let i=0,r=e.length;i<r;i++)yield t(e[i])}return n()}};globalThis.DeepMap=$;function Ee(){return globalThis}var Io=["#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"],qa=Symbol("color"),vo=new WeakMap,qi=pe();function Yi(o=Io){vo.set(o,o.map(t=>0))}Yi();var lm=(o=Io)=>{let t=[];vo.has(o)?t=vo.get(o):(t=o.map(n=>0),vo.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]??Io[0]},Bn=":",Zi="*",Ya="-",sm=",",um="debug",dm="diffdebug",Xa=!1,Kn=new $,Hn=new Map;function Xi(o,t){let e=o.split(Bn),n=new $;n.set(e,!0);let i=t.split(Bn),r=new Set(i).has(Zi),a=i.indexOf(Zi),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(Bn)):!0}}function Ja(o,t){let e=`channel=${o}_permissions=${t}`;if(Hn.has(e))return Hn.get(e);let n=t.split(sm);function i(l){return Hn.set(e,l),l}let r=[],a=[];n.forEach(l=>{l.includes(Zi)?a.push(l):r.push(l)});for(let l=0;l<r.length;l++){let u=r[l],d=u.startsWith(Ya);if(d&&(u=u.substring(Ya.length)),Xi(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)),Xi(o,u))return i(!d)}return i(!1)}var Ji=()=>Xe.enable??(Ee()&&Ee().localStorage?.getItem(um))??"",cm=()=>Xe.diffenable??(Ee()&&Ee().localStorage?.getItem(dm))??`${Xa}`,Qi="",Qa=Xa;function er(o){Qa=`${cm()}`=="true",Qi!==o&&(Qi=o,Hn.clear())}function el(o){er(Ji()),typeof Ee()<"u"&&Ee().addEventListener&&Ee().addEventListener("storage",function(){er(Ji())});function t(e,n){let i=n?`${n}${Bn}${e}`:e,r=i.split(Bn),a=Kn.get(r);if(a)return a;let l=Kn.get(r.slice(0,-1)),u=(l?l.logFn:Xe.logFn)??tl,d=u,s,c=0,f=()=>s??Ja(i,Qi),m=lm(Xe.colors),p=Object.defineProperties((...h)=>{let y=qi.getListenersCount(),C;if(y>0&&(C=C??Date.now(),qi({color:m,channel:i,args:h,timestamp:C})),f()){if(C=C??Date.now(),c&&Qa){let w=C-c;d(`%c[${i}]`,`color: ${m}`,`+${w}ms:`)}c=C;let b=[],S;if(h.forEach(w=>{if(w[qa])S===void 0&&(S=!0),b.push(...w);else{if(typeof w!="string"&&typeof w!="number"){S=!1;return}b.push(`${w}%s`)}}),S){let w=[`%c[${i}]%c %s`,`color: ${m}`,"",...b,""];d(...w)}else d(`%c[${i}]%c %s`,`color: ${m}`,"",...h)}},{channel:{value:i},color:{value:(h,...y)=>{let C=[`%c${y.join(" ")}%c%s`,`color: ${h}`,""];return C.toString=()=>y.join(" "),C[qa]=!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:()=>{Kn.delete(r)}}});return Kn.set(r,p),p}return t(o)}var tl=console.log.bind(console),Za;Object.defineProperty(el,"enable",{get:()=>Za,set:o=>{Za=o,er(Ji())}});var Xe=el;Xe.colors=Io;Xe.logFn=tl;var fm=(o,t)=>qi.onChange(e=>{if(!e)return;let{channel:n,args:i,color:r,timestamp:a}=e;Xi(n,o)&&t({channel:n,color:r,args:i,timestamp:a})});Xe.onLogIntent=fm;Xe.isChannelEnabled=Ja;Xe.destroyAll=()=>{Yi(),Yi(Xe.colors),Kn.clear(),Hn.clear()};var pm=Xe("IT:InfiniteTable"),mm="#dc3545",hm="#eb9316";var ol="Warn",il="Error",gm="Info",ym="Success",bm="Logs",Ro=pm.extend(bm),AT=Ro.extend(gm),Cm=Ro.extend(ol),Tm=Ro.extend(il),_T=Ro.extend(ym);var Sm=hm,wm=mm;var vm=(o,t)=>{t=t?t.extend?t.extend(ol):t:Cm,t(typeof t.color=="function"?t.color(Sm,o):o)},Im=(o,t)=>{t=t?t.extend?t.extend(il):t:Tm,t(typeof t.color=="function"?t.color(wm,o):o)};var nl=new $,rl=(o,...t)=>{nl.has(t)||(nl.set(t,!0),o())};var hn=(o,t=o,e)=>{rl(()=>vm(o,e),t,"warn")},al=(o,t=o,e)=>{rl(()=>Im(o,e),t,"error")};function Wn(o){return o}function Gt(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||Wn)(l,o);return e.push(u),e},[])}var Rm=new $,ll=new WeakMap;function xo(o){let{originalDataArray:t,groupBy:e,toPrimaryKey:n}=o;if(!t||!e.length)return Rm;let i=ll.get(t);if(i&&i.groupBy===e)return i.groups;let r=new $,a=e.length,l=[];return t.forEach(u=>{let d=Gt(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))}}),ll.set(t,{groupBy:e,groups:r}),r}function xm(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 $;this.deselectedMap=new $;this.onlyUsePrimaryKeys=!1;this.selectionCache=new $;this.selectionCountCache=new $;this.mapSet=(t,e)=>{Array.isArray(e)||(this.onlyUsePrimaryKeys?e=[e]:e=[...this.getGroupKeysForPrimaryKey(e),e]),this.xcache(),t==="selected"?this.selectedMap.set(e,!0):this.deselectedMap.set(e,!0)};this._selectedMapSet=t=>{this.mapSet("selected",t)};this._deselectedMapSet=t=>{this.mapSet("deselected",t)};let i=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;this.getConfig=e,this.onlyUsePrimaryKeys=e().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(i)}getGroupKeysForPrimaryKey(t){let{indexer:e,groupBy:n}=this.getConfig(),i=e.getDataForPrimaryKey(t);return i?Gt(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=Gt(l,n),d=i(l),s=[...u,d];a.delete(s),this.isRowSelected(d,u)!==e&&r.set(s,!0)}),this.xcache()}getLazyUnfilteredCount(t){let e=this.getConfig();if(!(!e.lazyLoad||e.multiRowSelectionTarget==="visible"))return t.length?e.groupDeepMap?.get(t)?.totalChildrenCountUnfiltered:e.lazyUnfilteredCount}getLazyHiddenRowsCount(t){let e=t.length<this.getGroupByLength()?this.getLazyUnfilteredCount(t):void 0;if(e===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),i=0;return this.getGroupKeysDirectlyInsideGroup(t).forEach(r=>{i+=this.getLazyUnfilteredCount(r)??(n?.get(r)?.totalChildrenCount||0)}),Math.max(e-i,0)}getGroupCount(t){if(t.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return 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?xm(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()}getState(){let t=i=>{let r=this.getGroupByLength();return i.map(a=>this.onlyUsePrimaryKeys||r===0&&a.length===1?a[0]:a)},e=t(this.selectedMap.topDownKeys()),n=t(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:e,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(t,e){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([t]):this.selectedMap.has([t]);e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t],i=this.selectionCache.get(n);if(i!==void 0)return i;let r=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(r)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(e))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(e))return this.selectionCache.set(n,!1),!1;for(e=[...e];e.length;){e.pop();let l=this.selectedMap.has(e),u=this.deselectedMap.has(e);if(l)return this.selectionCache.set(n,!0),!0;if(u)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(t,e){return!this.isRowSelected(t,e)}setRowSelected(t,e,n){e?this.setRowAsSelected(t,n):this.setRowAsDeselected(t,n)}getGroupRowSelectionState(t){let e=this.selectionCache.get(t);if(e!==void 0)return e;let{selectedCount:n,deselectedCount:i}=this.getSelectionCountFor(t,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(t)),r=n&&i?null:!!n;return this.selectionCache.set(t,r),r}getGroupRowBooleanSelectionStateFromParent(t){if(!t.length)return this.defaultSelection;let e=[...t],n=this.deselectedMap.has(e),i=this.selectedMap.has(e),r=i&&!n?!0:n&&!i?!1:void 0;if(r===void 0)for(;e.length;){if(e.pop(),this.deselectedMap.has(e)){r=!1;break}if(this.selectedMap.has(e)){r=!0;break}}return r===void 0&&(r=this.defaultSelection),r}isGroupRowPartlySelected(t){return this.getGroupRowSelectionState(t)===null}isGroupRowSelected(t){return this.getGroupRowSelectionState(t)===!0}isGroupRowDeselected(t){return this.getGroupRowSelectionState(t)===!1}selectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!0?this.deselectedMap.delete([r]):this._selectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!0);return}this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.selectedMap.delete(i)}),t.length===1&&this.defaultSelection===!0||this._selectedMapSet(t),this.deselectedMap.getKeysStartingWith(t).forEach(i=>{this.deselectedMap.delete(i)})}deselectGroupRow(t){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(t).forEach(r=>{this.defaultSelection===!1?this.selectedMap.delete([r]):this._deselectedMapSet(r)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(t)){this.setVisibleRowsSelection(t,!1);return}this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0}).forEach(i=>{this.deselectedMap.delete(i)}),t.length===1&&this.defaultSelection===!1||this._deselectedMapSet(t),this.selectedMap.getKeysStartingWith(t).forEach(i=>{this.selectedMap.delete(i)})}setRowAsSelected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([t]):this._selectedMapSet(t),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(e)===!0&&this.selectGroupRow(e))}setRowAsDeselected(t,e){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(t):this.selectedMap.delete([t]),this.xcache();return}e=e||this.getGroupKeysForPrimaryKey(t);let n=[...e,t];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(e)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(e)===!1&&this.deselectGroupRow(e))}deselectRow(t,e){this.setRowSelected(t,!1,e)}selectRow(t,e){this.setRowSelected(t,!0,e)}toggleGroupRowSelection(t){this.getGroupRowSelectionState(t)===!0?this.deselectGroupRow(t):this.selectGroupRow(t)}toggleRowSelection(t,e){this.isRowSelected(t,e)?this.deselectRow(t,e):this.selectRow(t,e)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(t=[],e){let n=this.selectionCountCache.get(t);if(n!=null)return n;let i=this.getGroupByLength();if(t.length>i){let f=this.isRowSelected(t)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(t,f),f}if(this.onlyUsePrimaryKeys&&(i||this.targetsVisibleRowsOnly())){let f=this.getAllPrimaryKeysInsideGroup(t),m=0,p=0;f.forEach(y=>{if(this.defaultSelection){if(this.deselectedMap.has([y])){p++;return}m++}else{if(this.selectedMap.has([y])){m++;return}p++}});let h={selectedCount:m,deselectedCount:p};return this.selectionCountCache.set(t,h),h}if(t.length===i&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:f}=this.getConfig(),m=0,p=0;this.getVisibleDataInsideGroup(t).forEach(y=>{this.isRowSelected(f(y),t)?m++:p++});let h={selectedCount:m,deselectedCount:p};return this.selectionCountCache.set(t,h),h}e=e??this.getGroupRowBooleanSelectionStateFromParent(t);let r=this.getGroupKeysDirectlyInsideGroup(t);if(t.length===this.getGroupByLength()){let f=this.selectedMap.has(t)?!0:this.deselectedMap.has(t)?!1:e,m=this.getGroupCount(t),p=this.selectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,h=this.deselectedMap.getKeysStartingWith(t,{excludeSelf:!0,depthLimit:1}).length,y=m-(p+h),C={selectedCount:p+(f?y:0),deselectedCount:h+(f?0:y)};return this.selectionCountCache.set(t,C),C}let a=0,l=0,{lazyLoad:u,groupDeepMap:d}=this.getConfig();if(u&&!r.length){let f=this.getLazyUnfilteredCount(t)??(d?.get(t)?.totalChildrenCount||0);e?(a=f,l=this.deselectedMap.getAllChildrenSizeFor(t),l===f&&(a=0)):(l=f,a=this.selectedMap.getAllChildrenSizeFor(t),a===f&&(l=0))}r.forEach(f=>{let m=this.selectedMap.get(f),p=this.deselectedMap.get(f),h=m?!0:p?!1:e,{selectedCount:y,deselectedCount:C}=this.getSelectionCountFor(f,h);a+=y,l+=C});let s=r.length?this.getLazyHiddenRowsCount(t):0;e?a+=s:l+=s;let c={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(t,c),c}};var Kt=o=>{let t=Xe(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return t.logFn=console.log.bind(console),t},Bt=o=>{let t=Xe(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return t.logFn=console.error.bind(console),t},jn=()=>jn;jn.extend=()=>jn;var et=class{constructor(t){this.debug=jn,this.error=jn}};var Pm=function(o,t){return o-t},Dm=function(o,t){return o=`${o}`,t=`${t}`,o.localeCompare(t)},Am=function(o,t){return o-t},_m={number:Pm,string:Dm,date:Am},Ht=_m;var Oe=Ee().requestAnimationFrame||(o=>setTimeout(o,16)),en=Ee().cancelAnimationFrame||(o=>clearTimeout(o));function Wt(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 tr(o){return o.map(Ct)}function Ct(o){if(Ee().structuredClone)return Ee().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return tr(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(tr(Array.from(o)));if(o instanceof Map)return new Map(tr(Array.from(o)));let t={};for(let e in o)o.hasOwnProperty(e)&&(t[e]=Ct(o[e]));return t}var tn=Object.seal({data:null,field:null});var $t="____root____",ul="____not_loaded_yet____";function jt(){return!1}function nr(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 Po(o,t,e,n,i){if(!(!e||!Object.keys(e).length)){for(let r in e)if(e.hasOwnProperty(r)){let a=e[r];if(typeof a.reducer!="function")continue;let l=n[r],u=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[r]=a.reducer(l,u,o,t,i)}}}function dl(o,t){let{marker:e,reducers:n={},pivot:i,groupBy:r,indexer:a,toPrimaryKey:l,cache:u,mappings:d}=o;e&&e.start();let s=new $;function c(C,b,S,w=0,T=[]){let P=!S.length||w===S.length-1,R=b[d?.values||"values"]||{};for(let E in R)if(R.hasOwnProperty(E)){let N=E;T.push(N),f.set(T,!0),C.set(T,{reducerResults:R[E][d?.totals||"totals"]||{},items:[]}),P||c(C,R[E],S,w+1,T),T.pop()}}let f=i?new $:void 0,m=[],p=nr(n),h=Ct(p);t.visitDepthFirst((C,b,S,w)=>{let[T,...P]=b,R=C.children,E=s.get(P);if(E&&(E.cache=C.cache,E.childrenLoading=C.childrenLoading,E.childrenAvailable=C.childrenAvailable,E.error=C.error),P.length==r.length&&r.length){if(E){E.items=R;for(let v=0,D=P.length;v<D;v++){let M=P.slice(0,v),A=s.get(M);A&&(A.items=A.items||[],A.items=A.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:u,nodesKey:void 0})}return w?.()}for(let N=0,v=R.length;N<v;N++){if(!R[N]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};s.set([...P,`${ul}${N}`],x);continue}let D=R[N].data,M=R[N].keys||[];if(M.length){let x=M[M.length-1];P.push(x)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:R[N].totalChildrenCount,totalChildrenCountUnfiltered:R[N].totalChildrenCountUnfiltered,reducerResults:R[N].aggregations||{},isTree:!1,isGroupBy:!0};if(s.set(P,A),i){let x=A.pivotDeepMap=new $,F=R[N].pivot;c(x,F,i,0,m)}M.length&&P.pop()}w?.()});let y={deepMap:s,groupParams:o,initialData:t,reducerResults:h};return i&&(y.topLevelPivotColumns=f,y.pivot=i),e&&e.end({details:[{name:"Group by fields",value:r.map(C=>C.field).join(", ")}]}),y}function sl(o,t,e,n,i,r,a,l,u,d=Wn){let{items:s,reducerResults:c,pivotDeepMap:f}=o.get(t);if(s.push(n),a&&Po(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&&(tn.data=n,tn.field=h,b=y(tn));let S=(C||d)(b,n);e.push(S),f.has(e)||(l.set(e,!0),f?.set(e,{reducerResults:Ct(u),items:[]}));let{reducerResults:w,items:T}=f.get(e);T.push(n),a&&Po(n,i,a,w,t)}e.length=0}}function cl(o,t,e,n,i,r,a,l){let{isLeafNode:u,getNodeChildren:d,toKey:s}=o,c=s(i),f=[...n,c],m=u(i);if(e.set(f,!0),m){for(let C=0,b=n.length;C<=b;C++){let S=n.slice(0,C),w=t.get(S),{reducerResults:T,items:P}=w;P.push(i),w.leavesAvailableCount++,w.totalLeafNodesCount++,a&&Po(i,r,a,T,S)}return}let p=Ct(l),h=[];t.set(f,{items:h,isTree:!0,isGroupBy:!1,node:i,reducerResults:p,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let y=d(i);if(!(!y||!Array.isArray(y))){for(let C=0,b=y.length;C<b;C++){let S=y[C];cl(o,t,e,f,S,C,a,l)}a&&$n(a,p,h)}}function or(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=nr(e),r=Ct(i),a=new $,l=new $;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let d=0,s=t.length;d<s;d++)cl(o,a,l,[],t[d],d,e,i);e&&$n(e,r,t);let u={deepMap:a,treeParams:o,treePaths:l,initialData:t,reducerResults:r};return n&&n.end(),u}function ir(o,t){let{marker:e,groupBy:n,defaultToKey:i=Wn,pivot:r,reducers:a}=o;e&&e.start();let l=n.length,u=r?new $:void 0,d=new $,s=[],c=[],f=nr(a),m=Ct(f);if(!l){let h={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(h.pivotDeepMap=new $),d.set(s,h)}for(let h=0,y=t.length;h<y;h++){let C=t[h],b={};for(let S=0;S<l;S++){let{field:w,groupField:T,valueGetter:P,toKey:R}=n[S],E=w?C[w]:null;P&&(tn.data=C,tn.field=w,E=P(tn));let N=(R||i)(E,C);if(b[w||T]=N,s.push(N),!d.has(s)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ct(f)};r&&(v.pivotDeepMap=new $),d.set(s,v)}sl(d,s,c,C,h,r,a,u,f,i)}l||sl(d,s,c,C,h,r,a,u,f,i),a&&Po(C,h,a,m,s),s.length=0}a&&(d.visitDepthFirst((h,y,C,b)=>{$n(a,h.reducerResults,h.items),r&&h.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:w},T,P,R)=>{$n(a,w,S),R?.()}),b?.()}),$n(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 Mm(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 Em(o,t){let{groupBy:e,groupKeys:n,parents:i,reducers:r,lazyLoad:a}=o,l=n.length,{items:u,reducerResults:d,pivotDeepMap:s,commonData:c}=t,f=c??null,m;if(Object.keys(d).length>0){f={...c},m={};for(let b in r)if(r.hasOwnProperty(b)){let w=r[b].field;w&&(m[w]=d[b]),w&&f[w]==null&&(f[w]=d[b])}}let p=!0,h=n[n.length-1],y=h;if(f!=null){let b=e[n.length-1];b&&b.field&&(y=f[b.field]),b&&b.toKey&&(y=b.toKey(y,f)),y=y??h}return typeof y=="string"&&y.startsWith(ul)&&(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:jt,hasSelectedCells:jt,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 Do(o,t,e){return{...o,id:`duplicate_row_on_page_${e}_for__${o.id}`,indexInAll:t,duplicateOf:o.id}}function $n(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 fl(o,t,e,n,i,r){let a=t.length,{isLeafNode:l,getNodeChildren:u}=i.treeParams,{toPrimaryKey:d,treeResult:s,isRowDisabled:c,isNodeSelected:f,withRowInfo:m,isNodeExpanded:p,treeSelectionState:h,repeatWrappedGroupRows:y,rowsPerPage:C}=i,{deepMap:b}=s,S=o.length,w=e[e.length-1],T=w?w.nodeExpanded:!0;for(let P=0;P<S;P++){let R=o[P],E=d(R,P),N=[...t,E];if(l(R)){let _={id:E,nodePath:N,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:jt,hasSelectedCells:jt,dataSourceHasGrouping:!1,parentNodes:Array.from(e),indexInParentNodes:[...n,P],indexInParent:P,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 L=0,K=e.length;L<K;L++){let B=e[L];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(_),O!=null&&T){if(typeof y=="function"&&y(B)!==!0)continue;let G=Do(B,_.indexInAll,O);r[G.indexInAll]=G,_.indexInAll++}}T&&(r[_.indexInAll]=_);continue}let M=b.get(N)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:N,id:E,data:R,indexInAll:r.length,indexInParent:P,indexInParentNodes:[...n,P],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(e),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:jt,hasSelectedCells:jt,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(A.rowSelected=f(A),h)){let _=h.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=_.selectedCount,A.deselectedLeafNodesCount=_.deselectedCount}c&&(A.rowDisabled=c(A)),m&&m(A);let x=!0;if(p&&(A.selfExpanded=x=p(A)),T||(x=!1),A.nodeExpanded=x,T&&y&&C!=null&&C>0){let _=A.indexInAll,O=A.parentNodes;if(O.length>0&&_%C===0){let L=_/C,K=0;O.forEach(B=>{typeof y=="function"&&y(B)!==!0||(r.push(Do(B,_+K,L)),K++,A.indexInAll++)})}}T&&(r[A.indexInAll]=A);let F=u(R);Array.isArray(F)&&fl(F,N,[...e,A],A.indexInParentNodes,i,r)}return r}function pl(o){let{dataArray:t,marker:e}=o;e&&e.start();let n=[];return fl(t,[],[],[],o,n),e&&e.end(),{data:n}}function ml(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(P=>P.field).join(", ")}]});let b=[],S=[],w=[],T=[];return h.visitDepthFirst((P,R,E,N)=>{let v=P.items,D=R.length,M=u?.isGroupRowCollapsed(R)??!1;T.push(E);let A=Em({lazyLoad:e,groupBy:C,parents:Array.from(w),reducers:m,indexInGroup:E,indexInParentGroups:Array.from(T),indexInAll:b.length,groupKeys:R,error:P.error,totalChildrenCount:P.totalChildrenCount,childrenLoading:(P.childrenLoading||!M&&!P.childrenAvailable)&&e,childrenAvailable:P.childrenAvailable,directChildrenCount:R.length===C.length?P.items.length:h.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},P);if(s&&(A.rowSelected=s(A),c)){let L=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=L.selectedCount,A.deselectedChildredCount=L.deselectedCount}d&&(A.rowDisabled=d(A));let x=w[w.length-1],F=x?.collapsed??!1;F&&(M=!0),A.collapsed=M;let _=f||M;if(F&&(_=!1),_){if(r&&i!=null&&i>0){let L=A.indexInAll,K=A.parents;if(K.length>0&&L%i===0){let B=L/i,G=0;K.forEach(le=>{typeof r=="function"&&r(le)!==!0||(b.push(Do(le,L+G,B)),G++,A.indexInAll++)})}}b.push(A),S.push(b.length-1)}A.collapsedChildrenCount=0,w.forEach(L=>{L.deepRowInfoArray.push(A),L.collapsedGroupsCount+=M?1:0}),x&&A.selfLoaded&&e&&(x.directChildrenLoadedCount+=1),a&&a(A),w.push(A);let O=!0;if(O){if(N)N();else if(!y){let L=b.length;M||(b.length+=v.length);let K=0;for(let B=0,G=v.length;B<G;B++){let le=v[B];if(!M&&r&&i!=null&&i>0){let ve=L+B+K;if(ve%i===0){let Ne=ve/i;w.forEach(Me=>{if(typeof r=="function"&&r(Me)!==!0)return;let Ce=L+B+K;b[Ce]=Do(Me,Ce,Ne),K++,b.length++})}}let Z=L+B+K,me={id:le?l(le,Z):`${R}-${B}`,data:le,isCellSelected:jt,hasSelectedCells:jt,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:C,collapsed:M,groupKeys:R,parents:Array.from(w),indexInParentGroups:[...T,B],indexInGroup:B,indexInAll:Z,groupBy:C,groupNesting:D+1,groupCount:A.groupCount};s&&(me.rowSelected=s(me)),d&&(me.rowDisabled=d(me)),a&&a(me),w.forEach((ve,Ne)=>{Ne===w.length-1&&le&&(ve.directChildrenLoadedCount+=1),M&&(ve.collapsedChildrenCount+=1),ve.deepRowInfoArray.push(me)}),M||(b[L+B+K]=me)}}}w.pop(),T.pop()}),t&&t.end(),{data:b,groupRowsIndexes:S}}function Ao(o,t){return new De(o,Ye(t))}function Ye(o){return()=>{let t=typeof o=="function"?o():o,{originalDataArray:e,postFilterDataArray:n}=t,i=!!t.lazyLoad,r=i?t.originalLazyGroupData.get([$t]):void 0;return{lazyLoad:i,toPrimaryKey:t.toPrimaryKey,onlyUsePrimaryKeys:!t.useGroupKeysForMultiRowSelection,groupBy:t.groupBy,groupDeepMap:t.groupDeepMap,indexer:t.indexer,totalCount:i?e?.length??0:t.unfilteredCount,lazyUnfilteredCount:t.groupBy.length?r?.totalChildrenCountUnfiltered:r?.totalCountUnfiltered,multiRowSelectionTarget:t.multiRowSelectionTarget,someRowsFilteredOut:!t.lazyLoad&&!!e&&!!n&&n.length<e.length,originalDataArray:e,postFilterDataArray:n}}}function hl(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,Ye(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,Ye(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?Gt(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?Gt(c,d):[]}let s=new De(a,Ye(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?Gt(c,d):[]}let s=new De(l,Ye(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,Ye(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,Ye(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,Ye(t));u.toggleGroupRowSelection(i),e.rowSelection=u},getGroupRowSelectionState(i,r){let a=t(),{selectionMode:l,groupBy:u}=a,d=r?new De(r,Ye(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,Ye(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 rr=new WeakMap,Fm=o=>o;function gl(o,t=50,e){rr.set(o,{lastCallTime:0,lastCallArg:null});let n=e??Fm;return i=>{let{lastCallTime:r,lastCallArg:a}=rr.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),u=l-r,d=Wt(n(a),n(i));u<t&&d||(rr.set(o,{lastCallTime:l,lastCallArg:i}),o(i))}}var Nm="*",Ge=class{constructor(t){this.wildcard=Nm;this.cache=new $;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}selectCell(t,e){this.setCellSelected(t,e,!0)}deselectCell(t,e){this.setCellSelected(t,e,!1)}selectColumn(t){this.setCellSelected(this.wildcard,t,!0)}deselectColumn(t){this.setCellSelected(this.wildcard,t,!1)}setCellSelected(t,e,n){let i=t===this.wildcard,r=e===this.wildcard;if(this.isCellSelected_Internal(t,e)===n)return;let l=[];if(i){let d=this.deselectedColumnsToRows.get(e),s=this.selectedColumnsToRows.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(c,e,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(c,e,!1)}),[...this.cache.keys()].forEach(c=>{let[f,m]=c;m===e&&l.push([f,e])})}if(r){let d=this.deselectedRowsToColumns.get(e),s=this.selectedRowsToColumns.get(e);d?.forEach(c=>{c!==this.wildcard&&this.setCellInDeselection(t,c,!1)}),s?.forEach(c=>{c!==this.wildcard&&this.setCellInSelection(t,c,!1)}),[...this.cache.keys()].forEach(c=>{let[f]=c;f===t&&l.push([t,e])})}let u=[t,e];if(l.forEach(d=>{this.cache.delete(d)}),this.cache.delete(u),n)if(this.defaultSelection){let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1);let s=this.deselectedRowsToColumns.get(this.wildcard),c=this.deselectedColumnsToRows.get(this.wildcard);(s?.has(e)||c?.has(t))&&this.setCellInSelection(t,e,!0)}else{let d=this.deselectedRowsToColumns.get(t);d&&d.has(e)&&this.setCellInDeselection(t,e,!1),this.setCellInSelection(t,e,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1),this.setCellInDeselection(t,e,!0);else{this.selectedRowsToColumns.get(t)?.has(e)&&this.setCellInSelection(t,e,!1);let s=this.selectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard);if(s?.has(e)||c?.has(t)){this.setCellInDeselection(t,e,!0);return}}}setCellInDeselection(t,e,n){if(n){let i=this.deselectedRowsToColumns.get(t)||new Set;i.add(e),this.deselectedRowsToColumns.set(t,i)}else{let i=this.deselectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.deselectedRowsToColumns.delete(t))}if(n){let i=this.deselectedColumnsToRows.get(e)||new Set;i.add(t),this.deselectedColumnsToRows.set(e,i)}else{let i=this.deselectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.deselectedColumnsToRows.delete(e))}}setCellInSelection(t,e,n){if(t===this.wildcard&&e===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let i=this.selectedRowsToColumns.get(t)||new Set;i.add(e),this.selectedRowsToColumns.set(t,i)}else{let i=this.selectedRowsToColumns.get(t);i&&(i.delete(e),i.size===0&&this.selectedRowsToColumns.delete(t))}if(n){let i=this.selectedColumnsToRows.get(e)||new Set;i.add(t),this.selectedColumnsToRows.set(e,i)}else{let i=this.selectedColumnsToRows.get(e);i&&(i.delete(t),i.size===0&&this.selectedColumnsToRows.delete(e))}}update(t){let e=t.selectedCells||null,n=t.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),e&&e.forEach(([i,r])=>{this.setCellInSelection(i,r,!0)}),n&&n.forEach(([i,r])=>{this.setCellInDeselection(i,r,!0)}),this.defaultSelection=t.defaultSelection}isCellSelectionInRow(t,e){if(this.defaultSelection){let i=this.deselectedRowsToColumns.get(t);if(i){if(i.has(this.wildcard)){let r=this.selectedRowsToColumns.get(t);return r&&r.size>0?e.some(a=>r.has(a)):!1}return e.some(r=>!i.has(r))}return!0}let n=this.selectedRowsToColumns.get(t);if(n){if(n.has(this.wildcard)){let i=this.deselectedRowsToColumns.get(t);return i&&i.size>0?!e.every(a=>i.has(a)):!0}return e?e.some(i=>n.has(i)):!1}return!1}error(t){Bt(`${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}}};import{defineComponent as xu,h as Pu}from"vue";import{computed as vt,defineComponent as _r,h as vn,inject as Yh,provide as Zh,ref as Iu,shallowRef as Xh,watch as Jh}from"vue";var ee=(...o)=>o.filter(t=>!!`${t}`).join(" ");var yl="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",bl={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var at="_16lm1iw3b _16lm1iw3c _16lm1iw35",Cl={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},_o={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Tl={1:"_16lm1iw1c",none:"_16lm1iw1d"},ar={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Sl={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},wl={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},vl={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Il={none:"_16lm1iwd"},Mo={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Rl={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var xl={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Pl={none:"_16lm1iw1x"};var Dl={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Al={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};import{defineComponent as Vm,h as Un,onBeforeUnmount as Gm,onMounted as Km,ref as Bm}from"vue";function Om(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 km(o){var t=Om(o,"string");return typeof t=="symbol"?t:String(t)}function Lm(o,t,e){return t=km(t),t in o?Object.defineProperty(o,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[t]=e,o}function _l(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 Ml(o){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?_l(Object(e),!0).forEach(function(n){Lm(o,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):_l(Object(e)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(e,n))})}return o}function El(o,t){var e={};for(var n in o)e[n]=t(o[n],n);return e}var zm=(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},we=o=>{var t=e=>{var n=o.defaultClassName,i=Ml(Ml({},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)zm(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 El(o.variantClassNames,e=>El(e,n=>n.split(" ")[0]))}},t};var Fl="_1eexc2a6";var Nl=we({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:[]}),Ol="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",kl=we({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Ll=we({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"]]}),zl=we({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"]]}),Vl="_12zfob12u _16lm1iw22 _16lm1iw1z";var Gl="_12zfob17",Kl="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Bl=we({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),lr=we({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Hl="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Wl=we({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),jl="_12zfob1b _16lm1iw2",$l="_16lm1iw1",Ul="_12zfob16",ql=we({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Yl="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var nt="InfiniteIcon";var Zl="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Xl={transition:"width 0.25s, opacity 0.25s"},Jl=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});var gn=Vm(o=>{let t=Bm(0),e=null;return Km(()=>{e=requestAnimationFrame(()=>{e=null,t.value=1})}),Gm(()=>{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={...Xl,borderTop:`${n}px solid currentColor`,...o.lineStyle,opacity:t.value};return Un("div",{"data-name":"filter-icon",style:{...o.style,width:`${l}px`},class:ee(i,nt,Zl,`${nt}-filter`)},[a?Un("div",{"data-name":"index",class:Gl},`${r}`):null,Un("div",{style:{width:`${d[0]}px`,...s}}),Un("div",{style:{width:`${d[1]}px`,...s}}),Un("div",{style:{width:`${d[2]}px`,...s}})])}},{name:"FilterIcon",props:[...Jl]});var Eo=Object.freeze({}),Hm={string:Eo,number:{}};function yn(o,t){let e=t.default||Eo;return o.type===void 0?e:o.type===null?Eo:typeof o.type=="string"?t[o.type]||Hm[o.type]||Eo:o.type.reduce((n,i)=>Object.assign(n,t[i]),{})}var ur=o=>{let{availableSize:t,items:e,minSize:n,maxSize:i}=o;if(t<0)throw"The provided availableSize cannot be negative!";let r=0,a=0,l=0,u=[],d=[];e.forEach((R,E)=>{let N=R.maxSize??i??void 0,v=R.minSize??n??void 0;u.push(v),d.push(N),R.size!=null&&(N!=null&&R.size>N&&(R.size=N),v!=null&&R.size<v&&(R.size=v));let D=R.flex==0?null:R.flex;if(R.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${E} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,r+=R.size??0});let s=o.computeSpecialSpaceDistribution?Math.max(t,0):Math.max(t-r,0),c=s/a,f={},m={},p=0;e.forEach((R,E)=>{if(R.flex!=null){let N=c*R.flex,v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=!1,A=0;v!=null&&N>v&&(f[E]=!0,M=!0,A=v),D!=null&&N<D&&(m[E]=!0,M=!0,A=D),M&&(p+=1,l-=1,a-=R.flex,s-=A)}}),p&&(c=s/a);let h=[],y=0,C=s,b=a,S=0,w=0,T=[];return{items:e.map((R,E)=>{let N={...R},v=R.maxSize??i??void 0,D=R.minSize??n??void 0,M=0,A=f[E],x=m[E],F=A||x,_=R.size??0;if(R.flex!=null){if(F)x&&(M=D),A&&(M=v);else{y+=1;let O=L=>(v!=null&&L>v&&(L=v),D!=null&&L<D&&(L=D),L);y===l?M=O(C):(M=O(Math.round(R.flex*c)),w+=M,C=s-w,b-=R.flex,c=C/b)}_=M,N.flexSize=M}return h.push(M),T.push(_),N.computedSize=_,S+=_,N}),flexSizes:h,minSizes:u,maxSizes:d,computedSizes:T,remainingSize:Math.round(t-S)}};function Fo(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 es(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 sr(o,t){return o.computedFlex&&!t?"flex":"width"}function qn(o,t,e){if(t==="width"){let{flex:n,...i}=o??{};return{...i,width:e}}return{...o,flex:e}}var dr=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((D,M)=>(D[M]={...o.columnSizing[M]},D),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[r],u=o.items[a],d=l.id,s=u?.id,c=es(o.items,t,e),f=l.computedWidth,m=l.computedMinWidth,p=l.computedMaxWidth,h=sr(l,c),y=u?.computedWidth,C=u?.computedMinWidth,b=u?.computedMaxWidth,S=u?sr(u,c):"width",w=!1,T=!1,P=i>0?1:-1,{value:R,clamped:E,diff:N}=Fo(Math.round(f+i),m,p,P);if(o.shareSpaceOnResize){if(u==null)return n[d]=qn(n[d],h,R),T=E==="min",w=E==="max",{adjustedDiff:R-f,reservedWidth:e,columnSizing:n,minReached:T,maxReached:w,constrained:T||w};let{value:D,clamped:M,diff:A}=Fo(Math.round(y-i),C,b,P);if(E&&M&&(Math.abs(N)>Math.abs(A)?M=!1:E=!1),!(!E&&!M)){if(E){let x=Fo(Math.round(y-i-N),C,b,P);D=x.value,M=x.clamped,A=x.diff}else if(M){let x=Fo(Math.round(f+i+A),m,p,P);R=x.value,E=x.clamped,N=x.diff}}n[d]=qn(n[d],h,R),n[s]=qn(n[s],S,D),T=E==="min"||M==="min",w=E==="max"||M==="max"}else n[d]=qn(n[d],h,R),T=E==="min",w=E==="max";let v=R-f;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?e:Math.round(e-v),columnSizing:n,minReached:T,maxReached:w,constrained:T||w}};function Ql(o,t){return o+t}function Wm(o){return Object.keys(o).reduce((e,n)=>(e[n]={...o[n]},e),{})}var ts=o=>{let{availableSize:t,reservedWidth:e=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(t<0)throw"The provided availableSize cannot be negative!";let i=o.dragHandleOffset,r=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=r.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),u=es(o.items,t,e),d=a.map(b=>sr(b,u)),s=0,{computedSizes:c}=ur({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(Ql,0)+i-s,0)}),f=a.map((b,S)=>c[S]-b.computedWidth),m=!0,p=!0,h=!0,y=[];f.forEach((b,S)=>{let w=a[S];if(!w.resizable){y.push(0);return}let T=d[S],P=l[S],R=Wm(n),{maxReached:E,minReached:N,constrained:v,adjustedDiff:D}=dr({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:r[S],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[w.id]=qn(R[w.id],T,Math.round(P+D)),y.push(D),E||(p=!1),N||(m=!1),v||(h=!1)});let C=y.reduce(Ql,0);return{minReached:m,maxReached:p,constrained:h,adjustedDiffs:y,adjustedDiff:C,columnSizing:n,reservedWidth:Math.round(e-C)}};var No;function Tt(){if(No!=null)return No;let o=Ee().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),No=t.offsetWidth-e.offsetWidth,t.parentNode?.removeChild(t),No}var ns=["start",void 0,"end"],os=(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:ns.indexOf(i)-ns.indexOf(r)}),o);function is(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 cr(o,...t){return is(e=>e!=null,o,...t)}function rs(o,t,...e){return is((n,i)=>!(i in o),t,...e)}var Oo=!0,jm=!0,$m=!0,as="string",Nt="unknown";var Um=Bt("getComputedVisibleColumns"),qm=(o,t,e)=>o[e]!==!1,fr=(o,t)=>{if(!t)return!1;let e=t[o];return e==="start"||e===!0?"start":e==="end"?"end":!1};function nn(o,t){if(o)return o[t]?o[t]:Object.values(o).find(e=>e.field===t)}function Ym(o,t){let e=yn(o,t);return o.sortType?o.sortType:e.sortType?e.sortType:typeof o.type=="string"?o.type:as}function Zm(o,t,e){let i=(Array.isArray(o)?o:o?[o]:[]).flatMap(r=>{let a=r.field??r.groupField;if(!a)return[Nt];let l=nn(t,a);if(!l)return[Nt];let u=Ym(l,e);return Array.isArray(u)?u:[u]});return i.every(r=>r===Nt)?Nt:i.length===1?i[0]:i}function pr(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??Oo}var ls=({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=Yn,viewportReservedWidth:C,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:w,columnOrder:T,columnPinning:P,editable:R,columnDefaultEditable:E,columnDefaultFilterable:N,columnDefaultGroupable:v,columnDefaultSortable:D,columnSizing:M,columnTypes:A,columnVisibility:x,columnVisibilityAssumeVisible:F,groupBy:_})=>{let O=0,L={};_.forEach((g,I)=>{g.field&&(L[g.field]=I)});let K=(f||[]).reduce((g,I)=>{let{id:z,field:k}=I;return k&&(g[k]=I),z&&(g[z]=I),g},{}),B=os(T===!0?Object.keys(o):T,P),G=B.filter(g=>o[g]?qm(x,F,g):(Um(`Column with id "${g}" specified in columnOrder array cannot be found in the columns map.`),!1)),le=new Map,Z=G.map((g,I)=>{let z=o[g];return le.set(g,I),z}),Pe=(p??[]).reduce((g,I,z)=>(I.id?g[I.id]={sortInfo:I,index:z}:I.field&&(g[I.field]={sortInfo:I,index:z}),g),{});function me(g){let I=o[g],z=yn(I,A),k={minWidth:z?.minWidth,maxWidth:z?.maxWidth,width:z?.defaultWidth,flex:z?.defaultFlex},Y={width:I?.defaultWidth,flex:I?.defaultFlex,minWidth:I?.minWidth,maxWidth:I?.maxWidth},V=M[g];V?.width!=null&&V.flex==null&&delete Y.flex,V?.flex!=null&&V.width==null&&delete Y.width;let J=cr(Y,V);J.width!=null&&delete k.flex,J.flex!=null&&delete k.width,J=cr(k,J);let ce=J.flex??void 0,se=J.minWidth??I?.minWidth??n,fe=J.maxWidth??I?.maxWidth??i,ae=ce!=null?void 0:J.width??(a?void 0:r);return!ae&&ce==null&&(a?ce=a:ae=se),{size:ae,flex:ce,minSize:se,maxSize:fe}}let ve=ur({availableSize:Math.max(e.width-(C??0)-(l??Tt()),0),maxSize:i,minSize:n,items:G.map(me)}),{computedSizes:Ne,flexSizes:Me,minSizes:Ce,maxSizes:_e}=ve,ue=[],Q=[],H=[],q=[];q.length=G.length;let X=new Map,te=new Map,oe=0,he=0,ge=0,ne=null,W=[],ie=0,Te=0,Ie=0;Z.forEach((g,I)=>{let z=G[I],k=Ne[I],Y=W[I]=fr(z,P);Y==="start"?ie+=k:Y==="end"?Ie+=k:Te+=k});let Se=e.width-Ie,We=[],Le=new Map;G.forEach((g,I)=>{let z=Z[I];Le.set(g,z)});let de=[];Object.keys(o).forEach(g=>{let I=o[g];de.push(g),Le.has(g)||Le.set(g,I)});let tt=new Map;Le.forEach((g,I)=>{let z=le.get(I);z==null&&(z=-1);let k=z!=-1,Y=G[z+1],V=yn(g,A),J=z,ce=Pe[I]?Pe[I]:g.field?Pe[g.field]??null:null,se=ce?.sortInfo??null,fe=!!se,ae=fe&&se.dir===1,ye=fe&&!ae,Re=ce?.index??-1,re=k?{}:me(I),rt=k?Ne[z]:re.size||0,_t=k&&Me[z]||null,Mt=k?Ce[z]||0:re.minSize||0,yt=k?_e[z]||1e4:re.maxSize||1e4,Ve=k?fr(I,P):!1,Et=k?z===G.length-1:!1,Ft=J,Ln=k?Ve==="start"?he:Ve==="end"?ge:O-he:0;Ve=="start"?Ft=k?J:-1:Ve==="end"?Ft=k?J-(ue.length+H.length):-1:Ft=k?J-ue.length:-1;let Vt=k?Ve==="start"||Ve===!1?O:Se+ge:-1,Np=k?Ve!==ne:!1,Op=k?Et||Ve!==fr(Y,P):!1,ka=g.cssEllipsis??V.cssEllipsis??u,kp=g.headerCssEllipsis??V.cssEllipsis??g.cssEllipsis??V.headerCssEllipsis??d??ka,So=k&&(K[I]||g.field||g.groupByForColumn)&&(K[I]||K[g.field||g.groupByForColumn])||null,Lp=g.defaultFilterable??V.defaultFilterable??N??!0,zp=R??g.defaultEditable??V.defaultEditable??E??!1,Hi=g.dataType||V.dataType||(Array.isArray(g.type)?g.type[0]:g.type)||as,Vp=g.sortType||V.sortType||Hi,La=g.filterType||V.filterType||Hi,za=!1;if(So!=null&&!So.disabled){let ji=y[La];ji&&(!ji.emptyValues||!ji.emptyValues.includes(So.filter.value))&&(za=!0)}let pn=g.field??V.field,Gp=g.valueGetter??V.valueGetter,Wi=g.defaultGroupable??V.defaultGroupable??v??!!pn;pn||(Wi=!1),g.groupByForColumn&&(Wi=!1);let Va=pn?L[pn]!==void 0:!1,Kp=Va?L[pn]:void 0,Bp=pr(g,{colType:V,sortable:m,columnDefaultSortable:D}),Hp=g.resizable??V.resizable??b??jm,Ke={colType:V,align:V.align,headerAlign:V.headerAlign,computedVisible:k,verticalAlign:V.verticalAlign,defaultHiddenWhenGroupedBy:V.defaultHiddenWhenGroupedBy,valueGetter:Gp,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:pn,...g,components:{...V.components,...g.components},computedResizable:Hp,computedMinWidth:Mt,computedMaxWidth:yt,computedFlex:_t,computedDataType:Hi,computedEditable:zp,computedSortType:Vp,computedFilterType:La,cssEllipsis:ka,headerCssEllipsis:kp,computedFilterValue:So,computedFiltered:za,computedFilterable:Lp,computedGroupable:Wi,computedGroupedBy:Va,computedGroupedByIndex:Kp,computedWidth:rt,computedAbsoluteOffset:Vt,computedPinningOffset:Ln,computedVisibleIndexInCategory:Ft,computedOffset:O,computedSortable:Bp,computedSortInfo:se,computedSortIndex:Re,computedMultiSort:h,computedSorted:fe,computedSortedAsc:ae,computedSortedDesc:ye,computedVisibleIndex:J,computedPinned:Ve,computedDraggable:S??g.defaultDraggable??w??$m,computedFirstInCategory:Np,computedLastInCategory:Op,computedFirst:z===0,computedLast:Et,id:I,header:g.header??V.header??g.name??g.field};k&&(O+=rt,X.set(Ke.id,Ke),q[z]=Ke,Ve==="start"&&(ue.push(Ke),he+=Ke.computedWidth),Ve==="end"&&(Q.push(Ke),ge+=Ke.computedWidth),Ve||(H.push(Ke),oe+=Ke.computedWidth),ne=Ve),Ke.groupByForColumn&&(Ke.computedSortType=g.sortType||V.sortType||Zm(Ke.groupByForColumn,t,A),We.push(Ke)),te.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!tt.has(Ke.field)&&tt.set(Ke.field,Ke)}),We.forEach(g=>{g.computedSortable=ss(g,{fieldsToColumn:tt,userColumns:t,columnTypes:A,sortable:m,columnDefaultSortable:D})});let Ze=new Map;de.forEach(g=>{let I=te.get(g);I&&Ze.set(g,I)}),te.forEach(g=>{Ze.has(g.id)||Ze.set(g.id,g)});let dt=s!=null?Math.min(s,he):he,gt=c!=null?Math.min(c,ge):ge;return{computedRemainingSpace:e.width-(ie+Ie+Te),computedPinnedStartColumnsWidth:he,computedPinnedEndColumnsWidth:ge,computedUnpinnedColumnsWidth:oe,computedColumnOrder:B,computedPinnedStartColumns:ue,computedPinnedEndColumns:Q,computedUnpinnedOffset:he,computedPinnedEndOffset:he+oe,computedUnpinnedColumns:H,computedVisibleColumns:q,computedColumnsMap:te,computedColumnsMapInInitialOrder:Ze,computedVisibleColumnsMap:X,computedPinnedEndWidth:gt,computedPinnedStartWidth:dt,renderSelectionCheckBox:q.reduce((g,I)=>g||!!I.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function ss(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??Oo,d=o.sortType??o.colType.sortType;return d!=null&&d!==Nt&&u?!0:c=>{let{column:f,api:m}=c,p=f.groupByForColumn||[];return p!=null&&!Array.isArray(p)&&(p=[p]),(p||[]).reduce((h,y)=>{if(!h)return!1;let C=y.field||y.groupField,b;if(C){let S=n.get(C),w=S?m.getColumnApi(S.id):void 0;if(S&&w)b=w.isSortable();else{let T=nn(r,C);if(T){let P=pr(T,{colType:yn(T,a??{}),sortable:e,columnDefaultSortable:i});b=typeof P=="boolean"?P:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??i??Oo},!0)}}function Je(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 Zn(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=Je(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 Fe="Infinite",ke={rootClassName:Fe};var ko=`${Fe}HeaderCell__filter`,mr=`${Fe}HeaderCell__filterOperator`,us=`${ko}__input`;import{computed as rn,defineComponent as Vh,h as $e,inject as Gh,provide as Kh,ref as bu,shallowRef as Bh,Teleport as Hh}from"vue";function U(o){return o.slice(4,-1)}function Lo(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(" ")}import{nextTick as Th}from"vue";var je=class o{constructor(t){this.top=0;this.left=0;this.left=t.left,this.top=t.top}static clone(t){return new o(t)}static from(t){return new o(t)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}getDistanceToPoint(t){let e=t.top-this.top,n=t.left-this.left;return{top:e,left:n}}};function ds(o,t){let e=Math.atan2(o.top-t.top,o.left-t.left);return e<=0&&(e=2*Math.PI+e),e}function cs(o,t){return Math.sqrt((t.top-o.top)**2+(t.left-o.left)**2)}function Xm(o,t,e){let n=ds(o,e),i=ds(t,e);return n===i?cs(e,t)-cs(e,o):n-i}function fs(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)=>Xm(n,i,e)),t}function Jm(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 Qm(o,t){if(o.length<2)return o[0]?o[0].left===t.left&&o[0].top===t.top:!1;o=fs(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 ps(o,t){if(Jm(o))return Qm(o,t);o=fs(o);let[e]=o;for(let n=1,i=o.length-1;n<i;n++){let r=o[n],a=o[n+1];if(eh([e,r,a],t))return!0}return!1}function eh(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 bn=class{containsPoint(t){return ps(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 Cn=class o extends bn{static clone(t){return new o(t)}constructor(t){super(),this.points=t.map(je.clone)}getPoints(){return this.points}shift(t){return this.points.forEach(e=>{e.shift(t)}),this}};function th(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 Ae({top:n,left:e,width:a-e,height:d-n})}var Ae=class o extends bn{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=th(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 Cn(this.getPoints()).containsPoint(e)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}};function Xn(o){if(!o)return!1;let t=o.tagName;return t==="INPUT"||t==="BUTTON"}var ms="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",hs="_1yeub2vs",gs="_1yeub2vr",ys=we({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 hr="_1yeub2vp";var zw=we({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 gr=`${Fe}Body`,bs=o=>o.querySelector(`.${gr}`);var on=`${Fe}HeaderCell`,yr=`${Fe}HeaderWrapper`,Cs=o=>Array.from(o.querySelectorAll(`.${yr}`));function Tn(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 Ts(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 xe={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)"}}},Ss="column-header-height";var ws=`.${ke.rootClassName}`;function br(o){return Tn(o,ws)}var vs=U(j.scrollLeft),nh=U(j.scrollTop),oh=U(j.columnWidthAtIndex),Cr=U(j.columnOffsetAtIndex),Is=U(j.columnReorderEffectDurationAtIndex),ih=U(j.columnOffsetAtIndexWhileReordering),rh=U(j.columnVisibilityAtIndex),ah=U(j.columnZIndexAtIndex);function St(o,t,e){let n=e?br(e):document.querySelector(ws);lh(o,t,n)}function lh(o,t,e){if(e){let n=o,i=j[n]?U(j[n]):o;e.style.setProperty(i,`${t}`)}}function Sn(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 Tr(o,t,e){St(`${Cr}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+t}px + var(${vs}))`:`${o.computedAbsoluteOffset+t}px`,e)}function Sr(o,t,e){St(`${ah}-${o}`,`${t}`,e)}function Jn(o,t,e){St(`${ih}-${o}`,typeof t=="number"?`calc( var(${Cr}-${o}) + ${t}px )`:t,e)}function Qn(o,t,e){St(`${rh}-${o}`,t,e)}function zo(o,t,e){St(`${Is}-${o}`,e??"",t)}function wr(o,t){let e=`${Is}-${o}`;St(e,xe.components.Cell.reorderEffectDuration,t)}var be={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${oh}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(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`${Cr}-${o}`}},set(o,t,e){t=typeof t=="number"?t+"px":t,St(this.varName.get(o),t,e)}}};function Rs(o,t){Sn({[vs]:`${o.scrollLeft}px`,[nh]:`${o.scrollTop}px`},t)}var eo={bodyWidth:{name:U(xe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:U(xe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:U(xe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:U(xe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:U(xe.runtime.browserScrollbarWidth),value:""}},sh=U(j.scrollbarWidthHorizontal),xs=U(j.scrollbarWidthVertical),uh=U(j.columnWidthAtIndex),dh=U(j.columnZIndexAtIndex),Ps=U(j.scrollLeft),ch=U(j.activeCellColWidth),Ds=U(j.activeCellColOffset),Es=U(j.baseZIndexForCells),fh=U(j.pinnedStartWidth),As=U(j.bodyWidth),ph=U(j.bodyHeight),_s=U(j.pinnedEndOffset),Ms=U(j.pinnedEndWidth),mh=U(j.computedVisibleColumnsCount);function vr(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(${Es}) `+(e<0?"-":"+")+` ${Math.abs(e)} )`:"auto"}function Fs(o){let{computedVisibleColumns:t,computedPinnedStartColumns:e,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:i,computedPinnedEndColumnsWidth:r,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:u,brain:d,scrollbars:s}=o,c=Tt(),f=[],m=t.reduce((p,h)=>{let y=h.computedVisibleIndex;p[be.columnWidths.varName.get(y)]=h.computedWidth+"px",p[be.columnOffsets.varName.get(y)]=h.computedPinned==="start"?`calc( ${h.computedOffset}px + var(${Ps}) )`:h.computedPinned==="end"?`calc( var(${_s}) ${f.length?"+":""} ${f.map(b=>be.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Ps}) )`:`${h.computedOffset}px`;let C=vr(h,{pinnedStartColsCount:e.length,visibleColsCount:t.length});return p[`${dh}-${y}`]=`${C}`,h.computedPinned==="end"&&f.push(h),p},{});if(l.width&&(m[eo.browserScrollbarWidth.name]=`${Tt()}px`),m[eo.bodyWidth.name]=`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,m[eo.totalVisibleColumnsWidthValue.name]=`${i+r+a}px`,m[eo.totalVisibleColumnsWidthVar.name]=`calc(${t.map((p,h)=>`var(${uh}-${h})`).join(" + ")})`,m[eo.visibleColumnsCount.name]=t.length,u!=null){m[ch]=be.columnWidths.get(u[1]);let p=be.columnOffsets.get(u[1]);if(d.isHorizontalLayoutBrain){let h=d.getPageIndexForRow(u[0]);m[Ds]=h?`calc( ${xe.runtime.totalVisibleColumnsWidthVar} * ${h} + ${p})`:p}else m[Ds]=p}return m[mh]=t.length,m[sh]=s.horizontal?`${c}px`:"0px",m[xs]=s.vertical?`${c}px`:"0px",m[fh]="calc( "+e.map(p=>be.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Ms]="calc( "+n.map(p=>be.columnWidths.get(p.computedVisibleIndex)).join(" + ")+")",m[Es]=t.length*10,m[_s]=`calc( var(${As}) - var(${Ms}) - var(${xs}) )`,m[As]=`${l.width}px`,m[ph]=`${l.height}px`,m}var to=(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 Ir(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 to(n,s,d)}else{let l=t.indexOf(i),u=t[l+1],d=n.indexOf(u),s=n.indexOf(i);return to(n,s,d)}return t}var zs=zn(wn());function Vo(o){return o.map(t=>t instanceof Ut?t:new Ut(null,[t]))}var Ut=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=>hh(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 hh(o,t){return typeof o=="string"||typeof o=="number"?`${o}`:t?o.__get(t):o.done()}var gh=(...o)=>new Ut("+",Vo(o)),Os=(...o)=>new Ut("-",Vo(o)),yh=(...o)=>new Ut("*",Vo(o)),bh=(...o)=>new Ut("/",Vo(o)),no={add:gh,subtract:Os,minus:Os,multiply:yh,divide:bh};var ks=o=>{let t=null,e=null;return{stop(){t!==null&&en(t),e!=null&&en(e)},scroll(n){t!==null&&en(t),e!=null&&en(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=Oe(()=>{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=Oe(()=>{r.scroll(n)}),!0}return!!(a()||l())}}};var Ls=10,Ch=U(j.pinnedStartWidth);function Vs(o){let{computedVisibleColumns:t,computedVisibleColumnsMap:e,computedPinnedEndColumns:n,computedPinnedStartColumns:i,dragColumnId:r,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:u,draggableColumnsRestrictTo:d,tableRect:s,acceptDropToReorderRect:c,allowColumnHideOnDrag:f,setProxyPosition:m,setDragColumnOutside:p,getCurrentDragSourceAndTarget:h,api:y,horizontalLayoutPageIndex:C,pageWidth:b}=o;function S(H){let q=H==="start"?L:K;return F===O?q:O===H?q+A.computedWidth:F===H?q-A.computedWidth:q}function w(H){if(H.columnIndex===x||C!=null)return!0;let q=t[H.columnIndex];if(q.computedPinned)return!0;let X=l.getScrollPosition().scrollLeft,te=q.computedOffset+(C!=null&&b!=null?b*C:0);return te>=X+S("start")&&te+q.computedWidth<=X+s.width-S("end")}let T=(H,q)=>{let{restrictToParentGroup:X,dragColumn:te}=q,oe=[];if(H.forEach(ge=>{if(ge.computedVisibleIndex===x)return;let ne={columnId:ge.id,columnIndex:ge.computedVisibleIndex,offsetX:ge.computedOffset+Math.round(ge.computedWidth/2)};w(ne)&&oe.push(ne)}),X){let ne=function(ie,Te,Ie){let Se=H[ie];Se&&(Se.columnGroup!==te.columnGroup&&Ie.add(Se.id),ne(ie+Te,Te,Ie))};var he=ne;let ge=te.computedVisibleIndex,W=new Set;ne(ge-1,-1,W),ne(ge+1,1,W),oe=oe.filter(ie=>!W.has(ie.columnId))}return oe},R=i.length,E={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},N={left:E.clientX-s.left-(E.clientX-u.left)+Ls,top:E.clientY-s.top-(E.clientY-u.top)+Ls},v=l.getScrollPosition(),D=t.map(H=>H.computedVisibleIndex),M=D,A=e.get(r),x=A.computedVisibleIndex,F=A?.computedPinned,_=x,O=F,L=l.getFixedStartColsWidth(),K=l.getFixedEndColsWidth(),B=E,G={x:0,y:0},le=1,Z=0;function Pe(H){let q=Math.round(H.clientX),X=Math.round(H.clientY);if(q===B.clientX&&X===B.clientY)return Ae.from(u).shift({left:G.x,top:G.y});B={clientX:q,clientY:X};let oe=l.getScrollPosition().scrollLeft-v.scrollLeft;return G.x=B.clientX-E.clientX,G.y=B.clientY-E.clientY,Z=G.x+oe,le=Z<0?-1:1,m({left:N.left+G.x,top:N.top+G.y}),Ae.from(u).shift({left:G.x,top:G.y})}function me(H){let q=0;F?F==="start"&&H.forEach((X,te)=>{q||t[X]?.computedPinned!=="start"&&(q=te)}):H.forEach((X,te)=>{t[X]?.computedPinned==="start"&&(q=te+1)}),R=q,ve("start",H,q)}function ve(H,q,X){if(H==="start"){let te=0;for(let oe=0;oe<X;oe++){let he=q[oe],ge=t[he];te+=ge.computedWidth}St(Ch,`${te}px`,a)}}function Ne(H){if(H==null||H===_)return;if(_===-1&&H!==-1&&(Qn(x,"",a),p(!1)),_=H,H===-1){Me(x);return}let q=to(D,x,_>x?_-1:_);R=0;let te=new Set;return q.forEach((oe,he)=>{let ge=M[he];oe!==ge&&te.add(oe),me(q)}),M=q,Ce(te),{newColumnIndexes:q,indexesWithTransition:te,pinnedStartCount:R}}function Me(H){M=M.filter(X=>X!==H),t.forEach(X=>{let te=X.computedVisibleIndex,oe=te>H;wr(te,a);let he="";oe&&(he=no.minus(be.columnOffsets.get(te),be.columnWidths.get(H)).done()),Jn(te,he,a)}),Qn(H,"hidden",a),p(!0)}function Ce(H){t.forEach(q=>{let X=q.computedVisibleIndex;H.has(X)?wr(X,a):zo(X,a);let te=X===x,oe=le===-1?X<_||X>x:X<x||X>=_,he="";le===-1?he=te?be.columnOffsets.get(_):oe?be.columnOffsets.get(X):no.add(be.columnOffsets.get(X),be.columnWidths.get(x)).done():he=oe?be.columnOffsets.get(X):te?no.add(be.columnOffsets.get(_-1),be.columnWidths.get(_-1)).minus(be.columnWidths.get(x)).done():no.minus(be.columnOffsets.get(X),be.columnWidths.get(x)).done(),Jn(X,he,a)})}let _e=s.left+S("start"),ue=s.right-S("end"),Q=ks({scrollOffsetStart:_e,scrollOffsetEnd:ue});return Pe(E),{speedScroller:Q,stop(){Q.stop()},onMove(H){let q=Pe(H);if(h().dropTargetListId==="grouping-toolbar"||f&&!c.containsPoint(q.getCenter()))return f&&Ne(-1),null;Q.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ne){y.scrollLeft=ne}});let X=T(t,{dragColumn:A,restrictToParentGroup:d==="group"}),te=le===-1?A.computedOffset+Z:A.computedOffset+A.computedWidth+Z,oe=(0,zs.default)(X,te,({offsetX:ne},W)=>ne<W?-1:ne>W?1:0);oe<0&&(oe=~oe),X.length?oe=X[oe]?X[oe].columnIndex:X[X.length-1].columnIndex+1:(t.length>1&&console.error("No breakpoints available, something is wrong!"),oe=0),oe===x+1&&(oe=x),Ne(oe);let he={};n.forEach(ne=>{he[ne.id]="end"});for(let ne=0;ne<R;ne++){let W=M[ne],ie=t[W];he[ie.id]="start"}let ge=M.map(ne=>t[ne].id);return{columnPinning:he,columnOrder:ge}}}}var Sh=U(j.baseZIndexForCells),wh=(o,t)=>{let e=!o||Object.keys(o).length===0,n=!t||Object.keys(t).length===0;return e&&n?!0:!!o!=!!t?!1:Wt(o,t)},vh=()=>({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"});function Gs(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&&Xn(p.target))return;let h=i(),y=u().domRef,{brain:C,draggableColumnsRestrictTo:b}=u(),{computedVisibleColumns:S,computedVisibleColumnsMap:w,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedPinnedEndColumns:R}=d(),E=w.get(t);if(!E||!E.computedDraggable){f(p);return}let N=n.current,v=N.getBoundingClientRect(),D=y.current.getBoundingClientRect(),M=C.getAvailableSize(),A=E.computedVisibleIndex,x=C.getVirtualColIndex(E.computedVisibleIndex,{pageIndex:h||0}),F=C.isHorizontalLayoutBrain?C.getPageWidth():null,_=N.style.cursor??"auto",O=!1,L=y.current,K=Ae.from(bs(L).getBoundingClientRect()),B=Cs(L).map(Ce=>Ae.from(Ce.getBoundingClientRect())),G=K.getMinimumBoundingRectangle(...B),le=Vs({brain:C,horizontalLayoutPageIndex:h,allowColumnHideOnDrag:r,pageWidth:F,draggableColumnsRestrictTo:b,computedPinnedEndColumns:R,computedPinnedStartColumns:T,computedUnpinnedColumns:P,computedVisibleColumns:S,computedVisibleColumnsMap:w,dragColumnHeaderTargetRect:v,dragColumnId:t,getCurrentDragSourceAndTarget:vh,api:c,infiniteDOMNode:y.current,setProxyPosition:Ce=>{a.value=Ce},setDragColumnOutside:Ce=>{l.value=Ce},tableRect:D,acceptDropToReorderRect:G,initialMousePosition:{clientX:p.clientX,clientY:p.clientY}}),Z=null,Pe,me;function ve(Ce){let{columnPinning:_e,columnOrder:ue}=Ce;wh(u().columnPinning,_e)||(s.columnPinning=_e);let Q=d().computedColumnOrder;s.columnOrder=Ir({newColumnOrder:ue,visibleColumnOrder:d().computedVisibleColumns.map(H=>H.id),existingColumnOrder:Q,dragColumnId:t})}let Ne=Ce=>{let{headerBrain:_e,brain:ue}=u();if(!O){O=!0;let Q=ue.keepColumnRendered(x),H=_e.keepColumnRendered(x);if(ue.isHorizontalLayoutBrain){let X=ue.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),te=_e.extendRenderRange({start:!0,end:!0,direction:"horizontal"});me=()=>{X(),te()}}Pe=()=>{Q(),H()},s.columnReorderDragColumnId=E.id,h!=null&&(s.columnReorderInPageIndex=h),Sr(A,`calc( var(${Sh}) + 10000 )`,y.current),y.current?.classList.add(hr),N.style.cursor="grabbing"}Z=le.onMove(Ce)},Me=Ce=>{let _e=Ce.pointerId;requestAnimationFrame(async()=>{let{multiSortBehavior:ue}=u(),Q=y.current;Q?.classList.remove(hr),le.stop(),C.update({...M}),Pe?.(),me?.(),N.style.cursor=_,N.hasPointerCapture?.(_e)&&N.releasePointerCapture(_e),N.removeEventListener("pointermove",Ne),N.removeEventListener("pointerup",Me),a.value=null;let H=c.getColumnApi(E.id)?.isSortable()??!1;!O&&H&&c.toggleSortingForColumn(E.id,{multiSortBehavior:ue==="replace"&&(Ce.ctrlKey||Ce.metaKey)?"append":ue}),Z?ve(Z):O&&r&&c.setVisibilityForColumn(E.id,!1),s.columnReorderDragColumnId=!1,h!=null&&(s.columnReorderInPageIndex=null),await Th(),S.forEach(q=>{zo(q.computedVisibleIndex,Q),Qn(q.computedVisibleIndex,"",Q),Jn(q.computedVisibleIndex,"",Q)}),Sr(A,vr(E,{pinnedStartColsCount:T.length,visibleColsCount:S.length}),Q)})};N.addEventListener("pointermove",Ne),N.addEventListener("pointerup",Me),N.setPointerCapture(p.pointerId)};return{onPointerDown:p=>{d().computedVisibleColumnsMap.get(t)?.computedDraggable?m(p):p.target&&Xn(p.target)||f(p)}}}import{defineComponent as Ih,h as Go}from"vue";var ot={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 Ks=Ih({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 Go("svg",{viewBox:o.viewBox,class:o.className,style:e},o.paths.map(n=>Go("path",{d:n})))}}});function ct(o,t){let e=n=>Go(Ks,{...n,paths:t});return e.displayName=o,e}var Bs=ct("IncludesOperatorIcon",ot.includesOperator),Hs=ct("StartsWithOperatorIcon",ot.startsWithOperator),Ws=ct("EndsWithOperatorIcon",ot.endsWithOperator),js=ct("EqualOperatorIcon",ot.eqOperator),$s=ct("NotEqualOperatorIcon",ot.neqOperator),Us=ct("GTOperatorIcon",ot.gtOperator),qs=ct("GTEOperatorIcon",ot.gteOperator),Ys=ct("LTOperatorIcon",ot.ltOperator),Zs=ct("LTEOperatorIcon",ot.lteOperator),Xs=ct("DoneIcon",ot.done),Js=ct("ClearIcon",ot.clear),Rr=o=>Go(Ks,{...o,viewBox:"0 -960 960 960",paths:ot.hidden});Rr.displayName="HiddenIcon";var Ko="_1eexc2a7 _1eexc2a6",Qs=we({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"]]}),eu=we({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 tu="_1eexc2a5",Bo=we({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Ho="_1eexc2a8";import{defineComponent as Rh,h as xh,onMounted as Ph,ref as ou,watch as Dh}from"vue";var nu="qz8ht90 _16lm1iwk";var qt=Rh({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=ou(e===void 0?!1:e),i=ou(null),r=()=>{i.value&&(i.value.indeterminate=n.value==null)};Ph(r),Dh(()=>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 xh("input",{...l,class:ee("InfiniteCheckBox",nu,l.class),type:"checkbox",ref:i,checked:!!n.value,disabled:o.disabled,onChange:a})}}});import{defineComponent as Ah,h as Wo}from"vue";function iu(o){let t={};return Object.keys(o).forEach(e=>{t[e]=e}),t}var ru=iu({"data-name":""}),xr={[ru["data-name"]]:"menu-icon"},au=`[${ru["data-name"]}="${xr["data-name"]}"]`;var _h={width:"100%",pointerEvents:"none"},Pr=`${nt}-menu`,oo=Ah({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={..._h,borderTop:`${xe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle},n=t.default?t.default():[Wo("div",{class:Pr,style:e}),Wo("div",{class:Pr,style:e}),Wo("div",{class:Pr,style:e})];return Wo("div",{...o.domProps,style:o.style,...xr,onPointerdown:i=>{i.stopPropagation(),o.domProps?.onPointerdown?.(i)},class:ee(o.className,Wl({menuVisible:o.menuVisible,reserveSpaceWhenHidden:o.reserveSpaceWhenHidden}),nt,`${nt}-menu`)},n)}}});import{defineComponent as Mh,h as io,ref as du,watch as Eh,onBeforeUnmount as Fh}from"vue";var lu="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var su={transition:"width 0.25s, opacity 0.25s"},uu=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});var cu=Mh(o=>{let t=du(!0),e=du(0),n=null;Eh(()=>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}),Fh(()=>{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={...su,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:e.value},p={};return r===-1&&(p.top="100%"),io("div",{"data-name":"sort-icon",style:{...o.style,width:`${s}px`},class:ee(l,nt,lu,`${nt}-sort`)},[d?io("div",{"data-name":"index",style:p,class:Ul},`${u}`):null,io("div",{style:{width:`${f[0]}px`,...m},onTransitionend:i}),io("div",{style:{width:`${f[1]}px`,...m}}),io("div",{style:{width:`${f[2]}px`,...m}})])}},{name:"SortIcon",props:[...uu]});var{rootClassName:fu}=ke,wt=`${fu}Cell`,jo=`${fu}Cell_content`;function Dr(o){return Math.max(o.width-Tt(),0)}function pu(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 dr({shareSpaceOnResize:i,availableSize:Dr(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}))})}import{defineComponent as Oh,h as gu,ref as kh}from"vue";function mu(o,{columns:t,shareSpaceOnResize:e,domRef:n}){let i=t[o];return{resize(r){be.columnWidths.set(o,i.computedWidth+r,n.current);let a=o+1;if(e){let l=t[a];if(!l)return;be.columnWidths.set(a,l.computedWidth-r,n.current),l.computedPinned==="start"?Tr(l,r,n.current):be.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"){Tr(d,r,n.current);continue}d.computedPinned!=="end"&&be.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||be.columnOffsets.set(l,d.computedOffset+r,n.current)}}}}}function hu(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;be.columnWidths.set(f,p,d),m.computedPinned!=="end"&&(l&&be.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"&&be.columnOffsets.set(s,c.computedOffset+u,d)}}}}var $o="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Uo=we({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"]]}),qo=we({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"]]});import{inject as Nh}from"vue";var ro=Symbol("InfiniteTable");function Be(){return Nh(ro)}var{rootClassName:Lh}=ke,zh=`${Lh}HeaderCell_ResizeHandle`,yu=Oh({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=Be(),{getState:e}=t,n={current:null},i=kh(!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"}),P=c.extendRenderRange({start:!0,end:!0,direction:"horizontal"});y=()=>{T(),P()}}h.setPointerCapture(m);let C=mu(o.columnIndex,{columns:o.columns,shareSpaceOnResize:f,domRef:n}),b=(T,{done:P}={})=>{d&&(T=T/(d+1),P&&(T=Math.round(T))),u==="end"&&(T*=-1);let{adjustedDiff:R,constrained:E}=o.computeResize({diff:T,shareSpaceOnResize:f});return i.value!==E&&(i.value=E),C.resize(R),R},S=T=>{b(Math.round(T.clientX-p))},w=T=>{h.releasePointerCapture(m),h.removeEventListener("pointermove",S),h.removeEventListener("pointerup",w);let P=Math.round(T.clientX-p),R=b(P,{done:!0});y(),C.resize(0),o.onResize({diff:R,shareSpaceOnResize:f})};h.addEventListener("pointermove",S),h.addEventListener("pointerup",w)};return()=>{let a=o.columns[o.columnIndex];if(!a)return null;let l=a.computedPinned,u=a.computedFirstInCategory,d=a.computedLastInCategory,s=(l===!1||l==="start")&&d?{right:l==="start"?void 0:0}:l==="end"&&u?{right:void 0}:void 0;return gu("div",{ref:c=>{n.current=c??null},class:`${zh} ${$o} ${qo({computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerdown:r},[gu("div",{style:s,class:Uo({constrained:i.value,computedPinned:l,computedFirstInCategory:u,computedLastInCategory:d})})])}}});var Wh=U(j.columnWidthAtIndex),jh=U(j.columnReorderEffectDurationAtIndex),$h=U(j.columnZIndexAtIndex),Uh=U(j.columnVisibilityAtIndex),Cu=Symbol("InfiniteHeaderCell");function Yo(){return Gh(Cu)}var qh=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||qt;return $e(u,{domProps:{class:Ho},onChange:d=>{if(l){d?i.treeApi.selectAll():i.treeApi.deselectAll();return}d?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:r})};function an(o,t){return o(t)}var Ar=()=>$e("div",{class:Tl[1]}),Tu=Vh({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=Be(),{api:e,actions:n,getState:i,getComputed:r,dataSourceContext:a}=t,{getDataSourceState:l,dataSourceApi:u,dataSourceActions:d}=a,s={current:null},c=v=>{let D=v&&v.$el!==void 0?v.$el:v;s.current=D??null,o.domRef(s.current)},f=Bh(null);Kh(Cu,f);let m=()=>Je(o.column,{actions:n,api:e,dataSourceActions:d,dataSourceApi:u,getComputed:r,getDataSourceState:l,getDataSourceMasterContext:()=>l().getDataSourceMasterContextRef?.current?.()??void 0,getState:i}),p=null,h=()=>{let v=o.column.id,D=l().filterDelay,M=`${v}:${D}`;if(!p||p.key!==M){let A=x=>{e.setColumnFilter(v,x)};p={key:M,fn:D>0?Qt(A,{wait:D}):A}}return p.fn},y=bu(null),C=bu(!1),{onPointerDown:b}=Gs({columnId:o.column.id,context:{getState:i,getComputed:r,actions:n,api:e},domRef:s,getHorizontalLayoutPageIndex:()=>o.horizontalLayoutPageIndex,allowColumnHideOnDrag:!0,proxyPosition:y,dragColumnOutside:C}),S=rn(()=>t.state.value.columnMenuVisibleForColumnId),w=rn(()=>t.state.value.columnReorderDragColumnId),T=rn(()=>t.state.value.columnReorderInPageIndex),P=rn(()=>t.state.value.showColumnFilters),R=rn(()=>t.state.value.columnHeaderHeight),E=rn(()=>t.state.value.components),N=rn(()=>a.state.value.filterTypes);return()=>{let{column:v,columnsMap:D,horizontalLayoutPageIndex:M,headerOptions:A}=o,{allRowsSelected:x,someRowsSelected:F,selectionMode:_}=o,O=v.computedSortInfo,L=v.header,K=m(),B=K.isSortable(),G=A.alwaysReserveSpaceForSortIcon,le=v.headerAlign??v.align,Z=(typeof le=="function"?le({isHeader:!0,column:v}):le)??"start",Pe=(typeof v.verticalAlign=="function"?v.verticalAlign({isHeader:!0,column:v}):v.verticalAlign)??"center",me=B&&(v.computedSorted||G)?$e(cu,{index:v.computedMultiSort?v.computedSortIndex+1:void 0,style:{marginInlineStart:xe.spacing[2],marginInlineEnd:xe.spacing[2]},className:`${on}__sort-icon ${$l} ${ql({align:Z})}`,direction:v.computedSorted?v.computedSortedAsc?1:-1:0}):null,Ne=v.computedFilterable&&v.computedFiltered?$e(gn):null,Me=v.headerCssEllipsis??v.cssEllipsis??!0,Ce=S.value,_e=w.value,ue=T.value,Q=_e===v.id,H=ue!=null?M!==ue:!1,q={reserveSpaceWhenHidden:Z==="center",menuVisible:Ce===v.id,style:Z==="end"?{marginInlineStart:`calc(${xe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:xe.spacing[2]}:{marginInlineEnd:`calc(${xe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:xe.spacing[2]},domProps:{onMousedown:re=>{re.stopPropagation(),K.toggleContextMenu(re.target)}}},X=v.components?.MenuIcon||E.value?.MenuIcon||oo,te=$e(X,q),oe=P.value,he=N.value,ge=v.computedFilterType,ne=he[ge],W=v.computedFilterable?v.computedFilterValue?.filter.operator??ne?.defaultOperator:void 0,ie=v.computedFilterable&&ne?ne.operators.find(re=>re.name===W):void 0,Te=ie?.components?.FilterEditor||ne?.components?.FilterEditor||v.components?.FilterEditor||ao,Ie=ne?.components?.FilterOperatorSwitch||v.components?.FilterOperatorSwitch||wu,Se=v.computedFilterable?$e(Su,{filterProps:{horizontalLayoutPageIndex:M,filterEditor:Te,filterOperatorSwitch:Ie,operator:ie,filterTypes:he,onChange:h(),columnFilterType:ge,columnLabel:v.field||v.name||v.id,columnFilterValue:v.computedFilterValue,columnHeaderHeight:R.value}}):$e(vu),We={horizontalLayoutPageIndex:M,dragging:Q,domRef:c,htmlElementRef:s,renderLocation:"column-header",column:v,columnsMap:D,columnSortInfo:O,columnFilterValue:v.computedFilterValue,filtered:v.computedFiltered,someRowsSelected:F,allRowsSelected:x,selectionMode:_,api:e,dataSourceApi:u,columnApi:K,renderBag:{sortIcon:me,filterIcon:Ne,menuIcon:te,menuIconProps:q,selectionCheckBox:null,header:v.header&&typeof v.header!="function"?v.header:v.name}},Le=We;Le.renderBag.filterEditor=Se,f.value=Le;let de={...We,renderBag:{...We.renderBag}};if(v.renderSortIcon&&(de.renderBag.sortIcon=an(v.renderSortIcon,{...de,renderBag:{...de.renderBag}})),v.renderFilterIcon&&(de.renderBag.filterIcon=an(v.renderFilterIcon,{...de,renderBag:{...de.renderBag}})),typeof v.renderMenuIcon=="function"){let re=an(v.renderMenuIcon,{...de,renderBag:{...de.renderBag}});de.renderBag.menuIcon=re?re.type===X||re.type===oo?re:$e(X,q,()=>re):null}if(v.renderSelectionCheckBox&&_==="multi-row"){de.renderBag.selectionCheckBox=an(qh,{...de,renderBag:{...de.renderBag}});let re=v.renderHeaderSelectionCheckBox??v.renderSelectionCheckBox;re&&re!==!0&&(de.renderBag.selectionCheckBox=an(re,{...de,renderBag:{...de.renderBag}}))}L instanceof Function&&(de.renderBag.header=an(L,{...de,renderBag:{...de.renderBag}}));let tt=Me?$e("div",{class:at},[de.renderBag.header]):de.renderBag.header,Ze=v.renderMenuIcon===!1?null:de.renderBag.menuIcon,dt=[Z==="center"?Ar():null,de.renderBag.selectionCheckBox,tt,de.renderBag.sortIcon,de.renderBag.filterIcon,Z==="center"?Ar():null,Z!=="center"?Ar():null,Ze],gt=v.renderHeader?an(v.renderHeader,{...de,renderBag:{...de.renderBag,all:dt}}):dt,ze={height:`${o.height}px`};v.headerStyle&&(ze=typeof v.headerStyle=="function"?{...ze,...v.headerStyle(Le)||{}}:{...ze,...v.headerStyle});let g=typeof v.headerClassName=="function"?v.headerClassName(Le):v.headerClassName,I=`var(${$h}-${v.computedVisibleIndex})`;ze.zIndex=I,ze.visibility=`var(${Uh}-${v.computedVisibleIndex}, visible)`,ze.width=`var(${Wh}-${v.computedVisibleIndex})`,ze.transition=`transform var(${jh}-${v.computedVisibleIndex}, 0s)`;let z={filtered:v.computedFiltered,verticalAlign:Pe,align:Z},k={"data-field":`${v.field||""}`,"data-column-id":v.id,"data-header-align":Z,"data-name":"HeaderCell","data-sort":v.computedSortedAsc?"asc":v.computedSortedDesc?"desc":"none","data-sort-index":`${v.computedSortIndex??-1}`},Y=ee(on,Pl.none,B?Cl.pointer:"",g,Lo(v,[on,wt],Ll,{dragging:Q,insideDisabledDraggingPage:H,align:Z,verticalAlign:Pe,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Fl,wt,Ko),V=$e("div",{class:ee(jo,Me?at:Mo.hidden,Nl(z),wl[Z]),style:oe?{height:`${o.height/2}px`}:void 0},[gt]),J=re=>pu({context:{getState:i,getComputed:r},column:v,diff:re.diff,shareSpaceOnResize:re.shareSpaceOnResize}),ce=v.computedResizable?$e(yu,{horizontalLayoutPageIndex:M,columns:r().computedVisibleColumns,columnIndex:v.computedVisibleIndex,computeResize:J,onResize:re=>{let{columnSizing:rt,reservedWidth:_t}=J(re);re.shareSpaceOnResize||(n.viewportReservedWidth=_t),n.columnSizing=rt}}):null,se=[oe?Se:null,ce],fe={ref:c,...k,"data-z-index":I,style:ze,class:Y,onPointerdown:b},ae=null,ye=i().portalDOMRef.current;Q&&y.value&&ye&&(ae=$e(Hh,{to:ye},[$e("div",{key:v.id,class:`${on}Proxy ${Ol}`,style:{height:`${o.height}px`,width:`${o.width}px`,left:`${y.value.left??0}px`,top:`${y.value.top??0}px`}},[$e("div",{class:kl({visible:C.value})},[$e(Rr,{size:16})]),de.renderBag.header])]));let Re=v.components?.HeaderCell;return Re?[$e(Re,fe,{default:()=>[V,se]}),ae]:[$e("div",fe,[V,se]),ae]}}});var Ru=Symbol("InfiniteColumnHeaderFilter"),Zo=o=>o.stopPropagation(),Su=_r({name:"InfiniteTableColumnHeaderFilter",props:{filterProps:{type:Object,required:!0}},setup(o){let t=Be(),e=Yo(),n=Xh(o.filterProps);Zh(Ru,n);let i=Iu(!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 vn("div",{onPointerup:Zo,onPointerdown:Zo,onFocusin:r,onFocusout:a,class:`${ko} ${lr({active:d})}`,style:{height:`${o.filterProps.columnHeaderHeight}px`}},[vn(c),vn(s)])}}}),wu=_r({name:"InfiniteTableFilterOperatorSwitch",setup(){let o=lo();return()=>{let t=o.disabled.value,n=o.operator.value?.components?.Icon??gn;return vn("div",{"data-name":"filter-operator","data-disabled":t,onMousedown:i=>{i.stopPropagation(),!t&&o.columnApi.toggleFilterOperatorMenu(i.target)},class:ee(mr,Kl,t?`${mr}--disabled`:"")},[vn(n,{size:20,className:`${Bl({disabled:!!t})}`})])}}}),vu=_r({name:"InfiniteTableColumnHeaderFilterEmpty",setup(){return()=>vn("div",{onPointerup:Zo,onPointerdown:Zo,class:`${ko} ${lr({active:!1})} ${Sl["50%"]}`})}});function lo(){let o=Be(),t=Yo(),e=Yh(Ru),{api:n,getComputed:i,getState:r,actions:a,dataSourceContext:l}=o,{getDataSourceState:u,dataSourceApi:d,dataSourceActions:s}=l,c=vt(()=>t.value.column),f=vt(()=>{let{columnFilterType:S,filterTypes:w}=e.value;return w[S]}),m=Iu(e.value.columnFilterValue?.filter.value??"");Jh(()=>e.value.columnFilterValue?.filter.value,S=>{if(e.value.columnFilterValue)m.value!==S&&(m.value=S);else{let w=f.value;if(w){let T=[...w.emptyValues][0];T!==m.value&&(m.value=T)}}});let p=S=>{m.value=S,e.value.onChange(S)},h=()=>{n.clearColumnFilter(c.value.id)},y=()=>{n.removeColumnFilter(c.value.id)},C={api:n,getState:r,getComputed:i,getDataSourceState:u,actions:a,dataSourceActions:s,dataSourceApi:d},b=vt(()=>`Filter for ${Zn(c.value,C,"column-filter")}`);return{api:n,column:c,columnFilterValue:vt(()=>e.value.columnFilterValue),columnApi:t.value.columnApi,operator:vt(()=>e.value.operator),operatorName:vt(()=>e.value.operator?.name),value:m,disabled:vt(()=>e.value.columnFilterValue?.disabled),filterType:f,filterTypes:vt(()=>e.value.filterTypes),filterTypeKey:vt(()=>e.value.columnFilterType),filtered:vt(()=>c.value.computedFiltered),setValue:p,clearValue:h,removeColumnFilter:y,ariaLabel:b,className:`${Vl} ${us}`}}var ao=xu({name:"StringFilterEditor",setup(){let o=lo();return()=>Pu("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})}}),Mr=xu({name:"NumberFilterEditor",setup(){let o=lo();return()=>Pu("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 It=(o,t)=>{let e=o?.[t];return e?{components:{Icon:e}}:{}};function Du(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",...It(n,"includes"),label:"Includes",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&typeof r=="string"&&i.toLowerCase().includes(r.toLowerCase())},{label:"Equals",...It(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>typeof i=="string"&&i===r},{name:"startsWith",...It(n,"startsWith"),label:"Starts With",fn:({currentValue:i,filterValue:r})=>i.startsWith(r)},{name:"endsWith",...It(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",...It(n,"eq"),name:"eq",fn:({currentValue:i,filterValue:r})=>i==r},{label:"Not Equals",...It(n,"neq"),name:"neq",fn:({currentValue:i,filterValue:r})=>i!=r},{name:"gt",label:"Greater Than",...It(n,"gt"),fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>r},{name:"gte",...It(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i>=r},{name:"lt",...It(n,"lt"),label:"Less Than",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<r},{name:"lte",...It(n,"lte"),label:"Less Than or Equal",fn:({currentValue:i,filterValue:r,emptyValues:a})=>a.includes(i)?!0:i<=r}]}}}var Yn=Du({StringFilterEditor:ao,NumberFilterEditor:Mr,icons:{includes:Bs,eq:js,neq:$s,startsWith:Hs,endsWith:Ws,gt:Us,gte:qs,lt:Ys,lte:Zs}});var Xo=class{constructor(t){let e=t instanceof Object.getPrototypeOf(this).constructor?t.getState():t,n=this.getPositiveFromState(e),i=this.getNegativeFromState(e);this.update({negativeItems:i,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(t){let{positiveItems:e,negativeItems:n}=t;if(this.allNegative=n===!0,this.allPositive=e===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(i=>[i,!0]))):this.negativeMap=new $(n.map(i=>[i,!0])),this.positiveMap&&this.positiveMap.clear()),e!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(e.map(i=>[i,!0]))):this.positiveMap=new $(e.map(i=>[i,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(t){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(t)}return this.positiveMap?.has(t)}isItemNegative(t){return!this.isItemPositive(t)}setItemValue(t,e){if(e!==this.isItemPositive(t)){if(e){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be positive`;this.positiveMap.set(t,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be positive`;this.negativeMap.delete(t)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${t.join(",")} be negative`;this.negativeMap.set(t,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${t.join(",")} be negative`;this.positiveMap?.delete(t)}}}makeItemNegative(t){this.setItemValue(t,!1)}makeItemPositive(t){this.setItemValue(t,!0)}toggleItem(t){this.setItemValue(t,!this.isItemPositive(t))}};var ft=class extends Xo{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 Jo=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new $;this.removeNodePath=(t,e)=>{if(this.nodePathsToData.delete(t),this.remove(t[t.length-1]),!e)return;let n=this.nodePathsToData.get(t);if(n){let i=e.getNodeChildren?e.getNodeChildren(n):e.nodesKey?n[e.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,e.toPrimaryKey(l)];this.removeNodePath(u,e)}}};this.remove=t=>{this.primaryKeyToData.delete(t)};this.add=(t,e)=>{this.primaryKeyToData.set(t,e)};this.addNodePath=(t,e,n)=>{if(this.nodePathsToData.set(t,e),this.add(t[t.length-1],e),!n)return;let i=n.getNodeChildren?n.getNodeChildren(e):n.nodesKey?e[n.nodesKey]:null;if(i&&Array.isArray(i))for(let r=0,a=i.length;r<a;r++){let l=i[r],u=[...t,n.toPrimaryKey(l)];this.addNodePath(u,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getDataForNodePath=t=>this.nodePathsToData.get(t);this.indexArray=(t,e)=>{let{cache:n,toPrimaryKey:i,getNodeChildren:r,isLeafNode:a,nodesKey:l}=e,u=!!r&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),t=[]);let d=n&&!n.isEmpty();if(d&&(t=t.concat()),!t.length&&n){if(!n.isEmpty()){let s=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let c=0,f=s.length;c<f;c++){let m=s[c];if(m.type==="insert"){let p=i(m.data);u?this.addNodePath([p],m.data,e):this.add(p,m.data),t.push(m.data)}}n?.removeInfo(void 0)}}else{let s=(c,f)=>{for(let m=0;m<c.length;m++){let p=c[m];d&&u&&Array.isArray(p[l])&&(p=c[m]={...p});let h=!1;if(p!=null){let y=i(p),C=u?[...f,y]:void 0,b=u&&!!C,S=b?n?.getMutationsForNodePath(C):n?.getMutationsForPrimaryKey(y);if(S&&S.length){for(let w=0,T=S.length;w<T;w++){let P=S[w];if(P.type==="delete"&&!h&&(b?this.removeNodePath(C,e):this.remove(y),h=!0,c.splice(m,1),m--),P.type==="update"&&!h&&(p={...p,...P.data},c[m]=p),P.type==="update-children"&&!h){let R=P.children(p[l],p);p={...p},R!==void 0?p[l]=R:delete p[l],c[m]=p}P.type==="insert"&&(P.position==="before"?(c.splice(m,0,P.data),m--):c.splice(m+1,0,P.data))}b?n?.removeNodePathInfo(C):n?.removeInfo(y)}if(!h)if(b){this.addNodePath(C,p);let w=a(p),T=w?null:r(p);!w&&Array.isArray(T)&&(f.push(y),d&&(p[l]=T=T.concat()),s(T,f),f.pop())}else this.add(y,p)}}};s(t,[])}return t}}};function Er(...o){return(...e)=>{o.forEach(n=>{typeof n=="function"&&n(...e)})}}function Fr(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 Nr(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 Au({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=bt(function(){l.forEach((m,p)=>{u[`total:${m.id}`]=Fr({header:`${m.name||m.id} total`,pivotBy:t,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:m,pivotAggregatorIndex:p,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[m.id]:null})})});(!a&&e==="start"||n==="start")&&s();let c=!r&&l.length===1;return o.visitDepthFirst((m,p,h,y)=>{if(p=[...p],e==="end"&&y?.(),p.length===a){let C=t[p.length-1],S=p.slice(0,-1).join("/");if(!c){let w=S;S=p.join("/");let T=p[p.length-1];d[S]=Nr({header:`${T}`,columnGroup:w,pivotBy:t,pivotGroupKeys:p,pivotByAtIndex:C,pivotIndex:p.length-1,pivotGroupKey:T})}l.forEach((w,T)=>{let P=c?`${p[p.length-1]}`:w.name||w.id,R=Fr({pivotBy:t,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:w,pivotAggregatorIndex:T,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotIndex:p.length-1,pivotByAtIndex:C,columnGroup:S,header:P,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[w.id]:null}),E=`${w.id}:${p.join("/")}`;u[E]=R})}else{let C=p.join("/"),b=p.slice(0,-1);if(d[C]=Nr({columnGroup:b.length?b.join("/"):void 0,header:`${p[p.length-1]}`,pivotBy:t,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:t[p.length-1],pivotGroupKey:p[p.length-1]}),e!==!1){let S=t[p.length-1],w=b.length?b.join("/"):void 0;if(!c){let T=w;w=`total:${p.join("/")}`,d[w]=Nr({header:`${p[p.length-1]} total`,columnGroup:T,pivotBy:t,pivotTotalColumnGroup:!0,pivotGroupKeys:p,pivotIndex:p.length-1,pivotByAtIndex:S,pivotGroupKey:p[p.length-1]})}l.forEach((T,P)=>{let R=c?`${p[p.length-1]} total `:`${T.name||T.id} total`,E=Fr({columnGroup:w,header:R,pivotAggregator:T,pivotAggregatorIndex:P,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:p,pivotGroupKey:p[p.length-1],pivotByAtIndex:S,pivotIndex:p.length-1,pivotBy:t,valueFormatter:({rowInfo:N})=>N.isGroupRow?N.pivotValuesMap?.get(p)?.reducerResults[T.id]:null});u[`total:${T.id}:${p.join("/")}`]=E})}}(e==="start"||e===!1)&&y?.()}),(!a&&e==="end"||n==="end")&&s(),{columns:u,columnGroups:d}}var Qh=()=>{};function _u(o,t){let e=new $,n=t.nodesKey??"children",i=t.emptyGroup??{},r=typeof t.pathKey=="function"?t.pathKey:l=>l[t.pathKey];for(let l of o){let u=r(l);for(let d=0;d<u.length;d++){let s=u.slice(0,d);e.has(s)||e.set(s,void 0)}e.set(u,l)}function a(l,u){let d=e.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let s of d){let c=[...l,s[s.length-1]],f=e.get(c),m=f?f[n]??[]:[];a(c,m),m.length&&(f||(f=typeof i=="function"?i(c,m):i),f[n]=m),u.push(f)}return u}return a([],[])}function Mu(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=bt(()=>{let p=r(n);if(!(!p||!Array.isArray(p)))for(let h=0,y=p.length;h<y;h++){let C=p[h];Mu(o,t,c,C)}});f?(d?.(n),u?.(n,Qh)):(l?.(n,m,r(n)),u?.(n,m))}function Eu(o,t,e){for(let n=0,i=e.length;n<i;n++)Mu(o,t,[],e[n])}function Fu(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 Yt=(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(Ou(Fu(o),n)),i&&i.end(),t},Nu=(o,t,e)=>{let{marker:n}=e;n&&n.start();let i=Ou(Fu(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 Eu({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};Yt.knownTypes=Ht;var eg=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=Yt.knownTypes[r],i||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Yt.knownTypes).join(", ")}`)}return i||(i=Ht.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}},tg=o=>o.map(eg).filter(t=>t instanceof Function),Ou=(o,t)=>{let e=tg(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 ku=Symbol("CLEAR"),ln=class o{constructor(t){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new $;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(t,e,n)=>{this.allFieldsAffected=!0;let i=t,r=this.primaryKeyToData.get(i)||[];r.push({type:"delete",primaryKey:t,originalData:e,metadata:n}),this.primaryKeyToData.set(i,r)};this.deleteNodePath=(t,e,n)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(t)||[];i.push({type:"delete",nodePath:t,originalData:e,metadata:n}),this.nodePathToData.set(t,i)};this.insert=(t,e,n,i)=>{let r=t,a=this.primaryKeyToData.get(r)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:t,data:e,position:n,originalData:null,metadata:i}),this.primaryKeyToData.set(r,a)};this.insertNodePath=(t,e,n,i)=>{let r=this.nodePathToData.get(t)||[];this.allFieldsAffected=!0,r.push({type:"insert",nodePath:t,data:e,position:n,originalData:null,metadata:i}),this.nodePathToData.set(t,r)};this.update=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(u=>this.affectedFields.add(u)));let r=t,a=this.primaryKeyToData.get(r)||[];a.push({type:"update",primaryKey:t,data:e,originalData:n,metadata:i}),this.primaryKeyToData.set(t,a)};this.updateNodePath=(t,e,n,i)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(e[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(e).forEach(l=>this.affectedFields.add(l)));let r=this.nodePathToData.get(t)||[];r.push({type:"update",nodePath:t,data:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.updateChildren=(t,e,n,i)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(t)||[];r.push({type:"update-children",nodePath:t,children:e,originalData:n,metadata:i}),this.nodePathToData.set(t,r)};this.resetDataSource=t=>{this.clear(),this.allFieldsAffected=!0;let e=ku,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(ku);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=t=>{this.primaryKeyToData.delete(t)};this.removeNodePathInfo=t=>{this.nodePathToData.delete(t)};this.getMutationsForPrimaryKey=t=>this.primaryKeyToData.get(t);this.getMutationsForNodePath=t=>this.nodePathToData.get(t);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>$.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=t.nodesKey}static clone(t,{light:e=!1}={}){let n=new o({nodesKey:t.nodesKey});return n.allFieldsAffected=t.allFieldsAffected,n.affectedFields=new Set(t.affectedFields),n.primaryKeyToData=e?t.primaryKeyToData:new Map(t.primaryKeyToData),n.nodePathToData=e?t.nodePathToData:$.clone(t.nodePathToData),n}};function Zt(o,t){return t().dataArray[o]}function Qo(o){return o().dataArray}var Qe=class{constructor(t){this.collapsedPathsMap=new $;this.expandedPathsMap=new $;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let e=t&&t instanceof Object.getPrototypeOf(this).constructor?t.getState():t;e&&this.update(e)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(t){this.setNodeExpanded(t,!0)}collapseNode(t){this.setNodeExpanded(t,!1)}setNodeExpanded(t,e){let{collapsedPathsMap:n,collapsedIdsMap:i,expandedPathsMap:r,expandedIdsMap:a,defaultExpanded:l,_mode:u}=this;u==="id"&&Array.isArray(t)&&(t=t[t.length-1]),e===l?e?u==="path"&&Array.isArray(t)?n.delete(t):i.delete(t):u==="path"&&Array.isArray(t)?r.delete(t):a.delete(t):e?u==="path"&&Array.isArray(t)?r.set(t,!0):a.set(t,!0):u==="path"&&Array.isArray(t)?n.set(t,!0):i.set(t,!0)}isNodeExpandedByPath(t){return this.isNodeExpanded(t)}isNodeExpandedById(t){return this.isNodeExpanded(t)}isNodeExpanded(t){if(this._mode==="id"&&Array.isArray(t)&&(t=t[t.length-1]),this._mode==="id"&&Array.isArray(t))throw`You try to check if a node is expanded by id (${t}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(t))throw`You try to check if a node is expanded by path (${t}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(t)?!this.collapsedPathsMap.has(t):!this.collapsedIdsMap.has(t):this._mode==="path"&&Array.isArray(t)?this.expandedPathsMap.has(t):this.expandedIdsMap.has(t)}update(t){if(this.defaultExpanded=t.defaultExpanded,this.reset(),t.expandedPaths||t.collapsedPaths){this._mode="path";let i=t.expandedPaths||null,r=t.collapsedPaths||null;if(i)for(let a=0,l=i.length;a<l;a++)this.expandedPathsMap.set(i[a],!0);if(r)for(let a=0,l=r.length;a<l;a++)this.collapsedPathsMap.set(r[a],!0);return}this._mode="id";let e=t.expandedIds||null,n=t.collapsedIds||null;if(e)for(let i=0,r=e.length;i<r;i++)this.expandedIdsMap.set(e[i],!0);if(n)for(let i=0,r=n.length;i<r;i++)this.collapsedIdsMap.set(n[i],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),i=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:i}}let t=Array.from(this.collapsedIdsMap.keys()),e=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:t,expandedIds:e}}};var Or=o=>Array.isArray(o)?new $(o.map(t=>[t,!0])):o,ng=(o,t)=>o.length-t.length,Ue=class o{constructor(t,e){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new $;this.cache=new $;this.strictMode=!1;let n=t instanceof Object.getPrototypeOf(this).constructor,i=n?t.getState():t;this.setConfig(e||(n?t.config:{treePaths:new $})),this.disableStrictMode(),this.update(i),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(t){return t?Or(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:Or(e.treePaths),strictCheckPaths:e.strictCheckPaths??!0,multiRowSelectionTarget:e.multiRowSelectionTarget,unfilteredTreePaths:e.unfilteredTreePaths?Or(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(ng);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 ti(o,t){return new Ue(o,In(t))}function In(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 ei=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 Ue))throw"Invalid tree selection";let a=new Ue(i,In(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 Qe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=t}collapseAll(){let t=new Qe({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 Qe(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 Qe(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 Qe(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?Zt(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 Ue))throw"Invalid node selection";let n=new Ue(t,In(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 Ue))throw"Invalid node selection";let n=new Ue(t,In(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 Ue))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 Rn=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 lt=class extends Rn{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 kr=1e3;function Lu(o){return new Lr(o)}var Lr=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=()=>Qo(this.getState);this.getRowInfoByIndex=t=>Zt(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?kr:i;return isNaN(a)||(a=kr),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 lt(n):new lt({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 lt({enabledRows:!0,disabledRows:[]});return}let e=new lt(t);e.enableAll(),this.actions.rowDisabledState=e};this.disableAllRows=()=>{let t=this.getState().rowDisabledState;if(!t){this.actions.rowDisabledState=new lt({disabledRows:!0,enabledRows:[]});return}let e=new lt(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 ei({...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?ln.clone(e,{light:!0}):new ln({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??kr,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 zu(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 ni(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 oi(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 ii(o){let t=Object.keys(o.reducers||{});if(!t.length||!o.results)return o.results;let e=o.reducers,n=o.results;for(let i=0,r=t.length;i<r;i++){let a=t[i],l=e[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var og="group-by",Vu="group-by-";function Gu(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===og){let r=Gu(t);return r==null?i:(e=!0,{...i,field:r})}if(i.id.startsWith(Vu)){let r=i.id.slice(Vu.length),a=t.find(u=>String(u.field)===r||u.groupField===r);if(!a)return i;let l=Gu([a]);return l==null?i:(e=!0,{...i,field:l})}return i});return e?n:o}function Ku(o){return"groupNesting"in o?o.groupNesting??0:0}function Bu(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 ig(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||Ht.string)(o,t);return a===0?0:e.dir*a}function rg(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 ag(o){let t=[],e=[];for(let n of o){let i={row:n,children:[]},r=Ku(n);for(;e.length&&Ku(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 lg(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 Hu(o,t,e,n){let i=rg(t,e);if(!i.length||!o.length)return o;let r={...Ht,...n},a=ag(o),l=(d,s)=>{for(let c of i){let f=ig(Bu(d.row,c),Bu(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),lg(a)}var so={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 zr=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(so).reduce((e,n)=>{let i={start:t.start,end:r=>t.end({...r,track:so[n].track,label:r.label}),get label(){let r=so[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=so[n];return t.markerDetails.track=r.track,i}}),e},{})}};function it(o){return zr.create(o)}function xn(o){if(o==null)return!1;let t=o;return!0}function Gr(o,t){return o&&o.filter(e=>{let n=t[e.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(e.filter.value))})}var Rt=(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 Vr(){return!1}function sg(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:Vr,hasSelectedCells:Vr};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 ug=bt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
2
|
|
|
3
3
|
Your filtering function probably looks like this:
|
|
4
4
|
|
|
@@ -10,19 +10,19 @@ function treeFilterFunction({ data }) {
|
|
|
10
10
|
|
|
11
11
|
Make sure you avoid mutations.
|
|
12
12
|
|
|
13
|
-
`)});function Ku(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a}=o,l=[],u=d=>{let s=i(d);if(r(d)||!Array.isArray(s))return d;let c=Ku({...o,dataArray:s});return c.length===0?!1:(d={...d,[a]:c},d)};for(let d=0,s=t.length;d<s;d++){let c=t[d],f=i(c),m=e({data:c,index:d,dataArray:t,primaryKey:n(c,d),filterTreeNode:u});m&&(m===!0?m=c:typeof m=="object"&&m===c&&f!==i(m)&&ig(),l.push(m))}return l}function rg(o){let{filterTypes:t,marker:e,operatorsByFilterType:n,filterFunction:i,toPrimaryKey:r,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}=o,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]}),i&&(s=s.filter((f,m,p)=>i({data:f,index:m,dataArray:p,primaryKey:r(f,m)}))),a&&(s=Ku({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}));let c=zr(o.filterValue,t)||[];if(c&&c.length){let f=s.filter((m,p,h)=>{let y={data:m,index:p,dataArray:h,primaryKey:r(m,p),field:void 0};for(let C=0,b=c.length;C<b;C++){let S=c[C],{disabled:w,field:T,valueGetter:P,filter:{type:R,value:E,operator:N}}=S,v=t[R];if(w||!v)continue;let D=n[R]?.[N];if(!D)continue;let A=P||v.valueGetter||(({data:F,field:_})=>_?F[_]:F);y.field=T;let x=y;if(x.filterValue=E,x.currentValue=A(x),x.emptyValues=v.emptyValues,!D.fn(x))return!1}return!0});return e?.end({details:[{name:"Count after",value:f.length}]}),f}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function Bu(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=it(i).track.DataSource.label.PrepareData.start());let a=Ou(e),l=ii(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Rt(n,e,["refetchKey"]),c=Rt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new U,c=!0);let m=e.cache?rn.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?W=>W[h]:void 0,b=h?W=>W[h]===void 0:void 0,S,w;c&&(e.indexer.clear(),e.lazyLoad||(S=m?.getMutations(),w=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:W},te)=>{W&&e.indexer.getDataForNodePath(te)!==void 0&&W.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:P,treeFilterFunction:R,filterValue:E,filterTypes:N,operatorsByFilterType:v}=e,D=!!P||!!R||Array.isArray(E)&&E.length,M=D&&e.filterMode==="local",A=Rt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=c||A,F=Rt(n,e,["sortInfo"]),_=c||A||F,O=e.filterMode==="local"&&(x||!e.lastFilterDataArray),L=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),le=y,Y=Rt(n,e,["rowDisabledState","isRowDisabled"]),xe=Rt(n,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),me=Rt(n,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),we=c||_||Rt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Ne=c||_||Rt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Me=Rt(n,e,["rowInfoReducers"]),Te=G&&(we||!e.lastGroupDataArray||a.groupBy)||xe||Y||Me,_e=le&&(Ne||a.tree||!e.lastTreeDataArray)||me||Y||Me,ue=Date.now(),Q=e.originalDataArray;if(le&&_e){let W={marker:i?it(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=Ar(W,Q).treePaths}if(D||(e.unfilteredCount=Q.length),M){e.unfilteredCount=Q.length;let W=ue;O?(e.devToolsDetected&&(W=Date.now()),Q=rg({marker:i?it(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:R,dataArray:Q,toPrimaryKey:p,filterTypes:N,operatorsByFilterType:v,filterFunction:P,filterValue:E}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-W)):Q=e.lastFilterDataArray,e.lastFilterDataArray=Q,e.filteredAt=ue}if(e.filteredCount=Q.length,e.postFilterDataArray=Q,d){let W=Ut.knownTypes;if(Ut.knownTypes={...W,...e.sortTypes},L){let te=ue;if(e.devToolsDetected&&(te=Date.now()),i&&(t=it(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:Q.length}]})),e.sortFunction?(Q=e.sortFunction(l,[...Q]),t&&(t.end(),t=void 0)):y?Q=Mu(l,Q,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):Q=Ut(l,[...Q],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let be=Date.now()-te;e.debugTimings.set("sort",be)}}else Q=e.lastSortDataArray;Ut.knownTypes=W,e.lastSortDataArray=Q,e.sortedAt=ue}e.postSortDataArray=Q;let H=e.dataArray,X=e.rowSelection instanceof De?e.rowSelection:void 0,Z=e.treeExpandState instanceof Qe?e.treeExpandState:void 0,ne=e.cellSelection instanceof Ge?e.cellSelection:void 0;X?.xcache();let ie=e.selectionMode==="single-row"?W=>W.id===e.rowSelection:e.selectionMode==="multi-row"?W=>{let te=X;return W.isGroupRow?te.getGroupRowSelectionState(W.groupKeys):te.isRowSelected(W.id,W.dataSourceHasGrouping?W.groupKeys:void 0)}:void 0,he=e.isRowDisabled||Lr;e.isRowSelected&&e.selectionMode==="multi-row"&&(ie=W=>e.isRowSelected(W,X,e.selectionMode));let ge;e.isNodeExpanded&&(ge=W=>e.isNodeExpanded(W,Z)),e.isNodeCollapsed&&(ge=W=>!e.isNodeExpanded(W,Z)),ge||(ge=te=>Z.isNodeExpanded(te.nodePath));let oe=e.rowInfoReducers;if(G){if(Te){let W=ue;e.devToolsDetected&&(W=Date.now());let te=e.aggregationReducers,be=e.lazyLoad?Su({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:te,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?it(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):_r({groupBy:K,pivot:B,reducers:te,marker:i?it(i).track.DataSource.label.Group.start():void 0},Q);e.groupDeepMap=be.deepMap,X&&(X.getConfig=Ze(e));let Re=Object.keys(oe||{}),Pe=ti(oe),We={reducers:oe,results:Pe,reducerKeys:Re,rowInfo:{}},Le=Pe?ze=>{We.rowInfo=ze,ni(We)}:void 0,de=ne?ze=>{ze.isCellSelected=g=>ne.isCellSelected(ze.id,g)}:void 0,tt=Le||de?Mr(Le,de):void 0,Ye=Ru({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:be,lazyLoad:!!e.lazyLoad,reducers:te,toPrimaryKey:p,isRowSelected:ie,rowSelectionState:X,withRowInfo:tt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=Ye.data,e.rowInfoReducerResults=oi({reducers:oe,results:Pe,array:H}),e.groupRowsIndexesInDataArray=Ye.groupRowsIndexes,e.reducerResults=be.reducerResults;let dt=B?xu({deepMap:be.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=dt?.columns,e.pivotColumnGroups=dt?.columnGroups;let gt=Gu(H,l,e.pivotColumns,e.sortTypes);gt!==H&&(H=gt,e.groupRowsIndexesInDataArray=H.map((ze,g)=>ze.isGroupRow?g:-1).filter(ze=>ze>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-W)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ue}else if(le){if(_e){let W=ue;e.devToolsDetected&&(W=Date.now());let te=e.aggregationReducers,be={marker:i?it(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:te},Re=Ar(be,Q);e.treeDeepMap=Re.deepMap,e.treePaths=Re.treePaths;let Pe=e.selectionMode==="multi-row"?Hu(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=Pe;let We=Object.keys(oe||{}),Le=ti(oe),de={reducers:oe,results:Le,reducerKeys:We,rowInfo:{}},tt=Le?I=>{de.rowInfo=I,ni(de)}:void 0,Ye=ne?I=>{I.isCellSelected=z=>ne.isCellSelected(I.id,z)}:void 0,dt=tt||Ye?Mr(tt,Ye):void 0,gt=e.selectionMode==="single-row"?I=>I.id===e.treeSelection:e.selectionMode==="multi-row"?I=>Pe.isNodeSelected(I.nodePath):void 0,ze=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=Iu({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:Re,treeParams:be,dataArray:Q,reducers:te,toPrimaryKey:p,isNodeSelected:gt,isNodeExpanded:ge,treeSelectionState:Pe,withRowInfo:dt,repeatWrappedGroupRows:ze,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=oi({reducers:oe,results:Le,array:H}),e.reducerResults=Re.reducerResults,e.totalLeafNodesCount=Re.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ue,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-W)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||we||xe||Y||Me){let te=Object.keys(oe||{}),be=ti(oe),Re={reducers:oe,results:be,reducerKeys:te,rowInfo:{}};H=Q.map((Pe,We)=>{let Le=og(Pe,Pe?p(Pe):We,We,ie,he,ne);return be&&(Re.rowInfo=Le,ni(Re)),Le}),e.rowInfoReducerResults=oi({reducers:oe,results:be,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ue),e.dataArray=H,e.reducedAt=ue,e.selectionMode==="multi-row")if(G&&e.lazyLoad){i&&(t=it(i).track.DataSource.label.ComputeSelectionCountLazy.start());let W=!0,te=!1;e.dataArray.forEach(be=>{if(!be.isTreeNode&&be.isGroupRow&&be.groupKeys.length===1){let{rowSelected:Re}=be;Re!==!0&&(W=!1),(Re===!0||Re===null)&&(te=!0)}}),e.allRowsSelected=W,e.someRowsSelected=te,i&&(t?.end(),t=void 0)}else{i&&(t=it(i).track.DataSource.label.ComputeSelectionCount.start());let W=e.isTree?e.totalLeafNodesCount:e.filteredCount,te=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=W===te,e.someRowsSelected=te>0,i&&(t?.end(),t=void 0)}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ue,mutations:S?.size?S:void 0,treeMutations:w?.size?w:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?it(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||L||Te||_e?{name:"Performed operations",value:[O?"filter":null,L?"sort":null,Te?"group":null,_e?"tree":null].filter(xn).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(xn)}),e}function Ot(){let o=Ee().performance?.now();return`${Date.now()}:${o}`}var Wu=!0,ag={originalDataArray:!0,changes:!0},lg={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function xt(o,t,e){let n=ii(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=[]),t&&Object.assign(r,t),r.filterValue&&r.filterValue.length){let u=ju(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)&&!ag[u]){let d=u,s=lg[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function Pn(o,t,e,n,i){let r=xt(t,n,i),a=r.append;if(t.lazyLoad){let u=t.originalLazyGroupData,d=[vn,...r.groupKeys||[]],s=u.get(d);if(!s){let c=[...r.groupKeys||[],r.lazyLoadStartIndex];t.lazyLoadCacheOfLoadedBatches.set(c,!0)}if(s&&s.cache&&d.length>1){let c=s.children,f=c.length,m=!0;for(let p=0;p<f;p++)if(c[p]==null){m=!1;break}if(m)return Promise.resolve(!0)}s?s.childrenLoading||(s.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Wu,totalCount:0,totalCountUnfiltered:0}),e.originalLazyGroupDataChangeDetect=Ot()}typeof o=="function"&&(o=o(r));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!0),Promise.resolve(o).then(u=>{let d=[],s=!1;if(Array.isArray(u.data)){let f=u;if(d=f.data,f.livePaginationCursor!==void 0&&(e.livePaginationCursor=f.livePaginationCursor),f.mappings&&(e.pivotMappings=f.mappings),f.totalCountUnfiltered&&(e.unfilteredCount=f.totalCountUnfiltered),t.lazyLoad){let p=function(h,y,C){let b=[vn,...h],S=y.data,w={cache:y.cache??Wu,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??S.length,totalCountUnfiltered:y.totalCount??S.length,children:S,error:y.error},T=[];if(r.lazyLoadBatchSize&&!C){let R=m.get(b),E=!R,N=Yl({children:!0},R||{},w);E&&(N.chidren=[]),N.children.length=N.totalCount;let v=r.lazyLoadStartIndex??0,D=Math.min(y.totalCount??S.length,v+r.lazyLoadBatchSize);for(let M=v;M<D;M++){let A=w.children[M-v];if(!A)throw`lazily loaded item not found at index ${M-v}`;N.children[M]=A,A.dataset&&T.push({keys:A.keys,dataset:A.dataset})}E&&m.set(b,N)}else w.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),w.children.length=w.totalCount,m.set(b,w);let P=!1;if(!h||!h.length){let R=m.get([vn]);e.originalDataArray=[...R.children],P=!0}if(P||(e.originalLazyGroupDataChangeDetect=Ot()),T.length){let R=h;T.forEach(({keys:E,dataset:N})=>{p(E,N,R)})}};var c=p;let m=t.originalLazyGroupData;s=!0,p(r.groupKeys||[],f)}}else d=u;s||(e.originalDataArray=a?t.originalDataArray.concat(d):d),l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!1)})}function ju(o,{filterTypes:t,filterMode:e}){return e==="local"?o:(zr(o,t)||[]).map(n=>{let i={...n};return delete i.valueGetter,i})}function $u(){let o;return(t,e,n)=>{if(o&&o.filterValue===t&&o.filterTypes===e&&o.filterMode===n)return o.result;let i=ju(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 sg=()=>new Promise(o=>{Oe(o)});function Vr(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function Uu(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;return!!t&&!!e&&e>0&&n.has([0])}function qu(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 U,f=["_______xxx______"];for(let h=e;h<=n;h++){let y=u[h];if(!y)continue;let C=d(h),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:f,w=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},P=y.groupKeys,R=c.get(P);if(!R?.[y.id]){let E=!R;R=R||{},R[y.id]||(R[y.id]=T),E&&c.set(P,R)}}if(!C&&i!=null){let T=c.get(S),P=Math.floor(w/i)*i,R=w-P,E=u[y.indexInAll-R].indexInAll,N=d(E),v=u[E].id;if(N||T?.[v])continue;let D=!T;T=T||{};let M={lazyLoadStartIndex:P,lazyLoadBatchSize:i,groupKeys:b,append:s};T[v]||(T[v]=M),D&&c.set(S,T)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,y)=>{let C=[...y.groupKeys,y.lazyLoadStartIndex];if(t&&t.has(C))return h;t?.set(C,!0);let b=[r.data,r,a,y];return h.then(()=>sg()).then(()=>Pn(...b))},m)}var ug=Object.freeze([]),Yu=(o,t)=>{let e=o??ug,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};function ri(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(!ri(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)||!ri(o[i],t[i]))return!1;return!0}return!1}function dg(o,t){return!(o===void 0||t===void 0||o.isGroupRow!==t.isGroupRow||o.dataSourceHasGrouping!==t.dataSourceHasGrouping||o.isTreeNode!==t.isTreeNode||o.isTreeNode&&o.isParentNode!==t.isParentNode)}var ai={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Xu={...ai,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},cg={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},fg={...ai,...cg,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},Zu={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},pg={...ai,...Zu,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},mg={...ai,...Zu,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},hg=Object.entries(Xu).map(([o,t])=>t?o:void 0).filter(Boolean),gg=Object.entries(Xu).map(([o,t])=>t?o:void 0),yg=Object.entries(fg).map(([o,t])=>t?o:void 0),bg=Object.entries(pg).map(([o,t])=>t?o:void 0),Cg=Object.entries(mg).map(([o,t])=>t?o:void 0);function Tg(o,t){if(o===t)return!0;if(!o||!t||!dg(o,t)||o.id!==t.id||o.data!==t.data&&!ri(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?yg:gg:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Cg:bg:e=hg;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!ri(i,r))return!1}return!0}function Ju(){let o=[],t=new Map,e=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},i=(f,m)=>{let p=o,h=m?.marker,C=f!==p&&e.size>0;C&&(n={dataSourceState:m?.dataSourceState,previousDataSourceState:m?.previousDataSourceState}),h&&h.start({details:[{name:"new dataArray length",value:f.length},{name:"old dataArray length",value:p.length}]});let b=[],S=l();for(let w of S){let T=p[w],P=f[w];if(P===void 0){b.push(w);continue}Tg(T,P)||b.push(w)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let w=0,T=b.length;w<T;w++){let P=b[w],R=t.get(P);if(R)for(let E of R)E()}if(C)for(let w of Array.from(e))w()}),h&&h.end({details:[{name:"updated row infos",value:b.length}]})},r=f=>o[f],a=(f,m)=>{let p=t.get(f);return p||(p=new Set,t.set(f,p)),p.add(m),()=>{let h=t.get(f);h&&(h.delete(m),h.size===0&&t.delete(f))}},l=()=>Array.from(t.keys());return{notifyDataArray:i,getRowInfoAtIndex:r,subscribeToRowIndex:a,subscribeToDataArrayChange:f=>(e.add(f),()=>{e.delete(f),e.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],t.clear(),e.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Gr=new Map,Kr=new Map;var Br="DebugID=";function Dn(o,t){return t&&t.startsWith(Br)?t:t?`${Br}${o}:${t}`:`${Br}${o}`}var Sg=Symbol("cursorId"),Qu=o=>o.totalLeafNodesCount===0,wg=o=>o.isParentNode?!Qu(o):!0;function ed(o){let t=Date.now(),e=[],n=[],i=new U;return{logger:Gt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Ju(),indexer:new Yo,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 U,waitForNodePathPromises:new U,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new U,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:Sg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function vg(o){let t={...o};return delete t.originalDataArray,t}var Ig=[],td=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()},nd=(o,t)=>({onDataParamsChange:e=>e?al(e,100,vg):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??Qu,isNodeSelectable:e=>e??wg,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,filterDelay:e=>e??200,filterTypes:e=>({...qn,...e}),sortTypes:e=>({...Bt,...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 lt)return e;let n=o.propsCache.get("rowDisabledState")??pt,i=n.get(e);return i||(i=new lt(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=>Yu(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Ig});function Rg(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var pt=new WeakMap;function xg(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 Pg={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Hu(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.
|
|
13
|
+
`)});function Wu(o){let{dataArray:t,treeFilterFunction:e,toPrimaryKey:n,getNodeChildren:i,isLeafNode:r,nodesKey:a}=o,l=[],u=d=>{let s=i(d);if(r(d)||!Array.isArray(s))return d;let c=Wu({...o,dataArray:s});return c.length===0?!1:(d={...d,[a]:c},d)};for(let d=0,s=t.length;d<s;d++){let c=t[d],f=i(c),m=e({data:c,index:d,dataArray:t,primaryKey:n(c,d),filterTreeNode:u});m&&(m===!0?m=c:typeof m=="object"&&m===c&&f!==i(m)&&ug(),l.push(m))}return l}function dg(o){let{filterTypes:t,marker:e,operatorsByFilterType:n,filterFunction:i,toPrimaryKey:r,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}=o,{dataArray:s}=o;e?.start({details:[{name:"Count before",value:s.length}]}),i&&(s=s.filter((f,m,p)=>i({data:f,index:m,dataArray:p,primaryKey:r(f,m)}))),a&&(s=Wu({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:u,isLeafNode:d}));let c=Gr(o.filterValue,t)||[];if(c&&c.length){let f=s.filter((m,p,h)=>{let y={data:m,index:p,dataArray:h,primaryKey:r(m,p),field:void 0};for(let C=0,b=c.length;C<b;C++){let S=c[C],{disabled:w,field:T,valueGetter:P,filter:{type:R,value:E,operator:N}}=S,v=t[R];if(w||!v)continue;let D=n[R]?.[N];if(!D)continue;let A=P||v.valueGetter||(({data:F,field:_})=>_?F[_]:F);y.field=T;let x=y;if(x.filterValue=E,x.currentValue=A(x),x.emptyValues=v.emptyValues,!D.fn(x))return!1}return!0});return e?.end({details:[{name:"Count after",value:f.length}]}),f}return e?.end({details:[{name:"Count after",value:s.length}]}),s}function ju(o){let t,{state:e,previousState:n}=o,i=e.debugId,r;i&&(r=it(i).track.DataSource.label.PrepareData.start());let a=zu(e),l=ri(e.sortInfo,e.groupBy),u=e.sortMode,d=l?.length?u==="local":!1;(e.lazyLoad||e.livePagination)&&(d=!1);let s=Rt(n,e,["refetchKey"]),c=Rt(n,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&s&&(c=!0),!1&&(e.originalLazyGroupData=new $,c=!0);let m=e.cache?ln.clone(e.cache):void 0;m&&!m.isEmpty()&&(c=!0);let p=e.toPrimaryKey,h=e.nodesKey,y=e.isTree,C=h?W=>W[h]:void 0,b=h?W=>W[h]===void 0:void 0,S,w;c&&(e.indexer.clear(),e.lazyLoad||(S=m?.getMutations(),w=m?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:p,cache:m,getNodeChildren:C,isLeafNode:b,nodesKey:h}),y&&e.waitForNodePathPromises.visit(({value:W},ie)=>{W&&e.indexer.getDataForNodePath(ie)!==void 0&&W.resolve(!0)}))),m&&(m.clear(),e.cache=void 0);let{filterFunction:P,treeFilterFunction:R,filterValue:E,filterTypes:N,operatorsByFilterType:v}=e,D=!!P||!!R||Array.isArray(E)&&E.length,M=D&&e.filterMode==="local",A=Rt(n,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=c||A,F=Rt(n,e,["sortInfo"]),_=c||A||F,O=e.filterMode==="local"&&(x||!e.lastFilterDataArray),L=d&&(_||!e.lastSortDataArray||a.sortInfo),K=e.groupBy,B=e.pivotBy,G=!y&&(K.length>0||!!B),le=y,Z=Rt(n,e,["rowDisabledState","isRowDisabled"]),Pe=Rt(n,e,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),me=Rt(n,e,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ve=c||_||Rt(n,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),Ne=c||_||Rt(n,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Me=Rt(n,e,["rowInfoReducers"]),Ce=G&&(ve||!e.lastGroupDataArray||a.groupBy)||Pe||Z||Me,_e=le&&(Ne||a.tree||!e.lastTreeDataArray)||me||Z||Me,ue=Date.now(),Q=e.originalDataArray;if(le&&_e){let W={marker:i?it(i).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p};e.unfilteredTreePaths=or(W,Q).treePaths}if(D||(e.unfilteredCount=Q.length),M){e.unfilteredCount=Q.length;let W=ue;O?(e.devToolsDetected&&(W=Date.now()),Q=dg({marker:i?it(i).track.DataSource.label.Filter.start():void 0,getNodeChildren:C,isLeafNode:b,nodesKey:h,treeFilterFunction:R,dataArray:Q,toPrimaryKey:p,filterTypes:N,operatorsByFilterType:v,filterFunction:P,filterValue:E}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-W)):Q=e.lastFilterDataArray,e.lastFilterDataArray=Q,e.filteredAt=ue}if(e.filteredCount=Q.length,e.postFilterDataArray=Q,d){let W=Yt.knownTypes;if(Yt.knownTypes={...W,...e.sortTypes},L){let ie=ue;if(e.devToolsDetected&&(ie=Date.now()),i&&(t=it(i).track.DataSource.label.Sort.start({details:[{name:"Count",value:Q.length}]})),e.sortFunction?(Q=e.sortFunction(l,[...Q]),t&&(t.end(),t=void 0)):y?Q=Nu(l,Q,{marker:t,inplace:!1,isLeafNode:b,getNodeChildren:C,toKey:p,nodesKey:h}):Q=Yt(l,[...Q],{marker:t}),i&&(t?.end(),t=void 0),e.devToolsDetected){let Te=Date.now()-ie;e.debugTimings.set("sort",Te)}}else Q=e.lastSortDataArray;Yt.knownTypes=W,e.lastSortDataArray=Q,e.sortedAt=ue}e.postSortDataArray=Q;let H=e.dataArray,q=e.rowSelection instanceof De?e.rowSelection:void 0,X=e.treeExpandState instanceof Qe?e.treeExpandState:void 0,te=e.cellSelection instanceof Ge?e.cellSelection:void 0;q&&(q.getConfig=Ye(e)),q?.xcache();let oe=e.selectionMode==="single-row"?W=>W.id===e.rowSelection:e.selectionMode==="multi-row"?W=>{let ie=q;return W.isGroupRow?ie.getGroupRowSelectionState(W.groupKeys):ie.isRowSelected(W.id,W.dataSourceHasGrouping?W.groupKeys:void 0)}:void 0,he=e.isRowDisabled||Vr;e.isRowSelected&&e.selectionMode==="multi-row"&&(oe=W=>e.isRowSelected(W,q,e.selectionMode));let ge;e.isNodeExpanded&&(ge=W=>e.isNodeExpanded(W,X)),e.isNodeCollapsed&&(ge=W=>!e.isNodeExpanded(W,X)),ge||(ge=ie=>X.isNodeExpanded(ie.nodePath));let ne=e.rowInfoReducers;if(G){if(Ce){let W=ue;e.devToolsDetected&&(W=Date.now());let ie=e.aggregationReducers,Te=e.lazyLoad?dl({groupBy:K,pivot:B,mappings:e.pivotMappings,reducers:ie,indexer:e.indexer,toPrimaryKey:p,cache:m,marker:i?it(i).track.DataSource.label.LazyGroup.start():void 0},e.originalLazyGroupData):ir({groupBy:K,pivot:B,reducers:ie,marker:i?it(i).track.DataSource.label.Group.start():void 0},Q);e.groupDeepMap=Te.deepMap,q&&(q.getConfig=Ye(e));let Ie=Object.keys(ne||{}),Se=ni(ne),We={reducers:ne,results:Se,reducerKeys:Ie,rowInfo:{}},Le=Se?ze=>{We.rowInfo=ze,oi(We)}:void 0,de=te?ze=>{ze.isCellSelected=g=>te.isCellSelected(ze.id,g)}:void 0,tt=Le||de?Er(Le,de):void 0,Ze=ml({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,groupResult:Te,lazyLoad:!!e.lazyLoad,reducers:ie,toPrimaryKey:p,isRowSelected:oe,rowSelectionState:q,withRowInfo:tt,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});H=Ze.data,e.rowInfoReducerResults=ii({reducers:ne,results:Se,array:H}),e.groupRowsIndexesInDataArray=Ze.groupRowsIndexes,e.reducerResults=Te.reducerResults;let dt=B?Au({deepMap:Te.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=dt?.columns,e.pivotColumnGroups=dt?.columnGroups;let gt=Hu(H,l,e.pivotColumns,e.sortTypes);gt!==H&&(H=gt,e.groupRowsIndexesInDataArray=H.map((ze,g)=>ze.isGroupRow?g:-1).filter(ze=>ze>=0)),e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-W)}else H=e.lastGroupDataArray;e.lastGroupDataArray=H,e.groupedAt=ue}else if(le){if(_e){let W=ue;e.devToolsDetected&&(W=Date.now());let ie=e.aggregationReducers,Te={marker:i?it(i).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:C,toKey:p,reducers:ie},Ie=or(Te,Q);e.treeDeepMap=Ie.deepMap,e.treePaths=Ie.treePaths;let Se=e.selectionMode==="multi-row"?$u(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=Se;let We=Object.keys(ne||{}),Le=ni(ne),de={reducers:ne,results:Le,reducerKeys:We,rowInfo:{}},tt=Le?I=>{de.rowInfo=I,oi(de)}:void 0,Ze=te?I=>{I.isCellSelected=z=>te.isCellSelected(I.id,z)}:void 0,dt=tt||Ze?Er(tt,Ze):void 0,gt=e.selectionMode==="single-row"?I=>I.id===e.treeSelection:e.selectionMode==="multi-row"?I=>Se.isNodeSelected(I.nodePath):void 0,ze=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;H=pl({marker:i?it(i).track.DataSource.label.FlattenTree.start():void 0,treeResult:Ie,treeParams:Te,dataArray:Q,reducers:ie,toPrimaryKey:p,isNodeSelected:gt,isNodeExpanded:ge,treeSelectionState:Se,withRowInfo:dt,repeatWrappedGroupRows:ze,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=ii({reducers:ne,results:Le,array:H}),e.reducerResults=Ie.reducerResults,e.totalLeafNodesCount=Ie.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=ue,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-W)}else H=e.lastTreeDataArray;e.lastTreeDataArray=H}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=e.postSortDataArray||ve||Pe||Z||Me){let ie=Object.keys(ne||{}),Te=ni(ne),Ie={reducers:ne,results:Te,reducerKeys:ie,rowInfo:{}};H=Q.map((Se,We)=>{let Le=sg(Se,Se?p(Se):We,We,oe,he,te);return Te&&(Ie.rowInfo=Le,oi(Ie)),Le}),e.rowInfoReducerResults=ii({reducers:ne,results:Te,array:H})}if(e.postGroupDataArray=H,H!==e.dataArray&&(e.updatedAt=ue),e.dataArray=H,e.reducedAt=ue,e.selectionMode==="multi-row")if(G&&e.lazyLoad){i&&(t=it(i).track.DataSource.label.ComputeSelectionCountLazy.start());let W=!0,ie=!1;e.dataArray.forEach(Ie=>{if(!Ie.isTreeNode&&Ie.isGroupRow&&Ie.groupKeys.length===1){let{rowSelected:Se}=Ie;Se!==!0&&(W=!1),(Se===!0||Se===null)&&(ie=!0)}});let{rowSelection:Te}=e;Te instanceof De&&Te.getLazyHiddenRowsCount([])&&(Te.defaultSelection?ie=!0:W=!1),e.allRowsSelected=W,e.someRowsSelected=ie,i&&(t?.end(),t=void 0)}else{i&&(t=it(i).track.DataSource.label.ComputeSelectionCount.start());let W=e.isTree?e.treeSelectionState?.getSelectionCountFor([]):e.rowSelection.getSelectionCountFor([]);W?(e.allRowsSelected=W.deselectedCount===0,e.someRowsSelected=W.selectedCount>0):(e.allRowsSelected=e.totalLeafNodesCount===0,e.someRowsSelected=!1),i&&(t?.end(),t=void 0)}return e.originalDataArrayChanged=c,c&&(e.originalDataArrayChangedInfo={timestamp:ue,mutations:S?.size?S:void 0,treeMutations:w?.size?w:void 0}),e.rowInfoStore.notifyDataArray(H,{marker:i?it(i).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:e,previousDataSourceState:n}),r&&r?.track.DataSource.label.PrepareData.end({details:[O||L||Ce||_e?{name:"Performed operations",value:[O?"filter":null,L?"sort":null,Ce?"group":null,_e?"tree":null].filter(xn).join(", ")}:null,s?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${e.refetchKey}`}:null,c?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:e.originalDataArray.length}].filter(xn)}),e}function Ot(){let o=Ee().performance?.now();return`${Date.now()}:${o}`}var Uu=!0,cg={originalDataArray:!0,changes:!0},fg={filterValue:(o,t)=>JSON.stringify(o)===JSON.stringify(t),groupRowsState:(o,t)=>JSON.stringify(o)===JSON.stringify(t)};function xt(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)&&!cg[u]){let d=u,s=fg[d],c=r[d],f=l[d];(s?s(c,f):c===f)||(a[d]=!0)}return r.changes=a,r}function Pn(o,t,e,n,i){let r=xt(t,n,i),a=r.append;if(t.lazyLoad){let u=t.originalLazyGroupData,d=[$t,...r.groupKeys||[]],s=u.get(d);if(!s){let c=[...r.groupKeys||[],r.lazyLoadStartIndex];t.lazyLoadCacheOfLoadedBatches.set(c,!0)}if(s&&s.cache&&d.length>1){let c=s.children,f=c.length,m=!0;for(let p=0;p<f;p++)if(c[p]==null){m=!1;break}if(m)return Promise.resolve(!0)}s?s.childrenLoading||(s.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Uu,totalCount:0}),e.originalLazyGroupDataChangeDetect=Ot()}typeof o=="function"&&(o=o(r));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!0),Promise.resolve(o).then(u=>{let d=[],s=!1;if(Array.isArray(u.data)){let f=u;if(d=f.data,f.livePaginationCursor!==void 0&&(e.livePaginationCursor=f.livePaginationCursor),f.mappings&&(e.pivotMappings=f.mappings),f.totalCountUnfiltered&&(e.unfilteredCount=f.totalCountUnfiltered),t.lazyLoad){let p=function(h,y,C){let b=[$t,...h],S=y.data,w={cache:y.cache??Uu,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??S.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:S,error:y.error},T=[];if(r.lazyLoadBatchSize&&!C){let R=m.get(b),E=!R,N=rs({children:!0},R||{},w);E&&(N.chidren=[]),N.children.length=N.totalCount;let v=r.lazyLoadStartIndex??0,D=Math.min(y.totalCount??S.length,v+r.lazyLoadBatchSize);for(let M=v;M<D;M++){let A=w.children[M-v];if(!A)throw`lazily loaded item not found at index ${M-v}`;N.children[M]=A,A.dataset&&T.push({keys:A.keys,dataset:A.dataset})}E&&m.set(b,N)}else w.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),w.children.length=w.totalCount,m.set(b,w);let P=!1;if(!h||!h.length){let R=m.get([$t]);e.originalDataArray=[...R.children],P=!0}if(P||(e.originalLazyGroupDataChangeDetect=Ot()),T.length){let R=h;T.forEach(({keys:E,dataset:N})=>{p(E,N,R)})}};var c=p;let m=t.originalLazyGroupData;s=!0,p(r.groupKeys||[],f)}}else d=u;s||(e.originalDataArray=a?t.originalDataArray.concat(d):d),l&&(!t.lazyLoad||t.lazyLoad&&!a)&&(e.loading=!1)})}function qu(o,{filterTypes:t,filterMode:e}){return e==="local"?o:(Gr(o,t)||[]).map(n=>{let i={...n};return delete i.valueGetter,i})}function Yu(){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 pg=()=>new Promise(o=>{Oe(o)});function Kr(o,t){let e=!!o,{stateReadyAsDetails:n}=t(),i=e&&o.shouldRestoreState?n:!0;return{isDetail:e,isDetailReady:i}}function Zu(o){let{lazyLoad:t,lazyLoadBatchSize:e,lazyLoadCacheOfLoadedBatches:n}=o;return!!t&&!!e&&e>0&&n.has([0])}function Xu(o,t){let{startIndex:e,endIndex:n,lazyLoadBatchSize:i,componentState:r,componentActions:a,dismissLoadedRows:l}=o,{dataArray:u}=r,d=l?()=>!1:h=>u[h].data!=null,s=!l,c=new $,f=["_______xxx______"];for(let h=e;h<=n;h++){let y=u[h];if(!y)continue;let C=d(h),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let S=b.length?b:f,w=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:i,groupKeys:y.groupKeys,append:s},P=y.groupKeys,R=c.get(P);if(!R?.[y.id]){let E=!R;R=R||{},R[y.id]||(R[y.id]=T),E&&c.set(P,R)}}if(!C&&i!=null){let T=c.get(S),P=Math.floor(w/i)*i,R=w-P,E=u[y.indexInAll-R].indexInAll,N=d(E),v=u[E].id;if(N||T?.[v])continue;let D=!T;T=T||{};let M={lazyLoadStartIndex:P,lazyLoadBatchSize:i,groupKeys:b,append:s};T[v]||(T[v]=M),D&&c.set(S,T)}}let m=Promise.resolve(!0),p=[];c.topDownValues().forEach(h=>{p.push(...Object.values(h))}),p.reduce((h,y)=>{let C=[...y.groupKeys,y.lazyLoadStartIndex];if(t&&t.has(C))return h;t?.set(C,!0);let b=[r.data,r,a,y];return h.then(()=>pg()).then(()=>Pn(...b))},m)}var mg=Object.freeze([]),Ju=(o,t)=>{let e=o??mg,n=Array.isArray(e)?e:[e];if(t&&t.has(e)){let i=t.get(e);if(i&&i.length===n.length)return i}return t&&e&&t.set(e,n),n};function ai(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(!ai(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)||!ai(o[i],t[i]))return!1;return!0}return!1}function hg(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 li={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Qu={...li,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},gg={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},yg={...li,...gg,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},ed={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},bg={...li,...ed,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Cg={...li,...ed,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Tg=Object.entries(Qu).map(([o,t])=>t?o:void 0).filter(Boolean),Sg=Object.entries(Qu).map(([o,t])=>t?o:void 0),wg=Object.entries(yg).map(([o,t])=>t?o:void 0),vg=Object.entries(bg).map(([o,t])=>t?o:void 0),Ig=Object.entries(Cg).map(([o,t])=>t?o:void 0);function Rg(o,t){if(o===t)return!0;if(!o||!t||!hg(o,t)||o.id!==t.id||o.data!==t.data&&!ai(o.data,t.data))return!1;let e=[];o.dataSourceHasGrouping?e=o.isGroupRow?wg:Sg:o.isTreeNode?e=o.isTreeNode&&o.isParentNode?Ig:vg:e=Tg;for(let n of e){let i=o[n],r=t[n];if(!(typeof i=="function"||typeof r=="function")&&!ai(i,r))return!1}return!0}function td(){let o=[],t=new Map,e=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},i=(f,m)=>{let p=o,h=m?.marker,C=f!==p&&e.size>0;C&&(n={dataSourceState:m?.dataSourceState,previousDataSourceState:m?.previousDataSourceState}),h&&h.start({details:[{name:"new dataArray length",value:f.length},{name:"old dataArray length",value:p.length}]});let b=[],S=l();for(let w of S){let T=p[w],P=f[w];if(P===void 0){b.push(w);continue}Rg(T,P)||b.push(w)}o=f,(b.length>0||C)&&queueMicrotask(()=>{for(let w=0,T=b.length;w<T;w++){let P=b[w],R=t.get(P);if(R)for(let E of R)E()}if(C)for(let w of Array.from(e))w()}),h&&h.end({details:[{name:"updated row infos",value:b.length}]})},r=f=>o[f],a=(f,m)=>{let p=t.get(f);return p||(p=new Set,t.set(f,p)),p.add(m),()=>{let h=t.get(f);h&&(h.delete(m),h.size===0&&t.delete(f))}},l=()=>Array.from(t.keys());return{notifyDataArray:i,getRowInfoAtIndex:r,subscribeToRowIndex:a,subscribeToDataArrayChange:f=>(e.add(f),()=>{e.delete(f),e.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],t.clear(),e.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Br=new Map,Hr=new Map;var Wr="DebugID=";function Dn(o,t){return t&&t.startsWith(Wr)?t:t?`${Wr}${o}:${t}`:`${Wr}${o}`}var xg=Symbol("cursorId"),nd=o=>o.totalLeafNodesCount===0,Pg=o=>o.isParentNode?!nd(o):!0;function od(o){let t=Date.now(),e=[],n=[],i=new $;return{logger:Kt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:td(),indexer:new Jo,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new $,waitForNodePathPromises:new $,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new $,dataParams:void 0,onCleanup:pe(),notifyScrollbarsChange:pe(),notifyScrollStop:pe(),notifyRenderRangeChange:pe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:i,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:xg,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt:t,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:t,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function Dg(o){let t={...o};return delete t.originalDataArray,t}var Ag=[],id=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()},rd=(o,t)=>({onDataParamsChange:e=>e?gl(e,100,Dg):void 0,lazyLoad:e=>!!e,isNodeReadOnly:e=>e??nd,isNodeSelectable:e=>e??Pg,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=>({...Yn,...e}),sortTypes:e=>({...Ht,...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 lt)return e;let n=o.propsCache.get("rowDisabledState")??pt,i=n.get(e);return i||(i=new lt(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=>Ju(e,o.propsCache.get("sortInfo")),groupBy:e=>e??Ag});function _g(o,t){return typeof o=="function"?o({array:t.originalDataArray,length:t.originalDataArray.length,lastItem:t.originalDataArray[t.originalDataArray.length-1]}):o}var pt=new WeakMap;function Mg(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 Eg={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function $u(o,t,e){if(t!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${t}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
`);let n=In(e);if(o instanceof Ue)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??
|
|
16
|
+
`);let n=In(e);if(o instanceof Ue)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let i=o??Eg,r=pt.get(i);return r&&r.setConfig(n),r=r??new Ue(i,n),pt.set(i,r),r}function ad(o){let{props:t,state:e,oldState:n}=o,i=!!e.nodesKey,r=Vn(t.sortInfo),a=Vn(t.filterValue),{filterTypes:l}=e,u=Object.keys(l).reduce((x,F)=>{let _=l[F].operators;x[F]=x[F]||{};let O=x[F];return _.forEach(L=>{O[L.name]=L}),x},{}),d=t,s=t.selectionMode;if(s===void 0)if(t.cellSelection!==void 0||t.defaultCellSelection!==void 0)s="multi-cell";else{let x=t.rowSelection!==void 0?t.rowSelection:t.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?s="multi-row":s="single-row"),!s){let F=d.treeSelection??d.defaultTreeSelection;F!==void 0&&(s=typeof F=="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},Ye(e)):s==="single-row"||m instanceof De?c=m:c=new De(m,Ye(e))),s==="single-cell"||s==="multi-cell"))if(p===null)f=s==="single-cell"?null:new Ge;else if(p instanceof Ge)f=p;else{let x=pt.get(p)??new Ge(p);pt.set(p,x),f=x}let h=e.primaryKey,y=typeof h=="function"?x=>h(x):x=>x[h],C=d.treeExpandState||e.treeExpandState||d.defaultTreeExpandState;if(C&&!(C instanceof Qe)){let x=pt.get(C)??new Qe(C);pt.set(C,x),C=x}C=C||new Qe({defaultExpanded:!0,collapsedPaths:[]});let b=t.groupRowsState||e.groupRowsState||t.defaultGroupRowsState;if(b&&!(b instanceof ft)){let x=pt.get(b)??new ft(b);pt.set(b,x),b=x}b=b||new ft(e.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=Mg(t.shouldReloadData||{}),w=t.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=t.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,P=t.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;t.groupMode&&hn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",e.logger),t.sortMode&&hn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",e.logger),t.filterMode&&hn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",e.logger);let R=typeof t.data=="function"?w??"local":"local",E=t.sortFunction?"local":T??(r?"remote":"local"),N=typeof t.filterFunction=="function"||typeof t.treeFilterFunction=="function"?"local":P??(typeof t.data=="function"?"remote":"local"),v=S.pivotBy?"remote":"local",D=e.rowDisabledState,M=t.isRowDisabled;if(!M&&D){let x=pt.get(D);x?M=x:(M=F=>D.isRowDisabled(F.id),pt.set(D,M))}let A={debugId:e.debugId??t.debugId,isTree:i,selectionMode:s,groupRowsState:b,treeExpandState:C,treeExpandMode:C.mode,shouldReloadData:{filterValue:S?.filterValue??N==="remote",sortInfo:S?.sortInfo??E==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??v==="remote"},isRowDisabled:M,rowSelection:c,cellSelection:f,groupMode:R,sortMode:E,filterMode:N,pivotMode:v,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 x=!n||n.originalDataArray!==e.originalDataArray,F=typeof t.livePaginationCursor=="function"?x?_g(t.livePaginationCursor,e):e.livePaginationCursor:t.livePaginationCursor;A.livePaginationCursor=F}if(e.devToolsDetected&&e.debugId){let x=Hr.get(e.debugId);x&&(A={...A,...x})}return A}var Fg=Kt("DataSource:fullLazyLoad");function ld(o,t,e){let{name:n,newValue:i}=o;n==="data"&&typeof i=="function"&&!t.groupRowsState&&(t.lazyLoad&&Fg('"data" function prop has changed'),t.collapseGroupRowsOnDataFunctionChange!==!1&&(e.groupRowsState=new ft({collapsedRows:!0,expandedRows:[]})))}function sd(){return{rowSelection:(o,t)=>t.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,t)=>{if(t.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let e=t.__apiRef.current,n=e.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:t.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:t.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:t.unfilteredTreePaths,dataSourceApi:e,treeApi:n}]}},treeExpandState:(o,t)=>({callbackParams:[o.getState(),{nodeState:t.lastExpandStateInfoRef.current.state,nodePath:t.lastExpandStateInfoRef.current.nodePath,dataSourceApi:t.__apiRef.current}]}),cellSelection:(o,t)=>t.selectionMode==="single-cell"?{callbackParams:[o instanceof Ge?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function ud(){return{sortInfo:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{sortInfo:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Oe(()=>{t.livePaginationCursor=null})},groupBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{groupBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Oe(()=>{t.livePaginationCursor=null})},pivotBy:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{pivotBy:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Oe(()=>{t.livePaginationCursor=null})},filterValue:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{filterValue:o,livePaginationCursor:null},n());t.dataParams=i,e.livePagination&&Oe(()=>{t.livePaginationCursor=null})},cursorId:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{__cursorId:o},n());t.dataParams=i},livePaginationCursor:(o,{actions:t,state:e})=>{let n=e.getDataSourceMasterContextRef.current,i=xt(e,{livePaginationCursor:o},n());t.dataParams=i},dataParams:(o,{state:t})=>Wt(o,t.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Kt(Dn(t.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function dd(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function Ng(o,t,e){return t=t.replaceAll("$ERR_CODE",o),t=`${t}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:t,type:e??"error"}}function cd(o){return Object.entries(o).reduce((t,[e,n])=>{let i=e,r=Ng(i,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return t[i]=r,t},{})}function Og(o){return{message:o.join(""),type:"warning"}}function kg(o){return{message:o.join(""),type:"error"}}var Lg=cd({DS001:Og`The "data" prop of your DataSource seems to be updating too frequently.
|
|
21
|
+
Make sure you don't pass a new reference on every render.`}),zg=cd({CSS001_CSS:kg`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),fd={...Lg,...zg};var pd=new Map;var Vg=o=>{let t=o.type==="error"?Bt(o.debugId):Kt(o.debugId),e=o.type==="error"?al:hn,n=o.debugId?`${o.code}-${o.debugId}`:o.code,i=o.message;o.debugId&&(i=`${i}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},Hr=o=>{let{debugId:t,key:e}=o,n=ud[e];if(n&&(Ng({...n,debugId:t}),t&&e)){let i=dd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),Og(t))}};globalThis.logDevToolsWarning=Hr;var Og=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=dd.get(o);e&&t(o,e)};import{inject as kg,provide as Lg}from"vue";var cd=Symbol("DataSourceMasterDetail");function fd(o){Lg(cd,o)}var zg=()=>{};function Wr(){return kg(cd,zg)}var jr=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","sortMode","filterMode","groupMode","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],uo=Symbol("DataSource");function co(){return Gg(uo)}var{useManagedComponent:Hg}=fn({debugName:"DataSource",initSetupState:ed,forwardProps:nd,concludeReducer:Bu,mapPropsToState:od,onPropChange:id,cleanup:td,interceptActions:ad(),mappedCallbacks:rd()});function ui(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};si(()=>i(o())),An(o,i,{flush:"post"})}function Wg(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;ui(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new U});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||qu({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:Zt(a,{wait:s})}),l.fn},d=null;ui(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,a(m)}))}),An(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),li(()=>{d?.(),d=null})}function jg(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=Bg({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});li(()=>{a()});let l=null;An(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;An(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),An(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),li(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=$u(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:S,cursorId:w}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:S?w:null}},f={current:!1};Wg({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];ui(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=Vr(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&Hr({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&Pn(p.data,p,n,void 0,h)}),ui(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){if(y=!!p.cursorId,p.filterValue&&e().filterMode==="local")return;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:S}=Vr(C,e);if(b&&!S)return;let w=e();if(typeof w.data=="function"){if(f.current&&!y&&Uu(w))return;Pn(w.data,w,n,{append:y},C)}}),si(()=>{let p=e(),h=xt(p,void 0,i());n.dataParams=h})}function $g(o){let t=Wr(),e=!!t(),{contextValue:n}=Hg(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Nu({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return Kg(uo,u),si(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),jg({state:i,getDataSourceState:a,dataSourceActions:r}),An(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),si(()=>{i.value.onReady?.(l)}),li(()=>{let d=a();d.onCleanup(d)}),u}var $r=Vg({name:"DataSource",props:[...jr],setup(o,{slots:t}){let e=$g(o);return()=>t.default?.(e.state.value)??null}});import{computed as AC,defineComponent as _C,h as qe,inject as MC,onBeforeUnmount as Ma,onMounted as EC,provide as Sp,ref as FC,shallowRef as NC,watch as He,watchEffect as OC}from"vue";import{computed as Ug}from"vue";function kt(o,t,e){let n=null,i;return Ug(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var _n=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?Zt(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var ci=class ci{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??ci.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};ci.DEFAULT_SIZE=10;var di=ci;var Ur=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},fi=class{constructor(t){this.storage=new di(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},qr=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},pi=class{constructor(t){this.cacheStorage=t===!1?new Ur:t===!0?new qr:typeof t=="number"?new fi(t):new fi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var st=class extends Rn{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var pd=zn(Sn());var Yr=(o,t)=>o-t,Lt={horizontal:!0,vertical:!0};function mi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var hi={start:0,end:0},Xr=o=>{o()},Zr=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},md=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function qg(o){return o.horizontalChange||o.verticalChange}var an=class extends et{constructor(e){let n=Dn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=hi;this.verticalExtendRangeBy=hi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{fo(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?Xr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?Xr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Lt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Lt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=Lt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,pd.default)(a,e,Yr);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Zr;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Lt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,S=l!=null,w=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let P=e.rowspan!=null,R=e.colspan!=null,E=P&&e.rowspan!=this.rowspan,N=R&&e.colspan!=this.colspan;E&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let v=C||T||f||N,D=y||w||m||E;(n||qg)({horizontalChange:v,verticalChange:D,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:w,heightChanged:m,rowspanChanged:E})&&this.updateRenderCount({horizontal:v,vertical:D})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Lt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Lt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?Xr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=mi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{fo(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=hi,this.verticalExtendRangeBy=hi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Yg={scrollLeft:0,scrollTop:0},po=class{constructor(){this.scrollPosition=Yg;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:Xg}=ke,mt=`${Xg}ColumnCell`;function hd(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}import{h as Zg}from"vue";function gd(o){return(t,e)=>Zg(o,{key:t.id,rowInfo:t,cache:e})}var mo=class extends an{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=mi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,S=C&&r!==this.rowHeight,w=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||f,P=y||w||c||T;(P||T)&&this.updateRenderCount({horizontal:P,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Lt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Oe(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Jr=zn(Sn());function yd(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function bd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function ho(o,t){for(let e of o)if(t(e))return e}var gi=(o,t)=>o-t,yi=class extends et{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new U;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=ho(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=ho(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(gi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(gi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,Jr.default)(n,e,gi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,Jr.default)(n,e,gi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return ho(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return ho(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var Cd=zn(Sn());var bi=class extends et{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,Cd.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Td=!0,ln=$(j.y),Sd=$(j.scrollTop),i1=$(j.columnOffsetAtIndex),Qr=$(j.columnOffsetAtIndexWhileReordering),Mn=class extends et{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(ln,r?`calc( ${i}px + var(${Sd}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${ln}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=Ce.columnOffsets.get(i),c=`${Qr}-${i}`,f=u?`calc( ${a}px + var(${Sd}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(ln,f));let m=`translate3d(var(${c}, ${s}), var(${ln}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Oe(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Td){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,Td&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(x=>{let F=r.getRowIndex(x);if(F!=null){let _=this.brain.getItemOffsetFor(F,"vertical");if(_==null)return;let O=x.getElement();if(!O)return;this.setDetailTransform(O,F,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&hs(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[S,w]=y;function T(x,F,_){let O=i.getCellAt([x,F]);if(O==null)return;let L=n.getCellOffset(x,F),K=O.getElement();K&&L&&_(x,F,K,L)}let P=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,y:L,scrollLeft:!0},u-F)},R=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:O.y,scrollTop:!0},s-x)},E=(x,F,_,{y:O})=>{let L=m[F];this.setTransform(_,x,F,{x:L,y:O,scrollLeft:!0},a-F)},N=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:p[x],scrollTop:!0},l-x)},v=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:L,scrollTop:!0},1e5)},D=(x,F,_,{x:O})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:p[x],scrollTop:!0},2e5)},M=(x,F,_,O)=>{this.setTransform(_,x,F,{x:m[F],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(x,F,_)=>{this.setTransform(_,x,F,{x:m[F],y:p[x],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let x=C;x<S;x++){for(let F=0;F<u;F++)T(x,F,P);if(d){let F=a-d;for(let _=F;_<a;_++)T(x,_,E)}}if(s||c)for(let x=b;x<w;x++){for(let F=0;F<s;F++)T(F,x,R);if(c){let F=l-c;for(let _=F;_<l;_++)T(_,x,N)}}if(u&&s)for(let x=0;x<s;x++)for(let F=0;F<u;F++)T(x,F,v);if(u&&c){let x=l-c;for(let F=x;F<l;F++)for(let _=0;_<u;_++)T(F,_,D)}if(d&&s){let x=a-d;for(let F=0;F<s;F++)for(let _=x;_<a;_++)T(F,_,M)}if(d&&c){let x=l-c,F=a-d;for(let _=x;_<l;_++)for(let O=F;O<a;O++)T(_,O,A)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new yi(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new bi(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Oe(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=pr(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let v=e.start[1],D=e.end[1];p.forEach(M=>{v<=M&&M<D||m.push({start:[e.start[0],M],end:[e.end[0],M+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([v,D])=>{h.set(`${v}:${D}`,!0)});let C=m.reduce((v,D)=>v+Zr(D),0),b=i?m.reduce((v,D)=>v+md(D),0):0,S=this.brain.getRowCount(),w=this.brain.getColCount();c.detachCellsStartingAt([S,w]);let T=Math.min(S*w,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let P=yd(...m.map(v=>c.getCellsOutsideRenderRange(v)));P=bd(P,v=>{let D=c.getCellPosition(v);return!(D&&h.has(`${D[0]}:${D[1]}`))}),c.detachCells(P),c.poolSize=T;let R=new Map,E=new Map;m.forEach(v=>{let{start:D,end:M}=v,[A,x]=D,[F,_]=M;for(let O=A;O<F;O++){for(let K=x;K<_;K++){let B=`${O}:${K}`;if(R.has(B))continue;R.set(B,!0);let{rendered:G,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===A||K===x){let xe=this.isCellCovered(O,K);if(xe&&h.has(`${xe[0]}:${xe[1]}`)){let me=c.getCellAt([O,K]);me!=null&&c.detachCell(me);continue}}if(G&&!r&&le)continue;let Y;G?Y=c.getCellAt([O,K]):Y=c.getCellFor([O,K],d?"row":"column"),Y==null&&(Y=c.getDetachedCell()),this.renderCellAt(O,K,Y,n)}!i||E.has(O)||(E.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([v,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(v,D);if(M){if(r||!A){let F=[v,D],_=c.getCellAt(F);this.renderCellAt(v,D,_,n)}return}let x=c.getCellFor([v,D],d?"row":"column");x!=null&&this.renderCellAt(v,D,x,n)});let N=c.getAllCells().map(v=>v.getNode());return i&&s.getAllRows().forEach(v=>{N.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let P=T.getElement();P&&(P.style.position="absolute",P.style.left="0px",P.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,w=this.brain.isHorizontalLayoutBrain;if(!b){w?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],S),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ci=class extends Mn{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=Ie.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=Ce.columnOffsets.get(l.colIndex),m=`${Qr}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(ln,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${ln})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};import{h as ay}from"vue";import{defineComponent as Jg,getCurrentInstance as Qg,isVNode as ey,onBeforeUnmount as ty,onMounted as ny,onUpdated as oy,shallowRef as iy,watch as ry}from"vue";function wd(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)wd(e,t);return}if(ey(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var Yt=Jg({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=iy(o.updater.get()??null),e=null;ry(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),ty(()=>{e!=null&&cancelAnimationFrame(e)}),ny(()=>o.afterCommit?.()),oy(()=>o.afterCommit?.());let n=Qg();return()=>{let i=t.value;return wd(i,n),i??null}}});var En=class En extends et{constructor(e){super(e);this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=En.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/En.POOL_SIZE_INCREMENT)*En.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};En.POOL_SIZE_INCREMENT=1;var Ti=En;var vd=new Map,ly=()=>{},ea=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=pe();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=vd.get(t)??0,i=`${t}:GridCellVue:${n}`;vd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=pe(),this.node=ay(Yt,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=ly,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Si=class extends Ti{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new ea(this.cellDebugId)}};import{h as sy}from"vue";var Fn=class Fn extends et{constructor(e){super(e);this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=Fn.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/Fn.POOL_SIZE_INCREMENT)*Fn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};Fn.POOL_SIZE_INCREMENT=1;var wi=Fn;var Id=new Map,uy=()=>{},ta=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let e=Id.get(t)??0,n=`${t}:ListRowVue:${e}`;Id.set(t,e+1),this.debugId=n,this.updater=pe(),this.node=sy(Yt,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=uy,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},vi=class extends wi{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new ta(this.rowDebugId)}};function Rd(o){return{cellPool:new Si(o),rowPool:new vi(o)}}function go(o){let t=o.isHorizontalLayoutBrain?new Ci(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Rd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new Mn(o,`${o.name}:VueHeadlessTableRenderer`,Rd(`${o.name}:VueHeadlessTableRenderer`)),e=pe();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function sn(){return{current:null}}var xd={};function na(o){return`.${mt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function oa(o,t){let e=Dn(o),n=t?new mo(e,{isHeader:!1}):new an(e),i=`${e}:header`,r=t?new mo(i,{isHeader:!0,masterBrain:n}):new an(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=go(n),{renderer:u,onRenderUpdater:d}=go(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function Pd({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=oa(o,!!t),d=sn(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=na(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:sn(),editingValueRef:sn(),scrollerDOMRef:sn(),portalDOMRef:sn(),focusDetectDOMRef:sn(),activeCellIndicatorDOMRef:sn(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new po,pinnedEndScrollListener:new po,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Dd=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new pi(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??xd,columnGroupVisibility:t=>t??xd,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function dy(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Ad=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function _d(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Ii=new WeakMap;function Md(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Ed=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?hd(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=dy({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=Ii.get(c);y||(y=gd(c),Ii.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof st)&&(d=new st(d)),d=d||new st({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=Ii.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&Ii.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||Ie.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=Gr.get(e.debugId);y&&(h={...h,...y})}return h};function Fd(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function Nd(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var cy=10;function Od(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${St} > .${Bo}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${en}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...at.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=Ee().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+cy}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let S=Ee().getComputedStyle(C);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var kd="InfiniteTable";import{h as dn}from"vue";var Ld=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import{defineComponent as fy,h as Bd,ref as py,watch as my}from"vue";var zd="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Vd=Se({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Gd="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Kd=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Ri=`${nt}-expand-collapse`,un=fy(o=>{let t=()=>o.expanded!==void 0,e=py(o.expanded??o.defaultExpanded??!1);my(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return Bd("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:ee(o.className,zd,Vd({direction:a||"start",expanded:e.value,disabled:l}),`${nt}`,`${Ri}`,`${Ri}--${i}`,`${Ri}--${a==="end"?"end":"start"}`,l?`${Ri}--disabled`:"")},[Bd("path",{d:Gd})])}},{name:"ExpandCollapseIcon",props:[...Kd]});import{defineComponent as hy,h as ia}from"vue";var Hd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Wd="164.93361431346415 56.97787143782138",jd={margin:"auto",display:"block",shapeRendering:"auto"},$d=Object.keys({size:1,style:1,className:1,viewBox:1});var Ud=hy(o=>()=>ia("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...jd,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:ee(o.className,Hd,"InfiniteIcon","InfiniteIcon-loading")},[ia("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":Wd},[ia("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...$d]});var qd=Se({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Yd="_7pupv00",Xd=Se({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Zd(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function Jd(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var gy=$(j.columnZIndexAtIndex),yy=$(j.columnVisibilityAtIndex);function Qd({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[$(Ie.components.Row.groupNesting)]:e}}function by({rowInfo:o}){return{[$(Ie.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function ra(o,t){return o?typeof o=="function"?o(t):o:void 0}function aa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function ec(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:S,cellSelected:w,cellSelection:T,getData:P,computedVisibleColumns:R,visibleColumnIds:E,computedColumnOrder:N,columnReorderInPageIndex:v}=o,D=E??R.map(Me=>Me.id),M=N,A,x={...s,visibleColumnIds:D,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return A===void 0&&(A=e.hasSelectedCells(D)),A}},F=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(x):m,O;c?.className&&(O=ra(c.className,d)),h&&(O=ee(O,ra(h,d))),t.className&&(O=ee(O,ra(t.className,d))),F&&(O=ee(O,Xd({align:l})));let L;e.dataSourceHasGrouping&&t.groupByForColumn&&(L=Qd({rowInfo:e,column:t})),F&&(L=by({rowInfo:e})),f&&(L=typeof f=="function"?{...L,...f(x)}:{...L,...f}),p&&(L=aa(L,p,d)),c?.style&&(L=aa(L,c.style,d)),t.style&&(L=aa(L,t.style,d)),L=L||{},L.height=i,L.zIndex=`var(${gy}-${t.computedVisibleIndex})`,L.visibility=`var(${yy}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,le=!1,Y=!1,xe=!1;if(T&&w){let Me=P(),Te=Me[e.indexInAll-1],_e=Me[e.indexInAll+1],ue=R[t.computedVisibleIndex+1],Q=R[t.computedVisibleIndex-1];G=Te?!T.isCellSelected(Te.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?le=!0:le=Q?!T.isCellSelected(e.id,Q.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Y=!0:Y=ue?!T.isCellSelected(e.id,ue.id):!0,xe=_e?!T.isCellSelected(_e.id,t.id):!0}let me=T&&w?{top:G,left:le,right:Y,bottom:xe}:null,we=v!=null?a!==v:!1,Ne=ee(me?Ws(me):"",No(t,[mt,St],Hs,{dragging:!1,insideDisabledDraggingPage:we,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:w,rowSelected:S,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:L,className:Ne,cellSelectionBorders:me,zebra:B,columnIsTree:F}}function Cy({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=ee(Po.flex,r.align==="end"?tr.rowReverse:tr.row,sl.center,`${mt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?qd({align:a}):null);return c?r.field?dn("div",{class:f},[d,dn("div",{class:at},[l??null])]):d?dn("div",{class:f},[d]):null:dn("div",{class:f},[u,d,dn("div",{class:at},[l??null])])}}function Ty({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return Ld(s)?m=dn(Ud):p&&(m=dn(un,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function tc(){return{getGroupColumnRender:Cy,getGroupColumnRenderGroupIcon:Ty}}function nc(o,t,e){return Zd(o,t,e,tc())}function oc(o,t,e){return Jd(o,t,e,tc())}function ic(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=nc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=oc({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?Qt(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function rc(o){return typeof o.field=="string"}function ac(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Pt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=Nn({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),w=Je(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:w,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}}function lc(o){return uc(o.column,o.rowInfo)}function sc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=ac({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=Nn(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:Sy({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function Sy(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:S}=C,w=ac({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,P=S?.isCellSelected(n.id,t.id)??!1,R={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:P,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:w,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function wy(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function uc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:rc(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&rc(o)&&(a=wy(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function vy(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function Nn(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=uc(t,e),a=vy(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function la(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function dc(o,t){let e=la(o,t);return e===-1?null:Pt({...o,rowIndex:e,columnId:t.columnId})}function yo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function sa(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function xi(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function ua(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function cc(o,t,e){if(ua(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let S=h;S<=y;S++){let w=b*n+S;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:w,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:w,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:w,colIndex:T})}return C}function Iy(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var da=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??qt(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Ge(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=qt(l,this.getDataSourceState),y=qt(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[S,w]=xi({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=S.rowIndex;T<=w.rowIndex;T++)for(let P=S.colIndex;P<=w.colIndex;P++){let R={rowIndex:T,colIndex:P},[E,N]=this.getCellSelectionPosition(R);n?a.selectCell(E,N):a.deselectCell(E,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=Jo(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Iy(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ge(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ge(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Ge:new Ge(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Ge(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Ge(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Ge(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function fc(o){return new da(o)}function pc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new st({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new st({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new st(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new st(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function Xt(o,t,e){return Math.min(Math.max(o,t),e)}function Pi(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return Xt(a,i,r)}function Ry(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,S={ArrowDown:()=>{f=Pi(n,f,1)},ArrowUp:()=>{f=Pi(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f-P>=C?f=f-P:S.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f+P<=b?f=f+P:S.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},w=S[l];return w?(w(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function ca(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),S=C-h-1,w=b-y-1,T=r().dataArray.length-1,P=i().computedVisibleColumns.length-1,R=0,E=0;m=Xt(m,0,T),p=Xt(p,0,P);let N={ArrowDown:()=>{m=Xt(m+1,R,T)},ArrowUp:()=>{m=Xt(m-1,R,T)},ArrowLeft:()=>{if(p===E)if(m!==R&&(p=P),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m-D>=R?m=m-D:N.ArrowUp()}else N.ArrowUp();else p=Xt(p-1,E,P)},ArrowRight:()=>{if(p===P)if(m!==T&&(p=E),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m+D<=T?m=m+D:N.ArrowDown()}else N.ArrowDown();else p=Xt(p+1,E,P)},Enter:()=>{let D=d[m];return D&&D.isGroupRow?e.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&e.rowDetailApi.isRowDetailEnabledForRow(D.id)?e.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{u?p=Math.min(p+w,P):m=Math.min(m+S,T)},PageUp:()=>{u?p=Math.max(p-w,E):m=Math.max(m-S,R)},End:()=>{u?p=P:m=T},Home:()=>{u?p=E:m=R}},v=N[l];return v?(v(),[m,p]):!1}function xy(o,t){let e=ca(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var Py={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function mc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!Py[e]?!1:r!=null&&l==="row"?Ry(o,t):a!=null&&l==="cell"?xy(o,t):!1}var fa=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Pi(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=ca(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function hc(o){return new fa(o)}function gc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var pa=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=la({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Pt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Pt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Pt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=Je(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=Nn({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new ft(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new ft(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[vn,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||Pn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=U.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ot())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=rl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=hc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=pc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=fc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(sa(e),t?.()),setTimeout(()=>{this.isDestroyed()||(sa(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??lc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Pt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(xn);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Nt){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let S=C?Qt(p,C):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[Nt]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!gc(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:gc(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(xn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function yc(o){return new pa(o)}function bc(o,t){return o<t?[o,t]:[t,o]}var Di=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=bc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=bc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var Ai=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!ua(t,e,i)){cc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=xi(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};import{defineComponent as Dy,h as wc,onBeforeUnmount as Ay,onMounted as _y}from"vue";var Cc=Kt("CSSVariableWatch"),Tc=Gt("CSSVariableWatch"),Sc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var bo=Dy({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return _y(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,Tc(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):Cc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=_n(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),Ay(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return wc("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Sc},[wc("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var ma=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function vc(o,t){ha(o,t),Ey(o,t),t.detail===2&&My(o,t),o.getState().onCellClick?.(o,t)}function My(o,t){if(Xn(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Ey(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Ge(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let S=!!n().wrapRowsHorizontally;c.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:S})}else c.resetClick(b);l.cellSelection=C}function ha(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:d}=i(),s=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=s;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(d&&!t.key)return!1;let{rowSelection:y}=s;if(y=l(y),u.rowSelectionState=y,y&&typeof y=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=y,!0}else if(c==="single-row"){let C=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(C):a.rowSelectionApi.selectRow(C)}return!1}function Ic(o,t){t.detail!==2&&void 0}var Fy={Enter:!0," ":!0,a:!0};function Rc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:d,ctrlKey:s,metaKey:c}=t;if(!Fy[d])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:y,keyboardSelection:C}=f,{selectionMode:b,groupBy:S,rowSelection:w,treeSelectionState:T,isTree:P}=m;if(C===!1)return!1;let R=y==="row"&&p!=null?p:y==="cell"&&h!=null?h[0]:null,E=R!=null?m.dataArray[R]:null;if(!E||R==null)return!1;if(b==="single-row"&&d===" ")return r.rowSelectionApi.toggleRowSelection(E.id),!0;if(b!=="multi-row")return!1;if(d==="a"&&(s||c)){if(P&&T){let v=u(T);return v.selectAll(),i.treeSelection=v,!0}let N=l(w);return N.selectAll(),i.rowSelection=N,!0}if(d===" "){if(S.length)return E.isGroupRow&&E.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(E.groupKeys):r.rowSelectionApi.toggleRowSelection(E.id),!0;if(P){if(E.isTreeNode&&E.nodePath)return a.treeApi.toggleNodeSelection(E.nodePath),!0}else{let N={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(N.metaKey=!1,N.ctrlKey=!0),ha({...o,rowIndex:R},N)}}return!1}var xc=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Pc=o=>Array.from(o.querySelectorAll(xc)).filter(e=>!!e.offsetParent),ga=o=>o.querySelector(xc);var Ac=zn(Sn());async function Dc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Ny=10,Oy=(o,t)=>o-t;function ya(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=Je(f.id,t);return f.contentFocusable({column:f,...Nn({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function _c(o,t,e){let n=e.getState().editingCell;return ky(o,t,e,{isCellFocusable:ya,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Mc(o,t,e){let n=(0,Ac.default)(e,o+t,Oy);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Mc;function ky(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:Mc(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function Ec([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Ny,l=null,u=!1;function d(s=0){s++,Jt(l),l=Oe(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await Dc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var Ly=`.${mt}`;function Fc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:Cn(n,Ly),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&ya({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:_c({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=Pc(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return Ec([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;ga(s)?.focus()}),!0}var Nc={control:"ctrl"},Oc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},zy={esc:"escape"},Lc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},zc=Object.keys(Lc),ba=new Set(zc),Vy=new Set(["shift","alt"]);function Vc(o,t){return Array.isArray(t)?t.some(e=>kc(o,e)):kc(o,t)}function kc(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>Oc[f]),r=n.map(f=>Nc[f]||Oc[f]||zy[f]||f),a=r.filter(f=>ba.has(f)),l=r.filter(f=>!ba.has(f)),u=zc.reduce((f,m)=>(f[m]=Lc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!Vy.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||ba.has(e)||e==="meta"||Nc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function Gc(o,t){let e={...o,cloneRowSelection:a=>xo(a,o.getDataSourceState),cloneTreeSelection:a=>ei(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Rc(e,t)&&t.preventDefault(),(Fc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&mc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!Vc(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}import{onBeforeUnmount as db,watch as cb}from"vue";import{Teleport as Ky,cloneVNode as By,defineComponent as qc,h as Mi,isVNode as Yc,nextTick as Hy,onBeforeUnmount as Wy,onMounted as jy,shallowRef as Uc,triggerRef as $y,watch as Uy}from"vue";var _i="__is_infinite_menu_component";function Ca(o){return!!o.tagName}function Hc(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ae.from(Ca(t)?t.getBoundingClientRect():t),a=Ae.from(Ca(e)?e.getBoundingClientRect():e),l=n?Ae.from(Ca(n)?n.getBoundingClientRect():n):null;if(!l)return{...Kc({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=Kc({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function Kc(o){let t=Ae.from(o.targetRect),e=Ae.from(o.anchorRect),n=o.constrainRect?Ae.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=Bc(t,r),u=Bc(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function Bc(o,t){return t==="TopLeft"?je.from({top:o.top,left:o.left}):t==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function Gy(o){return o&&typeof o.then=="function"||o instanceof Promise}function jc(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Wc(o){return typeof o=="function"&&(o=o()),Gy(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&jc(o)&&(o=o.getBoundingClientRect()),o?Ae.from(o):null}async function $c(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),jc(n)&&(i=n),i||null}return e(await t)}async function Ta(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await Wc(e)||void 0,a=n?await Wc(n):void 0,l=Ae.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=Hc({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var qy=qc({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&Ta(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&Ta(t,a)})};return jy(()=>i(o.handle)),Uy(()=>o.handle,i),Wy(()=>{n?.()}),()=>Mi("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function Yy(o){return Yc(o)?o.props?.id||o.key:null}function Xy(o,t,e){if(Yc(o)&&o.type?.[_i]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),By(o,n)}return o}function Dt(o){let t=o,e=new Map,n=Uc(e),i=()=>$y(n),r=(d,s)=>{let f=`${s.id||Yy(d)||Ot()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return Xy(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let S=p(C);Object.assign(m,{children:S}),i(),!!b?.skipRealign||Hy(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:pe()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:qc({name:"OverlayPortal",setup(){let d=Uc(null),{portalContainer:s}=t;return s&&(async()=>{let c=await $c(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push(Mi(qy,{handle:m,key:m.key}));return s?d.value?Mi(Ky,{to:d.value},c):null:s===null||s===!1?c:Mi("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}import{h as ub}from"vue";import{defineComponent as sf,h as ut,onBeforeUnmount as ob,ref as ib,watch as rb}from"vue";var Xc="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Zc=Se({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Jc="db3arf1",Qc="db3arfd";var ef="submenu",Zy="-";function tf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ot(),focused:!1,destroyed:!1,domRef:{current:null}}}function nf(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Jy=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===Zy?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},Qy=[{name:"label"}],of=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||Qy],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>Jy(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==ef)&&c.push({name:ef,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function rf(o,t){let e=af(o,t);if(!e.length)return null;let n=Ae.from(e[0]?.getBoundingClientRect()),i=Ae.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function af(o,t){let e=Cn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function lf(o,t){let e=af(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var Co=class extends bn{constructor(t){super(t.slice(0,3))}};var eb=250;function tb(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Oe(r)};Oe(()=>{r()})})}var nb=Ee(),Ei=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||eb;this.getPointerMoveTarget=()=>document.documentElement||nb;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new Co([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Co([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,tb(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var ab={renderSeparator:()=>ut("hr",{class:Qc}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?ut("div",o,[ut(un,{expanded:!1})]):ut("div",o))},{useManagedComponent:lb}=fn({initSetupState:tf,forwardProps:()=>nf(),mapPropsToState:o=>of(o,ab),debugName:"Menu"}),sb=sf({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=ib(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=ut("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:ee(Zc({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):ut("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return ut("div",{class:Jc},[u])}}}),At=sf({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=lb(o),n=e.state,i=e.componentActions,r=()=>n.value,a=D=>{i.keyboardActiveItemKey=D},l=D=>{i.activeItemKey=D},u=!1,d=()=>u,s=null,c=D=>{s=D},{showOverlay:f,portal:m,clearAll:p}=Dt({portalContainer:!1}),h=()=>{let D=r();D.onHideIntent?.(D)},y=()=>{i.focused=!0,setTimeout(()=>{let D=r().domRef.current;b&&D&&D===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,S={hideMenu:h,focus:()=>{let D=r().domRef.current;D&&(D.focus(),setTimeout(()=>{let M=r().domRef.current;M&&M!==document.activeElement&&M.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},w=(D,M)=>{a(M.key),l(M.key),M.originalMenuItem.onClick&&M.originalMenuItem.onClick(D);let A={key:M.key,item:M.originalMenuItem,hideMenu:h};M.originalMenuItem.onAction&&M.originalMenuItem.onAction(A);let{onAction:x}=r();x&&x(A),M.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:P}=new Ei({parentMenuId:r().parentMenuId,onItemActivate:D=>{d()&&l(D)},itemHasSubMenu:D=>!!r().runtimeItems.filter(A=>A.type==="item"&&A.key===D&&A.menu)[0],getMenuRectFor:D=>{let M=`[data-submenu-for="${D}"]`,A=document.querySelector(M);if(A)return Ae.from(A.getBoundingClientRect())}}).getHandlers(),R=D=>{let M=r().menuId,A=`${M}-submenu`,x=D.menu;return x?(typeof x=="function"&&(x=x()),ut(At,{key:A,parentMenuItemKey:D.key,parentMenuId:M,constrainTo:r().constrainTo,...x,autoFocus:!1,onShow:(F,_)=>{x?.onShow?.(F,_),c(_)},onHideIntent:F=>{x?.onHideIntent?.(F),h()},onHide:F=>{F.focused&&(l(null),a(D.key),S.focus())}})):null};rb(()=>n.value.activeItemKey,D=>{let{runtimeItems:M,menuId:A,constrainTo:x}=r(),F=M.filter(O=>O.type==="item"&&D===O.key)[0];if(!F||!F.menu){c(null),p();return}let _=rf(A,F.key);_&&f(()=>R(F),{id:`${A}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:x})},{flush:"post"});function E(D){let{runtimeItems:M,runtimeSelectableItems:A,keyboardActiveItemKey:x}=r(),F=M.findIndex(B=>B.type==="item"&&B.key===x),_=x,O=M[F],L={ArrowUp:()=>{let B=M.slice(0,F).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=M.slice(F+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{_=A[0].key},PageDown:()=>{_=A[A.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Oe(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){L.ArrowLeft();return}l(O.key)}else w(D,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||w(D,O);let B=lf(r().menuId,O.key);B&&B.click()},Escape:()=>{L.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=L[D.key];K&&(K(),D.preventDefault()),_!=x&&a(_)}let N=!1,v=D=>{let M=D??null;M&&!N?(N=!0,r().domRef.current=M,u=!0,r().onShow?.(r(),S),r().autoFocus&&S.focus()):!M&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):M&&(r().domRef.current=M)};return ob(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let D=r(),{columns:M,runtimeItems:A,menuId:x,activeItemKey:F,keyboardActiveItemKey:_,destroyed:O,wrapLabels:L,parentMenuItemKey:K}=D;if(O)return null;let B=A.map((Y,xe)=>ut(sb,{key:Y.type==="item"?Y.key:xe,columns:M,item:Y,index:xe,active:Y.type==="item"&&Y.key===F,keyboardActive:Y.type==="item"&&Y.key===_,onItemEnter:(me,we)=>T(me.key,we),onItemLeave:(me,we)=>P(me.key,we),onItemClick:w})),G=M.map(Y=>Y.width||(typeof Y.flex=="number"?`${Y.flex}fr`:Y.flex)||"auto").join(" "),le={...t.style,gridTemplateColumns:G,gridTemplateRows:A.map(()=>"auto").join(" ")};return L||(le.whiteSpace="nowrap"),ut("div",{class:Po.contents},[ut("div",{...t,"data-menu-id":x,"data-submenu-for":K,tabindex:0,ref:v,onKeydown:E,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:ee(Xc,t.class,"InfiniteMenu"),style:le},B),ut(m)])}}});At[_i]=!0;import{h as uf}from"vue";function df(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||jt,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=Yn(p,t,"column-menu");f.push({key:h,label:y,check:uf(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=Yn(p,t,"column-menu");f.push({key:h,label:y,check:uf(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function cf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??At,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:Je(u.id,t),...t},s=df([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:ub(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function fb(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${Xs}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>cf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function ff(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return cb([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),fb({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),db(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as pb,watch as mb}from"vue";import{h as Fi}from"vue";function pf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??At,m=n().computedColumnsMap.get(o);if(!m)return null;let p=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(R=>{let E=R.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===E:E===C.defaultOperator,v=R.components?.Icon??hn;return{key:E,icon:Fi(v),label:R.label??R.name,onAction:()=>{d.setColumnFilterOperator(o,E)},checked:N?Fi(Ks,{size:16}):null}}),w=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Fi(Bs),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},P=c?c(w,T):w;return Fi(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:P,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:R=>{h(R),e?.()}})}var Ni=10;function mf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ae.from(m.getBoundingClientRect());p.top-=Ni,p.left-=Ni,p.width+=2*Ni,p.height+=2*Ni,r(()=>pf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return mb(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),pb(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as bf,watch as Cf}from"vue";import{h as ki}from"vue";function Oi(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function Sa(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function hf(o,t,e){if(!o)return null;let n=pe();return o.then(i=>{let{items:r,columns:a}=Oi(i);r&&r.length&&n(ki(e,{...t,items:r||[],columns:a}))}),ki(Yt,{updater:n})}function gf(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??At,{computedColumnsMap:c}=a(),f=c.get(n),m={...Pt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=Sa({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:hf(h,p,s),preventDefault:y};let{items:C,columns:b}=Oi(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:ki(s,{...p,columns:b,items:C}),cellContext:m}}function yf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??At,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Pt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=Sa({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:hf(f,c,l),preventDefault:m};let{items:p,columns:h}=Oi(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:ki(l,{...c,columns:h,items:p}),cellContext:s}}var Li=5,Tf=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Sf(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=Dt({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=gf(s,t,f),y=Ae.fromPoint({top:c.clientY,left:c.clientX});y.width+=Li,y.height+=Li,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Tf}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return Cf(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),bf(()=>{d()}),{MenuPortal:l}}function wf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=yf(d,t,c),h={top:s.clientY,left:s.clientX},y=Ae.fromPoint(h);y.width+=Li,y.height+=Li,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Tf}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return Cf(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),bf(()=>{u()}),{MenuPortal:a}}import{defineComponent as Bb,h as On,onBeforeUnmount as Hb,onMounted as Wb,ref as jb,shallowRef as $b,watch as wa}from"vue";var vf="mlx2t3";import{defineComponent as hb,h as gb}from"vue";var If=hb({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>gb("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Rf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},xf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Pf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Df="_1ueijco1",Af="_1ueijco0 _16lm1iw0";import{defineComponent as yb,h as bb,onBeforeUnmount as Cb,onMounted as Tb,ref as Sb}from"vue";var _f=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Rf[`${o}`]:t=ee(xf[`${o.horizontal}`],Pf[`${o.vertical}`]),t};var wb="InfiniteVirtualScrollContainer",Mf=yb({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=Sb(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return Tb(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),Cb(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>bb("div",{...e,ref:n,tabindex:o.tabIndex,class:ee(e.class,wb,Af,_f(o.scrollable))},t.default?.())}});import{computed as vb,defineComponent as Ib,h as Rb,onBeforeUnmount as xb,onMounted as Pb,watch as Db,watchEffect as Ef}from"vue";var zi=Ib({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=vb(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:go(o.brain));Ef(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),Ef(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return Pb(n),Db(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),xb(()=>{e?.(),e=null}),()=>Rb(Yt,{name:o.name,updater:t.value.onRenderUpdater})}});var Vi=[js,`${Fe}DetachedCell`];import{defineComponent as Ab,h as Nf,onBeforeUnmount as _b,onMounted as Mb,ref as Of,watch as kf}from"vue";var Ff=Se({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Gi="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:Eb}=ke,Fb=`${Eb}-ActiveCellIndicator`,Nb=$(j.columnZIndexAtIndex),Lf=Ab({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=Of(null),e=Of(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Tn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return Mb(()=>{r(o.brain),n()}),kf(()=>o.brain,r),kf([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),_b(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return Nf("div",{class:Gi,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${Nb}-${o.activeCellIndex[1]})`}:void 0},[Nf("div",{"data-name":"active-cell-indicator",class:`${Fb} ${Ff({visible:a})}`})])}}});import{defineComponent as Ob,h as Vf,onBeforeUnmount as kb,onMounted as Lb,ref as Gf,watch as Kf}from"vue";var zf=Se({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:zb}=ke,Vb=`${zb}-ActiveRowIndicator`,Gb=`calc(${j.activeCellRowOffsetX} + var(${$(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Kb={[$(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${Gb}, calc( ${j.activeCellOffsetY} + var(${$(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:Ie.runtime.totalVisibleColumnsWidthVar},Bf=Ob({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=Gf(null),e=Gf(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${Ie.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Tn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Tn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return Lb(()=>{l(o.brain),n()}),Kf(()=>o.brain,l),Kf([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),kb(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return Vf("div",{class:Gi,"data-name":"active-row"},[Vf("div",{ref:t,"data-name":"active-row-indicator",class:`${Vb} ${zf({active:u})}`,style:u?Kb:void 0})])}}});var Ub=ee(vf,Df),Hf=Bb({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=jb(null),n=$b({width:0,height:0});wa(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=_n(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return Wb(()=>{u(o.brain),d()}),wa(()=>o.brain,s=>{u(s),d()}),wa(()=>o.wrapRowsHorizontally,()=>{d()}),Hb(()=>{a?.(),l?.()}),()=>On(Mf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[On("div",{ref:e,class:Ub,"data-name":"scroll-transform-target"},[On(zi,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:Vi}),o.activeCellIndex!=null?On(Lf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?On(Bf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,On(If,{width:n.value.width,height:n.value.height})]})}});var Wf="_16lm1iw1 _16lm1iw1c _16lm1iwe";import{computed as Xb,defineComponent as Jf,h as zt,onBeforeUnmount as Zb,provide as Qf,shallowRef as va,watch as Zf}from"vue";import{inject as Jb}from"vue";var $f=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Uf(o){return typeof o=="function"}function jf(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return $f;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function qf(o,t,e){let n=jf(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=jf(o,t);i!==$f&&(Object.is(i,n)||(n=i,e()))})}import{defineComponent as qb,h as Yb}from"vue";function Yf(){let{api:o,getState:t}=Be(),e=To(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var Xf=qb({name:"InfiniteTableColumnEditor",setup(){let{state:o}=Be(),t=Yf(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,Yb("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:ee(ll,ml.none),type:"text"}))}});var Qb=$(j.columnWidthAtIndex),eC=$(j.columnReorderEffectDurationAtIndex),Ra=Symbol("InfiniteColumnCell");function To(){return Jb(Ra)}var tC=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return zt(un,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},nC={display:"inline-block",visibility:"visible"},Ia=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return zt(un,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:nC,expanded:n,onChange:e})},oC=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,d=l?.CheckBox||jt;return zt(d,{domProps:{class:Go},disabled:t.isTreeNode?!u(t):!1,onChange:s=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,s??!1);return}if(t.isGroupRow){i();return}s?e():n()},checked:t.rowSelected})},iC=Jf({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return Qf(Ra,Xb(()=>o.renderParam)),()=>o.content}});function ht(o,t){let e=o(t);return e==null?e:zt(iC,{renderParam:t,content:e})}var ep=Jf({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=va(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;Zf([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=va(0),a=null;Zf([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,Uf(s)&&(a=qf(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),Zb(()=>{i?.(),i=null,a?.(),a=null});let l=va(null);Qf(Ra,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return zt("div",{ref:e,style:{display:"none"}});let{getState:S,getDataSourceState:w}=h,{activeRowIndex:T,keyboardNavigation:P,columnReorderInPageIndex:R}=S(),E=c===T&&P==="row",N=b.rowDisabled,{rowSelected:v}=b,D=o.getComputedVisibleColumns().map(W=>W.id),M=sc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:D,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:A,renderParams:x,formattedValueContext:F,renderFunctions:_,groupByColumnReference:O,inEdit:L}=M,{align:K,verticalAlign:B}=x,G=x;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:le}=w(),Y=G.cellSelected,xe=w().cellSelection??null,me=null;if(!m&&!L){if(_.renderGroupIcon&&(G.renderBag.groupIcon=ht(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&le=="multi-row"&&(G.renderBag.selectionCheckBox=ht(oC,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=ht(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:Re}=b,Pe;Pe=(Re?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:Re&&_.renderTreeIcon===!0?Ia:void 0,Pe===!0?Pe=Ia:Pe&&(G.renderBag.treeIcon=ht(Ia,G)),Pe&&(G.renderBag.treeIcon=ht(Pe,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=ht(tC,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=ht(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=ht(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=ht(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=ht(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let W=G.renderBag.value;W instanceof Date&&(W=W.toLocaleDateString());let te=G.renderBag,be=[K!=="end"?te.treeIcon:null,K!=="end"?te.groupIcon:null,K!=="end"?te.rowDetailsIcon:null,K!=="end"?te.selectionCheckBox:null,W,K==="end"?te.selectionCheckBox:null,K==="end"?te.rowDetailsIcon:null,K==="end"?te.groupIcon:null,K==="end"?te.treeIcon:null];me=s.render?ht(s.render,{...G,renderBag:{...G.renderBag,all:be}}):be}let{style:we,className:Ne}=ec({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:A,formattedValueContext:F,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:E,rowDisabled:N,rowSelected:v,cellSelected:Y,cellSelection:xe,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:R}),Me=s.computedVisibleIndex,Te=s.cssEllipsis??!0,_e={width:`var(${Qb}-${Me})`,transition:`transform var(${eC}-${Me}, 0s)`,...we,height:typeof we.height=="number"?`${we.height}px`:we.height},{onRowMouseEnter:ue,onRowMouseLeave:Q}=o.renderingContext.getState(),H=ue||o.onMouseEnter?W=>{ue?.({...F,rowIndex:c},W),o.onMouseEnter?.(W)}:void 0,X=Q||o.onMouseLeave?W=>{Q?.({...F,rowIndex:c,rowInfo:b},W),o.onMouseLeave?.(W)}:void 0,Z={ref:e,style:_e,"data-column-id":s.id,"data-z-index":_e.zIndex,"data-row-id":`${b.id}`,class:ee(Ne,St,zo),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:X},ne=zt("div",{class:ee(`${St}_content`,Te?at:Do.hidden)},[me]),ie=s.components?.Editor??Xf,he=L?zt(ie):null,ge=he?[ne,he]:[ne],oe=s.components?.ColumnCell;return oe?zt(oe,Z,{default:()=>ge}):zt("div",Z,ge)}}});import{defineComponent as lC,h as sC,shallowRef as uC,watch as dC}from"vue";var tp=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function rC(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function aC(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=ld(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function np(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function op(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:bt(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}rC(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&aC(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:cC}=ke,fC=`${cC}RowDetail`,xa=lC({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=co(),{getState:n}=Be(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=np(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:op({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=uC(i());dC(()=>o.rowInfo.id,()=>{r.value=i()}),fd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,sC("div",{ref:a,class:ee(fC,tp({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Pa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function pC(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function ip(o){let t=new Pa;return{computedRowHeight:pC(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}import{computed as fp,defineComponent as TC,h as kn,onBeforeUnmount as SC,watch as wC,watchEffect as vC}from"vue";function rp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,S,w=C;for(;b;){let T=t[b];if(T){h.add(b);let P=[f,...h];S=y.has(b)?r.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(P,S),r.set(b,S)),S.columnItems.push(C),S.uniqueGroupId.push(C.id),w&&!y.has(w.id)&&S.children.push(w),w=S,b=T.columnGroup}else break}});let l=[],u=new U,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&ap(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function ap(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&ap(e.children),t+=n})}import{defineComponent as bC,h as Da}from"vue";import{defineComponent as mC,h as lp,ref as hC}from"vue";var{rootClassName:gC}=ke,yC=`${gC}HeaderCell_ResizeHandle`,sp=mC({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=hC(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=ru(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((S,w)=>S+w.computedWidth-w.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:Ie.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return lp("div",{ref:d=>{t.current=d??null},class:`${yC} ${Ho} ${jo({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[lp("div",{style:{...u,...o.draggerStyle},class:Wo({constrained:e.value})})])}}});var up=`${Fe}HeaderGroup`,dp=$(j.columnWidthAtIndex),CC=$(j.columnZIndexAtIndex),cp=bC({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=Be(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...d[S.id],flex:S.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return jl({availableSize:vr(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(S=>`var(${dp}-${S.computedVisibleIndex})`).join(" + ")+" )":`var(${dp}-${m.computedVisibleIndex})`,h=`calc(var(${CC}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(S=>S.computedResizable)?Da(sp,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return Da("div",{ref:i,"data-group-id":l.uniqueGroupId,class:ee(Fl,up),style:y,"data-z-index":h},[Da("div",{class:ee(`${up}__header-content`,at)},[c]),b])}}});var{rootClassName:IC}=ke,pp=`${IC}Header`,RC=[],xC=Dl({overflow:!1}),mp=TC({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=Be(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=fp(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=fp(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=kt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return rp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");vC(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),S=a.value,w=l.value,T=u.value,P=p.showColumnFilters,R=p.columnHeaderHeight,E=({rowIndex:D,colIndex:M})=>{let A=h[M],x=1,F=1;if(!A||!T)return{rowspan:x,colspan:F};let _=T.pathsToCells.get([D,M]);if(!_)return{rowspan:x,colspan:F};if(_.type==="column")return{colspan:F,rowspan:S-_.depth};let O=_.columnItems.findIndex(L=>L.id===A.id);return{rowspan:x,colspan:O===0?_.columnItems.length:1}},N=D=>P?D<S-1?R:2*R:R,v=o.headerBrain;(y.length||C.length)&&v.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),v.update({colWidth:b,rowHeight:N,rows:S,cols:h.length,height:w,rowspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).rowspan,colspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;wC(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),SC(()=>{f?.(),f=null});let m=kt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,S=u.value,w=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:P,someRowsSelected:R,selectionMode:E}=h;return N=>{let{rowIndex:v,colIndex:D,domRef:M,height:A,widthWithColspan:x,heightWithRowspan:F,hidden:_}=N,O=y[D];if(!O||_)return null;let L=b.isHorizontalLayoutBrain?b.getPageIndexForRow(v):null,K=S?S.pathsToCells.get([v,D]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Y=>Y.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Y=>Y.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?kn(cp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:L,columnGroupsMaxDepth:w,domRef:M,columns:B,width:x,height:A,columnGroup:G}):null}return kn(du,{key:O.id,domRef:M,column:O,columnsMap:C,horizontalLayoutPageIndex:L,headerOptions:T,width:x,height:F,allRowsSelected:P,someRowsSelected:R,selectionMode:E})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=kn("div",{ref:c,class:ee(pp,`${pp}--virtualized`,xC),style:{height:`${p}px`}},[kn(zi,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:RC,cellDetachedClassNames:Vi})]),b=h.vertical&&Ct()?kn("div",{class:Ol,style:{zIndex:1e3,width:`${Ct()}px`}}):null;return kn("div",{class:`${fr} ${Vl}`,style:{height:`${p}px`}},[C,b])}}});import{defineComponent as PC,h as Aa}from"vue";var hp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},gp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",yp="qy58ya4";var{rootClassName:DC}=ke,_a=`${DC}-LoadMask`,Ki=PC({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>Aa("div",{class:`${hp[o.visible?"visible":"hidden"]} ${_a}`},[Aa("div",{class:`${gp} ${_a}-Overlay`}),Aa("div",{class:`${yp} ${_a}-Text`},t.default?t.default():"Loading")])}});var bp=o=>`--infinite-${o}`;var Cp=40,Tp=bp(cs);var kC=ke.rootClassName,Ea=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:LC,injectionKey:zC}=fn({initSetupState:Pd,forwardProps:Dd,mapPropsToState:Ed,cleanup:Ad,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Md(),getParentState:()=>{let o=MC(uo,null);return o?o.state:null},debugName:"InfiniteTable"});function wp(o){return t=>o[t]?.computedWidth??0}function vp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var Fa=_C({name:"InfiniteTable",props:[...Ea],setup(o,{attrs:t}){let e=co();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,I,z){let k=Reflect.get(g,I,z);return I==="rowHeight"?k??Cp:I==="columnHeaderHeight"?k??Tp:I==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=LC(n);Sp(zC,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{A.toggleGroupRow(g)};He([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,I=u.value,{columns:z,groupColumnIds:k}=ic({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:I.groupBy,pivotBy:I.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:I.selectionMode});a.columnsWhenGrouping=z;let q=r.value.columnOrder;if(k.length&&Array.isArray(q)){let V=new Set(q),J=!1;k.forEach(ce=>{V.has(ce)||(J=!0,q=[ce,...q])}),J&&(a.columnOrder=q)}},{immediate:!0}),He(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),He(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),He(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),He(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=FC(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};He(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),Ma(()=>{m?.()}),He([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:I,domRef:z}=r.value,k,q,V=!0;typeof I=="object"&&(I.columnsToResize&&(k=new Set(I.columnsToResize)),I.columnsToSkip&&(q=new Set(I.columnsToSkip)),V=I.includeHeader??V),f=g;let J=Od(z,{includeHeader:V,columnsToResize:k,columnsToSkip:q}),ce=Object.keys(J);if(!ce.length)return;let se=r.value.columnSizing,fe={...se},ae=!1;ce.forEach(ye=>{fe[ye]={width:J[ye]},ae=ae||fe[ye].width!==se[ye]?.width}),ae&&(a.columnSizing=fe)},{immediate:!0,flush:"post"});let h=AC(()=>_d(u.value.groupBy));He([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,I=u.value;if(g.groupRenderStrategy!=="multi-column")return;let z=h.value,k=Fd(g.computedColumns,z),q=Nd({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:I.groupRowsIndexesInDataArray,dataArray:I.dataArray,groupBy:I.groupBy,groupByMap:z});Ht(g.columnVisibility,q)||(a.columnVisibility=q)},{immediate:!0}),He([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,I=h.value,z=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:q,hideColumnWhenGrouped:V,computedColumns:J}=g,ce={...k},se={...q},fe=!1,ae=new Set,ye=new Set;Object.keys(J).forEach(ve=>{let re=J[ve];if(re.defaultHiddenWhenGroupedBy||V!=null)if(re.defaultHiddenWhenGroupedBy==="*"&&z||(re.defaultHiddenWhenGroupedBy===!0||V)&&re.field&&I.get(re.field)||typeof re.defaultHiddenWhenGroupedBy=="string"&&I.get(re.defaultHiddenWhenGroupedBy)||typeof re.defaultHiddenWhenGroupedBy=="object"&&Object.keys(re.defaultHiddenWhenGroupedBy).reduce((_t,Mt)=>_t||I.has(Mt),!1)){if(se[ve]!==!1){if(k[ve]===!1)return;se[ve]=!1,fe=!0,ae.add(ve)}}else se[ve]===!1&&(delete se[ve],fe=!0,ye.add(ve))}),fe&&(a.columnVisibilityForGrouping=se,ye.forEach(ve=>{delete ce[ve]}),ae.forEach(ve=>{ce[ve]=!1}),a.columnVisibility=ce)},{immediate:!0});let y=kt(()=>{let g=r.value,I=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,I.filterValue,I.filterTypes,g.sortable,I.sortInfo,I.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,I.groupBy]},()=>{let g=r.value,I=u.value;return Zl({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:I.filterValue,filterTypes:I.filterTypes,sortable:g.sortable,sortInfo:I.sortInfo??void 0,multiSort:I.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:I.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:S}=e,w=new Di({isRowDisabledAt:g=>b().dataArray[g]?.rowDisabled??!1,getIdForIndex:g=>b().dataArray[g]?.id??-1}),T=new Ai({getPrimaryKeyByIndex:S.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),P=NC({vertical:!1,horizontal:!1}),R=null;He(()=>r.value.brain,g=>{R?.(),R=g.onRenderCountChange(()=>{let{scrollTopMax:I,scrollLeftMax:z}=g,k=I>0,q=z>0,V=P.value;(V.vertical!==k||V.horizontal!==q)&&(P.value={vertical:k,horizontal:q})})},{immediate:!0}),He(P,g=>{let I=b(),{onScrollbarsChange:z}=l();z&&I.updatedAt&&I.dataArray.length&&z(g),I.notifyScrollbarsChange(g)});let E=null,N=()=>{let g=l(),I=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!E||E.deps.some((z,k)=>z!==I[k]))&&(E={deps:I,value:ip({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),E.value},v=()=>N().computedRowHeight,D=()=>{let g=y.value,I=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,z=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:P.value,multiRowSelector:w,multiCellSelector:T,computedRowHeight:v(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:vp(g.computedVisibleColumns,b),computedPinnedStartOverflow:I?g.computedPinnedStartColumnsWidth>I:!1,computedPinnedEndOverflow:z?g.computedPinnedEndColumnsWidth>z:!1,toggleGroupRow:k=>A.toggleGroupRow(k),columnSize:k=>wp(g.computedVisibleColumns)(k)}},M=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,A=yc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:S}),x={getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},F={getComputed:D,getDataSourceMasterContext:M,dataSourceApi:S,api:A,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>ei(g,b),cloneRowSelection:g=>xo(g,b)},_=l().keyDown.onChange(g=>{Gc(F,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,q=D().computedVisibleColumns[k],V=Je(q.id,F);I.key="",vc({...F,rowIndex:z,colIndex:k,column:q,columnApi:V},I)}),L=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,q=D().computedVisibleColumns[k],V=Je(q.id,F);Ic({...F,rowIndex:z,colIndex:k,column:q,columnApi:V},I)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let I=g?g*1:null;I!=null&&!isNaN(I)&&(a.flashingDurationCSSVarValue=I)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=ff({context:F,state:r}),{MenuPortal:G}=Sf({context:F,state:r}),{MenuPortal:le}=wf({context:F,state:r}),{MenuPortal:Y}=mf({context:F,state:r}),xe=g=>{let I=l(),z=g.target,k=ds(z,na(),I.domRef.current),q,V,J,ce;k&&(V=Number(k.dataset.colIndex),ce=Number(k.dataset.rowIndex),q=D().computedVisibleColumns[V].id,J=S.getRowInfoArray()[ce].id);let se={columnId:q,colIndex:V,rowId:J,rowIndex:ce,event:g,target:k??g.target};k&&I.cellContextMenu(se),I.contextMenu(se)},me=ma(g=>{a.focused=g}),we=ma(g=>{a.focusedWithin=g}),Ne=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(I.focused)return;me(!0),I.onSelfFocus?.(g),I.focusedWithin&&(we(!1),I.onBlurWithin?.(g));return}I.focusedWithin||(we(!0),I.onFocusWithin?.(g))},Me=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(!I.focused)return;me(!1),I.onSelfBlur?.(g),I.focusedWithin&&(we(!1),I.onBlurWithin?.(g));return}I.domRef.current?.contains(g.relatedTarget)||(we(!1),I.onBlurWithin?.(g))},Te=10,_e=(g,I)=>{let z=!1,k=null;return He([g,()=>u.value.dataArray.length],([q],[V]=[void 0,void 0])=>{if(q!=null&&q!==V&&(z=!1,k!=null&&cancelAnimationFrame(k)),q==null||z)return;let J=(ce=0)=>{ce++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{z=I(q),!z&&ce<Te&&J(ce)})};J()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ue=_e(()=>r.value.activeRowIndex,g=>A.scrollRowIntoView(g,{offset:0})),Q=_e(()=>r.value.activeCellIndex,g=>A.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>dc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},l().editingCell);He([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,I,z,k,q],[V,J,ce,se,fe])=>{if(g&&g!==V){let ae=l().editingCell,{onEditCancelled:ye}=l();if(ye){let ve=H();ve?ye({...ve,initialValue:ae.initialValue}):yo("onEditCancelled",ae)}}if(I&&I!==J){let ae=l().editingCell,{onEditRejected:ye}=l();if(ye){let ve=H();ve?ye({...ve,value:ae.value,error:I,initialValue:ae.initialValue}):yo("onEditRejected",ae)}}if(z&&z!==ce){let ae=l().editingCell,{value:ye,initialValue:ve}=ae,{onEditAccepted:re}=l();if(re){let rt=H();rt?re({...rt,value:ye,initialValue:ve}):yo("onEditAccepted",ae)}A.persistEdit({value:ye})}if(k&&k!==se){let ae=l().editingCell;if(ae){let ye=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[ye]){let ve=H();if(!ve)yo(ye,ae);else{let re={...ve,value:ae.value,initialValue:ae.initialValue};k instanceof Error?l().onEditPersistError?.({...re,error:k}):l().onEditPersistSuccess?.(re)}}}}!q&&fe&&A.focus()}),OC(()=>{let g=r.value,I=u.value,{computedVisibleColumns:z,computedPinnedStartColumns:k,computedPinnedEndColumns:q}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:q.length});let J=v();V.update({colWidth:wp(z),rowHeight:J,rows:I.dataArray.length,cols:z.length,rowspan:vp(z,d)})}),He(()=>r.value.wrapRowsHorizontally,(g,I)=>{if(I===g)return;let{brain:z,headerBrain:k,renderer:q,onRenderUpdater:V}=l();z.destroy(),k.destroy(),q.destroy(),V.destroy();let J=oa(kd,!!g);a.brain=J.brain,a.headerBrain=J.headerBrain,a.renderer=J.renderer,a.onRenderUpdater=J.onRenderUpdater,a.headerRenderer=J.headerRenderer,a.headerOnRenderUpdater=J.headerOnRenderUpdater},{flush:"post"});let X=null,Z=null,ne=()=>{X&&(clearTimeout(X),X=null),Z?.(),Z=null};He([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,I,z,k,q])=>{ne();let V=e.dataSourceActions;if(!I){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let J=()=>{let{rowsPerPage:ce,repeatWrappedGroupRows:se}=d(),fe=!1,ae=g.rowsPerPage,ye=(z&&z.length>0||k)&&ae>0?ae:null;return ce!=ye&&(V.rowsPerPage=ye,fe=!0),se!=q&&(V.repeatWrappedGroupRows=q??!1,fe=!0),fe};J(),Z=g.onVerticalRenderRangeChange(()=>{J()&&(X=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),Ma(ne),He(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),He(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,A,{dataSourceApi:e.dataSourceApi});let{onReady:I}=l();I&&I({api:A,dataSourceApi:S})},{immediate:!0,flush:"post"}),He(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let ie=null,he=null;He(()=>r.value.brain,g=>{ie?.(),ie=g.onVerticalRenderRangeChange(I=>{d().notifyRenderRangeChange({renderStartIndex:I[0],renderEndIndex:I[1]})}),he?.(),he=g.onRenderRangeChange(I=>{l().onRenderRangeChange?.(I)})},{immediate:!0});let ge=1,oe=0,W=null,te=null;He(()=>r.value.brain,g=>{W?.(),te?.(),W=g.onRenderCountChange(()=>{oe=g.scrollTopMax}),te=g.onScrollStop(I=>{let{scrollTop:z,scrollLeft:k}=I,{onScrollToTop:q,onScrollToBottom:V,onScrollStop:J}=l();z===0&&q?.();let ce=l().scrollToBottomOffset??ge;if(z+ce>=oe){V?.();let{livePagination:fe,livePaginationCursor:ae,dataArray:ye}=d();fe&&(e.dataSourceActions.cursorId=ae!==void 0?Date.now():ye.length)}if(J){let fe=g.getRenderRange();J({scrollTop:z,scrollLeft:k,renderRange:fe,viewportSize:l().bodySize,firstVisibleRowIndex:fe.start[0],lastVisibleRowIndex:fe.end[0],firstVisibleColIndex:fe.start[1],lastVisibleColIndex:fe.end[1]})}})},{immediate:!0});let be=null,Re=null,Pe=g=>{be=g,r.value.scrollerDOMRef.current=g,Re?.(),Re=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},Re=_n(g,I=>{a.bodySize={width:Math.round(I.width),height:Math.round(I.height)}},{debounce:50}))};EC(()=>{be&&(a.bodySize={width:be.clientWidth,height:be.clientHeight})}),Ma(()=>{Re?.(),ie?.(),he?.(),_(),O(),L(),ue(),Q()});let We=()=>b().dataArray,Le=()=>y.value.computedColumnOrder,de=[Yd,`${mt}--hovered`],tt=kt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let I=[];return g.rowHoverClassName&&(I=I.concat(g.rowHoverClassName)),I=I.concat(de),I.join(" ").split(" ").map(z=>z.trim()).filter(Boolean)},"hoverClassNames"),Ye=kt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),dt=kt(()=>{let g=r.value,I=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,I.rowInfoStore,Ye.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:I,fieldsToColumn:z}=y.value,k=l(),q=k.showZebraRows,V=b().rowInfoStore,J=Ye.value;return ce=>{let{rowIndex:se,colIndex:fe,domRef:ae,hidden:ye,width:ve,heightWithRowspan:re,onMouseEnter:rt,onMouseLeave:_t}=ce,Mt=We()[se],yt=g[fe];if(!Mt||!yt)return null;let Ve=!1,Et=k.isRowDetailEnabled,Ft=k.isRowDetailExpanded;!Et||typeof Et=="function"&&!Et(Mt)?Ve=!1:Ft&&(Ve=Ft(Mt)?"expanded":"collapsed");let Ln=A.isEditorVisibleForCell({rowIndex:se,columnId:yt.id});return qe(ep,{key:`${se}:${yt.id}`,rowIndex:se,rowHeight:re,width:ve,hidden:ye,domRef:ae,column:yt,columnsMap:I,fieldsToColumn:z,showZebraRows:q,rowDetailState:Ve,inEditMode:Ln,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(se):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(se):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:yt.repaintCellsKey!==void 0?yt.repaintCellsKey:k.repaintCellsKey,getData:We,rowInfoStore:V,renderingContext:x,getComputedVisibleColumns:C,getComputedColumnOrder:Le,dataSourceStatePartial:J,onMouseEnter:rt,onMouseLeave:_t})}},"body.renderCell"),gt=kt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),I=g.isRowDetailExpanded,z=g.rowDetailRenderer;if(!I||!z)return;let k=g.rowDetailCache;return q=>{let{rowIndex:V,domRef:J}=q,se=We()[V],fe=N().computedRowSizeCacheForDetails;if(!se||!I(se)||!fe)return qe("div",{ref:J,class:bl.hidden});let{rowDetailHeight:ae,rowHeight:ye}=fe.getSize(V);return qe(xa,{rowInfo:se,rowDetailsCache:k,rowIndex:V,domRef:J,detailOffset:ye,rowDetailHeight:ae,rowDetailRenderer:z})}});return Sp(io,{state:r,getState:l,actions:a,api:A,getComputed:D,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,I=y.value,z=vs({computedVisibleColumns:I.computedVisibleColumns,computedPinnedStartColumns:I.computedPinnedStartColumns,computedPinnedEndColumns:I.computedPinnedEndColumns,computedPinnedStartColumnsWidth:I.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:I.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:I.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:P.value}),k=g.focused,q=g.focusedWithin,V=I.computedPinnedStartWidth??I.computedPinnedStartColumnsWidth,J=I.computedPinnedEndWidth??I.computedPinnedEndColumnsWidth,ce=V?I.computedPinnedStartColumnsWidth>V:!1,se=J?I.computedPinnedEndColumnsWidth>J:!1,{autoFocus:fe,tabIndex:ae,className:ye,class:ve,style:re,onKeyDown:rt,onKeydown:_t,...Mt}=g.domProps??{},yt=ee(t.class,ye,ve,Fe,is,g.wrapRowsHorizontally?`${Fe}--horizontal-layout`:null,I.computedPinnedStartColumnsWidth?`${Fe}--has-pinned-start ${as}`:null,I.computedPinnedEndColumnsWidth?`${Fe}--has-pinned-end ${rs}`:null,k?`${Fe}--focused`:null,q?`${Fe}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,q&&g.focusedWithinClassName?g.focusedWithinClassName:null,ce?`${Fe}--has-pinned-start-overflow`:null,se?`${Fe}--has-pinned-end-overflow`:null,ls({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!I.computedPinnedStartColumnsWidth,hasPinnedEnd:!!I.computedPinnedEndColumnsWidth,focused:k,focusedWithin:q})),Ve={...t.style,...re,...z};k&&g.focusedStyle&&Object.assign(Ve,g.focusedStyle),q&&g.focusedWithinStyle&&Object.assign(Ve,g.focusedWithinStyle);let Et=_t??rt,Ft=Et?Vt=>{K(Vt),Et(Vt)}:K,Ln=u.value.loading;return qe("div",{...t,...Mt,ref:Vt=>{g.domRef.current=Vt??null},"data-debug-id":g.debugId,class:yt,style:Ve,onKeydown:Ft,onFocusin:Ne,onFocusout:Me},[g.header?qe(mp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,qe("div",{class:ee(Wf,cr),onContextmenu:xe},[qe(Hf,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:dt.value,renderDetailRow:gt.value,cellHoverClassNames:tt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:Pe,tabIndex:ae??0,autoFocus:!!fe,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||v()}),qe(Ki,{visible:!!Ln},()=>g.loadingText)]),qe("div",{ref:Vt=>{g.portalDOMRef.current=Vt??null},class:ee(`${Fe}Portal`,Cl[1e7],hl.absolute,gl[0],pl[0])},[qe(B),qe(G),qe(le),qe(Y)]),g.rowHeightCSSVar?qe(bo,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,qe(bo,{key:"flashing-duration",allowInts:!0,varName:Ie.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?qe(bo,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?qe(bo,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});import{defineComponent as VC,h as GC,watch as KC}from"vue";var Ip=$(j.currentFlashingDuration),BC=({children:o})=>o,Rp=1e3,xp={up:Vo({direction:"up"}).split(" "),down:Vo({direction:"down"}).split(" "),neutral:Vo({direction:"neutral"}).split(" ")},Pp=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=BC}=o;return VC({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=To(),u=Be(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=xp[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Ip),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:S}=u.getState(),w=typeof S=="number"?S??t??Rp:t??Rp,T=typeof y=="number"?y>C?"up":"down":"neutral",P=xp[T];b.style.setProperty(Ip,`${w}`),b.classList.add(...e?[e,...P]:P),m=T,f=setTimeout(p,w)};return KC(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,S,w]=y,[T,P]=C??[];if(!(b===T&&S===P)){p(),d=!0,s=null,c=w;return}w!==c&&(d=!1,s=c,c=w,h(w,s))},{flush:"post"}),()=>{let y=l.value;return GC("div",{...r,class:ee(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},HC=Pp();import{defineComponent as Ap,h as _p}from"vue";var Dp=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Ue(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var WC=Ap({name:"TreeGrid",props:[...Ea],setup(o,{slots:t}){return()=>_p(Fa,{...o},t)}}),jC=Ap({name:"TreeDataSource",props:[...jr],setup(o,{slots:t}){return()=>_p($r,{...o,nodesKey:o.nodesKey??"children"},t)}});var $C={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},UC={instantEdit:$C};var b0={CheckBox:jt,LoadMask:Ki,MenuIcon:no};export{Ge as CellSelectionState,$r as DataSource,uo as DataSourceInjectionKeyForVue,U as DeepMap,HC as FlashingColumnCell,ft as GroupRowsState,Fa as InfiniteTable,kC as InfiniteTableClassName,xa as InfiniteTableDetailRow,io as InfiniteTableInjectionKeyForVue,At as Menu,xr as NumberFilterEditor,st as RowDetailState,De as RowSelectionState,ro as StringFilterEditor,jC as TreeDataSource,Qe as TreeExpandState,WC as TreeGrid,Ue as TreeSelectionState,b0 as components,Pp as createFlashingColumnCellComponent,Zt as debounce,qn as defaultFilterTypes,$h as flatten,_r as group,UC as keyboardShortcuts,Pu as toTreeDataArray,co as useDataSourceContext,Wr as useGetMasterDetailContextForVue,To as useInfiniteColumnCell,Yf as useInfiniteColumnEditor,ao as useInfiniteColumnFilterEditor,$o as useInfiniteHeaderCell,Be as useInfiniteTableContext,Dt as useOverlay,Dp as withSelectedLeafNodesOnly};
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),e(i,n,t)},jr=o=>{let{debugId:t,key:e}=o,n=fd[e];if(n&&(Vg({...n,debugId:t}),t&&e)){let i=pd.get(t);i&&i.getState().devToolsDetected&&n&&(i.getState().debugWarnings.set(e,{...n,debugId:t,status:"new"}),Gg(t))}};globalThis.logDevToolsWarning=jr;var Gg=o=>{let t=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!t)return;let e=pd.get(o);e&&t(o,e)};import{inject as Kg,provide as Bg}from"vue";var md=Symbol("DataSourceMasterDetail");function hd(o){Bg(md,o)}var Hg=()=>{};function $r(){return Kg(md,Hg)}var Ur=["debugId","primaryKey","fields","refetchKey","batchOperationDelay","rowInfoReducers","data","selectionMode","useGroupKeysForMultiRowSelection","multiRowSelectionTarget","rowSelection","defaultRowSelection","onRowSelectionChange","cellSelection","defaultCellSelection","onCellSelectionChange","rowDisabledState","defaultRowDisabledState","onRowDisabledStateChange","isRowDisabled","isRowSelected","lazyLoad","loading","defaultLoading","onLoadingChange","onReady","pivotBy","defaultPivotBy","onPivotByChange","aggregationReducers","defaultAggregationReducers","groupBy","defaultGroupBy","onGroupByChange","groupRowsState","defaultGroupRowsState","onGroupRowsStateChange","collapseGroupRowsOnDataFunctionChange","sortFunction","sortInfo","defaultSortInfo","onSortInfoChange","onDataParamsChange","onDataArrayChange","onDataMutations","livePagination","livePaginationCursor","onLivePaginationCursorChange","filterFunction","treeFilterFunction","sortMode","filterMode","groupMode","shouldReloadData","filterValue","defaultFilterValue","onFilterValueChange","filterDelay","filterTypes","sortTypes","multiSort","nodesKey","isNodeExpanded","isNodeCollapsed","isNodeReadOnly","isNodeSelectable","isNodeSelected","treeSelection","defaultTreeSelection","onTreeSelectionChange","onTreeDataMutations","onNodeCollapse","onNodeExpand","treeExpandState","defaultTreeExpandState","onTreeExpandStateChange"],uo=Symbol("DataSource");function co(){return jg(uo)}var{useManagedComponent:qg}=mn({debugName:"DataSource",initSetupState:od,forwardProps:rd,concludeReducer:ju,mapPropsToState:ad,onPropChange:ld,cleanup:id,interceptActions:ud(),mappedCallbacks:sd()});function di(o,t){let e={},n=!0,i=r=>{let a={},l={};for(let u in r)r.hasOwnProperty(u)&&(n||r[u]!==e[u])&&(a[u]=r[u],l[u]=e[u]);e=r,n=!1,Object.keys(a).length!==0&&t(a,l)};ui(()=>i(o())),An(o,i,{flush:"post"})}function Yg(o){let{state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:i}=o;di(()=>({data:t.value.data,dataParams:t.value.dataParams}),()=>{n.lazyLoadCacheOfLoadedBatches=new $});let r=null,a=(s,c,f=e().lazyLoadCacheOfLoadedBatches)=>{let m=e();if(s=s||r,!s)return;let{renderStartIndex:p,renderEndIndex:h}=s,{lazyLoadBatchSize:y,lazyLoad:C}=m;C&&((!y||y<=0)&&(!m.groupBy||m.groupBy.length===0)||Xu({startIndex:p,endIndex:h,lazyLoadBatchSize:y,componentState:m,componentActions:n,dismissLoadedRows:c?.dismissLoadedRows??!1},f))},l=null,u=()=>{let s=e().scrollStopDelayUpdatedByTable;return(!l||l.wait!==s)&&(l={wait:s,fn:Qt(a,{wait:s})}),l.fn},d=null;di(()=>{let s=t.value;return{sortInfo:s.sortInfo,filterValue:s.filterValue,groupBy:s.groupBy,pivotBy:s.pivotBy,refetchKey:s.refetchKey,cursorId:s.livePagination?s.cursorId:null,lazyLoadBatchSize:s.lazyLoadBatchSize,lazyLoad:s.lazyLoad,originalLazyGroupDataChangeDetect:s.originalLazyGroupDataChangeDetect,groupRowsState:s.groupRowsState}},s=>{d?.(),d=null;let{lazyLoad:c,notifyRenderRangeChange:f}=e();c&&(s.sortInfo||s.filterValue||s.groupBy||s.pivotBy||s.refetchKey||s.cursorId?(e().lazyLoadCacheOfLoadedBatches.clear(),e().originalLazyGroupData.clear(),a(f.get(),{dismissLoadedRows:!0}),i.current=!0,Promise.resolve().then(()=>{i.current=!1})):(s.originalLazyGroupDataChangeDetect||s.groupRowsState)&&a(f.get()),d=f.onChange(m=>{r=m,a(m)}))}),An(()=>t.value.dataArray,()=>{let{lazyLoadBatchSize:s}=e();s&&s>0&&u()()},{flush:"post"}),si(()=>{d?.(),d=null})}function Zg(o){let{state:t,getDataSourceState:e,dataSourceActions:n}=o,i=()=>t.value.getDataSourceMasterContextRef.current?.()??void 0,r=Ug({vertical:!1,horizontal:!1}),a=t.value.notifyScrollbarsChange.onChange(p=>{p&&(r.value=p)});si(()=>{a()});let l=null;An(()=>t.value.livePaginationCursor,p=>{t.value.livePagination&&(l!=null&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{l=null,r.value?.vertical||p&&(n.cursorId=p)}))},{flush:"post"});let u=null;An(()=>[t.value.dataArray.length,t.value.livePaginationCursor],()=>{let{livePagination:p,livePaginationCursor:h,cursorId:y,dataArray:C}=t.value;!p||h!==void 0||(u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=null,r.value?.vertical||y!=null&&C.length&&(n.cursorId=C.length)}))},{flush:"post"}),An(()=>r.value.vertical,p=>{let{livePaginationCursor:h,livePagination:y,dataArray:C}=e();!p&&y&&(h?n.cursorId=h:h===void 0&&C.length&&(n.cursorId=C.length))},{flush:"post"}),si(()=>{l!=null&&cancelAnimationFrame(l),u!=null&&cancelAnimationFrame(u)});let d=Yu(),s=()=>{let{filterValue:p,filterMode:h,filterTypes:y}=t.value;return d(p,y,h)},c=()=>{let{shouldReloadData:p,sortInfo:h,groupBy:y,pivotBy:C,refetchKey:b,livePagination:S,cursorId:w}=t.value;return{sortInfo:p.sortInfo?h:null,groupBy:p.groupBy?y:null,pivotBy:p.pivotBy?C:null,refetchKey:b,filterValue:p.filterValue?s():null,cursorId:S?w:null}},f={current:!1};Yg({state:t,getDataSourceState:e,dataSourceActions:n,reloadedRef:f});let m=[];di(()=>({data:t.value.data}),()=>{let p=e(),h=i(),{isDetail:y,isDetailReady:C}=Kr(h,e);if(y&&!C)return;let b=Date.now();m.length>=10&&m.splice(0,1),m.push(b),b-m[0]<200&&m.length>=10&&jr({debugId:p.debugId,key:"DS001"}),typeof p.data!="function"&&Pn(p.data,p,n,void 0,h)}),di(()=>({...c(),data:t.value.data}),p=>{let h=Object.keys(p),y=!1;if(h.length===1){if(y=!!p.cursorId,p.filterValue&&e().filterMode==="local")return;let T=e().data;if(Array.isArray(T)&&p.refetchKey){n.originalDataArray=T;return}}let C=i(),{isDetail:b,isDetailReady:S}=Kr(C,e);if(b&&!S)return;let w=e();if(typeof w.data=="function"){if(f.current&&!y&&Zu(w))return;Pn(w.data,w,n,{append:y},C)}}),ui(()=>{let p=e(),h=xt(p,void 0,i());n.dataParams=h})}function Xg(o){let t=$r(),e=!!t(),{contextValue:n}=qg(o),i=n.state,r=n.componentActions,a=n.getComponentState;i.value.getDataSourceMasterContextRef.current=t;let l=Lu({getState:a,actions:r}),u={state:i,getDataSourceState:a,dataSourceActions:r,dataSourceApi:l,assignState:n.assignState};return $g(uo,u),ui(()=>{let d=t();if(d){let s={dataSourceState:i.value,dataSourceActions:r,getDataSourceMasterContext:t,getDataSourceState:a,assignState:u.assignState,dataSourceApi:l};d.registerDetail(s)}}),Zg({state:i,getDataSourceState:a,dataSourceActions:r}),An(()=>i.value.originalDataArrayChangedInfo,()=>{let d=i.value;d.onDataArrayChange?.(d.originalDataArray,d.originalDataArrayChangedInfo),d.onDataMutations&&d.originalDataArrayChangedInfo.mutations&&d.originalDataArrayChangedInfo.mutations.size&&d.onDataMutations({primaryKeyField:typeof d.primaryKey=="string"?d.primaryKey:void 0,dataArray:d.originalDataArray,mutations:d.originalDataArrayChangedInfo.mutations,timestamp:d.originalDataArrayChangedInfo.timestamp}),d.onTreeDataMutations&&d.originalDataArrayChangedInfo.treeMutations&&d.originalDataArrayChangedInfo.treeMutations.size&&d.onTreeDataMutations({nodesKey:d.nodesKey?d.nodesKey:void 0,dataArray:d.originalDataArray,treeMutations:d.originalDataArrayChangedInfo.treeMutations,timestamp:d.originalDataArrayChangedInfo.timestamp})},{flush:"post"}),ui(()=>{i.value.onReady?.(l)}),si(()=>{let d=a();d.onCleanup(d)}),u}var qr=Wg({name:"DataSource",props:[...Ur],setup(o,{slots:t}){let e=Xg(o);return()=>t.default?.(e.state.value)??null}});import{computed as NC,defineComponent as OC,h as qe,inject as kC,onBeforeUnmount as Fa,onMounted as LC,provide as Ip,ref as zC,shallowRef as VC,watch as He,watchEffect as GC}from"vue";import{computed as Jg}from"vue";function kt(o,t,e){let n=null,i;return Jg(()=>{let r=o();return(n===null||r.length!==n.length||r.some((a,l)=>!Object.is(a,n[l])))&&(i=t()),n=r,i})}var _n=(o,t,e={debounce:0})=>{let n=e.debounce??0,i=window.ResizeObserver,r=n?Qt(t,{wait:n}):t,a=new i(l=>{let u=l[0],{width:d,height:s}=u.contentRect;if(u.borderBoxSize?.[0])s=u.borderBoxSize[0].blockSize,d=u.borderBoxSize[0].inlineSize;else{let c=o.getBoundingClientRect();s=c.height,d=c.width}r({width:d,height:s})});return a.observe(o),()=>{a.disconnect()}};var fi=class fi{constructor(t,e){this.keysInOrder=[];if(typeof t=="number")this.maxSize=t,this.currentMap=new Map;else if(this.maxSize=e??fi.DEFAULT_SIZE,t){let n=Array.from(t);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([i,r])=>{this.set(i,r)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(t){return this.currentMap.has(t)?(this.currentMap.delete(t),this.keysInOrder=this.keysInOrder.filter(e=>e!==t),!0):!1}has(t){return this.currentMap.has(t)}get(t){return this.currentMap.get(t)}set(t,e){if(this.has(t)&&this.delete(t),this.maxSize-this.currentMap.size<=0){let[i]=this.keysInOrder.splice(0,1);i!=null&&this.currentMap.delete(i)}return this.keysInOrder.push(t),this.currentMap.set(t,e),this}};fi.DEFAULT_SIZE=10;var ci=fi;var Yr=class{add(t,e){}get(t){}delete(t){}has(t){return!1}},pi=class{constructor(t){this.storage=new ci(t)}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},Zr=class{constructor(){this.storage=new Map}add(t,e){this.storage.set(t,e)}get(t){return this.storage.get(t)}delete(t){this.storage.delete(t)}has(t){return this.storage.has(t)}},mi=class{constructor(t){this.cacheStorage=t===!1?new Yr:t===!0?new Zr:typeof t=="number"?new pi(t):new pi(5)}add(t,e){this.cacheStorage.add(t,e)}get(t){return this.cacheStorage.get(t)}delete(t){this.cacheStorage.delete(t)}has(t){return this.cacheStorage.has(t)}};var st=class extends Rn{constructor(e){super(e);this.isRowDetailsExpanded=e=>!!this.isItemPositive(e)}getState(){let e=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:e,collapsedRows:n}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(e){return!this.isRowDetailsExpanded(e)}setRowDetailsExpanded(e,n){return this.setItemValue(e,n)}collapseRowDetails(e){this.setRowDetailsExpanded(e,!1)}expandRowDetails(e){this.setRowDetailsExpanded(e,!0)}toggleRowDetails(e){this.toggleItem(e)}};var gd=zn(wn());var Xr=(o,t)=>o-t,Lt={horizontal:!0,vertical:!0};function hi(o,t){let e=t.length;if(!e)return 0;let n=-1;for(let i=0;i<e;i++){let r=0,a=0;if(e-i<=n)break;for(let l=i;l<e;l++)if(r+=t[l],a++,r>o){a>n&&(n=a);break}}return n<0?e:Math.min(n,e)}var gi={start:0,end:0},Jr=o=>{o()},Qr=o=>{let{start:t,end:e}=o,[n,i]=t,[r,a]=e,l=r-n,u=a-i;return l*u},yd=o=>{let{start:t,end:e}=o,[n]=t,[i]=e;return i-n},fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Qg(o){return o.horizontalChange||o.verticalChange}var sn=class extends et{constructor(e){let n=Dn(e,`${e}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=gi;this.verticalExtendRangeBy=gi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=e=>{this.scrollStopDelay=e};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=e=>{let n=this.scrolling;this.scrolling=e,e&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),e!==n&&(e?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let e=this.onScrollStartFns;for(let n=0,i=e.length;n<i;n++)e[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let e=this.onScrollStopFns,n=this.scrollPosition,i=this.getRenderRange();for(let r=0,a=e.length;r<a;r++)e[r](n,i)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let e=this.onAvailableSizeChangeFns,n=this.getAvailableSize();e.forEach(i=>{fo(()=>{this.destroyed||e.has(i)&&i(n)})})};this.notifyVerticalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,i=this.verticalRenderRange,r=e?Jr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.notifyHorizontalRenderRangeChange=(e=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,i=this.horizontalRenderRange,r=e?Jr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a([i.startIndex,i.endIndex])})})};this.isColFixedEnd=e=>this.fixedColsEnd?e>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=e=>this.fixedColsStart?e<this.fixedColsStart:!1;this.isRowFixedEnd=e=>this.fixedRowsEnd?e>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=e=>this.fixedRowsStart?e<this.fixedRowsStart:!1;this.isColFixed=e=>this.isColFixedStart(e)||this.isColFixedEnd(e);this.isRowFixed=e=>this.isRowFixedStart(e)||this.isRowFixedEnd(e);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let e=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)e+=this.getColWidth(n);return e};this.getFixedEndColsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=this.getColWidth(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.cols-this.fixedColsEnd;s<this.cols;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedEndRowsOffsets=({skipScroll:e}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:i}=this.getAvailableSize(),r=[],a=[],l=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=this.getRowHeight(s);a.push(c),l+=c}let u=i-l+(e?0:n);l=0;let d=0;for(let s=this.rows-this.fixedRowsEnd;s<this.rows;s++){let c=u+l;r[s]=c,l+=a[d],d++}return r};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let e=0;for(let n=0;n<this.fixedColsStart;n++)e+=this.getColWidth(n);return e};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let e=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)e+=this.getRowHeight(n);return e};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let e=0;for(let n=0;n<this.fixedRowsStart;n++)e+=this.getRowHeight(n);return e};this.computeRenderCount=(e=Lt)=>{let n=e.horizontal,i=e.vertical,r=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(r=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),i&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:r,vertical:a}};this.setRenderCount=({horizontal:e,vertical:n})=>{e===void 0&&(e=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let i=e===this.horizontalRenderCount,r=n===this.verticalRenderCount;i&&r||(this.horizontalRenderCount=e,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!i,vertical:!r}),this.notifyRenderCountChange())};this.updateFixedCells=e=>{e.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=e.fixedColsStart||0),e.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=e.fixedColsEnd||0),e.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=e.fixedRowsStart||0),e.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=e.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}=this;return{fixedRowsStart:e,fixedColsStart:n,fixedRowsEnd:i,fixedColsEnd:r}};this.updateRenderRange=(e=Lt)=>{this.setRenderRange(this.computeRenderRange(e))};this.getExtraSpanCellsForRange=({horizontal:e,vertical:n})=>{let{colspan:i,rowspan:r}=this,a=[];if(r){let l=n.startIndex,u=e.startIndex,d=e.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(l,s,"vertical");let c=this.rowspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([f,s])}}}if(i){let l=e.startIndex,u=n.startIndex,d=n.endIndex;for(let s=u;s<d;s++){this.computeItemSpanUpTo(s,l,"horizontal");let c=this.colspanParent.get(s);if(c[l]!=l){let f=l;for(;c[f]!=f;)f--;a.push([s,f])}}}return a};this.computeRenderRange=(e=Lt)=>{let n=e.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,i=e.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:i,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:i})}};this.computeDirectionalRenderRange=e=>{let n=e==="horizontal"?this.colWidth:this.rowHeight,i=e==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,r=e==="horizontal"?this.cols:this.rows;if(!i)return{startIndex:0,endIndex:0};let a=(e==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=e==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(e);let u=typeof n!="function",d=e==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,s=this.getItemAt(l,e),c=d.start||0,f=d.end||0;u||(c+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),c&&(s=Math.max(0,s-c),i+=c),f&&(i+=f);let m=s+i,p=Math.max(a,r-(e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return m>p&&(m=p,s=Math.max(a,m-i)),{startIndex:s,endIndex:m}};this.getItemAt=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.cols:this.rows;if(typeof i!="function")return Math.min(Math.max(0,Math.floor(e/i)),r-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,u=a.length-1,d=l.length-1,s=a[u],c;for(;s<e;)if(u>=r||(d+=1,this.computeCacheFor(d,n),c=s,s=a[d],c===s&&c!=0))return r-1;let f=(0,gd.default)(a,e,Xr);return f>=0?f:~f-1};this.computeCacheFor=(e,n)=>{let i=n==="horizontal"?this.colWidth:this.rowHeight,r=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof i!="function")return;let l=i(e);if(r[e]=l,e>0){let u=a[e-1],d=r[e-1];u==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${e-1}`),d==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${e-1}`);let s=u+d;a[e]=s}};this.computeItemSpanUpTo=(e,n,i)=>{let r=i==="horizontal"?n:e,a=i==="horizontal"?e:n,l=i==="horizontal"?this.cols:this.rows,u=i==="horizontal"?this.colspan:this.rowspan;if(!u)return;let d=i==="horizontal"?this.colspanParent:this.rowspanParent;d.has(a)||d.set(a,[]);let s=i==="horizontal"?this.colspanValue:this.rowspanValue;s.has(a)||s.set(a,[]);let c=d.get(a),f=s.get(a);if(c[r]===void 0){let m=c.length,p=l?Math.min(r,l-1):0,h={rowIndex:e,colIndex:n};for(;m<=p;m++)if(c[m]===void 0){h[i==="horizontal"?"colIndex":"rowIndex"]=m;let y=u(h);c[m]=m,f[m]=y;let C=m;for(;y>1;)C+=1,c[C]=m,f[C]=0,y-=1}}};this.getCellSpan=(e,n,i)=>{let r=i==="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return 1;let u=i==="horizontal"?this.colspanValue:this.rowspanValue,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]||1};this.getRowspan=(e,n)=>this.getCellSpan(e,n,"vertical");this.getColspan=(e,n)=>this.getCellSpan(e,n,"horizontal");this.getRowspanParent=(e,n)=>this.getItemSpanParent(e,n,"vertical");this.getColspanParent=(e,n)=>this.getItemSpanParent(e,n,"horizontal");this.getItemSpanParent=(e,n,i)=>{let r=i=="horizontal"?this.colspan:this.rowspan,a=i==="horizontal"?n:e,l=i==="horizontal"?e:n;if(!r)return a;let u=i==="horizontal"?this.colspanParent:this.rowspanParent,d=u.get(l);return(!d||d[a]===void 0)&&this.computeItemSpanUpTo(e,n,i),d||(d=u.get(l)),d[a]};this.getRowHeightWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"vertical");this.getColWidthWithSpan=(e,n,i)=>this.getItemSizeWithSpan(e,n,i,"horizontal");this.getItemSizeWithSpan=(e,n,i,r)=>{let a=r==="horizontal"?n:e,l=this.getItemSize(a,r);for(;i>1;)a+=1,i-=1,l+=this.getItemSize(a,r);return l};this.getRowHeight=e=>this.getItemSize(e,"vertical");this.getColWidth=e=>this.getItemSize(e,"horizontal");this.getItemSize=(e,n)=>{let i=n==="horizontal"?this.cols:this.rows,r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return r;let a=this.getItemSizeCacheFor(e,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let u=l.length,d=Math.min(e,i-1);for(;u<=d;u++)this.computeCacheFor(u,n);a=this.getItemSizeCacheFor(e,n)}return a};this.keepColumnRendered=e=>(this.alwaysRenderedColumns.add(e),()=>{this.alwaysRenderedColumns.delete(e)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:e,vertical:n,extraCells:i})=>{let r=!1;(e.startIndex!==this.horizontalRenderRange.startIndex||e.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=e,r=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=i||[],(r||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),r&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Qr;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==e)});this.onScrollStart=e=>(this.onScrollStartFns.push(e),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==e)});this.onScrollStop=e=>(this.onScrollStopFns.push(e),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==e)});this.onRenderRangeChange=e=>(this.onRenderRangeChangeFns.add(e),()=>{this.onRenderRangeChangeFns.delete(e)});this.onVerticalRenderRangeChange=e=>(this.onVerticalRenderRangeChangeFns.add(e),()=>{this.onVerticalRenderRangeChangeFns.delete(e)});this.onHorizontalRenderRangeChange=e=>(this.onHorizontalRenderRangeChangeFns.add(e),()=>{this.onHorizontalRenderRangeChangeFns.delete(e)});this.onRenderCountChange=e=>(this.onRenderCountChangeFns.add(e),()=>{this.onRenderCountChangeFns.delete(e)});this.onAvailableSizeChange=e=>(this.onAvailableSizeChangeFns.add(e),()=>{this.onAvailableSizeChangeFns.delete(e)});this.onDestroy=e=>(this.onDestroyFns.push(e),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==e)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(e){e!=this._rowsPerPage&&(this._rowsPerPage=e)}get rowsPerPage(){return this._rowsPerPage}reset(e=Lt){e.vertical&&this.resetVertical(),e.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(e,n){return e}update(e,n){let{rows:i,cols:r,rowHeight:a,colWidth:l,width:u,height:d}=e,s=typeof u=="number",c=typeof d=="number",f=s&&u!==this.availableWidth,m=c&&d!==this.availableHeight;f&&(this.availableWidth=u,this.availableRenderWidth=u),m&&(this.availableHeight=d,this.availableRenderHeight=d),(f||m)&&this.notifyAvailableSizeChange();let p=typeof i=="number",h=typeof r=="number",y=p&&i!==this.rows,C=h&&r!==this.cols;p&&(this.rows=i,this.rowsPerPage=i),h&&(this.cols=r);let b=a!=null,S=l!=null,w=b&&a!==this.rowHeight,T=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let P=e.rowspan!=null,R=e.colspan!=null,E=P&&e.rowspan!=this.rowspan,N=R&&e.colspan!=this.colspan;E&&(this.rowspan=e.rowspan),N&&(this.colspan=e.colspan);let v=C||T||f||N,D=y||w||m||E;(n||Qg)({horizontalChange:v,verticalChange:D,colsChanged:C,colWidthChanged:T,widthChanged:f,colspanChanged:N,rowsChanged:y,rowHeightChanged:w,heightChanged:m,rowspanChanged:E})&&this.updateRenderCount({horizontal:v,vertical:D})}extendRenderRange(e){let{direction:n}=e,i=n==="horizontal",r=i?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof e.start=="number"?e.start:e.start===!0?r:0,l=typeof e.end=="number"?e.end:e.end===!0?r:0;return i?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:i,vertical:!i}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(e=Lt){this.reset(e),this.doUpdateRenderCount(e)}doUpdateRenderCount(e=Lt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(e))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(e,n){this.setScrolling(!0);let i=e.scrollLeft!==this.scrollPosition.scrollLeft,r=e.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=e,(i||r)&&(n?.(e),this.updateRenderRange({horizontal:i,vertical:r}),this.notifyScrollChange())}notifyRenderRangeChange(e=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,i=this.getRenderRange(),r=e?Jr:fo;n.forEach(a=>{r(()=>{this.destroyed||n.has(a)&&a(i)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:e}=this,n=this.onScrollFns;for(let i=0,r=n.length;i<r;i++)n[i](e)}computeDirectionalRenderCount(e,n,i,r){let a=0,l=e==="horizontal"?r.width:r.height;if(l-=this.getFixedSize(e),l<=0)return 0;let u=e==="horizontal"?this.fixedColsStart:this.fixedRowsStart,d=e==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let s=[],c=0,f=i;c+=u,f-=d;for(let m=c;m<f;m++)s.push(this.getItemSize(m,e));a=hi(l,s)}else a=(n?Math.ceil(l/n):0)+1;return a+=u+d,e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getFixedSize(e){return e==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(e){return e==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(e){return e==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:e,verticalRenderCount:n}=this,i={horizontal:e,vertical:n},r=this.onRenderCountChangeFns;r.forEach(a=>{fo(()=>{this.destroyed||r.has(a)&&a(i)})})}getCellOffset(e,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(e,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(e,n){let i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return e*i;let r=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=r[e];if(l==null){let u=a.length-1;for(;u<e;)u+=1,this.computeCacheFor(u,n);l=r[e]}return l}getItemSizeCacheFor(e,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[e]}getRowIndexInPage(e){return e}getPageIndexForRow(e){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(e){let n=e==="horizontal"?this.cols:this.rows,i=e==="horizontal"?this.colWidth:this.rowHeight,r=e==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof i!="function")return i*n;if(r!==0&&!isNaN(r))return r;let a=e==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,e):0,u=n?a[n-1]:0,d=l+u;return e==="horizontal"?this.horizontalTotalSize=d:this.verticalTotalSize=d,d}notifyDestroy(){let e=this.onDestroyFns;for(let n=0,i=e.length;n<i;n++)e[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=gi,this.verticalExtendRangeBy=gi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ey={scrollLeft:0,scrollTop:0},po=class{constructor(){this.scrollPosition=ey;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(e=>e!==t)});this.setScrollPosition=t=>{this.scrollPosition=t,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:t}=this,e=this.onScrollFns;for(let n=0,i=e.length;n<i;n++)e[n](t)}};var{rootClassName:ty}=ke,mt=`${ty}ColumnCell`;function bd(o,t){let e=new Map;function n(i){return t[i]!==!1}return Object.keys(o).forEach(i=>{let a=o[i].columnGroup,l=0;for(n(i)||(l=-1);a;){let u=o[a];if(!u)break;n(a)&&l++,a=u.columnGroup}e.set(i,l)}),e}import{h as ny}from"vue";function Cd(o){return(t,e)=>ny(o,{key:t.id,rowInfo:t,cache:e})}var mo=class extends sn{constructor(e,n){super(`${e}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=e=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(e%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=e=>(this.onTotalPageCountChangeFns.add(e),()=>{this.onTotalPageCountChangeFns.delete(e)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(e,n,i,r){if(e==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(e,n,i,r);let a=0,l=r.width,u=Math.floor(l/this.pageWidth);a+=u*this.initialCols;let d=l-u*this.pageWidth,s=[];for(let c=0;c<this.initialCols;c++)s.push(this.getItemSize(c,e));return a+=hi(d,s.concat(s)),e==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(i,a),a}getRowIndexInPage(e){return this.rowsPerPage?e%this.rowsPerPage:e}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(e){return Math.floor(e/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(e){let n=e.rowIndex,i=e.colIndex;return e.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=e.rowIndex%this.rowsPerPage,i=Math.floor(e.rowIndex/this.rowsPerPage)*this.initialCols+i),{rowIndex:n,colIndex:i}}getHorizontalLayoutPositionFromMatrixCoordinates(e){let n=e.rowIndex,i=e.colIndex;if(e.colIndex>=this.initialCols&&this.initialCols>0){let r=Math.floor(e.colIndex/this.initialCols);i=e.colIndex-r*this.initialCols,n=this.rowsPerPage*r+e.rowIndex}return{colIndex:Math.min(i,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(e){let{rows:n,cols:i,rowHeight:r,colWidth:a,width:l,height:u}=e,d=typeof l=="number",s=typeof u=="number",c=d&&l!==this.availableWidth,f=s&&u!==this.availableHeight;c&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=u,this.availableRenderHeight=u),(c||f)&&this.notifyAvailableSizeChange();let m=typeof n=="number",p=typeof i=="number",h=m&&n!==this.initialRows,y=p&&i!==this.initialCols;m&&h&&(this.initialRows=n,this.rows=n),p&&y&&(this.initialCols=i,this.cols=i);let C=r!=null,b=a!=null,S=C&&r!==this.rowHeight,w=b&&a!==this.initialColWidth;C&&(this.rowHeight=r),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||f,P=y||w||c||T;(P||T)&&this.updateRenderCount({horizontal:P,vertical:T})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(e){this.options.masterBrain||(this._totalPageCount=e)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(e=Lt){let n=this.getInitialRowHeight(),i=0;for(let a=0;a<this.initialCols;a++)i+=this.getColWidth(a);this.pageWidth=i,this.rowsPerPage=Math.floor(this.availableHeight/n);let r=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(r=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(e),r&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let e=this.onTotalPageCountChangeFns;e.forEach(n=>{Oe(()=>{this.destroyed||e.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(e,n){return this.initialCols*(n?.pageIndex??0)+e}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(e){return e==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var ea=zn(wn());function Td(...o){if(!o.length)return new Set;let[t,...e]=o;return new Set([...t].filter(n=>e.every(i=>i.has(n))))}function Sd(o,t){let e=new Set;for(let n of o)t(n)&&e.add(n);return e}function ho(o,t){for(let e of o)if(t(e))return e}var yi=(o,t)=>o-t,bi=class extends et{constructor(e,n){super(`${e}:GridCellManager`);this.matrix=new $;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i,d=new Set;return this.matrix.visit(({value:s},c)=>{if(!s)return;let[f,m]=c,p=f<r,h=f>=l,y=m<a,C=m>=u;(p||h||y||C)&&d.add(s)}),d};this.debugId=e,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(i=>this.onRemoveCell(i))}onRemoveCell(e){let n=this.cellToMatrixPosition.get(e);this.cellToMatrixPosition.delete(e),n&&this.clearCellFromMatrix(e,n,{skipHistory:!1})}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(e,n,i){if(this.matrix.delete(n),i.skipHistory)return;let[r,a]=n,l=this.rowsWithCellsHistory.get(r),u=this.columnsWithCellsHistory.get(a);l&&(l.delete(e),l.size===0&&this.rowsWithCellsHistory.delete(r)),u&&(u.delete(e),u.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(e,n){let[i,r]=n;this.matrix.set(n,e),this.cellToMatrixPosition.set(e,n);let a=this.rowsWithCellsHistory.get(i),l=this.columnsWithCellsHistory.get(r);a?a.add(e):(a=new Set,a.add(e),this.rowsWithCellsHistory.set(i,a)),l?l.add(e):(l=new Set,l.add(e),this.columnsWithCellsHistory.set(r,l))}setCellPositionInMatrix(e,n){let i=this.cellToMatrixPosition.get(e);if(n==null){i&&this.clearCellFromMatrix(e,i,{skipHistory:!0});return}let[r,a]=n,l=i&&i[0]===r&&i[1]===a;i&&!l&&this.clearCellFromMatrix(e,i,{skipHistory:!1}),this.addCellToMatrix(e,n)}renderNodeAtCell(e,n,i,r){let a=this.getCellAt(i);return a&&a!==n&&this.detachCellAt(i),this.pool.attachCell(n),this.setCellPositionInMatrix(n,i),n.update(e,r),n}getCellPosition(e){let n=this.cellToMatrixPosition.get(e);return!n||this.getCellAt(n)!=e?null:n}getCellAt(e){return this.matrix.get(e)}getCellFor(e,n){let i=this.getCellAt(e);if(i)return i;let[r,a]=e;if(n==="row"){let l=this.rowsWithCellsHistory.get(r);l&&(i=ho(l,u=>!this.isCellAttached(u)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(i=ho(l,u=>!this.isCellAttached(u)))}return i??this.getDetachedCell()}isCellAttached(e){return this.getCellPosition(e)!==null}isCellAttachedAt(e){let n=this.getCellAt(e);return n?this.isCellAttached(n):!1}getMatrix(){let e=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:e+1},(r,a)=>Array.from({length:n+1},(u,d)=>{let s=[a,d],c=this.getCellAt(s);return c?c.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(e){return this.matrix.getKeysStartingWith([e]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(yi)}getColumnsWithCells(){let e=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(e.map(i=>i[1])).values()].sort(yi)}isRowAttached(e){return this.getRowsWithCells().includes(e)}isColumnAttached(e){return this.getColumnsWithCells().includes(e)}detachRow(e){this.matrix.getKeysStartingWith([e]).forEach(i=>this.detachCellAt(i))}detachCol(e){this.matrix.visit((n,i)=>{i[1]===e&&this.detachCellAt(i)})}detachCell(e){return e?(this.pool.detachCell(e)&&this.setCellPositionInMatrix(e,null),!0):!1}detachCells(e){e.forEach(n=>this.detachCell(n))}detachRowsStartingWith(e){let n=this.getRowsWithCells().sort(),i=(0,ea.default)(n,e,yi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRow(a))}detachColsStartingWith(e){let n=this.getColumnsWithCells().sort(),i=(0,ea.default)(n,e,yi);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachCol(a))}detachCellsStartingAt(e){let[n,i]=e;this.matrix.visit((r,a)=>{let[l,u]=a;l>n&&this.detachCellAt(a),l===n&&u>=i&&this.detachCellAt(a)})}detachCellAt(e){let n=this.getCellAt(e);return n?this.detachCell(n):!1}onCellAttachmentChange(e){return this.pool.onCellAttachmentChange(e)}getCellFromListForRow(e,n){return ho(e,i=>this.getCellPosition(i)?.[0]===n)}getCellFromListForColumn(e,n){return ho(e,i=>this.getCellPosition(i)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(e=>{e.update(null)})}withDetachedCells(e){this.pool.getDetachedCells().forEach(e)}};var wd=zn(wn());var Ci=class extends et{constructor(e,n){super(`${e}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=e,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(i=>this.onRemoveRow(i))}onRemoveRow(e){let n=this.rowToIndex.get(e);n!=null&&(this.rowToIndex.delete(e),this.indexToRow.delete(n))}set poolSize(e){this.pool.poolSize=e}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(e){return this.getRowAt(e)??this.getDetachedRow()}setRowIndexInList(e,n){let i=this.rowToIndex.get(e);i!=null&&this.indexToRow.delete(i),n==null?this.rowToIndex.delete(e):(this.rowToIndex.set(e,n),this.indexToRow.set(n,e))}detachStartingWith(e){let n=this.getAttachedIndexes(),i=(0,wd.default)(n,e,(a,l)=>a-l);i<0&&(i=~i),n.slice(i).forEach(a=>this.detachRowAt(a))}getRowAt(e){return this.indexToRow.get(e)}getRowIndex(e){return this.rowToIndex.get(e)}isRowAttached(e){return this.getRowIndex(e)!=null}isRowAttachedAt(e){return!!this.getRowAt(e)}getList(){let e=Math.max(...this.indexToRow.keys());return Array.from({length:e+1},(i,r)=>{let a=this.indexToRow.get(r);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(e){this.indexToRow.forEach(e)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(e){let n=this.getRowAt(e);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(e){let n=this.getRowIndex(e);n!=null&&this.detachRowAt(n)}renderNodeAtRow(e,n,i){let r=this.getRowAt(i);return r&&r!==n&&this.detachRowAt(i),this.pool.attachRow(n),this.setRowIndexInList(n,i),n.update(e),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(e=>{e.update(null)})}onRowAttachmentChange(e){return this.pool.onRowAttachmentChange(e)}withDetachedRows(e){this.pool.getDetachedRows().forEach(e)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var vd=!0,un=U(j.y),Id=U(j.scrollTop),c1=U(j.columnOffsetAtIndex),ta=U(j.columnOffsetAtIndexWhileReordering),Mn=class extends et{constructor(e,n,i){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(e,n,{y:i,scrollTop:r,scrollLeft:a})=>{e.style.setProperty(un,r?`calc( ${i}px + var(${Id}) )`:`${i}px`),e.style.transform=`translate3d(${a||0}px, var(${un}), 0)`};this.setTransform=(e,n,i,{x:r,y:a,scrollLeft:l,scrollTop:u},d)=>{let s=be.columnOffsets.get(i),c=`${ta}-${i}`,f=u?`calc( ${a}px + var(${Id}) )`:`${a}px`;e.__currentTransformY!==f&&(e.__currentTransformY=f,e.style.setProperty(un,f));let m=`translate3d(var(${c}, ${s}), var(${un}), 0)`;e.__transformValue!==m&&(e.__transformValue=m,e.style.transform=m),d!=null};this.getFullyVisibleRowsRange=()=>{let{start:[e],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(e);)if(e++,e===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===e)return null;return{start:e,end:n}};this.getScrollPositionForScrollRowIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=r.scrollLeft,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isRowFullyVisible(e)&&!l)return r;let d=i.getItemOffsetFor(e,"vertical"),s=i.getItemSize(e,"vertical"),c=i.getFixedStartRowsHeight(),f=i.getFixedEndRowsHeight(),m=r.scrollTop,p=i.getAvailableSize();if(!p.height)return null;let h=m+p.height;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollTop;if(l==="center"?y=d-Math.floor((i.getAvailableSize().height-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),this.brain.isHorizontalLayoutBrain){let C=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(C,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(e)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};this.getScrollPositionForScrollColumnIntoView=(e,n={offset:0})=>{if(this.destroyed)return null;let{brain:i}=this,r=i.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:u=0}=n;if(this.isColumnFullyVisible(e,void 0,a)&&!l)return r;a&&(e=i.getInitialCols()*a.horizontalLayoutPageIndex+e);let d=i.getItemOffsetFor(e,"horizontal"),s=i.getItemSize(e,"horizontal"),c=i.getFixedStartColsWidth(),f=i.getFixedStartColsWidth(),m=r.scrollLeft,p=i.getAvailableSize();if(!p.width)return null;let h=m+p.width;l||(l=d>h-f?"end":d<m+c?"start":"end");let y=r.scrollLeft;return l==="center"?y=d-Math.floor((i.getAvailableSize().width-c-f)/2):l==="start"?(u=-u,y+=d-m+u-c):(u+=s,y+=d-h+u+f),{...r,scrollLeft:y}};this.getScrollPositionForScrollCellIntoView=(e,n,i={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let r=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:i.colScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(e,{scrollAdjustPosition:i.rowScrollAdjustPosition||i.scrollAdjustPosition,offset:i.offsetTop});if(!r||!a)return null;let{scrollLeft:l}=r,{scrollTop:u}=a;return{scrollLeft:l,scrollTop:u}};this.isRowFullyVisible=(e,n=2)=>this.isRowVisible(e,this.brain.getRowHeight(e)-n);this.isRowVisible=(e,n=10)=>{if(!this.isRowRendered(e))return!1;e=this.brain.getPageIndexForRow(e)&&this.brain.rowsPerPage?e%this.brain.rowsPerPage:e;let{brain:r}=this;if(r.isRowFixed(e))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),u=Math.floor((a+l)/2);if(e<a||e>=l)return!1;if(e>=u){let d=r.getItemAt(r.getAvailableSize().height+r.getScrollPosition().scrollTop-n,"vertical");return e<=d}if(e<u){let d=r.getItemAt(r.getScrollPosition().scrollTop+n,"vertical");return e>=d}return!0};this.isRowRendered=e=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(e);let n=e;return e=this.brain.rowsPerPage?e%this.brain.rowsPerPage:e,this.cellManager.getCellsForRow(e).filter(i=>i.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(e,n)=>this.isRowVisible(e)&&this.isColumnVisible(n);this.isCellFullyVisible=(e,n,i)=>this.isRowFullyVisible(e)&&this.isColumnVisible(n,void 0,i);this.isColumnFullyVisible=(e,n=2,i)=>this.isColumnVisible(e,this.brain.getColWidth(e)-n,i);this.isColumnVisible=(e,n=10,i)=>{if(!this.isColumnRendered(e,i))return!1;let{brain:r}=this;if(r.isColFixed(e))return!0;i&&i.horizontalLayoutPageIndex!=null&&(e=r.getVirtualColIndex(e,{pageIndex:i.horizontalLayoutPageIndex}));let{start:[a,l],end:[u,d]}=r.getRenderRange();if(e<l||e>=d)return!1;let s=Math.floor((l+d)/2);if(e>=s){let c=r.getItemAt(r.getAvailableSize().width+r.getScrollPosition().scrollLeft-n-r.getFixedEndColsWidth(),"horizontal");return e<=c}if(e<s){let c=r.getItemAt(r.getScrollPosition().scrollLeft+n+r.getFixedStartColsWidth(),"horizontal");return e>=c}return!0};this.isCellRendered=(e,n,i)=>this.isRowRendered(e)&&this.isColumnRendered(n,i);this.isColumnRendered=(e,n)=>{let{start:[i]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(e=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+e),this.cellManager.isCellAttachedAt([i,e])};this.getExtraSpanCellsForRange=e=>{let{start:n,end:i}=e,[r,a]=n,[l,u]=i;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:u},vertical:{startIndex:r,endIndex:l}})};this.getFixedRanges=e=>{let{fixedRowsStart:n,fixedRowsEnd:i,fixedColsStart:r,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!r&&!i&&!a)return[];let l=this.brain.getColCount(),u=this.brain.getRowCount(),{start:d,end:s}=e,[c,f]=d,[m,p]=s,h=[];if(r&&(n&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,r]}),i&&h.push({rowFixed:"end",colFixed:"start",start:[u-i,0],end:[u,r]}),h.push({rowFixed:!1,colFixed:"start",start:[c,0],end:[m,r]})),a&&(n&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),i&&h.push({colFixed:"end",rowFixed:"end",start:[u-i,l-a],end:[u,l]}),h.push({colFixed:"end",rowFixed:!1,start:[c,l-a],end:[m,l]})),n){let y={start:[0,f],end:[n,p],rowFixed:"start",colFixed:!1};h.push(y)}if(i){let y={rowFixed:"end",colFixed:!1,start:[u-i,f],end:[u,p]};h.push(y)}return h};this.isCellFixed=(e,n)=>{let{fixedRowsStart:i,fixedRowsEnd:r,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),u=this.brain.getColCount(),d=this.brain.getRowCount(),s=!1,c=!1,f=!1;if(e<i&&(s=!0,f="start"),r&&!s){let m=d-r;e>=m&&(s=!0,f="end")}if(n<a&&(c=!0,f="start"),l&&!c){let m=u-l;n>=m&&(c=!0,f="end")}return{row:s?f:!1,col:c?f:!1}};this.isCellCovered=(e,n)=>{let i=this.brain.getRowspanParent(e,n),r=this.brain.getColspanParent(e,n),a=i!=e,l=r!=n;return a||l?[i,r]:!1};this.onMouseEnterNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=e=>{let n=this.getMatrixRowIndexFromElement(e.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=e=>{this.lastEnteredRow=e,this.lastExitedRow=-1,!this.scrolling&&e!=-1&&this.addHoverClass(e)};this.addHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.add(r)})})};this.onMouseLeave=e=>{this.lastExitedRow=e,this.lastEnteredRow=-1,!this.scrolling&&e!=-1&&this.removeHoverClass(e)};this.removeHoverClass=e=>{this.cellManager.getCellsForRow(e).forEach(n=>{let i=n.getElement();i&&this.cellHoverClassNames.forEach(r=>{i.classList.remove(r)})})};this.updateHoverClassNamesForRow=e=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(e))return;this.hoverRowUpdatesInProgress.set(e,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===e?this.addHoverClass(e):this.removeHoverClass(e))};Oe(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(e))})};this.updateElementPosition=(e,n)=>{if(this.destroyed)return;let i=e.getElement(),r=this.cellManager.getCellPosition(e);if(!r)return;let[a,l]=r,u=this.brain.getCellOffset(a,l);if(u==null)return;let{x:d,y:s}=u;if(i){let c=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,vd){this.setTransform(i,a,l,{x:d,y:s},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let p=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==p&&(i.__zIndex=p,i.style.zIndex=p)}else i.style.display="",i.style.left=`${d}px`,i.style.top=`${s}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?e.setPendingAfterCommitWork(c):c()}};this.updateDetailElementPosition=e=>{if(this.destroyed)return;let n=e.getElement(),i=this.rowManager.getRowIndex(e);if(i==null)return;let r=this.brain.getItemOffsetFor(i,"vertical");if(r==null)return;let a=r;n&&(n.dataset.detailRowIndex=i,vd&&(this.setDetailTransform(n,i,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(e=this.brain.getScrollPosition())=>{let{brain:n,cellManager:i,rowManager:r}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:u,fixedColsEnd:d,fixedRowsStart:s,fixedRowsEnd:c}=this.brain.getFixedCellInfo();if(r.getAttachedCount()&&r.forEachAttachedRow(x=>{let F=r.getRowIndex(x);if(F!=null){let _=this.brain.getItemOffsetFor(F,"vertical");if(_==null)return;let O=x.getElement();if(!O)return;this.setDetailTransform(O,F,{y:_,scrollLeft:e.scrollLeft})}}),!u&&!d&&!s&&!c)return;let f=this.cellManager.getOneAttachedCell();f&&Rs(e,this.getInfiniteNode(f.getElement()));let m=this.brain.getFixedEndColsOffsets({skipScroll:!0}),p=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:y}=this.brain.getRenderRange(),[C,b]=h,[S,w]=y;function T(x,F,_){let O=i.getCellAt([x,F]);if(O==null)return;let L=n.getCellOffset(x,F),K=O.getElement();K&&L&&_(x,F,K,L)}let P=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,y:L,scrollLeft:!0},u-F)},R=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:O.y,scrollTop:!0},s-x)},E=(x,F,_,{y:O})=>{let L=m[F];this.setTransform(_,x,F,{x:L,y:O,scrollLeft:!0},a-F)},N=(x,F,_,O)=>{this.setTransform(_,x,F,{x:O.x,y:p[x],scrollTop:!0},l-x)},v=(x,F,_,{x:O,y:L})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:L,scrollTop:!0},1e5)},D=(x,F,_,{x:O})=>{this.setTransform(_,x,F,{x:O,scrollLeft:!0,y:p[x],scrollTop:!0},2e5)},M=(x,F,_,O)=>{this.setTransform(_,x,F,{x:m[F],y:O.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(x,F,_)=>{this.setTransform(_,x,F,{x:m[F],y:p[x],scrollLeft:!0,scrollTop:!0},4e5)};if(u||d)for(let x=C;x<S;x++){for(let F=0;F<u;F++)T(x,F,P);if(d){let F=a-d;for(let _=F;_<a;_++)T(x,_,E)}}if(s||c)for(let x=b;x<w;x++){for(let F=0;F<s;F++)T(F,x,R);if(c){let F=l-c;for(let _=F;_<l;_++)T(_,x,N)}}if(u&&s)for(let x=0;x<s;x++)for(let F=0;F<u;F++)T(x,F,v);if(u&&c){let x=l-c;for(let F=x;F<l;F++)for(let _=0;_<u;_++)T(F,_,D)}if(d&&s){let x=a-d;for(let F=0;F<s;F++)for(let _=x;_<a;_++)T(F,_,M)}if(d&&c){let x=l-c,F=a-d;for(let _=x;_<l;_++)for(let O=F;O<a;O++)T(_,O,A)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=e,this.debugId=n,this.cellManager=new bi(n,i.cellPool),this.cellManager.onCellAttachmentChange((d,s)=>{s?this.onCellAttached(d):this.onCellDetached(d)}),this.rowManager=new Ci(n,i.rowPool),this.rowManager.onRowAttachmentChange((d,s)=>{s?this.onRowAttached(d):this.onRowDetached(d)}),this.renderRange=this.renderRange.bind(this);let r=e.onScroll(this.adjustFixedElementsOnScroll),a=e.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Oe(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=e.onScrollStart(this.onScrollStart),u=e.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),a(),l(),u()}}getInfiniteNode(e){return this.infiniteNode||(this.infiniteNode=br(e)),this.infiniteNode}onCellAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onCellDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}onRowAttached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.remove(i)})}}onRowDetached(e){if(this.cellDetachedClassNames.length){let n=e.getElement();n&&this.cellDetachedClassNames.forEach(i=>{n.classList.add(i)})}}isCellRenderedAndMappedCorrectly(e,n){let i=!!this.cellManager.getCellAt([e,n]);return{rendered:i,mapped:i}}renderRange(e,{renderCell:n,renderDetailRow:i,force:r,onRender:a}){if(this.destroyed)return[];let{start:l,end:u}=e,d=this.brain.isHorizontalLayoutBrain,{rowManager:s,cellManager:c}=this,f=this.getFixedRanges(e),m=[e,...f],p=this.brain.getAlwaysRenderedColumns();if(p.length>0){let v=e.start[1],D=e.end[1];p.forEach(M=>{v<=M&&M<D||m.push({start:[e.start[0],M],end:[e.end[0],M+1]})})}let h=new Map,y=m.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([v,D])=>{h.set(`${v}:${D}`,!0)});let C=m.reduce((v,D)=>v+Qr(D),0),b=i?m.reduce((v,D)=>v+yd(D),0):0,S=this.brain.getRowCount(),w=this.brain.getColCount();c.detachCellsStartingAt([S,w]);let T=Math.min(S*w,C);i&&(s.detachStartingWith(this.brain.getRowCount()),s.poolSize>b&&(s.poolSize=b));let P=Td(...m.map(v=>c.getCellsOutsideRenderRange(v)));P=Sd(P,v=>{let D=c.getCellPosition(v);return!(D&&h.has(`${D[0]}:${D[1]}`))}),c.detachCells(P),c.poolSize=T;let R=new Map,E=new Map;m.forEach(v=>{let{start:D,end:M}=v,[A,x]=D,[F,_]=M;for(let O=A;O<F;O++){for(let K=x;K<_;K++){let B=`${O}:${K}`;if(R.has(B))continue;R.set(B,!0);let{rendered:G,mapped:le}=this.isCellRenderedAndMappedCorrectly(O,K);if(O===A||K===x){let Pe=this.isCellCovered(O,K);if(Pe&&h.has(`${Pe[0]}:${Pe[1]}`)){let me=c.getCellAt([O,K]);me!=null&&c.detachCell(me);continue}}if(G&&!r&&le)continue;let Z;G?Z=c.getCellAt([O,K]):Z=c.getCellFor([O,K],d?"row":"column"),Z==null&&(Z=c.getDetachedCell()),this.renderCellAt(O,K,Z,n)}!i||E.has(O)||(E.set(O,!0),s.isRowAttachedAt(O)&&!r)||this.renderDetailRowAtElement(O,this.rowManager.getRowFor(O),i)}}),y.forEach(([v,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(v,D);if(M){if(r||!A){let F=[v,D],_=c.getCellAt(F);this.renderCellAt(v,D,_,n)}return}let x=c.getCellFor([v,D],d?"row":"column");x!=null&&this.renderCellAt(v,D,x,n)});let N=c.getAllCells().map(v=>v.getNode());return i&&s.getAllRows().forEach(v=>{N.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(N),N}renderDetailRowAtElement(e,n,i){if(this.destroyed)return;let r=!1,a=this.brain.getRowHeight(e),l=this.brain.isRowFixedStart(e)?"start":this.brain.isRowFixedEnd(e)?"end":!1,d=i({rowIndex:e,height:a,rowFixed:l,hidden:!!r,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(s=>{let c=s.getElement();c&&(c.style.position="absolute",c.style.left="0px"),this.updateDetailElementPosition(s)}),!d){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(d,n,e),this.updateDetailElementPosition(n)}getCellRealCoordinates(e,n){return{rowIndex:e,colIndex:n}}getMatrixRowIndexFromElement(e){let n=Number(e.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(e,n,i,r){if(this.destroyed)return;let a=this.isCellCovered(e,n),l=this.brain.getRowHeight(e),u=this.brain.getColWidth(n),d=this.brain.getRowspan(e,n),s=this.brain.getColspan(e,n),c=d===1?l:this.brain.getRowHeightWithSpan(e,n,d),f=s===1?u:this.brain.getColWidthWithSpan(e,n,s),{row:m,col:p}=this.isCellFixed(e,n),h=!!a,{rowIndex:y,colIndex:C}=this.getCellRealCoordinates(e,n),b=r({rowIndex:y,colIndex:C,height:l,width:u,rowspan:d,colspan:s,rowFixed:m,colFixed:p,hidden:h,heightWithRowspan:c,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:i.ref});i.isMounted()||i.onMount(T=>{let P=T.getElement();P&&(P.style.position="absolute",P.style.left="0px",P.style.top="0px"),this.updateElementPosition(T)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:C}:void 0,w=this.brain.isHorizontalLayoutBrain;if(!b){w?this.cellManager.detachCell(i):this.cellManager.detachCell(i);return}this.cellManager.renderNodeAtCell(b,i,[e,n],S),this.updateElementPosition(i,{hidden:h,rowspan:d,colspan:s})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ti=class extends Mn{constructor(e,n,i){super(e,n,i);this.setTransform=(e,n,i,r,a)=>{let l=this.getCellRealCoordinates(n,i),{y:u}=r,d=Math.floor(l.rowIndex/this.brain.rowsPerPage),s=xe.runtime.totalVisibleColumnsWidthVar,c=d?`calc(${s} * ${d})`:"0px",f=be.columnOffsets.get(l.colIndex),m=`${ta}-${l.colIndex}`,p=`${u}px`;e.__currentTransformY!==p&&(e.__currentTransformY=p,e.style.setProperty(un,p));let h=`calc(var(${m}, ${f}) + ${c})`,y=`var(${un})`,C=`translate3d(${h}, ${y}, 0px)`;e.__transformValue!==C&&(e.__transformValue=C,e.style.transform=C)};this.brain=e}getCellRealCoordinates(e,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:e,colIndex:n})}isCellRenderedAndMappedCorrectly(e,n){let i=this.cellManager.getCellAt([e,n]),r=!!i;if(!r)return{rendered:r,mapped:!1};let a=i.getAdditionalInfo();if(!a)return{rendered:r,mapped:!1};let l=this.getCellRealCoordinates(e,n),u=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:r,mapped:u}}};import{h as cy}from"vue";import{defineComponent as oy,getCurrentInstance as iy,isVNode as ry,onBeforeUnmount as ay,onMounted as ly,onUpdated as sy,shallowRef as uy,watch as dy}from"vue";function Rd(o,t){if(!(!t||!o)){if(Array.isArray(o)){for(let e of o)Rd(e,t);return}if(ry(o)){let e=o.ref;e&&e.i==null&&(e.i=t)}}}var Xt=oy({name:"RenderSlot",props:{name:{type:String,required:!1},useraf:{type:Boolean,required:!1,default:!1},updater:{type:Function,required:!0},afterCommit:{type:Function,required:!1}},setup(o){let t=uy(o.updater.get()??null),e=null;dy(()=>[o.updater,o.useraf],([i,r],a,l)=>{t.value=i.get()??null;let u=i.onChange(d=>{r?(e!=null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{t.value=d})):t.value=d});l(u)},{immediate:!0,flush:"sync"}),ay(()=>{e!=null&&cancelAnimationFrame(e)}),ly(()=>o.afterCommit?.()),sy(()=>o.afterCommit?.());let n=iy();return()=>{let i=t.value;return Rd(i,n),i??null}}});var En=class En extends et{constructor(e){super(e);this.cellRemoveSubscription=pe();this.cellAttachmentChangeSubscription=pe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(e){return this.cellRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onCellAttachmentChange(e){return this.cellAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{cell:r,attached:a}=i;e(r,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let e=this.createCellInstance();return this.detachedCells.add(e),this.allCellsOrdered.add(e),e}removeCell(e){this.detachedCells.delete(e),this.attachedCells.delete(e),this.allCellsOrdered.delete(e),e.destroy(),this.cellRemoveSubscription(e)}attachCell(e){return e&&this.attachedCells.has(e)||(e||(e=this.getDetachedCell()),this.detachedCells.delete(e),this.attachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!0})),e}detachCell(e){return this.detachedCells.has(e)?!1:(this.attachedCells.delete(e),this.detachedCells.add(e),this.cellAttachmentChangeSubscription({cell:e,attached:!1}),!0)}getDetachedCell(){let{detachedCells:e}=this,n=e.values().next().value;return n||(this.poolSize+=En.POOL_SIZE_INCREMENT,n=e.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let e of this.attachedCells)e.flushPendingAfterCommitWork()}set poolSize(e){e=Math.ceil(e/En.POOL_SIZE_INCREMENT)*En.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedCells:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeCell(l),r--}}else for(r=-r;r>0;)this.createCell(),r--}};En.POOL_SIZE_INCREMENT=1;var Si=En;var xd=new Map,fy=()=>{},na=class{constructor(t,e){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=pe();this.afterCommit=()=>{this.flushPendingAfterCommitWork()};let n=xd.get(t)??0,i=`${t}:GridCellVue:${n}`;xd.set(t,n+1),this.debugId=i,this.cellInfo=e,this.updater=pe(),this.node=cy(Xt,{key:i,name:i,updater:this.updater,afterCommit:this.afterCommit}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(t){this.pendingAfterCommitWork=t}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let t=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,t()}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=fy,this.element=null,this.node=null}getNode(){return this.node}update(t,e){this.updater(t),this.cellInfo=e}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},wi=class extends Si{constructor(e){super(`${e}:GridCellPoolForVue`);this.cellDebugId=e}createCellInstance(){return new na(this.cellDebugId)}};import{h as py}from"vue";var Fn=class Fn extends et{constructor(e){super(e);this.rowRemoveSubscription=pe();this.rowAttachmentChangeSubscription=pe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(e){return this.rowRemoveSubscription.onChange(i=>{i!=null&&e(i)})}onRowAttachmentChange(e){return this.rowAttachmentChangeSubscription.onChange(i=>{if(i==null)return;let{row:r,attached:a}=i;e(r,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let e=this.createRowInstance();return this.detachedRows.add(e),this.allRowsOrdered.add(e),e}removeRow(e){this.detachedRows.delete(e),this.attachedRows.delete(e),this.allRowsOrdered.delete(e),e.destroy(),this.rowRemoveSubscription(e)}attachRow(e){return e&&this.attachedRows.has(e)||(e||(e=this.getDetachedRow()),this.detachedRows.delete(e),this.attachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!0})),e}detachRow(e){return this.detachedRows.has(e)?!1:(this.attachedRows.delete(e),this.detachedRows.add(e),this.rowAttachmentChangeSubscription({row:e,attached:!1}),!0)}getDetachedRow(){let{detachedRows:e}=this,n=e.values().next().value;return n||(this.poolSize+=Fn.POOL_SIZE_INCREMENT),n=e.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(e){e=Math.ceil(e/Fn.POOL_SIZE_INCREMENT)*Fn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(e===n)return;let{detachedRows:i}=this,r=n-e;if(r>0){r>i.size&&(r=i.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=i.values();for(;r>0;){let l=a.next().value;this.removeRow(l),r--}}else for(r=-r;r>0;)this.createRow(),r--}};Fn.POOL_SIZE_INCREMENT=1;var vi=Fn;var Pd=new Map,my=()=>{},oa=class{constructor(t){this.element=null;this.mounted=!1;this.mountSubscription=pe();let e=Pd.get(t)??0,n=`${t}:ListRowVue:${e}`;Pd.set(t,e+1),this.debugId=n,this.updater=pe(),this.node=py(Xt,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(t){return this.mountSubscription.onChange(n=>{n!=null&&t(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=my,this.element=null,this.node=null}getNode(){return this.node}update(t){this.updater(t)}getElement(){return this.element}},Ii=class extends vi{constructor(e){super(`${e}:ListRowPoolForVue`);this.rowDebugId=e}createRowInstance(){return new oa(this.rowDebugId)}};function Dd(o){return{cellPool:new wi(o),rowPool:new Ii(o)}}function go(o){let t=o.isHorizontalLayoutBrain?new Ti(o,`${o.name}:VueHorizontalLayoutTableRenderer`,Dd(`${o.name}:VueHorizontalLayoutTableRenderer`)):new Mn(o,`${o.name}:VueHeadlessTableRenderer`,Dd(`${o.name}:VueHeadlessTableRenderer`)),e=pe();return o.onDestroy(()=>{t.destroy(),e.destroy()}),{renderer:t,onRenderUpdater:e}}function dn(){return{current:null}}var Ad={};function ia(o){return`.${mt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function ra(o,t){let e=Dn(o),n=t?new mo(e,{isHeader:!1}):new sn(e),i=`${e}:header`,r=t?new mo(i,{isHeader:!0,masterBrain:n}):new sn(i);n.onScroll(s=>{r.setScrollPosition({scrollLeft:s.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=go(n),{renderer:u,onRenderUpdater:d}=go(r);return n.onAvailableSizeChange(s=>{r.update({width:s.width})}),{brain:n,headerBrain:r,renderer:a,onRenderUpdater:l,headerRenderer:u,headerOnRenderUpdater:d}}function _d({debugId:o,wrapRowsHorizontally:t}){let e={},{brain:n,headerBrain:i,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u}=ra(o,!!t),d=dn(),s=Date.now();return{debugWarnings:new Map,renderer:r,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:u,updatedAt:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:c=>{if(!d.current)return null;let f=ia(c);return d.current.querySelector(f)||null},brain:n,headerBrain:i,domRef:d,columnMenuTargetRef:dn(),editingValueRef:dn(),scrollerDOMRef:dn(),portalDOMRef:dn(),focusDetectDOMRef:dn(),activeCellIndicatorDOMRef:dn(),onColumnMenuClick:pe(),cellContextMenu:pe(),contextMenu:pe(),onFilterOperatorMenuClick:pe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:pe(),onRowHeightCSSVarChange:pe(),onRowDetailHeightCSSVarChange:pe(),onColumnHeaderHeightCSSVarChange:pe(),cellClick:pe(),cellMouseDown:pe(),keyDown:pe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:e,columnVisibilityForGrouping:{},pinnedStartScrollListener:new po,pinnedEndScrollListener:new po,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Md=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:t=>t??!1,columnMenuRealignDelay:t=>t??50,scrollStopDelay:t=>t??250,viewportReservedWidth:t=>t??0,resizableColumns:t=>t??!0,rowDetailCache:t=>new mi(t),hideColumnWhenGrouped:t=>t??!1,columnMinWidth:t=>t??30,columnMaxWidth:t=>t??5e3,columnDefaultWidth:t=>t??200,columnCssEllipsis:t=>t??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:t=>({alwaysReserveSpaceForSortIcon:!0,...t}),showSeparatePivotColumnForSingleAggregation:t=>t??!1,sortable:1,hideEmptyGroupColumns:t=>t??!1,pivotTotalColumnPosition:t=>t??"end",pivotGrandTotalColumnPosition:1,licenseKey:t=>t||"",keyboardSelection:t=>t??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:t=>t??!0,header:t=>t??!0,showZebraRows:t=>t??!0,showHoverRows:t=>t??!0,virtualizeColumns:t=>t??!0,rowHeight:t=>typeof t=="number"||typeof t=="function"?t:0,rowDetailHeight:t=>typeof t=="number"||typeof t=="function"?t:300,columnHeaderHeight:t=>typeof t=="number"?t:30,columns:1,columnVisibility:t=>t??Ad,columnGroupVisibility:t=>t??Ad,columnSizing:t=>t||{},columnTypes:t=>t||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:t=>t??"replace",collapsedColumnGroups:t=>t??new Map,columnGroups:1});function hy(o){let{groupBy:t,groupColumn:e,groupRenderStrategy:n}=o;return n||(e!=null&&typeof e=="object"?"single-column":(t.filter(r=>r.column).length,"multi-column"))}var Ed=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Fd(o){return o.reduce((t,e,n)=>{let i={groupBy:e,groupIndex:n};return e.field?t.set(e.field,i):e.groupField&&t.set(e.groupField,i),t},new Map)}var Ri=new WeakMap;function Nd(){return{rowDetailState:(o,t)=>({callbackParams:[o,{expandRow:t.lastRowToExpandRef.current,collapseRow:t.lastRowToCollapseRef.current}]})}}var Od=o=>{let{props:t,state:e,oldState:n,parentState:i}=o,r=e.pivotColumnGroups||e.columnGroups,a=e.columnGroups&&e.columnGroups!=n?.columnGroups||e.columnGroups&&e.columnGroupVisibility!=n?.columnGroupVisibility||e.pivotColumnGroups&&e.pivotColumnGroups!=n?.pivotColumnGroups?bd(r,e.columnGroupVisibility):e.columnGroupsDepthsMap,l=i?.groupBy,u=hy({groupRenderStrategy:t.groupRenderStrategy,groupBy:l,groupColumn:t.groupColumn}),d,s=t.rowDetailRenderer,c=t.components?.RowDetail;if(!s&&c){let y=Ri.get(c);y||(y=Cd(c),Ri.set(c,y)),s=y}s&&(d=t.rowDetailState||e.rowDetailState||t.defaultRowDetailState,d&&!(d instanceof st)&&(d=new st(d)),d=d||new st({expandedRows:[],collapsedRows:!0}));let f=e.columnsWhenGrouping||e.columnsWhenInlineGroupRenderStrategy||e.columns,m=d?t.isRowDetailExpanded:void 0;!m&&d&&(m=Ri.get(d),m||(m=y=>d.isRowDetailsExpanded(y.id),typeof d=="object"&&Ri.set(d,m)));let p=s?t.isRowDetailEnabled||!0:!1,h={updatedAt:Date.now(),isTree:i.isTree,rowDetailRenderer:s,rowDetailState:d,isRowDetailExpanded:m,isRowDetailEnabled:p,showColumnFilters:t.showColumnFilters??!!i.filterValue,controlledColumnVisibility:!!t.columnVisibility,groupRenderStrategy:u,groupBy:l,computedColumns:f,initialColumns:t.columns,keyboardNavigation:t.keyboardNavigation??(e.activeCellIndex!=null?"cell":e.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:t.columnHeaderCssEllipsis??t.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=e.columnGroupsDepthsMap?Math.max(...a.values(),-1):e.columnGroupsMaxDepth,computedColumnGroups:r,rowHeightCSSVar:typeof t.rowHeight=="string"?t.rowHeight:"",rowDetailHeightCSSVar:typeof t.rowDetailHeight=="string"?t.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof t.columnHeaderHeight=="string"?t.columnHeaderHeight||xe.components.Header.columnHeaderHeight:""};if(e.devToolsDetected&&e.debugId){let y=Br.get(e.debugId);y&&(h={...h,...y})}return h};function kd(o,t){let e={};return Object.keys(o).forEach(n=>{let i=o[n],r=i;if(!r.groupByForColumn||Array.isArray(r.groupByForColumn))return;let{groupByForColumn:a}=r,l=a.field||a.groupField;l&&t.get(l)&&(e[n]=i)}),e}function Ld(o){let{hideEmptyGroupColumns:t,groupByMap:e,computedGroupColumns:n,groupRowsIndexesInDataArray:i,dataArray:r,groupBy:a}=o,l={...o.columnVisibility};if(!t)return Object.keys(n).forEach(c=>{l[c]===!1&&delete l[c]}),l;if(!i||!i.length)return l;let u=a.length,d=0,s=i.length;for(let c=0;c<s;c++){let f=i[c],m=r[f];if(!m.isTreeNode&&m.isGroupRow&&(d=Math.max(d,m.groupNesting-1),d===u-1))break}return Object.keys(n).forEach(c=>{let f=n[c],{groupByForColumn:m}=f;if(Array.isArray(m))return;let p=m.field||m.groupField;if(!p)return;e.get(p).groupIndex>d&&t?l[c]!==!1&&(l[c]=!1):l.hasOwnProperty(c)&&delete l[c]}),l}var gy=10;function zd(o,t){let{includeHeader:e,columnsToResize:n,columnsToSkip:i}=t,r=`.${wt} > .${jo}`,a=o.current?.querySelectorAll(r),l={},u={};return a&&a.length&&a.forEach(d=>{let s=d.parentElement,c=s.matches(`.${on}`);if(e===!1&&c)return;let f=s.getAttribute("data-column-id"),m=d.cloneNode(!0);m.style.visibility="hidden",m.style.pointerEvents="none",m.classList.remove(...at.split(" ")),m.style.position="absolute",m.style.width="auto",s.appendChild(m);let p=m.offsetWidth;if(s.removeChild(m),!u[f]){let h=Ee().getComputedStyle(s);u[f]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+gy}if(p+=u[f],c){let h=0;s.childNodes.forEach(y=>{if(y!==d&&y.nodeType===1){let C=y,b=Math.max(C.offsetWidth,parseInt(C.style.width,10));if(isNaN(b)&&(b=0),h+=b,b>0){let S=Ee().getComputedStyle(C);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),p+=h}i&&i.has(f)||n&&!n.has(f)||(l[f]=Math.max(p,l[f]||0))}),l}var Vd="InfiniteTable";import{h as fn}from"vue";var Gd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import{defineComponent as yy,h as jd,ref as by,watch as Cy}from"vue";var Kd="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Bd=we({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Hd="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",Wd=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var xi=`${nt}-expand-collapse`,cn=yy(o=>{let t=()=>o.expanded!==void 0,e=by(o.expanded??o.defaultExpanded??!1);Cy(()=>o.expanded,i=>{t()&&(e.value=!!i)});let n=()=>{o.onChange?.(!e.value),t()||(e.value=!e.value)};return()=>{let i=e.value?"expanded":"collapsed",{size:r=24,direction:a="start",disabled:l=!1}=o;return jd("svg",{"data-name":"expand-collapse-icon","data-state":i,"data-disabled":l,xmlns:"http://www.w3.org/2000/svg",height:`${r}px`,viewBox:"0 0 24 24",width:`${r}px`,style:o.style,onClick:l?void 0:n,class:ee(o.className,Kd,Bd({direction:a||"start",expanded:e.value,disabled:l}),`${nt}`,`${xi}`,`${xi}--${i}`,`${xi}--${a==="end"?"end":"start"}`,l?`${xi}--disabled`:"")},[jd("path",{d:Hd})])}},{name:"ExpandCollapseIcon",props:[...Wd]});import{defineComponent as Ty,h as aa}from"vue";var $d="_16lm1iwb _16lm1iw1d _16lm1iwk";var Ud="164.93361431346415 56.97787143782138",qd={margin:"auto",display:"block",shapeRendering:"auto"},Yd=Object.keys({size:1,style:1,className:1,viewBox:1});var Zd=Ty(o=>()=>aa("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...qd,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",class:ee(o.className,$d,"InfiniteIcon","InfiniteIcon-loading")},[aa("circle",{cx:"50",cy:"50",fill:"none","stroke-width":"10",r:"35","stroke-dasharray":Ud},[aa("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})])]),{name:"LoadingIcon",props:[...Yd]});var Xd=we({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Jd="_7pupv00",Qd=we({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function ec(o,t,e,n){let{groupByForColumn:i,groupIndexForColumn:r,groupRenderStrategy:a}=o,l=i.column?{...i.column}:{},u={header:`Group by ${i.field||i.groupField}`,groupByForColumn:i,render:n.getGroupColumnRender({groupIndexForColumn:r,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:t,groupRenderStrategy:a})};return e&&(typeof e=="function"?u={...u,...e(o,t)}:u={...u,...e}),u}function tc(o,t,e,n){let i=typeof e=="function"?e(o,t):e,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...i,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:i?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:t,groupRenderStrategy:"single-column"})}}var Sy=U(j.columnZIndexAtIndex),wy=U(j.columnVisibilityAtIndex);function nc({rowInfo:o,column:t}){let e=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=t?.groupByForColumn,i=o.groupBy[o.groupBy.length-1],r=!!o.pivotValuesMap,a=r&&!!t?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(i?.field??i?.groupField),l=r&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;e=a||l?o.groupNesting:o.groupNesting-1}else e=o.groupNesting;return{[U(xe.components.Row.groupNesting)]:e}}function vy({rowInfo:o}){return{[U(xe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function la(o,t){return o?typeof o=="function"?o(t):o:void 0}function sa(o,t,e){return typeof t=="function"?{...o,...t(e)}:{...o,...t}}function oc(o){let{column:t,rowInfo:e,rowIndex:n,rowHeight:i,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:a,align:l,verticalAlign:u,stylingParam:d,formattedValueContext:s,groupByColumnReference:c,rowStyle:f,rowClassName:m,cellStyle:p,cellClassName:h,showZebraRows:y,rowActive:C,rowDisabled:b,rowSelected:S,cellSelected:w,cellSelection:T,getData:P,computedVisibleColumns:R,visibleColumnIds:E,computedColumnOrder:N,columnReorderInPageIndex:v}=o,D=E??R.map(Me=>Me.id),M=N,A,x={...s,visibleColumnIds:D,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return A===void 0&&(A=e.hasSelectedCells(D)),A}},F=!!(e.isTreeNode&&(t.renderTreeIcon||t.renderTreeIconForLeafNode||t.renderTreeIconForParentNode)),_=typeof m=="function"?m(x):m,O;c?.className&&(O=la(c.className,d)),h&&(O=ee(O,la(h,d))),t.className&&(O=ee(O,la(t.className,d))),F&&(O=ee(O,Qd({align:l})));let L;e.dataSourceHasGrouping&&t.groupByForColumn&&(L=nc({rowInfo:e,column:t})),F&&(L=vy({rowInfo:e})),f&&(L=typeof f=="function"?{...L,...f(x)}:{...L,...f}),p&&(L=sa(L,p,d)),c?.style&&(L=sa(L,c.style,d)),t.style&&(L=sa(L,t.style,d)),L=L||{},L.height=i,L.zIndex=`var(${Sy}-${t.computedVisibleIndex})`,L.visibility=`var(${wy}-${t.computedVisibleIndex}, visible)`;let K=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:n)%2===1,B=y?K?"odd":"even":!1,G=!1,le=!1,Z=!1,Pe=!1;if(T&&w){let Me=P(),Ce=Me[e.indexInAll-1],_e=Me[e.indexInAll+1],ue=R[t.computedVisibleIndex+1],Q=R[t.computedVisibleIndex-1];G=Ce?!T.isCellSelected(Ce.id,t.id):!0,t.computedPinned==="end"&&t.computedFirstInCategory?le=!0:le=Q?!T.isCellSelected(e.id,Q.id):!0,t.computedPinned==="start"&&t.computedLastInCategory?Z=!0:Z=ue?!T.isCellSelected(e.id,ue.id):!0,Pe=_e?!T.isCellSelected(_e.id,t.id):!0}let me=T&&w?{top:G,left:le,right:Z,bottom:Pe}:null,ve=v!=null?a!==v:!1,Ne=ee(me?eu(me):"",Lo(t,[mt,wt],Qs,{dragging:!1,insideDisabledDraggingPage:ve,zebra:B,align:l,verticalAlign:u,rowDisabled:b,rowActive:C,cellSelected:w,rowSelected:S,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!t.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),O,_);return{style:L,className:Ne,cellSelectionBorders:me,zebra:B,columnIsTree:F}}function Iy({groupIndexForColumn:o,groupRenderStrategy:t}){return e=>{let{rowInfo:n,renderBag:i,column:r,align:a}=e,{value:l,groupIcon:u,selectionCheckBox:d}=i,s=n,c=t==="multi-column"&&s.isGroupRow&&o+1!==s.groupNesting,f=ee(_o.flex,r.align==="end"?ar.rowReverse:ar.row,bl.center,`${mt}Expander`,t==="single-column"||t==="multi-column"&&(!n.isGroupRow||d||c&&r.field)?Xd({align:a}):null);return c?r.field?fn("div",{class:f},[d,fn("div",{class:at},[l??null])]):d?fn("div",{class:f},[d]):null:fn("div",{class:f},[u,d,fn("div",{class:at},[l??null])])}}function Ry({groupIndexForColumn:o,groupRenderStrategy:t,toggleGroupRow:e,initialRenderGroupIcon:n}){return i=>{let{rowInfo:r,value:a,rootGroupBy:l,pivotBy:u,column:d}=i,s=t!=="inline"?r:r.isGroupRow&&r.parents?.[o]||r;if(!s)return null;let c=s.collapsed;if(t==="inline"){if(s.groupCount===1)return a;if(s.groupNesting===o&&c)return null}else if(!s.isGroupRow||t==="multi-column"&&o+1!==s.groupNesting)return null;let f=s.groupKeys,m=null,p=u?(s.groupKeys?.length||0)<l?.length:(s.groupKeys?.length||0)<=l?.length;return Gd(s)?m=fn(Zd):p&&(m=fn(cn,{expanded:!c,direction:d.align==="end"?"end":"start",onChange:()=>{e(f)}})),n&&(i.renderBag.groupIcon=m,m=n(i)),m}}function ic(){return{getGroupColumnRender:Iy,getGroupColumnRenderGroupIcon:Ry}}function rc(o,t,e){return ec(o,t,e,ic())}function ac(o,t,e){return tc(o,t,e,ic())}function lc(o){let{pivotColumns:t,groupBy:e,pivotBy:n,selectionMode:i,groupColumn:r,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:u,groupRenderStrategy:d,toggleGroupRow:s,columns:c}=o;if(d==="inline")return{columns:void 0,groupColumnIds:[]};let f={},m=[];if(d==="multi-column")e.forEach((p,h,y)=>{let C=rc({groupByForColumn:p,groupBy:e,pivotBy:n,groupIndexForColumn:h,groupCount:y.length,groupRenderStrategy:d,selectionMode:i},s,r),b=C.id||`group-by-${p.field||p.groupField}`;m.push(b),f[b]=C});else if(d==="single-column"&&e.length){let p=ac({groupCount:e.length,groupBy:e,pivotBy:n,groupRenderStrategy:d,selectionMode:i},s,r),h=p.id||"group-by";m.push(h),f[h]=p}return t?Object.keys(t).forEach(p=>{let h=t[p],y=h.pivotTotalColumn&&h.columnGroup,C=h.pivotTotalColumn&&!h.columnGroup;if(y&&a===!1||C&&l===!1)return;let b={...h};u&&(typeof u=="function"?b={...b,...u({column:b,pivotBy:n,groupBy:e})}:b={...b,...u}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?c[b.inheritFromColumn]:b.pivotAggregator?.field?nn(c,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),f[p]=b}):Object.keys(c).forEach(p=>{let h=c[p];f[p]=h}),{columns:Object.keys(f).length?f:void 0,groupColumnIds:m}}function sc(o){return typeof o.field=="string"}function uc(o){let{column:t,rowInfo:e,fieldsToColumn:n}=o,i;if(t.groupByForColumn){if(e.isGroupRow){let r=e.groupBy[e.groupBy.length-1];(Array.isArray(t.groupByForColumn)||t.groupByForColumn===r)&&(i=r?n.get(r.field||r.groupField):void 0)}!i&&t.field&&(i=n.get(t.field))}return i}function Pt(o){let{getComputed:t,getDataSourceState:e,getState:n,rowIndex:i,columnId:r,api:a,dataSourceApi:l}=o,{dataArray:u}=e(),d=u[i],{isGroupRow:s,isTreeNode:c}=d,f=t().computedColumnsMap.get(r),{activeRowIndex:m,keyboardNavigation:p,isRowDetailEnabled:h}=n(),y=i===m&&p==="row",C=!h||typeof h=="function"&&!h(d)?!1:a.rowDetailApi.isRowDetailExpanded(d.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=Nn({column:f,rowInfo:d,rowDetailState:C,columnsMap:t().computedColumnsMap,context:o}),w=Je(f.id,o);return s?{api:a,dataSourceApi:l,column:f,columnApi:w,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:c?d.isParentNode?{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:d.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:w,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:C,data:d.data,rowActive:y,rowInfo:d,rowSelected:d.rowSelected,value:b,rawValue:S}}function dc(o){return fc(o.column,o.rowInfo)}function cc(o){let{column:t,context:e,rowInfo:n,visibleColumnIds:i}=o,r=uc({rowInfo:n,column:t,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:e.getState().groupRenderStrategy}),{getState:a}=e,{editingCell:l}=a(),u=Nn(o),{formattedValueContext:d}=u,s=e.api.isEditorVisibleForCell({columnId:t.id,rowIndex:n.indexInAll}),c=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:s,rowHasSelectedCells:!1},d,{editError:l&&l.primaryKey===n.id&&l.columnId===t.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(c,"rowHasSelectedCells",{get(){return n.hasSelectedCells(i)}});let f=typeof t.align=="function"?t.align({isHeader:!1,...c}):t.align??"start",m=typeof t.verticalAlign=="function"?t.verticalAlign({isHeader:!1,...c}):t.verticalAlign??"center";return{inEdit:s,stylingParam:c,formattedValueContext:d,renderFunctions:{renderGroupIcon:t.renderGroupIcon||r?.renderGroupIcon,renderSelectionCheckBox:t.renderSelectionCheckBox,renderRowDetailIcon:t.renderRowDetailIcon,renderTreeIcon:t.renderTreeIcon,renderTreeIconForParentNode:t.renderTreeIconForParentNode,renderTreeIconForLeafNode:t.renderTreeIconForLeafNode,renderValue:t.renderValue||r?.renderValue,renderGroupValue:t.renderGroupValue||r?.renderGroupValue,renderLeafValue:t.renderLeafValue||r?.renderLeafValue},renderParams:xy({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:f,verticalAlign:m,formattedValueContext:d}),groupByColumnReference:r}}function xy(o){let{column:t,context:e,rowInfo:n,align:i,verticalAlign:r,visibleColumnIds:a,columnsMap:l,fieldsToColumn:u,formattedValueContext:d}=o,{value:s}=d,{api:c,getDataSourceState:f,getState:m,dataSourceApi:p}=e,{editingCell:h}=m(),{indexInAll:y}=n,C=f(),{selectionMode:b,cellSelection:S}=C,w=uc({rowInfo:n,column:t,fieldsToColumn:u,groupRenderStrategy:e.getState().groupRenderStrategy}),T=c.toggleGroupRow,P=S?.isCellSelected(n.id,t.id)??!1,R={column:t,columnsMap:l,fieldsToColumn:u,align:i,verticalAlign:r,cellSelected:P,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...d,editError:h&&h.primaryKey===n.id&&h.columnId===t.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:w,selectionMode:b,api:c,dataSourceApi:p,toggleCurrentRowDetails:()=>c.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:c.rowDetailApi.toggleRowDetail,expandRowDetails:c.rowDetailApi.expandRowDetail,collapseRowDetails:c.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{p.treeApi.toggleNode(n.nodePath)},toggleTreeNode:p.treeApi.toggleNode,expandTreeNode:p.treeApi.expandNode,collapseTreeNode:p.treeApi.collapseNode,selectTreeNode:p.treeApi.selectNode,deselectTreeNode:p.treeApi.deselectNode,toggleTreeNodeSelection:p.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&p.treeApi.toggleNodeSelection(n.nodePath)},selectRow:c.rowSelectionApi.selectRow,deselectRow:c.rowSelectionApi.deselectRow,toggleRowSelection:c.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:c.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{c.cellSelectionApi.selectCell({rowId:n.id,colId:t.id})},deselectCell:()=>{c.cellSelectionApi.deselectCell({rowId:n.id,colId:t.id})},renderBag:{all:null,value:typeof s=="boolean"?`${s}`:s,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return c.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:y,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return c.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return c.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:C.groupBy,pivotBy:C.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function Py(o,t){if(!o.isGroupRow)return;let e=o.groupData;if(!e.length)return;let n=e[0][t];for(let i=1,r=e.length;i<r;i++)if(e[i][t]!==n)return;return n}function fc(o,t){let{data:e,isGroupRow:n,dataSourceHasGrouping:i}=t,r=i?t.groupBy:void 0,a=n&&r&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===r[r.length-1])?t.value:sc(o)?e?.[o.field]:null;return o.field&&t.isGroupRow&&t.reducerData&&t.reducerData[o.field]!=null&&(a=t.reducerData[o.field]),a===void 0&&t.isGroupRow&&o.groupByForColumn&&sc(o)&&(a=Py(t,o.field)),o.valueGetter&&!t.isGroupRow&&t.data&&(a=o.valueGetter({data:t.data,field:o.field})),a}function Dy(o,t,e,n,i){let{rowSelected:r,indexInAll:a}=e,{activeRowIndex:l,keyboardNavigation:u}=n.getState(),d=a===l&&u==="row";return e.isGroupRow?{rowInfo:e,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:!1,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:e.isTreeNode?e.isParentNode?{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:e.nodeExpanded,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}:{rowInfo:e,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:e.data,rowDetailState:i,rowSelected:r,rowActive:d,value:o,rawValue:o,field:t.field}}function Nn(o){let{column:t,rowInfo:e,context:n,rowDetailState:i}=o,r=fc(t,e),a=Dy(r,t,e,n,i),l=t.valueFormatter?t.valueFormatter(a):r;return a.value=l,{formattedValue:l,formattedValueContext:a}}function ua(o,t){let{rowIndex:e,primaryKey:n}=t,{dataArray:i}=o.getDataSourceState();if(n!==void 0){let r=o.dataSourceApi.getIndexByPrimaryKey(n);if(r!==-1)return r;if(i[e]?.id!==n)return-1}return i[e]?e:-1}function pc(o,t){let e=ua(o,t);return e===-1?null:Pt({...o,rowIndex:e,columnId:t.columnId})}function yo(o,t){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`)}function da(o){let{getComputed:t,getState:e,actions:n}=o,i=e().columnMenuVisibleForColumnId;if(!i)return;let r=t(),a=r.computedVisibleColumnsMap,l=r.computedColumnOrder;if(a.has(i)){n.columnMenuVisibleKey=Date.now();return}function u(m,p){let h=l[d+m*p],y=a.get(h);if(y&&y.renderMenuIcon!==!1)return h}let d=l.indexOf(i),s=0,c=-1,f;for(;!f&&s<l.length&&(s++,f=u(s,c),f||(c*=-1,f=u(s,c)),!f););return f&&(n.columnMenuVisibleForColumnId=f),f}function Pi(o,t){let{rowIndex:e,colIndex:n}=o,{rowIndex:i,colIndex:r}=t,[a,l]=n>r?[r,n]:[n,r],[u,d]=e>i?[i,e]:[e,i];return[{rowIndex:u,colIndex:a},{rowIndex:d,colIndex:l}]}function ca(o,t,e){let{rowsPerPage:n}=e;return n?Math.floor(o.rowIndex/n)===Math.floor(t.rowIndex/n):!0}function mc(o,t,e){if(ca(o,t,e))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:i}=e;if(n===0)throw"rowsPerPage cannot be 0";let r=o,a=t;Math.floor(o.rowIndex/n)>Math.floor(t.rowIndex/n)&&(r=t,a=o);let{rowIndex:l,colIndex:u}=r,{rowIndex:d,colIndex:s}=a,c=Math.floor(l/n),f=Math.floor(d/n),m=l%n,p=d%n,h=Math.min(m,p),y=Math.max(m,p),C=[];for(let b=c;b<=f;b++)for(let S=h;S<=y;S++){let w=b*n+S;if(b===c)for(let T=u;T<i;T++)C.push({rowIndex:w,colIndex:T});else if(b===f)for(let T=0;T<=s;T++)C.push({rowIndex:w,colIndex:T});else for(let T=0;T<i;T++)C.push({rowIndex:w,colIndex:T})}return C}function Ay(o,t){let e=new Set(o);return t.map(n=>e.has(n)?n:null).filter(n=>n!=null)}var fa=class{constructor(t){this.getCellSelectionPosition=t=>{let e=t.rowId??Zt(t.rowIndex,this.getDataSourceState)?.id,n=t.colId??this.getComputed().computedVisibleColumns[t.colIndex].id;return[e,n]};this.setRangeSelected=(t,e,n)=>{let i=this.getDataSourceState(),r=i.cellSelection;if(!r)return;let a=new Ge(r);a.debugId=i.debugId??"";let[l,u]=this.getCellSelectionPosition(t),[d,s]=this.getCellSelectionPosition(e),c=this.getComputed().computedVisibleColumnsMap.get(u),f=this.getComputed().computedVisibleColumnsMap.get(s);if(!c||!f)return;let m=c.computedVisibleIndex,p=f.computedVisibleIndex,h=Zt(l,this.getDataSourceState),y=Zt(d,this.getDataSourceState);if(!h||!y)return;let C=h.indexInAll,b=y.indexInAll,[S,w]=Pi({rowIndex:C,colIndex:m},{rowIndex:b,colIndex:p});for(let T=S.rowIndex;T<=w.rowIndex;T++)for(let P=S.colIndex;P<=w.colIndex;P++){let R={rowIndex:T,colIndex:P},[E,N]=this.getCellSelectionPosition(R);n?a.selectCell(E,N):a.deselectCell(E,N)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(t,e)=>{let n=Qo(this.getDataSourceState),{computedVisibleColumns:i}=this.getComputed(),r=i.map(c=>c.id),a=new Set,l=[],u=new Set;n.filter(c=>{i.forEach(f=>{this.isCellSelected({rowId:c.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),u.has(c.id)||(u.add(c.id),l.push(c)))})});let d=Ay(Array.from(a),r),s=l.map(c=>d.map(f=>this.isCellSelected({rowId:c.id,colId:f})?t(c,f):e));return{columnIds:d,positions:s}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((t,e)=>[t.id,e],null);this.mapCellSelectionPositions=(t,e)=>this.getCellSelectionPositionsWithFn(t,e);this.deselectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ge(e);n.debugId=t.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState(),e=t.cellSelection;if(!e)return;let n=new Ge(e);n.debugId=t.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(t,e)=>{this.setRangeSelected(t,e,!0)};this.deselectRange=(t,e)=>{this.setRangeSelected(t,e,!1)};this.isCellSelected=t=>{let[e,n]=this.getCellSelectionPosition(t);return this.getDataSourceState().cellSelection?.isCellSelected(e,n)??!1};this.selectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=t.clear?new Ge:new Ge(n);a.debugId=e.debugId??"",a.selectCell(i,r),this.dataSourceActions.cellSelection=a};this.deselectCell=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let[i,r]=this.getCellSelectionPosition(t),a=new Ge(n);a.debugId=e.debugId??"",a.deselectCell(i,r),this.dataSourceActions.cellSelection=a};this.selectColumn=(t,e)=>{e?.clear&&this.deselectAll();let n=this.getDataSourceState(),i=n.cellSelection;if(!i)return;let r=new Ge(i);r.debugId=n.debugId??"",r.selectColumn(t),this.dataSourceActions.cellSelection=r};this.deselectColumn=t=>{let e=this.getDataSourceState(),n=e.cellSelection;if(!n)return;let i=new Ge(n);i.debugId=e.debugId??"",i.deselectColumn(t),this.dataSourceActions.cellSelection=i};this.getComputed=t.getComputed,this.getDataSourceState=t.getDataSourceState,this.dataSourceActions=t.dataSourceActions}};function hc(o){return new fa(o)}function gc(o){let{dataSourceApi:t,getState:e,actions:n}=o,i={collapseAllDetails(){n.rowDetailState=new st({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new st({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(r){let a=e().isRowDetailExpanded;if(!a)return!0;let l=t.getRowInfoByPrimaryKey(r);return l?!a(l):!0},isRowDetailEnabledForRow(r){let{isRowDetailEnabled:a}=e();if(!a)return!1;if(typeof a=="function"){let l=t.getRowInfoByPrimaryKey(r);return l?a(l):!1}return!0},isRowDetailExpanded(r){return!i.isRowDetailCollapsed(r)},collapseRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new st(l);u.collapseRowDetails(r),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=r,n.rowDetailState=u},expandRowDetail(r){let a=e(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let u=new st(l);u.expandRowDetails(r),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=r,n.rowDetailState=u},toggleRowDetail(r){i.isRowDetailExpanded(r)?i.collapseRowDetail(r):i.expandRowDetail(r)}};return i}function Jt(o,t,e){return Math.min(Math.max(o,t),e)}function Di(o,t,e){let n=o().dataArray,i=0,r=n.length-1,a=t;do{a+=e;let l=n[a];if(!l)return a<i?i:r;if(!l.rowDisabled)return a}while(a>=i&&a<=r);return Jt(a,i,r)}function _y(o,t){let{getState:e,getDataSourceState:n,actions:i,api:r,dataSourceApi:a}=o,{key:l}=t,u=n().dataArray,d=u.length,s=e(),{brain:c}=s,{activeRowIndex:f}=s;if(f==null)return!1;let{start:[m],end:[p]}=c.getRenderRange(),h=f,y=p-m-1,C=0,b=d-1,S={ArrowDown:()=>{f=Di(n,f,1)},ArrowUp:()=>{f=Di(n,f,-1)},ArrowLeft:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f-P>=C?f=f-P:S.ArrowUp();return}return T&&T.isGroupRow?r.collapseGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=u[f];if(c.isHorizontalLayoutBrain){let P=c.rowsPerPage;f+P<=b?f=f+P:S.ArrowDown();return}return T&&T.isGroupRow?r.expandGroupRow(T.groupKeys):T&&r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=u[f];return T&&T.isGroupRow?r.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):r.rowDetailApi.isRowDetailEnabledForRow(T.id)?r.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{f=Math.min(f+y,d-1)},PageUp:()=>{f=Math.max(f-y,C)},End:()=>{f=b},Home:()=>{f=C}},w=S[l];return w?(w(),h!==f?(i.activeRowIndex=f,!0):!1):!1}function pa(o,t){let{api:e,getState:n,getComputed:i,getDataSourceState:r,dataSourceApi:a}=o,{key:l,shiftKey:u}=t,d=r().dataArray,s=n(),{activeCellIndex:c,brain:f}=s;if(!c)return!1;let[m,p]=c,{start:[h,y],end:[C,b]}=f.getRenderRange(),S=C-h-1,w=b-y-1,T=r().dataArray.length-1,P=i().computedVisibleColumns.length-1,R=0,E=0;m=Jt(m,0,T),p=Jt(p,0,P);let N={ArrowDown:()=>{m=Jt(m+1,R,T)},ArrowUp:()=>{m=Jt(m-1,R,T)},ArrowLeft:()=>{if(p===E)if(m!==R&&(p=P),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m-D>=R?m=m-D:N.ArrowUp()}else N.ArrowUp();else p=Jt(p-1,E,P)},ArrowRight:()=>{if(p===P)if(m!==T&&(p=E),f.isHorizontalLayoutBrain){let D=f.rowsPerPage;m+D<=T?m=m+D:N.ArrowDown()}else N.ArrowDown();else p=Jt(p+1,E,P)},Enter:()=>{let D=d[m];return D&&D.isGroupRow?e.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&e.rowDetailApi.isRowDetailEnabledForRow(D.id)?e.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{u?p=Math.min(p+w,P):m=Math.min(m+S,T)},PageUp:()=>{u?p=Math.max(p-w,E):m=Math.max(m-S,R)},End:()=>{u?p=P:m=T},Home:()=>{u?p=E:m=R}},v=N[l];return v?(v(),[m,p]):!1}function My(o,t){let e=pa(o,t);return e?(o.actions.activeCellIndex=e,!0):!1}var Ey={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function yc(o,t){let{key:e}=t,{getState:n}=o,i=n(),{activeRowIndex:r,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:u,contextMenuVisibleFor:d}=i;return u||d||!Ey[e]?!1:r!=null&&l==="row"?_y(o,t):a!=null&&l==="cell"?My(o,t):!1}var ma=class{constructor(t){this.param=t}setKeyboardNavigation(t){this.param.actions.keyboardNavigation=t}setActiveCellIndex(t){this.param.actions.activeCellIndex=t}setActiveRowIndex(t){this.param.actions.activeRowIndex=t}gotoRowWithDirection(t){let{getDataSourceState:e,getState:n}=this.param,{activeRowIndex:i,keyboardNavigation:r}=n();if(r!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(i==null)return!1;let a=Di(e,i,t);return a!==i?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(t){return this.gotoRowWithDirection(t)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(t){let{direction:e}=t,n=e=="top"?"ArrowUp":e=="bottom"?"ArrowDown":e=="left"?"ArrowLeft":"ArrowRight",i=pa(this.param,{key:n,shiftKey:!1});return i===!1?!1:(this.param.actions.activeCellIndex=i,i)}};function bc(o){return new ma(o)}function Cc(o,t){return o.id?o.id===t.id:!!(o.field&&o.field===t.field)}var ha=class{constructor(t){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=t=>{this.actions.groupRenderStrategy=t};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=t=>this.getComputed().computedColumnsMap.get(t);this.getVisibleColumnOrder=()=>{let t=this.getColumnOrder(),e=this.getComputed().computedVisibleColumnsMap;return t.filter(n=>e.has(n))};this.persistEdit=async t=>{t=t??{};let{editingCell:e,editingValueRef:n}=this.getState();if(!e)return Promise.resolve(new Error("no edit in progress"));await new Promise(f=>requestAnimationFrame(f));let i=this.getComputed().computedColumnsMap.get(e.columnId),r=t.value??e.value;!e.active&&e.waiting!=="persist"&&(this.actions.editingCell={...e,active:!1,waiting:"persist"});let a=ua({...this.context,api:this},e);if(a===-1){let f=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:f},Promise.resolve(f)}let l={...Pt({rowIndex:a,columnId:e.columnId,...this.context,api:this}),value:r,initialValue:e.initialValue},u=r;n.current=null,i.getValueToPersist&&(u=await i.getValueToPersist(l)),l.value=u,e.value=u;let d=this.getState().persistEdit??(()=>{if(!l.column.field)return r;let f=this.getDataSourceState().primaryKey,m=l.data&&typeof f=="string"?{[f]:l.data[f],[l.column.field]:u}:{...l.data,[l.column.field]:u};return this.context.dataSourceApi.updateData(m)}),s;try{s=await d(l)}catch(f){s=f}let c=s instanceof Error?s:!0;return this.actions.editingCell={...e,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:t}=this.getState();return t?t.active:!1};this.isEditorVisibleForCell=t=>{let{rowIndex:e,columnId:n}=t,{dataArray:i}=this.getDataSourceState(),{editingCell:r}=this.getState(),a=i[e];return!a||!r?!1:r.columnId===n&&r.primaryKey===a.id&&!!(r.active||r.waiting)};this.confirmEdit=t=>this.stopEdit({value:t});this.stopEdit=async t=>{let e=this.getState(),{editingCell:n,editingValueRef:i}=e;if(!n)return!0;t||(t={});let r=t.value??i.current;if(!t.cancel&&!t.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...e.editingCell,value:r,active:!1,waiting:"accept"};let{computedColumnsMap:u}=this.getComputed(),d=u.get(l),s=e.shouldAcceptEdit??d.shouldAcceptEdit,c=s?s({...Pt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:r,initialValue:n.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(c).then(f=>{if(f===!0)return this.actions.editingCell={...e.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:r},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...n,value:r,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:r}))}return t.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:r}):t.reject&&n?.active?(this.actions.editingCell={...n,value:r,active:!1,persisted:!1,waiting:!1,accepted:t.reject},{reject:t.reject,value:r}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=t=>this.stopEdit({reject:t});this.getColumnAtIndex=t=>this.getComputed().computedVisibleColumns[t]??null;this.isCellEditable=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,r=e??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(i);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let u=this.getDataSourceState().dataArray[r];if(!u||u.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let d=l.computedEditable(Pt({...this.context,api:this,columnId:i,rowIndex:r}));return typeof d=="boolean"?Promise.resolve(d):d};this.getColumnApi=t=>{let e=typeof t=="string"?t:this.getComputed().computedVisibleColumns[t]?.id,n=this.columnApiById.get(e);if(n)return n;let i=Je(t,{...this.context,api:this});return i&&this.columnApiById.set(i.getColumnId(),i),i};this.isColumnSortable=t=>this.getColumnApi(t)?.isSortable()??!1;this.getCellValue=t=>this.getCellValues(t)?.value??null;this.getCellValues=t=>{let{rowIndex:e,primaryKey:n,columnId:i}=t,{dataSourceApi:r,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),u=e??r.getIndexByPrimaryKey(n),d=l.get(i),s=r.getRowInfoByIndex(u),c=s?.id;if(!s||!d)return d||console.warn(`No column found with id: "${i}"`),s||console.warn(`No row found with index: "${u}" or primary key: "${c}"`),null;let f=this,{isRowDetailEnabled:m}=a(),p=!m||typeof m=="function"&&!m(s)?!1:this.rowDetailApi.isRowDetailExpanded(s.id)?"expanded":"collapsed",h=Nn({column:d,rowInfo:s,columnsMap:l,context:{...this.context,api:f},rowDetailState:p});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let t=this.getState().brain.getRenderRange();return{renderStartIndex:t.start[0],renderEndIndex:t.end[0]}};this.setColumnOrder=t=>{this.actions.columnOrder=t};this.setVisibilityForColumnGroup=(t,e)=>{let n={...this.getState().columnGroupVisibility};e?delete n[t]:n[t]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let t=this.getDataSourceState(),e=new ft(t.groupRowsState);e.collapseAll(),this.dataSourceActions.groupRowsState=e};this.collapseGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(t)?(this.toggleGroupRow(t),!0):!1;this.expandGroupRow=t=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(t)?(this.toggleGroupRow(t),!0):!1;this.toggleGroupRow=t=>{let e=this.getDataSourceState(),n=new ft(e.groupRowsState);if(n.toggleGroupRow(t),this.dataSourceActions.groupRowsState=n,e.lazyLoad){let i=[$t,...t],r=e.originalLazyGroupData.get(i);n.isGroupRowExpanded(t)?r?.cache||Pn(e.data,e,this.dataSourceActions,{groupKeys:t},this.context.getDataSourceMasterContext()):r?.cache||(e.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(t).forEach(l=>{e.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=$.clone(e.lazyLoadCacheOfLoadedBatches),e.originalLazyGroupData.delete(i),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ot())}};this.toggleSortingForColumn=(t,e)=>{if(!this.getComputed().computedColumnsMap.get(t))return;let i=this.getSortingForColumn(t);i===null?i=1:i=i===1?-1:null,this.setSortingForColumn(t,i,e)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(t,e,n={offset:0})=>{let i=this.getState(),r=this.getComputed(),a=e;if(typeof e=="string"){let h=r.computedVisibleColumnsMap.get(e);if(!h)return!1;a=h.computedVisibleIndex}if(i.brain.isHorizontalLayoutBrain){n=n||{};let h=i.brain.getPageIndexForRow(t);n.horizontalLayoutPageIndex=h||0}let l=i.renderer.getScrollPositionForScrollColumnIntoView(a,n),u=i.renderer.getScrollPositionForScrollRowIntoView(t,n);if(!l||!u)return!1;let d={scrollLeft:l.scrollLeft,scrollTop:u.scrollTop},s=i.brain.getScrollPosition(),c=i.brain.scrollLeftMax,f=i.brain.scrollTopMax;if(c<0&&f<0)return!0;let m=d.scrollLeft>c+(n.offset||0),p=d.scrollTop>f+(n.offset||0);return m&&p?!1:(d.scrollLeft!==s.scrollLeft&&!m&&(i.scrollerDOMRef.current.scrollLeft=d.scrollLeft),d.scrollTop!==s.scrollTop&&!p&&(i.scrollerDOMRef.current.scrollTop=d.scrollTop),!0)};this.context=t,this.rowSelectionApi=hl({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState}),this.keyboardNavigationApi=bc({getState:t.getState,getDataSourceState:t.getDataSourceState,actions:t.actions,getComputed:t.getComputed,api:this,dataSourceApi:t.dataSourceApi}),this.rowDetailApi=gc({getState:t.getState,actions:t.actions,dataSourceApi:t.dataSourceApi}),this.cellSelectionApi=hc({dataSourceActions:t.dataSourceActions,getDataSourceState:t.getDataSourceState,getComputed:t.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(t){let e={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(da(e),t?.()),setTimeout(()=>{this.isDestroyed()||(da(e),t?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(t){let{columnId:e,rowIndex:n,primaryKey:i,value:r}=t,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(i);return this.isCellEditable({rowIndex:a,columnId:e}).then(async l=>{if(l){let u=this.getDataSourceState().dataArray,s=this.getComputed().computedColumnsMap.get(e),c=u[a],f=r??dc({column:s,rowInfo:c}),m=f;s.getValueToEdit&&(f=await s.getValueToEdit(Pt({...this.context,rowIndex:a,columnId:e,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:e,value:f,initialValue:m,rowIndex:a,primaryKey:u[a]?.id}}return l})}setSortingForColumn(t,e,n){let{computedColumnsMap:i}=this.getComputed(),r=i.get(t);if(!r||this.getSortingForColumn(t)===e&&this.getDataSourceState().multiSort===!1)return;if(e===null){this.setSortInfoForColumn(t,null,n);return}let l=!!r.pivotColumn,u=r.groupByForColumn,d=l?void 0:r.field,s=u?Array.isArray(u)?u:[u]:[],c=s.map(p=>p.valueGetter?h=>p.valueGetter({data:h,field:p.field}):p.field?p.field:p.groupField??void 0).filter(xn);c.length&&(d=c);let f=r.computedSortType;if(s.length&&f===Nt){let p=this.getState().initialColumns;f=s.flatMap(y=>{let C=y.field??y.groupField,b=C?i.get(C):null;if(b)return b.computedSortType;let S=C?nn(p,C):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[Nt]})}s.length&&!Array.isArray(f)&&(f=[f]);let m={dir:e,id:r.id,field:d,type:f};!l&&r.valueGetter&&(m.valueGetter=p=>r.valueGetter({data:p,field:r.field})),this.setSortInfoForColumn(t,m,n)}setSortInfoForColumn(t,e,n){let i=this.getDataSourceState(),r=this.getComputed().computedColumnsMap.get(t);if(!r)return;if(!i.multiSort){this.dataSourceApi.setSortInfo(e?[e]:null);return}let a=r.field,l={id:t,field:a},u=i.sortInfo?.slice()??[];if(e===null){u=u.filter(c=>!Cc(c,l)),this.dataSourceApi.setSortInfo(u);return}let d=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([e]);return}u=u.map(c=>d?c:Cc(c,l)?(d=!0,e):c),d||u.push(e),this.dataSourceApi.setSortInfo(u)}getSortTypeForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortType:null}getSortInfoForColumn(t){let e=this.getComputed().computedColumnsMap.get(t);return e?e.computedSortInfo:null}getSortingForColumn(t){let e=this.getSortInfoForColumn(t);return e?e.dir:null}setPinningForColumn(t,e){let n={...this.getState().columnPinning};e===!1?delete n[t]:n[t]=e,this.actions.columnPinning=n}setColumnFilter(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!r[l])return;let u={filter:{type:l,value:e,operator:r[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(u.field=n.field||n.groupByForColumn),a=u}a.id=n.id,a.filter.value=e,this.setFilterValueForColumn(t,a)}setColumnFilterOperator(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let i=this.getDataSourceState(),{filterTypes:r}=i,a=n.computedFilterType,l=r[a].operators,u=l.find(c=>c.name===e)??l.find(c=>c.name===r[a].defaultOperator),d=u.name,s;n.computedFilterValue?(s={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:d}},u.defaultFilterValue!==void 0&&(s.filter.value=u.defaultFilterValue)):(s={filter:{operator:d,type:a,value:u.defaultFilterValue!==void 0?u.defaultFilterValue:[...r[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(s.field=n.field)),s.id=n.id,this.setFilterValueForColumn(t,s)}setFilterValueForColumn(t,e){let n=this.getComputed().computedColumnsMap.get(t);if(!n)return;let r=this.getDataSourceState().filterValue??[],a=!1;r=r.map(l=>l===n.computedFilterValue?(a=!0,e):l),a||r.push(e),this.dataSourceActions.filterValue=r}removeColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let i=this.getDataSourceState().filterValue??[],r=!1;i=i.filter(a=>a===e.computedFilterValue?(r=!0,!1):!0),r&&(this.dataSourceActions.filterValue=i)}clearColumnFilter(t){let e=this.getComputed().computedColumnsMap.get(t);if(!e)return;let n=this.getDataSourceState(),i=n.filterValue??[],r=!1;i=i.map(a=>{if(a===e.computedFilterValue){let l=e.computedFilterValue.filter.type,u=n.operatorsByFilterType[l],d=n.filterTypes[l];if(r=!0,!d)return null;let s=a.filter.operator??d?.defaultOperator,f=u[s].defaultFilterValue??(d.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:s,value:f}}}return a}).filter(xn),r&&(this.dataSourceActions.filterValue=i)}setVisibilityForColumn(t,e){let n={...this.getState().columnVisibility};e?delete n[t]:n[t]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(t){this.actions.columnVisibility=t}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollLeft=Math.max(t,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(t){let e=this.getState();e.scrollerDOMRef.current&&(e.scrollerDOMRef.current.scrollTop=Math.max(t,0))}scrollRowIntoView(t,e={offset:0}){let n=this.getState(),i=this.getComputed(),r=n.brain.getScrollPosition(),a=e.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&i.computedVisibleColumns.length>0&&(a=i.computedVisibleColumns[Math.ceil(i.computedVisibleColumns.length/2)].id,l=i.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let u=n.renderer.getScrollPositionForScrollRowIntoView(t,{...e,colIndex:l});if(!u)return!1;let d=n.brain.scrollTopMax,s=u.scrollLeft!==r.scrollLeft,c=u.scrollTop<=d+(e.offset||0);return!c&&!s?!1:(c&&u.scrollTop!==r.scrollTop&&(n.scrollerDOMRef.current.scrollTop=u.scrollTop),s&&(n.scrollerDOMRef.current.scrollLeft=u.scrollLeft),!0)}scrollColumnIntoView(t,e={offset:0}){let n=this.getState(),r=this.getComputed().computedVisibleColumnsMap.get(t);if(!r)return!1;let a=r.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,e);if(!l)return!1;let u=n.brain.getScrollPosition(),d=n.brain.scrollLeftMax;return l.scrollLeft>d+(e.offset||0)?!1:(l.scrollLeft!==u.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Tc(o){return new ha(o)}function Sc(o,t){return o<t?[o,t]:[t,o]}var Ai=class{constructor(t){this.multiSelectStartIndex=0;this.getIdForIndex=t.getIdForIndex,this.isRowDisabledAt=t.isRowDisabledAt}set rowSelectionState(t){this._rowSelectionState=t}get rowSelectionState(){return this._rowSelectionState}selectRange(t,e){let[n,i]=Sc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.selectRow(l)}}deselectRange(t,e){let[n,i]=Sc(t,e),r=this.rowSelectionState;for(let a=n;a<=i;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||r.deselectRow(l)}}resetClick(t){this.rowSelectionState.deselectAll();let e=this.getIdForIndex(t);this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t,this.multiSelectEndIndex=void 0}singleAddClick(t){let e=this.getIdForIndex(t);if(this.rowSelectionState.isRowSelected(e))this.rowSelectionState.deselectRow(e),this.rowSelectionState.isRowSelected(this.getIdForIndex(t+1))&&(this.multiSelectStartIndex=t+1);else{this.rowSelectionState.selectRow(e),this.multiSelectStartIndex=t;let n;for(let i=t-1;i>=0;i--){let r=this.getIdForIndex(i);if(this.rowSelectionState.isRowSelected(r))n=i;else break}this.multiSelectEndIndex=n}}multiSelectClick(t){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,t),this.multiSelectEndIndex=t}};var _i=class{constructor(t){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=t.getPrimaryKeyByIndex,this.getColumnIdByIndex=t.getColumnIdByIndex}getCellSelectionPosition(t){let{rowIndex:e,colIndex:n}=t,i=this.getPrimaryKeyByIndex(e),r=this.getColumnIdByIndex(n);if(!(i===void 0||!r))return[i,r]}set cellSelectionState(t){this._cellSelectionState=t}get cellSelectionState(){return this._cellSelectionState}resetClick(t){this.cellSelectionState.deselectAll();let e=this.getCellSelectionPosition(t);e&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0)}singleAddClick(t){let e=this.getCellSelectionPosition(t);if(e)if(this.cellSelectionState.isCellSelected(...e)){this.cellSelectionState.deselectCell(...e);let n={rowIndex:t.rowIndex+1,colIndex:t.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...e),this.multiSelectStartPosition=t,this.multiSelectEndPosition=void 0}multiSelectClick(t,e){!this.multiSelectStartPosition||!this.getCellSelectionPosition(t)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,e),this.selectRange(this.multiSelectStartPosition,t,e),this.multiSelectEndPosition=t)}setRangeSelected(t,e,n,i){if(i.horizontalLayout&&!ca(t,e,i)){mc(t,e,{rowsPerPage:i.rowsPerPage,columnsPerSet:i.columnsPerSet}).forEach(s=>{let c=this.getCellSelectionPosition({rowIndex:s.rowIndex,colIndex:s.colIndex});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))});return}let[r,a]=Pi(t,e),l=this.getCellSelectionPosition(r),u=this.getCellSelectionPosition(a);if(!(!l||!u))for(let d=r.rowIndex;d<=a.rowIndex;d++)for(let s=r.colIndex;s<=a.colIndex;s++){let c=this.getCellSelectionPosition({rowIndex:d,colIndex:s});c&&(n?this.cellSelectionState.selectCell(...c):this.cellSelectionState.deselectCell(...c))}}deselectRange(t,e,n){this.setRangeSelected(t,e,!1,n)}selectRange(t,e,n){this.setRangeSelected(t,e,!0,n)}};import{defineComponent as Fy,h as Rc,onBeforeUnmount as Ny,onMounted as Oy}from"vue";var wc=Bt("CSSVariableWatch"),vc=Kt("CSSVariableWatch"),Ic={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var bo=Fy({name:"CSSNumericVariableWatch",props:{varName:{type:String,required:!0},allowInts:{type:Boolean,default:!1},onChange:{type:Function,required:!0}},setup(o){let t={current:null},e=0,n=null;return Oy(()=>{let i=t.current;if(!i)return;let r=i.getBoundingClientRect().height;r!=null?(e=r,vc(`Variable ${o.varName} found and equals ${r}.`),o.onChange(r)):wc(`Specified variable ${o.varName} not found or does not have a numeric value.`),n=_n(i,({height:a})=>{a!=null&&a!==e&&(e=a,o.onChange(a))})}),Ny(()=>{n?.(),n=null}),()=>{let i=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`;return Rc("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Ic},[Rc("div",{ref:r=>{t.current=r??null},style:{height:o.allowInts?`calc(1px * ${i})`:i}})])}}});var ga=o=>{let t=0;return(...e)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=0,o(...e)})}};function xc(o,t){ya(o,t),Ly(o,t),t.detail===2&&ky(o,t),o.getState().onCellClick?.(o,t)}function ky(o,t){if(Xn(t.target))return;let{onCellDoubleClick:e}=o.getState(),n={preventEdit:!1};if(e){let a=e(o,t);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let r=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:r.id})}function Ly(o,t){let{getDataSourceState:e,getState:n,getComputed:i,rowIndex:r,colIndex:a,dataSourceActions:l}=o,u=e(),{selectionMode:d,cellSelection:s}=u;if(!s||d!=="multi-cell")return;let{multiCellSelector:c,computedVisibleColumns:f}=i(),{brain:m,debugId:p}=n(),{rowsPerPage:h}=m,y=f.length,C=new Ge(s);C.debugId=p??"",c.cellSelectionState=C;let b={rowIndex:r,colIndex:a};if(t.metaKey||t.ctrlKey)c.singleAddClick(b);else if(t.shiftKey){let S=!!n().wrapRowsHorizontally;c.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:y}:{horizontalLayout:S})}else c.resetClick(b);l.cellSelection=C}function ya(o,t){let{rowIndex:e,getDataSourceState:n,getComputed:i,dataSourceActions:r,api:a,cloneRowSelection:l}=o,{multiRowSelector:u,renderSelectionCheckBox:d}=i(),s=n(),{selectionMode:c,groupBy:f,dataArray:m,isTree:p}=s;if(f.length||p||m[e]?.rowDisabled)return!1;if(c==="multi-row"){if(d&&!t.key)return!1;let{rowSelection:y}=s;if(y=l(y),u.rowSelectionState=y,y&&typeof y=="object")return t.shiftKey?u.multiSelectClick(e):t.metaKey||t.ctrlKey?u.singleAddClick(e):u.resetClick(e),r.rowSelection=y,!0}else if(c==="single-row"){let C=m[e].id;t.metaKey||t.ctrlKey?a.rowSelectionApi.toggleRowSelection(C):a.rowSelectionApi.selectRow(C)}return!1}function Pc(o,t){t.detail!==2&&void 0}var zy={Enter:!0," ":!0,a:!0};function Dc(o,t){let{getState:e,getDataSourceState:n,dataSourceActions:i,api:r,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:u}=o,{key:d,ctrlKey:s,metaKey:c}=t;if(!zy[d])return!1;let f=e(),m=n(),{activeRowIndex:p,activeCellIndex:h,keyboardNavigation:y,keyboardSelection:C}=f,{selectionMode:b,groupBy:S,rowSelection:w,treeSelectionState:T,isTree:P}=m;if(C===!1)return!1;let R=y==="row"&&p!=null?p:y==="cell"&&h!=null?h[0]:null,E=R!=null?m.dataArray[R]:null;if(!E||R==null)return!1;if(b==="single-row"&&d===" ")return r.rowSelectionApi.toggleRowSelection(E.id),!0;if(b!=="multi-row")return!1;if(d==="a"&&(s||c)){if(P&&T){let v=u(T);return v.selectAll(),i.treeSelection=v,!0}let N=l(w);return N.selectAll(),i.rowSelection=N,!0}if(d===" "){if(S.length)return E.isGroupRow&&E.groupKeys?r.rowSelectionApi.toggleGroupRowSelection(E.groupKeys):r.rowSelectionApi.toggleRowSelection(E.id),!0;if(P){if(E.isTreeNode&&E.nodePath)return a.treeApi.toggleNodeSelection(E.nodePath),!0}else{let N={key:t.key,metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,preventDefault:()=>t.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(N.metaKey=!1,N.ctrlKey=!0),ya({...o,rowIndex:R},N)}}return!1}var Ac=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),_c=o=>Array.from(o.querySelectorAll(Ac)).filter(e=>!!e.offsetParent),ba=o=>o.querySelector(Ac);var Ec=zn(wn());async function Mc(o,t=10,e=300){return new Promise((n,i)=>{let r=Date.now();function a(){if(Date.now()-r>e)return i(!1);if(!o()){setTimeout(a,t);return}n(!0)}a()})}var Vy=10,Gy=(o,t)=>o-t;function Ca(o,t){let{getComputed:e,getDataSourceState:n,getState:i,api:r,dataSourceApi:a}=t,{editingCell:l,isRowDetailEnabled:u}=i(),{dataArray:d}=n(),{computedVisibleColumns:s,computedColumnsMap:c}=e(),f=s[o.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===o.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let m=d[o.rowIndex],p=!u||typeof u=="function"&&!u(m)?!1:r.rowDetailApi.isRowDetailExpanded(m.id)?"expanded":"collapsed",h=Je(f.id,t);return f.contentFocusable({column:f,...Nn({column:f,rowInfo:m,columnsMap:c,context:t,rowDetailState:p}).formattedValueContext,columnApi:h,api:r,dataSourceApi:a})}function Fc(o,t,e){let n=e.getState().editingCell;return Ky(o,t,e,{isCellFocusable:Ca,isColumnElligible:r=>n&&n.columnId===r.id?!0:!!r.contentFocusable})}function Nc(o,t,e){let n=(0,Ec.default)(e,o+t,Gy);return n<0&&(n=~n,t>0&&n>=e.length||t<0&&n===0)?null:e[n]??null}globalThis.getNextCol=Nc;function Ky(o,t,e,n){let{isColumnElligible:i,isCellFocusable:r}=n,a=e.getComputed().computedVisibleColumns.filter(i).reduce((c,f)=>(c.push(f.computedVisibleIndex),c),[]);if(!a.length)return null;let{getDataSourceState:l}=e,{dataArray:u}=l(),d=o.rowIndex,s=o.colIndex;for(;d!=null||s!=null;){if(s=s===null?a[t===-1?a.length-1:0]:Nc(s,t,a),s===null){if(d+=t,d<0||d>=u.length)return null;continue}if(r({colIndex:s,rowIndex:d},e))return{colIndex:s,rowIndex:d}}return null}async function Oc([o,t],e){let{api:n}=e;return new Promise((i,r)=>{let a=Vy,l=null,u=!1;function d(s=0){s++,en(l),l=Oe(async()=>{if(u=n.scrollCellIntoView(o,t,{offset:30}),!u&&s<a&&d(s),u){try{await Mc(()=>!!e.getState().getDOMNodeForCell({rowIndex:o,colIndex:t}))}catch(c){r(c);return}i(!0)}})}d()})}var By=`.${mt}`;function kc(o,t){if(t.key!=="Tab")return!1;let e=t.shiftKey?-1:1,n=t.target,i=o.getState().scrollerDOMRef.current,r=document.activeElement===i||n===i;if(!i||r&&e===-1)return!1;let a=r?null:Tn(n,By),l=null,u=null;if(a)l=Number(a.getAttribute("data-row-index")),u=Number(a.getAttribute("data-col-index"));else if(r){let{activeCellIndex:s}=o.getState();[l,u]=s||[0,0]}if(l==null||u==null||isNaN(l)||isNaN(u))return!1;let d=r&&Ca({colIndex:u,rowIndex:l},o)?{rowIndex:l,colIndex:u}:Fc({rowIndex:l,colIndex:u},e,o);if(!d){if(e===-1)i.focus();else{let s=_c(document.body),c=o.getState().focusDetectDOMRef.current,f=s.findIndex(p=>p===c);s[f+1]?.focus()}return!0}return Oc([d.rowIndex,d.colIndex],o).then(()=>{let s=o.getState().getDOMNodeForCell(d);if(!s)return;ba(s)?.focus()}),!0}var Lc={control:"ctrl"},zc={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},Hy={esc:"escape"},Gc={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Kc=Object.keys(Gc),Ta=new Set(Kc),Wy=new Set(["shift","alt"]);function Bc(o,t){return Array.isArray(t)?t.some(e=>Vc(o,e)):Vc(o,t)}function Vc(o,t){let e=o.key.toLowerCase(),n=t.split("+").map(f=>f.toLowerCase().trim()),i=n.find(f=>zc[f]),r=n.map(f=>Lc[f]||zc[f]||Hy[f]||f),a=r.filter(f=>Ta.has(f)),l=r.filter(f=>!Ta.has(f)),u=Kc.reduce((f,m)=>(f[m]=Gc[m](o),f),{});i&&u.cmd&&(u.cmd=!1,u.ctrl=!0);let d=Object.keys(u).filter(f=>u[f]);if(!a.every(f=>u[f]===!0))return!1;if(l.includes("*")){if(d.length<a.length||d.filter(m=>!Wy.has(m)).length)return!1}else if(a.length!=d.length)return!1;return!l.length||Ta.has(e)||e==="meta"||Lc[e]?!1:l.reduce((f,m)=>f?m==="*"||e===m:!1,!0)}async function Hc(o,t){let e={...o,cloneRowSelection:a=>Ao(a,o.getDataSourceState),cloneTreeSelection:a=>ti(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),i={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,t);a&&typeof a=="object"&&(i={...i,...a})}if(!i.preventSelection&&Dc(e,t)&&t.preventDefault(),(kc(e,t)||!o.getState().focusedWithin&&!i.preventNavigation&&yc(e,t))&&t.preventDefault(),!i.preventEdit&&t.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,u]=a,d=o.getComputed().computedVisibleColumns[u];d.computedEditable&&o.api.startEdit({rowIndex:l,columnId:d.id})}}o.api.isEditInProgress()&&(t.key==="Escape"&&!i.preventEditStop&&o.api.stopEdit({cancel:!0}),t.key==="Tab"&&i.preventDefaultForTabKeyWhenEditing&&t.preventDefault());let{keyboardShortcuts:r}=o.getState();if(r)for await(let a of r){if(!Bc(t,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,t);if(l&&l.stopNext)break}}import{onBeforeUnmount as hb,watch as gb}from"vue";import{Teleport as $y,cloneVNode as Uy,defineComponent as Xc,h as Ei,isVNode as Jc,nextTick as qy,onBeforeUnmount as Yy,onMounted as Zy,shallowRef as Zc,triggerRef as Xy,watch as Jy}from"vue";var Mi="__is_infinite_menu_component";function Sa(o){return!!o.tagName}function $c(o){let{alignTarget:t,alignAnchor:e,constrainTo:n,alignPosition:i}=o,r=Ae.from(Sa(t)?t.getBoundingClientRect():t),a=Ae.from(Sa(e)?e.getBoundingClientRect():e),l=n?Ae.from(Sa(n)?n.getBoundingClientRect():n):null;if(!l)return{...Wc({anchorRect:a,targetRect:r,position:i[0]}),index:0};let u=null;for(let d=0,s=i.length;d<s;d++){let c=Wc({anchorRect:a,targetRect:r,position:i[d],constrainRect:l});if(d===0&&(u={...c,index:0}),c.valid)return{...c,index:d}}return u}function Wc(o){let t=Ae.from(o.targetRect),e=Ae.from(o.anchorRect),n=o.constrainRect?Ae.from(o.constrainRect):null,{position:i}=o,[r,a]=i,l=jc(t,r),u=jc(e,a),d=l.getDistanceToPoint(u);t.shift(d);let s=n?n.contains(t):!0;return{alignPosition:i,alignedRect:t,valid:s,distance:d}}function jc(o,t){return t==="TopLeft"?je.from({top:o.top,left:o.left}):t==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):t==="TopRight"?je.from({top:o.top,left:o.left+o.width}):t==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):t==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):t==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):t==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):t==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function jy(o){return o&&typeof o.then=="function"||o instanceof Promise}function qc(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Uc(o){return typeof o=="function"&&(o=o()),jy(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&qc(o)&&(o=o.getBoundingClientRect()),o?Ae.from(o):null}async function Yc(o){let t=null;typeof o=="function"?t=o():t=o;function e(n){let i=null;return typeof n=="string"&&(i=document.querySelector(n)),qc(n)&&(i=n),i||null}return e(await t)}async function wa(o,t){let{constrainTo:e,alignTo:n,alignPosition:i}=t;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof e=="boolean"&&(e=e?document.documentElement.getBoundingClientRect():void 0);let r=e&&await Uc(e)||void 0,a=n?await Uc(n):void 0,l=Ae.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:u}=$c({constrainTo:r,alignAnchor:a,alignTarget:l,alignPosition:i});o.style.transform=`translate3d(${u.left}px,${u.top}px, 0px)`;let d=o.getBoundingClientRect();if(d.left!==u.left||d.top!==u.top){let s=o.offsetParent;if(s){let c=s.getBoundingClientRect(),f=c.left,m=c.top,p=u.left-f,h=u.top-m;o.style.transform=`translate3d(${p}px,${h}px, 0px)`}}}var Qy=Xc({name:"OverlayContent",props:{handle:{type:Object,required:!0}},setup(o){let t=null,e=r=>{r&&r!==t&&wa(r,o.handle),t=r??null},n=null,i=r=>{n?.(),n=r.realign.onChange(a=>{t&&a&&wa(t,a)})};return Zy(()=>i(o.handle)),Jy(()=>o.handle,i),Yy(()=>{n?.()}),()=>Ei("div",{style:{position:"absolute",top:"0px",left:"0px"},ref:e},[o.handle.children()])}});function eb(o){return Jc(o)?o.props?.id||o.key:null}function tb(o,t,e){if(Jc(o)&&o.type?.[Mi]){let n={};return o.props?.portalContainer===void 0&&(n.portalContainer=t),o.props?.constrainTo===void 0&&(n.constrainTo=e),Uy(o,n)}return o}function Dt(o){let t=o,e=new Map,n=Zc(e),i=()=>Xy(n),r=(d,s)=>{let f=`${s.id||eb(d)||Ot()}`,m=e.get(f),p=C=>()=>{let b=typeof C=="function"?C():C;return tb(b,t.portalContainer,s.constrainTo??t.constrainTo)},h=p(d),y=(C,b)=>{if(!m)return;let S=p(C);Object.assign(m,{children:S}),i(),!!b?.skipRealign||qy(()=>{m&&e.get(m.key)===m&&m.realign(m)})};return m?(Object.assign(m,s),y(d),y):(m={key:f,children:h,alignPosition:s.alignPosition,alignTo:s.alignTo,constrainTo:s.constrainTo,realign:pe()},e.set(m.key,m),i(),y)},a=d=>{d=`${d}`,e.has(d)&&(e.delete(d),i())},l=()=>{e.clear(),i()};return{portal:Xc({name:"OverlayPortal",setup(){let d=Zc(null),{portalContainer:s}=t;return s&&(async()=>{let c=await Yc(s);c!=null&&(d.value=c)})(),()=>{let c=[];for(let[f,m]of n.value)c.push(Ei(Qy,{handle:m,key:m.key}));return s?d.value?Ei($y,{to:d.value},c):null:s===null||s===!1?c:Ei("div",{style:{position:"fixed",top:"0px",left:"0px"}},c)}}}),hideOverlay:a,clearAll:l,rerenderOverlays:i,showOverlay:r}}import{h as mb}from"vue";import{defineComponent as cf,h as ut,onBeforeUnmount as sb,ref as ub,watch as db}from"vue";var Qc="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",ef=we({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),tf="db3arf1",nf="db3arfd";var of="submenu",nb="-";function rf(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ot(),focused:!1,destroyed:!1,domRef:{current:null}}}function af(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var ob=({columns:o,keyboardActiveItemKey:t,activeItemKey:e,menuId:n},i,r)=>{let a=i&&(i.key!=null||i.label!=null)?i:null,l=a===null?i===nb?r.renderSeparator():i:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===t,active:a.key===e,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},ib=[{name:"label"}],lf=(o,t)=>{let{props:e,state:n}=o,{activeItemKey:i,keyboardActiveItemKey:r}=n,{items:a,children:l,addSubmenuColumnIfNeeded:u,parentMenuId:d}=e,s=e.id||n.generatedId;d&&(s=`${d}-${s}`);let c=[...e.columns||ib],f={columns:c,keyboardActiveItemKey:r??null,activeItemKey:i??null,menuId:s},m=[];a?m=a.map(h=>ob(f,h,t)):!a&&typeof l!="function"&&(m=t.childrenToRuntimeItems?t.childrenToRuntimeItems(f,l):[]),u&&m.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!c.find(y=>y.name==of)&&c.push({name:of,render:t.renderSubmenuColumn});let p=m.filter(h=>h.type==="item"&&!h.disabled);return{runtimeItems:m,runtimeSelectableItems:p,columns:c,menuId:s}};function sf(o,t){let e=uf(o,t);if(!e.length)return null;let n=Ae.from(e[0]?.getBoundingClientRect()),i=Ae.from(e[e.length-1].getBoundingClientRect()),r=n;return r.width=i.left+i.width-n.left,r}function uf(o,t){let e=Tn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${t}"]`),`[data-menu-id="${o}"]`);if(!e)return[];let n=e.querySelectorAll(`[data-menu-item-key="${t}"]`);return Array.from(n)}function df(o,t){let e=uf(o,t);if(!e.length)return null;for(let n of e){let i=n.querySelector('input[type="checkbox"]');if(i)return i}return null}var Co=class extends Cn{constructor(t){super(t.slice(0,3))}};var rb=250;function ab(o,t=100){let e=Date.now();return new Promise(n=>{let i,r=()=>{if(i=o(),i!==void 0){n(i);return}if(Date.now()-e>t){n(void 0);return}Oe(r)};Oe(()=>{r()})})}var lb=Ee(),Fi=class{constructor(t){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||rb;this.getPointerMoveTarget=()=>document.documentElement||lb;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=t=>{if(clearTimeout(this.mouseMoveTimeoutId),!t){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let e=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=e);let i=e-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=e;let r=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t)};if(i){r();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&r()},this.getTimeout());let l=new je({left:t.clientX,top:t.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let u=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,s=(u?1:-1)*(l.left-this.activeItemLeavePoint.left);if(s-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,r();return}this.lastHorizontalDiff=s,(u?new Co([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Co([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,t))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(t,e)=>{if(t!==this.activeItem){if(t==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=t,this.params.onItemActivate(t,e),this.activeItemMenuRect=null,ab(()=>this.activeItem!=t?!1:this.params.getMenuRectFor(t)).then(n=>{this.activeItem==t&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(t,e,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!t){this.removePointerMoveListener(),e===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=e,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(e,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(t,e)=>{this.onItemChange(!0,t,e)},onItemLeave:(t,e)=>{this.onItemChange(!1,t,e)}});this.params=t}};var cb={renderSeparator:()=>ut("hr",{class:nf}),renderSubmenuColumn:(({domProps:o,item:t})=>t.menu?ut("div",o,[ut(cn,{expanded:!1})]):ut("div",o))},{useManagedComponent:fb}=mn({initSetupState:rf,forwardProps:()=>af(),mapPropsToState:o=>lf(o,cb),debugName:"Menu"}),pb=cf({name:"MenuRuntimeItem",props:{columns:{type:Array,required:!0},item:{type:Object,required:!0},index:{type:Number,required:!0},active:{type:Boolean,required:!0},keyboardActive:{type:Boolean,required:!0},onItemEnter:{type:Function,required:!1},onItemLeave:{type:Function,required:!1},onItemClick:{type:Function,required:!0}},setup(o){let t=ub(!1);return()=>{let{columns:e,item:n,index:i,active:r,keyboardActive:a}=o,l=n.type==="item"?n.value.key:i,u=null;if(n.type==="decoration")u=ut("div",{style:n.style},[n.value]);else{let d=0;u=e.map((s,c)=>{let f=n.value,m=s.field||s.name,p=c+1,h=p+n.span;if(p<d)return null;d=h;let C={style:{...s.style,...n.style,gridColumnStart:p,gridColumnEnd:h},"data-menu-column-id":`${n.parentMenuId}-col-${s.name}`,"data-menu-col-name":`${s.name}`,"data-menu-row-id":`${n.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${n.key}`,class:ee(ef({active:r,disabled:!!n.disabled,keyboardActive:a,pressed:t.value||r}),n.className),onPointerenter:b=>{n.disabled||o.onItemEnter?.(n,b)},onPointerleave:b=>{n.disabled||o.onItemLeave?.(n,b)},onMousedown:()=>{n.disabled||(t.value=!0)},onMouseup:()=>{n.disabled||(t.value=!1)},onClick:b=>{n.disabled||o.onItemClick(b,n)}};return s.render?s.render({item:f,column:s,value:f[m],domProps:C}):ut("div",{key:`${l}-${m}`,...C},[f[m]])}).filter(Boolean)}return ut("div",{class:tf},[u])}}}),At=cf({name:"InfiniteMenu",inheritAttrs:!1,props:{id:{type:String,required:!1},items:{type:Array,required:!1},columns:{type:Array,required:!1,default:void 0},portalContainer:{type:[String,Object,Function,Boolean],required:!1,default:void 0},constrainTo:{type:[String,Object,Function,Boolean],required:!1,default:void 0},wrapLabels:{type:Boolean,required:!1,default:!1},autoFocus:{type:Boolean,required:!1,default:void 0},addSubmenuColumnIfNeeded:{type:Boolean,required:!1,default:!0},bubbleActionsFromSubmenus:{type:Boolean,required:!1,default:!0},parentMenuId:{type:String,required:!1},parentMenuItemKey:{type:String,required:!1},onShow:{type:Function,required:!1},onHide:{type:Function,required:!1},onHideIntent:{type:Function,required:!1},onAction:{type:Function,required:!1}},setup(o,{attrs:t}){let{contextValue:e}=fb(o),n=e.state,i=e.componentActions,r=()=>n.value,a=D=>{i.keyboardActiveItemKey=D},l=D=>{i.activeItemKey=D},u=!1,d=()=>u,s=null,c=D=>{s=D},{showOverlay:f,portal:m,clearAll:p}=Dt({portalContainer:!1}),h=()=>{let D=r();D.onHideIntent?.(D)},y=()=>{i.focused=!0,setTimeout(()=>{let D=r().domRef.current;b&&D&&D===document.activeElement&&r().keyboardActiveItemKey==null&&a(r().runtimeSelectableItems[0]?.key??null)})},C=()=>{i.focused=!1},b=!0,S={hideMenu:h,focus:()=>{let D=r().domRef.current;D&&(D.focus(),setTimeout(()=>{let M=r().domRef.current;M&&M!==document.activeElement&&M.focus()},10),y())},getMenuId:()=>r().menuId,getParentMenuId:()=>r().parentMenuId},w=(D,M)=>{a(M.key),l(M.key),M.originalMenuItem.onClick&&M.originalMenuItem.onClick(D);let A={key:M.key,item:M.originalMenuItem,hideMenu:h};M.originalMenuItem.onAction&&M.originalMenuItem.onAction(A);let{onAction:x}=r();x&&x(A),M.originalMenuItem.hideMenuOnAction&&h()},{onItemEnter:T,onItemLeave:P}=new Fi({parentMenuId:r().parentMenuId,onItemActivate:D=>{d()&&l(D)},itemHasSubMenu:D=>!!r().runtimeItems.filter(A=>A.type==="item"&&A.key===D&&A.menu)[0],getMenuRectFor:D=>{let M=`[data-submenu-for="${D}"]`,A=document.querySelector(M);if(A)return Ae.from(A.getBoundingClientRect())}}).getHandlers(),R=D=>{let M=r().menuId,A=`${M}-submenu`,x=D.menu;return x?(typeof x=="function"&&(x=x()),ut(At,{key:A,parentMenuItemKey:D.key,parentMenuId:M,constrainTo:r().constrainTo,...x,autoFocus:!1,onShow:(F,_)=>{x?.onShow?.(F,_),c(_)},onHideIntent:F=>{x?.onHideIntent?.(F),h()},onHide:F=>{F.focused&&(l(null),a(D.key),S.focus())}})):null};db(()=>n.value.activeItemKey,D=>{let{runtimeItems:M,menuId:A,constrainTo:x}=r(),F=M.filter(O=>O.type==="item"&&D===O.key)[0];if(!F||!F.menu){c(null),p();return}let _=sf(A,F.key);_&&f(()=>R(F),{id:`${A}-submenu`,alignTo:_,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:x})},{flush:"post"});function E(D){let{runtimeItems:M,runtimeSelectableItems:A,keyboardActiveItemKey:x}=r(),F=M.findIndex(B=>B.type==="item"&&B.key===x),_=x,O=M[F],L={ArrowUp:()=>{let B=M.slice(0,F).filter(G=>G.type==="item"&&!G.disabled).pop();B&&B.type==="item"&&B.key&&(_=B.key)},ArrowDown:()=>{let B=M.slice(F+1).filter(G=>G.type==="item"&&!G.disabled)[0];B&&B.type==="item"&&B.key&&(_=B.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{_=A[0].key},PageDown:()=>{_=A[A.length-1].key},ArrowLeft:()=>{l(null),r().parentMenuId&&(i.destroyed=!0)},ArrowRight:()=>{O&&(l(O.key),Oe(()=>{d()&&s&&s.getParentMenuId()===r().menuId&&s.focus()}))},Enter:()=>{if(O)if(O.originalMenuItem?.menu){if(s){L.ArrowLeft();return}l(O.key)}else w(D,O)}," ":()=>{if(!O)return;O.originalMenuItem.menu||w(D,O);let B=df(r().menuId,O.key);B&&B.click()},Escape:()=>{L.ArrowLeft();let B=r();B.parentMenuId||B.onHideIntent?.(B)}},K=L[D.key];K&&(K(),D.preventDefault()),_!=x&&a(_)}let N=!1,v=D=>{let M=D??null;M&&!N?(N=!0,r().domRef.current=M,u=!0,r().onShow?.(r(),S),r().autoFocus&&S.focus()):!M&&N?(N=!1,r().onHide?.(r()),r().domRef.current=null):M&&(r().domRef.current=M)};return sb(()=>{u=!1,N&&(N=!1,r().onHide?.(r())),r().domRef.current=null}),()=>{let D=r(),{columns:M,runtimeItems:A,menuId:x,activeItemKey:F,keyboardActiveItemKey:_,destroyed:O,wrapLabels:L,parentMenuItemKey:K}=D;if(O)return null;let B=A.map((Z,Pe)=>ut(pb,{key:Z.type==="item"?Z.key:Pe,columns:M,item:Z,index:Pe,active:Z.type==="item"&&Z.key===F,keyboardActive:Z.type==="item"&&Z.key===_,onItemEnter:(me,ve)=>T(me.key,ve),onItemLeave:(me,ve)=>P(me.key,ve),onItemClick:w})),G=M.map(Z=>Z.width||(typeof Z.flex=="number"?`${Z.flex}fr`:Z.flex)||"auto").join(" "),le={...t.style,gridTemplateColumns:G,gridTemplateRows:A.map(()=>"auto").join(" ")};return L||(le.whiteSpace="nowrap"),ut("div",{class:_o.contents},[ut("div",{...t,"data-menu-id":x,"data-submenu-for":K,tabindex:0,ref:v,onKeydown:E,onMousedown:()=>{b=!1},onMouseup:()=>{b=!0},onFocus:y,onBlur:C,class:ee(Qc,t.class,"InfiniteMenu"),style:le},B),ut(m)])}}});At[Mi]=!0;import{h as ff}from"vue";function pf(o,t){let{columnApi:e,column:n,getComputed:i,api:r,dataSourceApi:a,getState:l}=t,u=l().components?.CheckBox||qt,s=e.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{r.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{r.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{r.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{r.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{r.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{r.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{r.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{let y=Zn(p,t,"column-menu");f.push({key:h,label:y,check:ff(u,{key:p.id,disabled:p.computedVisible&&r.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:C=>{let b=!!C;r.setVisibilityForColumn(p.id,b),requestAnimationFrame(()=>{r.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}},"-",{key:"group-by",label:"Group by",menu:()=>{let f=[];return i().computedColumnsMapInInitialOrder.forEach((p,h)=>{if(p.groupByForColumn)return;let y=Zn(p,t,"column-menu");f.push({key:h,label:y,check:ff(u,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:f}}}].filter(f=>!!f)}function mf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i}=t,{components:r,getColumnMenuItems:a}=i(),l=r?.Menu??At,u=n().computedColumnsMap.get(o);if(!u)return null;let d={column:u,columnApi:Je(u.id,t),...t},s=pf([],d),c=a?a(s,d):s,f=p=>{p.__insideMenu=!0},m=p=>{p.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!c||!c.length?null:mb(l,{autoFocus:!0,items:c,onShow:p=>{p.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:m,onHideIntent:p=>{m(p),e?.()}})}function yb(o){let{columnId:t,context:e,clearAll:n,showOverlay:i}=o,{getState:r,actions:a}=e,{columnMenuTargetRef:l,domRef:u}=r();function d(){n(),a.columnMenuVisibleForColumnId=null}let s=o.target;if(s||(s=l.current??void 0,s&&!u.current.contains(s)&&(s=void 0)),!s){let c=`[data-column-id="${t}"] ${au}`;s=r().domRef.current.querySelector(c)}if(!s){console.warn(`Cannot show column menu for column "${t}"`);return}l.current=null,i(()=>mf(t,e,d),{constrainTo:u.current,id:"column-menu",alignTo:s,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function hf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onColumnMenuClick.onChange(d=>{d&&(n().columnMenuTargetRef.current=d.target,i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.filterOperatorMenuVisibleForColumnId=null,i.columnMenuVisibleForColumnId=d.column.id)});return gb([()=>e.value.columnMenuVisibleForColumnId,()=>e.value.columnMenuVisibleKey],(d,s,c)=>{let{columnMenuVisibleForColumnId:f,columnMenuTargetRef:m}=n();if(f){let h=function(y){y.__insideMenu!==!0&&(l(),i.columnMenuVisibleForColumnId=null)};var p=h;document.documentElement.addEventListener("mousedown",h),yb({columnId:f,context:t,clearAll:l,showOverlay:r}),c(()=>{document.documentElement.removeEventListener("mousedown",h)})}else m.current=null,l()},{flush:"post"}),hb(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as bb,watch as Cb}from"vue";import{h as Ni}from"vue";function gf(o,t,e){if(o==null)return null;let{getComputed:n,getState:i,getDataSourceState:r,actions:a,dataSourceApi:l,dataSourceActions:u,api:d}=t,{components:s,getFilterOperatorMenuItems:c}=i(),f=s?.Menu??At,m=n().computedColumnsMap.get(o);if(!m)return null;let p=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",p)},{filterTypes:y}=r(),C=y[m.computedFilterType];if(!C)return null;let b=C.operators.map(R=>{let E=R.name,N=m.computedFilterValue?m.computedFilterValue.filter.operator===E:E===C.defaultOperator,v=R.components?.Icon??gn;return{key:E,icon:Ni(v),label:R.label??R.name,onAction:()=>{d.setColumnFilterOperator(o,E)},checked:N?Ni(Xs,{size:16}):null}}),w=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{d.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Ni(Js),disabled:!m.computedFiltered,onAction:()=>{d.clearColumnFilter(o)}},"-"],...b],T={column:m,api:d,getState:i,getDataSourceState:r,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:u,columnFilterValue:m.computedFilterValue,filterTypes:y},P=c?c(w,T):w;return Ni(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:P,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:h,onHideIntent:R=>{h(R),e?.()}})}var Oi=10;function yf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().onFilterOperatorMenuClick.onChange(d=>{if(!d)return;let{target:s,column:c}=d;function f(){l(),i.filterOperatorMenuVisibleForColumnId=null}let m=s?.parentElement||s,p=Ae.from(m.getBoundingClientRect());p.top-=Oi,p.left-=Oi,p.width+=2*Oi,p.height+=2*Oi,r(()=>gf(c.id,t,f),{constrainTo:n().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),i.contextMenuVisibleFor=null,i.cellContextMenuVisibleFor=null,i.columnMenuVisibleForColumnId=null,i.filterOperatorMenuVisibleForColumnId=c.id});return Cb(()=>e.value.filterOperatorMenuVisibleForColumnId,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.filterOperatorMenuVisibleForColumnId=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),bb(()=>{u()}),{MenuPortal:a}}import{onBeforeUnmount as Sf,watch as wf}from"vue";import{h as Li}from"vue";function ki(o){let t=o?Array.isArray(o)?o:o.items:null,e=o&&!Array.isArray(o)?o.columns:void 0;return{items:t,columns:e}}function va(o){let t=i=>{i.__insideMenu=!0},e=i=>{i.domRef.current?.parentNode?.removeEventListener("mousedown",t)};return{columns:[],items:[],autoFocus:!0,onShow:i=>{i.domRef.current?.parentNode?.addEventListener("mousedown",t)},onHide:e,onHideIntent:i=>{e(i),o.onHideIntent?.()}}}function bf(o,t,e){if(!o)return null;let n=pe();return o.then(i=>{let{items:r,columns:a}=ki(i);r&&r.length&&n(Li(e,{...t,items:r||[],columns:a}))}),Li(Xt,{updater:n})}function Cf(o,t,e){let{columnId:n,rowIndex:i,event:r}=o,{getComputed:a,getState:l}=t,{components:u,getCellContextMenuItems:d}=l(),s=u?.Menu??At,{computedColumnsMap:c}=a(),f=c.get(n),m={...Pt({...t,rowIndex:i,columnId:f.id}),event:r};if(!f||!d)return{cellContext:m,menu:null,preventDefault:!1};let p=va({onHideIntent:e}),h=d(m,t),y=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:m,menu:bf(h,p,s),preventDefault:y};let{items:C,columns:b}=ki(h);return!C||!C.length?{cellContext:m,menu:null,preventDefault:Array.isArray(C)}:{preventDefault:y,menu:Li(s,{...p,columns:b,items:C}),cellContext:m}}function Tf(o,t,e){let{getState:n,getComputed:i}=t,{components:r,getContextMenuItems:a}=n(),l=r?.Menu??At,{computedColumnsMap:u}=i(),d=o.columnId?u.get(o.columnId):void 0,s=d?{...o,...Pt({...t,rowIndex:o.rowIndex,columnId:d.id})}:o;if(!a)return{cellContext:s,menu:null,preventDefault:!1};let c=va({onHideIntent:e}),f=a(s,t),m=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:s,menu:bf(f,c,l),preventDefault:m};let{items:p,columns:h}=ki(f);return!p||!p.length?{cellContext:s,menu:null,preventDefault:Array.isArray(p)}:{preventDefault:m,menu:Li(l,{...c,columns:h,items:p}),cellContext:s}}var zi=5,vf=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function If(o){let{context:t,state:e}=o,{getState:n,actions:i,getDataSourceState:r}=t,{showOverlay:a,portal:l,clearAll:u}=Dt({portalContainer:!1}),d=n().cellContextMenu.onChange(s=>{if(!s)return;let{event:c}=s;function f(){u(),i.cellContextMenuVisibleFor=null}let{menu:m,cellContext:p,preventDefault:h}=Cf(s,t,f),y=Ae.fromPoint({top:c.clientY,left:c.clientX});y.width+=zi,y.height+=zi,a(()=>m,{constrainTo:n().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:vf}),h&&c.preventDefault(),i.cellContextMenuVisibleFor={columnId:s.columnId,rowId:s.rowId,rowIndex:s.rowIndex,colIndex:s.colIndex};let{onCellContextMenu:C}=n();C&&C({...p,getState:n,getDataSourceState:r},c)});return wf(()=>e.value.cellContextMenuVisibleFor,(s,c,f)=>{if(s){let p=function(h){h.__insideMenu!==!0&&(u(),i.cellContextMenuVisibleFor=null)};var m=p;document.documentElement.addEventListener("mousedown",p),f(()=>{document.documentElement.removeEventListener("mousedown",p)})}else u()},{flush:"post"}),Sf(()=>{d()}),{MenuPortal:l}}function Rf(o){let{context:t,state:e}=o,{getState:n,actions:i}=t,{showOverlay:r,portal:a,clearAll:l}=Dt({portalContainer:!1}),u=n().contextMenu.onChange(d=>{if(!d)return;let{event:s}=d;function c(){l(),i.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:p}=Tf(d,t,c),h={top:s.clientY,left:s.clientX},y=Ae.fromPoint(h);y.width+=zi,y.height+=zi,r(()=>f,{constrainTo:n().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:vf}),p&&s.preventDefault(),i.contextMenuVisibleFor={point:h,...d};let{onContextMenu:C}=n();C&&C({...t,...m},s)});return wf(()=>e.value.contextMenuVisibleFor,(d,s,c)=>{if(d){let m=function(p){p.__insideMenu!==!0&&(l(),i.contextMenuVisibleFor=null)};var f=m;document.documentElement.addEventListener("mousedown",m),c(()=>{document.documentElement.removeEventListener("mousedown",m)})}else l()},{flush:"post"}),Sf(()=>{u()}),{MenuPortal:a}}import{defineComponent as Ub,h as On,onBeforeUnmount as qb,onMounted as Yb,ref as Zb,shallowRef as Xb,watch as Ia}from"vue";var xf="mlx2t3";import{defineComponent as Tb,h as Sb}from"vue";var Pf=Tb({name:"SpacePlaceholder",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},count:{type:Number,required:!1}},setup(o){return()=>Sb("div",{"data-count":o.count,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:`${o.height}px`,width:`${o.width}px`,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}});var Df={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Af={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},_f={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Mf="_1ueijco1",Ef="_1ueijco0 _16lm1iw0";import{defineComponent as wb,h as vb,onBeforeUnmount as Ib,onMounted as Rb,ref as xb}from"vue";var Ff=o=>{let t="";return typeof o=="boolean"||typeof o=="string"?t=Df[`${o}`]:t=ee(Af[`${o.horizontal}`],_f[`${o.vertical}`]),t};var Pb="InfiniteVirtualScrollContainer",Nf=wb({name:"VirtualScrollContainer",props:{scrollable:{type:[Boolean,String,Object],required:!1,default:!0},tabIndex:{type:Number,required:!1},autoFocus:{type:Boolean,required:!1},onContainerScroll:{type:Function,required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{slots:t,attrs:e}){let n=xb(null),i=r=>{let a=r.target;o.onContainerScroll?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})};return Rb(()=>{let r=n.value;r&&(o.scrollerRef?.(r),r.addEventListener("scroll",i,{passive:!1}),o.autoFocus&&document.activeElement!==r&&r.focus())}),Ib(()=>{n.value?.removeEventListener("scroll",i),o.scrollerRef?.(null)}),()=>vb("div",{...e,ref:n,tabindex:o.tabIndex,class:ee(e.class,Pb,Ef,Ff(o.scrollable))},t.default?.())}});import{computed as Db,defineComponent as Ab,h as _b,onBeforeUnmount as Mb,onMounted as Eb,watch as Fb,watchEffect as Of}from"vue";var Vi=Ab({name:"RawTable",props:{name:{type:String,required:!1},brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},cellDetachedClassNames:{type:Array,required:!1,default:()=>[]},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1}},setup(o){let t=Db(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:go(o.brain));Of(()=>{t.value.renderer.cellHoverClassNames=o.cellHoverClassNames||[]}),Of(()=>{t.value.renderer.cellDetachedClassNames=o.cellDetachedClassNames||[]});let e=null,n=()=>{e?.();let{renderer:i,onRenderUpdater:r}=t.value,{brain:a,renderCell:l,renderDetailRow:u}=o,d=a.getRenderRange();i.renderRange(d,{onRender:r,force:!0,renderCell:l,renderDetailRow:u}),e=a.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:c=>{let f=r.get();f&&c&&f.length===c.length||r(c)},renderCell:l,renderDetailRow:u})})};return Eb(n),Fb(()=>[t.value,o.brain,o.renderCell,o.renderDetailRow,o.forceRerenderTimestamp],n,{flush:"post"}),Mb(()=>{e?.(),e=null}),()=>_b(Xt,{name:o.name,updater:t.value.onRenderUpdater})}});var Gi=[tu,`${Fe}DetachedCell`];import{defineComponent as Nb,h as Lf,onBeforeUnmount as Ob,onMounted as kb,ref as zf,watch as Vf}from"vue";var kf=we({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Ki="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var{rootClassName:Lb}=ke,zb=`${Lb}-ActiveCellIndicator`,Vb=U(j.columnZIndexAtIndex),Gf=Nb({name:"ActiveCellIndicator",props:{activeCellIndex:{type:Array,required:!1,default:null},brain:{type:Object,required:!0},rowHeight:{type:[Number,Function],required:!1}},setup(o){let t=zf(null),e=zf(0),n=()=>{let{activeCellIndex:a,brain:l,rowHeight:u}=o;if(a==null)return;let[d]=a;l.isHorizontalLayoutBrain&&l.rowsPerPage&&(d=d%l.rowsPerPage);let s=typeof u=="function"?u(d):u??l.getRowHeight(d),c=l.getItemOffsetFor(d,"vertical");Sn({activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`},t.value)},i=null,r=a=>{i?.(),i=a.onRenderCountChange(()=>{e.value++})};return kb(()=>{r(o.brain),n()}),Vf(()=>o.brain,r),Vf([()=>o.activeCellIndex,()=>o.rowHeight,()=>o.brain],()=>n(),{flush:"post"}),Ob(()=>{i?.()}),()=>{e.value;let a=o.activeCellIndex!=null&&o.brain.getInitialRows()>o.activeCellIndex[0];return Lf("div",{class:Ki,ref:t,"data-name":"active-cell",style:a?{zIndex:`var(${Vb}-${o.activeCellIndex[1]})`}:void 0},[Lf("div",{"data-name":"active-cell-indicator",class:`${zb} ${kf({visible:a})}`})])}}});import{defineComponent as Gb,h as Bf,onBeforeUnmount as Kb,onMounted as Bb,ref as Hf,watch as Wf}from"vue";var Kf=we({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Hb}=ke,Wb=`${Hb}-ActiveRowIndicator`,jb=`calc(${j.activeCellRowOffsetX} + var(${U(j.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,$b={[U(j.activeCellOffsetY)]:j.activeCellRowOffset,transform:`translate3d(${jb}, calc( ${j.activeCellOffsetY} + var(${U(j.scrollTopForActiveRow)}, 0px)), 0px)`,height:j.activeCellRowHeight,maxWidth:xe.runtime.totalVisibleColumnsWidthVar},jf=Gb({name:"ActiveRowIndicator",props:{activeRowIndex:{type:Number,required:!1,default:null},brain:{type:Object,required:!0}},setup(o){let t=Hf(null),e=Hf(0),n=()=>{let{brain:u}=o;if(o.activeRowIndex==null)return;let d="0px",s=o.activeRowIndex;if(u.isHorizontalLayoutBrain&&u.rowsPerPage){let m=u.getPageIndexForRow(s);m>0&&(d=`calc(${xe.runtime.totalVisibleColumnsWidthVar} * ${m})`),s=s%u.rowsPerPage}let c=u.getRowHeight(s),f=u.getItemOffsetFor(s,"vertical");Sn({activeCellRowHeight:`${c}px`,activeCellRowOffset:`${f}px`,activeCellRowOffsetX:d},t.value)},i=u=>{Sn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.brain.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.value)},r=null,a=null,l=u=>{r?.(),a?.(),i(u.getScrollPosition()),r=u.onScroll(i),a=u.onRenderCountChange(()=>{e.value++})};return Bb(()=>{l(o.brain),n()}),Wf(()=>o.brain,l),Wf([()=>o.activeRowIndex,()=>o.brain],()=>n(),{flush:"post"}),Kb(()=>{r?.(),a?.()}),()=>{e.value;let u=o.activeRowIndex!=null&&o.brain.getInitialRows()>o.activeRowIndex;return Bf("div",{class:Ki,"data-name":"active-row"},[Bf("div",{ref:t,"data-name":"active-row-indicator",class:`${Wb} ${Kf({active:u})}`,style:u?$b:void 0})])}}});var Jb=ee(xf,Mf),$f=Ub({name:"HeadlessTable",props:{brain:{type:Object,required:!0},renderCell:{type:Function,required:!0},renderDetailRow:{type:Function,required:!1},cellHoverClassNames:{type:Array,required:!1},renderer:{type:Object,required:!1},onRenderUpdater:{type:Function,required:!1},forceRerenderTimestamp:{type:Number,required:!1},scrollStopDelay:{type:Number,required:!1},wrapRowsHorizontally:{type:Boolean,required:!1},autoFocus:{type:Boolean,required:!1},tabIndex:{type:Number,required:!1},activeRowIndex:{type:Number,required:!1,default:null},activeCellIndex:{type:Array,required:!1,default:null},activeCellRowHeight:{type:[Number,Function],required:!1},scrollerRef:{type:Function,required:!1}},setup(o,{attrs:t}){let e=Zb(null),n=Xb({width:0,height:0});Ia(()=>o.scrollStopDelay,s=>{s!=null&&o.brain.setScrollStopDelay(s)},{immediate:!0});let i=s=>{requestAnimationFrame(()=>{e.value&&e.value.style.setProperty("transform",`translate3d(${-s.scrollLeft}px, ${-s.scrollTop}px, 0px)`)})},r=s=>{o.brain.setScrollPosition(s,i)},a=null,l=null,u=s=>{l?.(),l=s.onRenderCountChange(()=>{n.value=s.getVirtualizedContentSize()}),n.value=s.getVirtualizedContentSize(),i(s.getScrollPosition()||{scrollLeft:0,scrollTop:0})},d=()=>{a?.(),a=null;let s=e.value?.parentNode;if(!s)return;a=_n(s,()=>{let f={height:s.clientHeight,width:s.clientWidth};o.brain.update(f)},{debounce:50})};return Yb(()=>{u(o.brain),d()}),Ia(()=>o.brain,s=>{u(s),d()}),Ia(()=>o.wrapRowsHorizontally,()=>{d()}),qb(()=>{a?.(),l?.()}),()=>On(Nf,{...t,autoFocus:o.autoFocus,tabIndex:o.tabIndex,onContainerScroll:r,scrollerRef:o.scrollerRef},{default:()=>[On("div",{ref:e,class:Jb,"data-name":"scroll-transform-target"},[On(Vi,{forceRerenderTimestamp:o.forceRerenderTimestamp,renderer:o.renderer,onRenderUpdater:o.onRenderUpdater,renderCell:o.renderCell,renderDetailRow:o.renderDetailRow,brain:o.brain,cellHoverClassNames:o.cellHoverClassNames,cellDetachedClassNames:Gi}),o.activeCellIndex!=null?On(Gf,{brain:o.brain,rowHeight:o.activeCellRowHeight,activeCellIndex:o.activeCellIndex}):null]),o.activeRowIndex!=null?On(jf,{brain:o.brain,activeRowIndex:o.activeRowIndex}):null,On(Pf,{width:n.value.width,height:n.value.height})]})}});var Uf="_16lm1iw1 _16lm1iw1c _16lm1iwe";import{computed as tC,defineComponent as tp,h as zt,onBeforeUnmount as nC,provide as np,shallowRef as Ra,watch as ep}from"vue";import{inject as oC}from"vue";var Yf=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Zf(o){return typeof o=="function"}function qf(o,t){let{column:e,rowIndex:n,rowInfoStore:i,getDataSourceState:r}=t,a=i.getRowInfoAtIndex(n);if(!a)return Yf;let l=i.getDataSourceStates();return o({rowInfo:a,column:e,dataSourceState:l.dataSourceState??r(),previousDataSourceState:l.previousDataSourceState})}function Xf(o,t,e){let n=qf(o,t);return t.rowInfoStore.subscribeToDataArrayChange(()=>{let i=qf(o,t);i!==Yf&&(Object.is(i,n)||(n=i,e()))})}import{defineComponent as Qb,h as eC}from"vue";function Jf(){let{api:o,getState:t}=Be(),e=To(),{editingCell:n,editingValueRef:i}=t(),r=n?.value,a=r;i.current=r;let l=s=>{i.current=s,a=s},{column:u,rowInfo:d}=e.value;return{api:o,initialValue:r,get value(){return a},get readOnly(){let{editingCell:s}=t();return s?!s.active&&!!s.waiting:!1},column:u,rowInfo:d,setValue:l,confirmEdit:o.confirmEdit,cancelEdit:o.cancelEdit,rejectEdit:o.rejectEdit}}var Qf=Qb({name:"InfiniteTableColumnEditor",setup(){let{state:o}=Be(),t=Jf(),{initialValue:e,setValue:n,confirmEdit:i,cancelEdit:r}=t,a=!1,l=!1,u=f=>{f&&!l&&(l=!0,f.value=e??"",f.focus())},d=f=>{let{key:m}=f;m==="Enter"||m==="Tab"?(i(),f.stopPropagation(),m==="Tab"&&f.preventDefault()):m==="Escape"?(a=!0,r()):f.stopPropagation()},s=()=>{!a&&o.value.editingCell?.active&&i()},c=f=>{n(f.target.value)};return()=>(o.value.editingCell,eC("input",{readonly:t.readOnly||void 0,ref:u,onKeydown:d,onBlur:s,onInput:c,class:ee(yl,Il.none),type:"text"}))}});var iC=U(j.columnWidthAtIndex),rC=U(j.columnReorderEffectDurationAtIndex),Pa=Symbol("InfiniteColumnCell");function To(){return oC(Pa)}var aC=o=>{let{toggleCurrentRowDetails:t,rowDetailState:e}=o;return zt(cn,{style:{visibility:e===!1?"hidden":"visible"},expanded:e==="expanded",onChange:t})},lC={display:"inline-block",visibility:"visible"},xa=o=>{let{rowInfo:t,toggleCurrentTreeNode:e,nodeExpanded:n,api:i}=o,r=i.getDataSourceState().isNodeReadOnly;return zt(cn,{disabled:t.isTreeNode&&t.isParentNode?r(t):!1,style:lC,expanded:n,onChange:e})},sC=o=>{let{rowInfo:t,selectCurrentRow:e,deselectCurrentRow:n,toggleCurrentGroupRowSelection:i,dataSourceApi:r,api:a}=o,{components:l}=a.getState(),u=a.getDataSourceState().isNodeSelectable,d=l?.CheckBox||qt;return zt(d,{domProps:{class:Ho},disabled:t.isTreeNode?!u(t):!1,onChange:s=>{if(t.isTreeNode){r.treeApi.setNodeSelection(t.nodePath,s??!1);return}if(t.isGroupRow){i();return}s?e():n()},checked:t.rowSelected})},uC=tp({name:"RenderCellHook",props:{renderParam:{type:Object,required:!0},content:{type:null,default:null}},setup(o){return np(Pa,tC(()=>o.renderParam)),()=>o.content}});function ht(o,t){let e=o(t);return e==null?e:zt(uC,{renderParam:t,content:e})}var op=tp({name:"InfiniteTableColumnCell",props:{rowIndex:{type:Number,required:!0},rowHeight:{type:Number,required:!0},width:{type:Number,required:!0},hidden:{type:Boolean,default:!1},domRef:{type:Function,required:!0},column:{type:Object,required:!0},columnsMap:{type:Object,required:!0},fieldsToColumn:{type:Object,required:!0},showZebraRows:{type:Boolean,default:!0},rowDetailState:{type:[Boolean,String],default:!1},inEditMode:{type:Boolean,default:!1},rowIndexInHorizontalLayoutPage:{type:Number,default:null},horizontalLayoutPageIndex:{type:Number,default:null},rowStyle:{type:[Object,Function],default:void 0},rowClassName:{type:[String,Function],default:void 0},cellStyle:{type:[Object,Function],default:void 0},cellClassName:{type:[String,Function],default:void 0},repaintCellsKey:{type:[String,Number,Object,Function],default:void 0},getData:{type:Function,required:!0},rowInfoStore:{type:Object,required:!0},renderingContext:{type:Object,required:!0},getComputedVisibleColumns:{type:Function,required:!0},getComputedColumnOrder:{type:Function,required:!0},dataSourceStatePartial:{type:Object,default:void 0},onMouseEnter:{type:Function,default:void 0},onMouseLeave:{type:Function,default:void 0}},setup(o){let t={current:null},e=s=>{let c=s&&s.$el!==void 0?s.$el:s;t.current=c??null,o.domRef(t.current)},n=Ra(o.rowInfoStore.getRowInfoAtIndex(o.rowIndex)),i=null;ep([()=>o.rowInfoStore,()=>o.rowIndex],([s,c])=>{i?.(),n.value=s.getRowInfoAtIndex(c),i=s.subscribeToRowIndex(c,()=>{n.value=s.getRowInfoAtIndex(c)})},{immediate:!0});let r=Ra(0),a=null;ep([()=>o.repaintCellsKey,()=>o.column,()=>o.rowIndex,()=>o.rowInfoStore],([s,c,f,m])=>{a?.(),a=null,Zf(s)&&(a=Xf(s,{column:c,rowIndex:f,rowInfoStore:m,getDataSourceState:o.renderingContext.getDataSourceState},()=>{r.value++}))},{immediate:!0}),nC(()=>{i?.(),i=null,a?.(),a=null});let l=Ra(null);np(Pa,l);let u=s=>{let{renderingContext:c,column:f,rowIndex:m}=o;c.getState().cellClick({rowIndex:m,colIndex:f.computedVisibleIndex,event:s})},d=s=>{let{renderingContext:c,column:f,rowIndex:m}=o,{getState:p,actions:h}=c,y=f.computedVisibleIndex;p().cellMouseDown({rowIndex:m,colIndex:y,event:s});let{keyboardNavigation:C}=p(),b=n.value?.rowDisabled??!1;if(C==="row"){b||(h.activeRowIndex=m);return}C==="cell"&&(h.activeCellIndex=[m,y])};return()=>{let{column:s,rowIndex:c,rowHeight:f,hidden:m,rowDetailState:p,renderingContext:h,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C}=o,b=n.value;if(r.value,!s||!b)return zt("div",{ref:e,style:{display:"none"}});let{getState:S,getDataSourceState:w}=h,{activeRowIndex:T,keyboardNavigation:P,columnReorderInPageIndex:R}=S(),E=c===T&&P==="row",N=b.rowDisabled,{rowSelected:v}=b,D=o.getComputedVisibleColumns().map(W=>W.id),M=cc({horizontalLayoutPageIndex:C,rowIndexInHorizontalLayoutPage:y,column:s,rowInfo:b,rowDetailState:p,columnsMap:o.columnsMap,visibleColumnIds:D,fieldsToColumn:o.fieldsToColumn,context:h}),{stylingParam:A,renderParams:x,formattedValueContext:F,renderFunctions:_,groupByColumnReference:O,inEdit:L}=M,{align:K,verticalAlign:B}=x,G=x;G.domRef=e,G.htmlElementRef=t,l.value=G;let{selectionMode:le}=w(),Z=G.cellSelected,Pe=w().cellSelection??null,me=null;if(!m&&!L){if(_.renderGroupIcon&&(G.renderBag.groupIcon=ht(_.renderGroupIcon,{...G,renderBag:{...G.renderBag}})),_.renderSelectionCheckBox&&le=="multi-row"&&(G.renderBag.selectionCheckBox=ht(sC,G),_.renderSelectionCheckBox!==!0&&(G.renderBag.selectionCheckBox=ht(_.renderSelectionCheckBox,{...G,renderBag:{...G.renderBag}}))),b.isTreeNode){let{isParentNode:Ie}=b,Se;Se=(Ie?_.renderTreeIconForParentNode:_.renderTreeIconForLeafNode)||typeof _.renderTreeIcon=="function"?_.renderTreeIcon:Ie&&_.renderTreeIcon===!0?xa:void 0,Se===!0?Se=xa:Se&&(G.renderBag.treeIcon=ht(xa,G)),Se&&(G.renderBag.treeIcon=ht(Se,{...G,renderBag:{...G.renderBag}}))}_.renderRowDetailIcon&&(G.renderBag.rowDetailsIcon=ht(aC,{...G,renderBag:{...G.renderBag}}),typeof _.renderRowDetailIcon=="function"&&(G.renderBag.rowDetailsIcon=ht(_.renderRowDetailIcon,{...G,renderBag:{...G.renderBag}}))),_.renderValue&&(G.renderBag.value=ht(_.renderValue,{...G,renderBag:{...G.renderBag}})),b.isGroupRow&&_.renderGroupValue&&(G.renderBag.value=ht(_.renderGroupValue,{...G,renderBag:{...G.renderBag}})),!b.isGroupRow&&_.renderLeafValue&&(G.renderBag.value=ht(_.renderLeafValue,{...G,renderBag:{...G.renderBag}}));let W=G.renderBag.value;W instanceof Date&&(W=W.toLocaleDateString());let ie=G.renderBag,Te=[K!=="end"?ie.treeIcon:null,K!=="end"?ie.groupIcon:null,K!=="end"?ie.rowDetailsIcon:null,K!=="end"?ie.selectionCheckBox:null,W,K==="end"?ie.selectionCheckBox:null,K==="end"?ie.rowDetailsIcon:null,K==="end"?ie.groupIcon:null,K==="end"?ie.treeIcon:null];me=s.render?ht(s.render,{...G,renderBag:{...G.renderBag,all:Te}}):Te}let{style:ve,className:Ne}=oc({column:s,rowInfo:b,rowIndex:c,rowHeight:f,rowIndexInHorizontalLayoutPage:y,horizontalLayoutPageIndex:C,align:K,verticalAlign:B,stylingParam:A,formattedValueContext:F,groupByColumnReference:O,rowStyle:o.rowStyle,rowClassName:o.rowClassName,cellStyle:o.cellStyle,cellClassName:o.cellClassName,showZebraRows:o.showZebraRows,rowActive:E,rowDisabled:N,rowSelected:v,cellSelected:Z,cellSelection:Pe,getData:o.getData,computedVisibleColumns:o.getComputedVisibleColumns(),computedColumnOrder:o.getComputedColumnOrder(),columnReorderInPageIndex:R}),Me=s.computedVisibleIndex,Ce=s.cssEllipsis??!0,_e={width:`var(${iC}-${Me})`,transition:`transform var(${rC}-${Me}, 0s)`,...ve,height:typeof ve.height=="number"?`${ve.height}px`:ve.height},{onRowMouseEnter:ue,onRowMouseLeave:Q}=o.renderingContext.getState(),H=ue||o.onMouseEnter?W=>{ue?.({...F,rowIndex:c},W),o.onMouseEnter?.(W)}:void 0,q=Q||o.onMouseLeave?W=>{Q?.({...F,rowIndex:c,rowInfo:b},W),o.onMouseLeave?.(W)}:void 0,X={ref:e,style:_e,"data-column-id":s.id,"data-z-index":_e.zIndex,"data-row-id":`${b.id}`,class:ee(Ne,wt,Ko),onClick:u,onMousedown:d,onMouseenter:H,onMouseleave:q},te=zt("div",{class:ee(`${wt}_content`,Ce?at:Mo.hidden)},[me]),oe=s.components?.Editor??Qf,he=L?zt(oe):null,ge=he?[te,he]:[te],ne=s.components?.ColumnCell;return ne?zt(ne,X,{default:()=>ge}):zt("div",X,ge)}}});import{defineComponent as fC,h as pC,shallowRef as mC,watch as hC}from"vue";var ip=we({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});function dC(o,t){let{masterState:e,detailContext:n}=t,i=e.detailDataSourcesStateToRestore;if(i.has(o)){let r=i.get(o);return n.assignState(r),!0}return!1}function cC(o,t){let{detailState:e,masterState:n,masterActions:i,cacheEntryForRow:r}=t,a=new Map(n.detailDataSourcesStateToRestore),l=dd(e);r.all||(r.groupBy||delete l.groupBy,r.sortInfo||delete l.sortInfo,r.filterValue||delete l.filterValue,r.data||delete l.originalDataArray),a.set(o,l),i.detailDataSourcesStateToRestore=a}function rp(o,t){let e={current:!1};return{currentRowCache:{getRowId:()=>o,add:i=>{e.current=!0,t.add(o,i)},get:()=>t.get(o),delete:()=>(e.current=!0,t.delete(o)),has:()=>t.has(o)},cacheCalledByRowDetailRenderer:e}}function ap(o){let{rowInfo:t,currentRowCache:e,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:i,masterActions:r,getMasterState:a}=o,l=i().detailDataSourcesStateToRestore.has(t.id)&&e.has(),d={registerDetail:bt(s=>{if(n.current||e.add({all:!0}),!e.has()){requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)});return}dC(t.id,{masterState:i(),detailContext:s}),requestAnimationFrame(()=>{s.dataSourceState.destroyedRef.current||(s.dataSourceActions.stateReadyAsDetails=!0)}),s.dataSourceState.onCleanup.onChange(()=>{let c=e.get();c&&cC(t.id,{detailState:s.getDataSourceState(),masterActions:r,masterState:i(),cacheEntryForRow:c})})}),shouldRestoreState:l};return d.masterRowInfo=t,d.getMasterDataSourceState=i,d.getMasterState=a,d}var{rootClassName:gC}=ke,yC=`${gC}RowDetail`,Da=fC({name:"InfiniteTableDetailRow",props:{rowInfo:{type:Object,required:!0},rowIndex:{type:Number,required:!0},domRef:{type:Function,required:!1},rowDetailHeight:{type:Number,required:!0},detailOffset:{type:Number,required:!0},rowDetailRenderer:{type:Function,required:!0},rowDetailsCache:{type:Object,required:!0}},setup(o){let{getDataSourceState:t,dataSourceActions:e}=co(),{getState:n}=Be(),i=()=>{let{currentRowCache:l,cacheCalledByRowDetailRenderer:u}=rp(o.rowInfo.id,o.rowDetailsCache);return{masterDetailContextValue:ap({rowInfo:o.rowInfo,currentRowCache:l,cacheCalledByRowDetailRenderer:u,getMasterDataSourceState:t,masterActions:e,getMasterState:n}),currentRowCache:l}},r=mC(i());hC(()=>o.rowInfo.id,()=>{r.value=i()}),hd(()=>r.value.masterDetailContextValue);let a=l=>{let u=l&&l.$el!==void 0?l.$el:l;o.domRef?.(u||null)};return()=>{let{masterDetailContextValue:l,currentRowCache:u}=r.value;return l.masterRowInfo=o.rowInfo,pC("div",{ref:a,class:ee(yC,ip({})),style:{position:"absolute",top:`${o.detailOffset}px`,left:0,width:`calc(${j.bodyWidth} - ${j.scrollbarWidthVertical})`,height:`${o.rowDetailHeight}px`}},[o.rowDetailRenderer(o.rowInfo,u)])}}});var Aa=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=t=>this.rowHeight.get(t)??0;this.getRowDetailHeight=t=>this.rowDetailHeight.get(t)??0}getTotalRowHeight(t){return this.getRowHeight(t)+this.getRowDetailHeight(t)}getSize(t){let e=this.getRowHeight(t),n=this.getRowDetailHeight(t);return{rowHeight:e,rowDetailHeight:n,totalRowHeight:e+n}}};function bC(o,t){let e=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:i,isRowDetailsEnabled:r,getDataSourceState:a}=o;if(!i)return typeof n=="function"?s=>{if(t&&t.rowHeight.has(s))return t.rowHeight.get(s);let c=a().dataArray[s],f=c?n(c):0;return t&&t.rowHeight.set(s,f),f}:n;let l=typeof n=="function",u=typeof e=="function";return s=>{if(t&&t.rowHeight.has(s)&&t.rowDetailHeight.has(s))return t.rowHeight.get(s)+t.rowDetailHeight.get(s);let c=a().dataArray[s];if(!c)return t&&(t.rowHeight.set(s,0),t.rowDetailHeight.set(s,0)),0;let f=l?n(c):n;if(!!(!r||typeof r=="function"&&r(c)===!1)||!i(c))return t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,0)),f;let p=0;return u?p=e(c):p=e,t&&(t.rowHeight.set(s,f),t.rowDetailHeight.set(s,p)),f+p}}function lp(o){let t=new Aa;return{computedRowHeight:bC(o,t),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?t:void 0}}import{computed as hp,defineComponent as RC,h as kn,onBeforeUnmount as xC,watch as PC,watchEffect as DC}from"vue";function sp(o,t,e,n){let i=new Map,r=new Map,a=new Map;o.forEach((s,c)=>{let f=s.id,m=o[c-1],p=m?.id??"",h=new Set,y=m?.computedPinned!==s.computedPinned?new Set:a.get(p)??new Set;a.set(f,h);let C={type:"column",id:f,ref:s,groupOffset:0,computedPinned:s.computedPinned,computedWidth:s.computedWidth,depth:s.columnGroup?(e.get(s.columnGroup)??0)+1:0};i.set([f],C);let b=s.columnGroup,S,w=C;for(;b;){let T=t[b];if(T){h.add(b);let P=[f,...h];S=y.has(b)?r.get(b):void 0,S||(S={id:b,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:C.computedPinned,depth:e.get(b)??0},i.set(P,S),r.set(b,S)),S.columnItems.push(C),S.uniqueGroupId.push(C.id),w&&!y.has(w.id)&&S.children.push(w),w=S,b=T.columnGroup}else break}});let l=[],u=new $,d=0;return i.forEach(s=>{if(!s.ref.columnGroup){let c=s.type==="column"?s.ref.computedWidth:s.columnItems.reduce((f,m)=>f+m.ref.computedWidth,0);s.groupOffset=d,s.computedWidth=c,s.type==="group"&&up(s.children),l.push(s),d+=c}if(s.type==="group")s.columnItems.forEach(c=>{u.set([s.depth,c.ref.computedVisibleIndex],s)});else for(let c=s.depth;c<=n+1;c++)u.set([c,s.ref.computedVisibleIndex],s)}),i.clear(),r.clear(),{tree:l,pathsToCells:u}}function up(o,t=0){o.forEach(e=>{let n=e.type==="column"?e.ref.computedWidth:e.columnItems.reduce((i,r)=>i+r.ref.computedWidth,0);e.computedWidth=n,e.groupOffset=t,e.type==="group"&&up(e.children),t+=n})}import{defineComponent as vC,h as _a}from"vue";import{defineComponent as CC,h as dp,ref as TC}from"vue";var{rootClassName:SC}=ke,wC=`${SC}HeaderCell_ResizeHandle`,cp=CC({name:"GroupResizeHandle",props:{groupColumns:{type:Array,required:!0},columns:{type:Array,required:!0},draggerStyle:{type:Object,default:void 0},brain:{type:Object,required:!0},computeResize:{type:Function,required:!0},onResize:{type:Function,required:!0}},setup(o){let t={current:null},e=TC(!1),n=i=>{i.stopPropagation();let r=o.groupColumns[0];if(!r)return;let a=r.computedPinned,l=i.pointerId,u=i.clientX,d=i.target;d.setPointerCapture(l);let s=!0,c=hu(o.groupColumns.map(h=>h.computedVisibleIndex),{columns:o.columns,domRef:t}),f=h=>{a==="end"&&(h*=-1);let{constrained:y,adjustedDiffs:C,adjustedDiff:b}=o.computeResize(h);return e.value!==y&&(e.value=y),c.resize(C),b},m=h=>{if(s){let y=o.groupColumns.reduce((S,w)=>S+w.computedWidth-w.computedMinWidth,0),C=o.brain.getAvailableSize(),b={width:C.width+y,height:C.height};o.brain.update(b),s=!1}f(Math.round(h.clientX-u))},p=h=>{d.releasePointerCapture(l),d.removeEventListener("pointermove",m),d.removeEventListener("pointerup",p);let y=Math.round(h.clientX-u),C=f(y);c.resize(o.groupColumns.map(()=>0)),o.onResize(C)};d.addEventListener("pointermove",m),d.addEventListener("pointerup",p)};return()=>{let i=o.groupColumns[0];if(!i)return null;let r=i.computedPinned,a=i.computedFirstInCategory,l=i.computedLastInCategory,u=(r===!1||r==="start")&&l?{right:r==="start"?void 0:xe.components.HeaderCell.resizeHandleWidth}:r==="end"&&a?{right:void 0}:void 0;return dp("div",{ref:d=>{t.current=d??null},class:`${wC} ${$o} ${qo({computedPinned:r,computedFirstInCategory:a,computedLastInCategory:l})}`,onPointerdown:n},[dp("div",{style:{...u,...o.draggerStyle},class:Uo({constrained:e.value})})])}}});var fp=`${Fe}HeaderGroup`,pp=U(j.columnWidthAtIndex),IC=U(j.columnZIndexAtIndex),mp=vC({name:"InfiniteTableHeaderGroup",props:{columnGroup:{type:Object,required:!0},columns:{type:Array,required:!0},height:{type:Number,required:!0},width:{type:Number,required:!0},columnGroupsMaxDepth:{type:Number,required:!0},horizontalLayoutPageIndex:{type:Number,default:null},domRef:{type:Function,required:!0}},setup(o){let{getState:t,getComputed:e,actions:n}=Be(),i=l=>{o.domRef(l??null)},r=l=>{let u=t(),{columnSizing:d,viewportReservedWidth:s,bodySize:c}=u,f=e().computedVisibleColumns,m=o.columns,p=m[m.length-1],h=!1,y=f.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...d[S.id],flex:S.computedWidth},h=!0),b),{}),C=h?{...d,...y}:d;return ts({availableSize:Dr(c),reservedWidth:s||0,dragHandleOffset:l,dragHandlePositionAfter:p.computedVisibleIndex,columnSizing:C,columnGroupSize:m.length,items:f.map(b=>({id:b.id,resizable:b.computedResizable,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},a=l=>{let{columnSizing:u,reservedWidth:d}=r(l);n.viewportReservedWidth=d,n.columnSizing=u};return()=>{let{columnGroup:l,height:u,columns:d,columnGroupsMaxDepth:s}=o,{header:c}=l,{style:f}=l;c instanceof Function&&(c=c({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let m=d[0],p=d.length>1?"calc( "+d.map(S=>`var(${pp}-${S.computedVisibleIndex})`).join(" + ")+" )":`var(${pp}-${m.computedVisibleIndex})`,h=`calc(var(${IC}-${m.computedVisibleIndex}) + ${s-l.depth})`,y=typeof f=="function"?f({columnGroup:l,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):f;y=y&&typeof y=="object"?{...y}:{},y.width=p,y.height=`${u}px`;let b=d.some(S=>S.computedResizable)?_a(cp,{brain:t().brain,draggerStyle:{height:`${u*(s-l.depth+2)}px`},columns:e().computedVisibleColumns,groupColumns:d,computeResize:r,onResize:a}):null;return _a("div",{ref:i,"data-group-id":l.uniqueGroupId,class:ee(Hl,fp),style:y,"data-z-index":h},[_a("div",{class:ee(`${fp}__header-content`,at)},[c]),b])}}});var{rootClassName:AC}=ke,gp=`${AC}Header`,_C=[],MC=zl({overflow:!1}),yp=RC({name:"TableHeaderWrapper",props:{headerBrain:{type:Object,required:!0},bodyBrain:{type:Object,required:!0},wrapRowsHorizontally:{type:Boolean,default:!1}},setup(o){let t=Be(),{state:e,getState:n,getComputed:i,dataSourceContext:r}=t,a=hp(()=>{let p=e.value,h=p.computedColumnGroups;return!h||!Object.keys(h).length?1:p.columnGroupsMaxDepth+2}),l=hp(()=>{let p=e.value;return a.value*p.columnHeaderHeight+(p.showColumnFilters?p.columnHeaderHeight:0)}),u=kt(()=>{let p=e.value;return[p.computedColumnGroups,p.columnGroupsDepthsMap,p.columnGroupsMaxDepth,i().computedVisibleColumns]},()=>{let p=n(),{computedColumnGroups:h,columnGroupsDepthsMap:y}=p,{computedVisibleColumns:C}=i();if(!(!h||!Object.keys(h).length))return sp(C,h,y,p.columnGroupsMaxDepth)},"header.treeInfo");DC(()=>{let p=e.value,{computedVisibleColumns:h,computedPinnedStartColumns:y,computedPinnedEndColumns:C,columnSize:b}=i(),S=a.value,w=l.value,T=u.value,P=p.showColumnFilters,R=p.columnHeaderHeight,E=({rowIndex:D,colIndex:M})=>{let A=h[M],x=1,F=1;if(!A||!T)return{rowspan:x,colspan:F};let _=T.pathsToCells.get([D,M]);if(!_)return{rowspan:x,colspan:F};if(_.type==="column")return{colspan:F,rowspan:S-_.depth};let O=_.columnItems.findIndex(L=>L.id===A.id);return{rowspan:x,colspan:O===0?_.columnItems.length:1}},N=D=>P?D<S-1?R:2*R:R,v=o.headerBrain;(y.length||C.length)&&v.updateFixedCells({fixedColsStart:y.length,fixedColsEnd:C.length}),v.update({colWidth:b,rowHeight:N,rows:S,cols:h.length,height:w,rowspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).rowspan,colspan:({rowIndex:D,colIndex:M})=>E({rowIndex:D,colIndex:M}).colspan})});let d=null,s=p=>{d&&(d.style.transform=`translate3d(-${p.scrollLeft}px, 0px, 0px)`)},c=p=>{d=p??null},f=null;PC(()=>o.headerBrain,p=>{f?.(),f=p.onScroll(s),s(p.getScrollPosition()||{scrollLeft:0,scrollTop:0})},{immediate:!0}),xC(()=>{f?.(),f=null});let m=kt(()=>{let p=e.value,h=r.state.value,{computedVisibleColumns:y,computedColumnsMap:C}=i();return[p.headerOptions,p.columnHeaderHeight,p.columnGroupsMaxDepth,p.showColumnFilters,y,C,u.value,o.headerBrain,h.allRowsSelected,h.someRowsSelected,h.selectionMode,h.filterTypes,h.filterDelay]},()=>{let p=n(),h=r.getDataSourceState(),{computedVisibleColumns:y,computedColumnsMap:C}=i(),b=o.headerBrain,S=u.value,w=p.columnGroupsMaxDepth,T=p.headerOptions,{allRowsSelected:P,someRowsSelected:R,selectionMode:E}=h;return N=>{let{rowIndex:v,colIndex:D,domRef:M,height:A,widthWithColspan:x,heightWithRowspan:F,hidden:_}=N,O=y[D];if(!O||_)return null;let L=b.isHorizontalLayoutBrain?b.getPageIndexForRow(v):null,K=S?S.pathsToCells.get([v,D]):null;if(K&&K.type==="group"){let B=K.columnItems.map(Z=>Z.ref),G={...K.ref,id:K.id,uniqueGroupId:K.uniqueGroupId,depth:K.depth,columns:B.map(Z=>Z.id),computedWidth:K.computedWidth,groupOffset:K.groupOffset};return n().columnGroupVisibility[K.id]!==!1?kn(mp,{key:K.uniqueGroupId.join("/"),horizontalLayoutPageIndex:L,columnGroupsMaxDepth:w,domRef:M,columns:B,width:x,height:A,columnGroup:G}):null}return kn(Tu,{key:O.id,domRef:M,column:O,columnsMap:C,horizontalLayoutPageIndex:L,headerOptions:T,width:x,height:F,allRowsSelected:P,someRowsSelected:R,selectionMode:E})}},"header.renderCell");return()=>{let p=l.value,{scrollbars:h}=i(),y=e.value,C=kn("div",{ref:c,class:ee(gp,`${gp}--virtualized`,MC),style:{height:`${p}px`}},[kn(Vi,{name:"header",renderCell:m.value,brain:o.headerBrain,renderer:y.headerRenderer,onRenderUpdater:y.headerOnRenderUpdater,cellHoverClassNames:_C,cellDetachedClassNames:Gi})]),b=h.vertical&&Tt()?kn("div",{class:jl,style:{zIndex:1e3,width:`${Tt()}px`}}):null;return kn("div",{class:`${yr} ${Yl}`,style:{height:`${p}px`}},[C,b])}}});import{defineComponent as EC,h as Ma}from"vue";var bp={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Cp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Tp="qy58ya4";var{rootClassName:FC}=ke,Ea=`${FC}-LoadMask`,Bi=EC({name:"LoadMask",props:{visible:{type:Boolean,required:!0}},setup(o,{slots:t}){return()=>Ma("div",{class:`${bp[o.visible?"visible":"hidden"]} ${Ea}`},[Ma("div",{class:`${Cp} ${Ea}-Overlay`}),Ma("div",{class:`${Tp} ${Ea}-Text`},t.default?t.default():"Loading")])}});var Sp=o=>`--infinite-${o}`;var wp=40,vp=Sp(Ss);var KC=ke.rootClassName,Na=["debugId","id","children","columns","columnDefaultWidth","columnDefaultFlex","columnMinWidth","columnMaxWidth","columnCssEllipsis","columnHeaderCssEllipsis","columnDefaultSortable","columnDefaultDraggable","columnDefaultEditable","columnDefaultFilterable","columnDefaultGroupable","columnOrder","defaultColumnOrder","onColumnOrderChange","columnVisibility","defaultColumnVisibility","onColumnVisibilityChange","columnPinning","defaultColumnPinning","onColumnPinningChange","columnSizing","defaultColumnSizing","onColumnSizingChange","columnTypes","columnGroups","defaultColumnGroups","columnGroupVisibility","collapsedColumnGroups","pinnedStartMaxWidth","pinnedEndMaxWidth","viewportReservedWidth","onViewportReservedWidthChange","resizableColumns","draggableColumns","draggableColumnsRestrictTo","sortable","multiSortBehavior","editable","rowHeight","onRowHeightChange","rowDetailHeight","columnHeaderHeight","onColumnGroupVisibilityChange","header","headerOptions","showColumnFilters","showZebraRows","showHoverRows","rowHoverClassName","rowClassName","rowStyle","rowProps","cellClassName","cellStyle","repaintCellsKey","domProps","licenseKey","loadingText","components","keyboardNavigation","keyboardSelection","keyboardShortcuts","activeRowIndex","defaultActiveRowIndex","onActiveRowIndexChange","activeCellIndex","defaultActiveCellIndex","onActiveCellIndexChange","onKeyDown","onCellClick","onCellDoubleClick","onCellContextMenu","onContextMenu","onScrollToTop","onScrollToBottom","onScrollStop","scrollToBottomOffset","scrollStopDelay","scrollTopKey","onReady","onRenderRangeChange","onRowMouseEnter","onRowMouseLeave","onSelfFocus","onSelfBlur","onFocusWithin","onBlurWithin","focusedClassName","focusedWithinClassName","focusedStyle","focusedWithinStyle","groupColumn","groupRenderStrategy","hideColumnWhenGrouped","hideEmptyGroupColumns","pivotColumn","pivotColumns","pivotColumnGroups","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","wrapRowsHorizontally","repeatWrappedGroupRows","onScrollbarsChange","autoSizeColumnsKey","columnMenuRealignDelay","getColumnMenuItems","getCellContextMenuItems","getContextMenuItems","getFilterOperatorMenuItems","onEditCancelled","onEditRejected","onEditAccepted","persistEdit","shouldAcceptEdit","onEditPersistError","onEditPersistSuccess","rowDetailCache","rowDetailRenderer","isRowDetailExpanded","isRowDetailEnabled","rowDetailState","defaultRowDetailState","onRowDetailStateChange"],{useManagedComponent:BC,injectionKey:HC}=mn({initSetupState:_d,forwardProps:Md,mapPropsToState:Od,cleanup:Ed,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Nd(),getParentState:()=>{let o=kC(uo,null);return o?o.state:null},debugName:"InfiniteTable"});function Rp(o){return t=>o[t]?.computedWidth??0}function xp(o,t){return o.filter(n=>typeof n.rowspan=="function").length?({rowIndex:n,colIndex:i})=>{let r=t().dataArray,a=r[n];if(!a)return 1;let l=o[i];return!l||!l.rowspan?1:l.rowspan({column:l,data:a.data,dataArray:r,rowInfo:a,rowIndex:n})}:void 0}var Oa=OC({name:"InfiniteTable",props:[...Na],setup(o,{attrs:t}){let e=co();if(!e)throw new Error("InfiniteTable must be rendered inside a <DataSource> component");let n=new Proxy(o,{get(g,I,z){let k=Reflect.get(g,I,z);return I==="rowHeight"?k??wp:I==="columnHeaderHeight"?k??vp:I==="repeatWrappedGroupRows"?k??!!Reflect.get(g,"wrapRowsHorizontally"):k}}),{contextValue:i}=BC(n);Ip(HC,i);let r=i.state,a=i.componentActions,l=i.getComponentState,{state:u,getDataSourceState:d}=e,s=g=>{A.toggleGroupRow(g)};He([()=>r.value.columns,()=>u.value.groupBy,()=>u.value.pivotBy,()=>u.value.selectionMode,()=>r.value.hideColumnWhenGrouped,()=>r.value.groupColumn,()=>r.value.groupRenderStrategy,()=>r.value.pivotColumns,()=>r.value.pivotTotalColumnPosition,()=>r.value.pivotColumn],()=>{let g=r.value,I=u.value,{columns:z,groupColumnIds:k}=lc({columns:g.columns,groupColumn:g.groupColumn,pivotColumn:g.pivotColumn,pivotTotalColumnPosition:g.pivotTotalColumnPosition,pivotGrandTotalColumnPosition:g.pivotGrandTotalColumnPosition,groupRenderStrategy:g.groupRenderStrategy==="inline"?"single-column":g.groupRenderStrategy,groupBy:I.groupBy,pivotBy:I.pivotBy,pivotColumns:g.pivotColumns,toggleGroupRow:s,selectionMode:I.selectionMode});a.columnsWhenGrouping=z;let Y=r.value.columnOrder;if(k.length&&Array.isArray(Y)){let V=new Set(Y),J=!1;k.forEach(ce=>{V.has(ce)||(J=!0,Y=[ce,...Y])}),J&&(a.columnOrder=Y)}},{immediate:!0}),He(()=>r.value.groupRenderStrategy,g=>{e.dataSourceActions.generateGroupRows=g!=="inline"},{immediate:!0}),He(()=>r.value.showSeparatePivotColumnForSingleAggregation,g=>{e.dataSourceActions.showSeparatePivotColumnForSingleAggregation=g},{immediate:!0}),He(()=>r.value.pivotTotalColumnPosition,g=>{e.dataSourceActions.pivotTotalColumnPosition=g},{immediate:!0}),He(()=>r.value.pivotGrandTotalColumnPosition,g=>{g!=null&&(e.dataSourceActions.pivotGrandTotalColumnPosition=g)},{immediate:!0});let c=zC(0),f=null,m=null,p=()=>{let{autoSizeColumnsKey:g}=r.value;return typeof g=="object"?g.key:g};He(()=>r.value.brain,g=>{m?.(),m=g.onRenderRangeChange(()=>{p()!=null&&r.value.autoSizeColumnsKey!==f&&(c.value+=1)})},{immediate:!0}),Fa(()=>{m?.()}),He([p,()=>r.value.ready,c],()=>{let g=p();if(g==null)return;let{autoSizeColumnsKey:I,domRef:z}=r.value,k,Y,V=!0;typeof I=="object"&&(I.columnsToResize&&(k=new Set(I.columnsToResize)),I.columnsToSkip&&(Y=new Set(I.columnsToSkip)),V=I.includeHeader??V),f=g;let J=zd(z,{includeHeader:V,columnsToResize:k,columnsToSkip:Y}),ce=Object.keys(J);if(!ce.length)return;let se=r.value.columnSizing,fe={...se},ae=!1;ce.forEach(ye=>{fe[ye]={width:J[ye]},ae=ae||fe[ye].width!==se[ye]?.width}),ae&&(a.columnSizing=fe)},{immediate:!0,flush:"post"});let h=NC(()=>Fd(u.value.groupBy));He([()=>r.value.groupRenderStrategy,()=>u.value.originalLazyGroupDataChangeDetect,()=>u.value.groupBy,h,()=>r.value.computedColumns,()=>r.value.hideEmptyGroupColumns?u.value.dataArray:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsState:null,()=>r.value.hideEmptyGroupColumns?u.value.groupRowsIndexesInDataArray:null,()=>r.value.hideEmptyGroupColumns],()=>{let g=r.value,I=u.value;if(g.groupRenderStrategy!=="multi-column")return;let z=h.value,k=kd(g.computedColumns,z),Y=Ld({computedGroupColumns:k,columnVisibility:g.columnVisibility,hideEmptyGroupColumns:g.hideEmptyGroupColumns,groupRowsIndexesInDataArray:I.groupRowsIndexesInDataArray,dataArray:I.dataArray,groupBy:I.groupBy,groupByMap:z});Wt(g.columnVisibility,Y)||(a.columnVisibility=Y)},{immediate:!0}),He([()=>r.value.computedColumns,()=>r.value.columnTypes,()=>u.value.groupBy,h,()=>r.value.hideColumnWhenGrouped],()=>{let g=r.value,I=h.value,z=u.value.groupBy.length>0,{columnVisibility:k,columnVisibilityForGrouping:Y,hideColumnWhenGrouped:V,computedColumns:J}=g,ce={...k},se={...Y},fe=!1,ae=new Set,ye=new Set;Object.keys(J).forEach(Re=>{let re=J[Re];if(re.defaultHiddenWhenGroupedBy||V!=null)if(re.defaultHiddenWhenGroupedBy==="*"&&z||(re.defaultHiddenWhenGroupedBy===!0||V)&&re.field&&I.get(re.field)||typeof re.defaultHiddenWhenGroupedBy=="string"&&I.get(re.defaultHiddenWhenGroupedBy)||typeof re.defaultHiddenWhenGroupedBy=="object"&&Object.keys(re.defaultHiddenWhenGroupedBy).reduce((_t,Mt)=>_t||I.has(Mt),!1)){if(se[Re]!==!1){if(k[Re]===!1)return;se[Re]=!1,fe=!0,ae.add(Re)}}else se[Re]===!1&&(delete se[Re],fe=!0,ye.add(Re))}),fe&&(a.columnVisibilityForGrouping=se,ye.forEach(Re=>{delete ce[Re]}),ae.forEach(Re=>{ce[Re]=!1}),a.columnVisibility=ce)},{immediate:!0});let y=kt(()=>{let g=r.value,I=u.value;return[g.computedColumns,g.bodySize.width,g.columnMinWidth,g.columnMaxWidth,g.columnDefaultWidth,g.columnDefaultFlex,g.columnCssEllipsis,g.columnHeaderCssEllipsis,g.viewportReservedWidth,g.resizableColumns,I.filterValue,I.filterTypes,g.sortable,I.sortInfo,I.multiSort,g.pinnedEndMaxWidth,g.pinnedStartMaxWidth,g.draggableColumns,g.columnDefaultDraggable,g.columnOrder,g.columnPinning,g.columnDefaultEditable,g.columnDefaultFilterable,g.columnDefaultGroupable,g.columnDefaultSortable,g.editable,g.columnSizing,g.columnTypes,g.columnVisibility,g.initialColumns,I.groupBy]},()=>{let g=r.value,I=u.value;return ls({columns:g.computedColumns,userColumns:g.initialColumns,scrollbarWidth:void 0,bodySize:g.bodySize,columnMinWidth:g.columnMinWidth,columnMaxWidth:g.columnMaxWidth,columnDefaultWidth:g.columnDefaultWidth,columnDefaultFlex:g.columnDefaultFlex,columnCssEllipsis:g.columnCssEllipsis,columnHeaderCssEllipsis:g.columnHeaderCssEllipsis,viewportReservedWidth:g.viewportReservedWidth,resizableColumns:g.resizableColumns,filterValue:I.filterValue,filterTypes:I.filterTypes,sortable:g.sortable,sortInfo:I.sortInfo??void 0,multiSort:I.multiSort,pinnedEndMaxWidth:g.pinnedEndMaxWidth,pinnedStartMaxWidth:g.pinnedStartMaxWidth,draggableColumns:g.draggableColumns,columnDefaultDraggable:g.columnDefaultDraggable,columnOrder:g.columnOrder,columnPinning:g.columnPinning,columnDefaultEditable:g.columnDefaultEditable,columnDefaultFilterable:g.columnDefaultFilterable,columnDefaultGroupable:g.columnDefaultGroupable,columnDefaultSortable:g.columnDefaultSortable,editable:g.editable,columnSizing:g.columnSizing,columnTypes:g.columnTypes,columnVisibility:g.columnVisibility,columnVisibilityAssumeVisible:!0,groupBy:I.groupBy})},"computedColumnsResult"),C=()=>y.value.computedVisibleColumns,{getDataSourceState:b,dataSourceApi:S}=e,w=new Ai({isRowDisabledAt:g=>b().dataArray[g]?.rowDisabled??!1,getIdForIndex:g=>b().dataArray[g]?.id??-1}),T=new _i({getPrimaryKeyByIndex:S.getPrimaryKeyByIndex,getColumnIdByIndex:g=>C()[g]?.id||""}),P=VC({vertical:!1,horizontal:!1}),R=null;He(()=>r.value.brain,g=>{R?.(),R=g.onRenderCountChange(()=>{let{scrollTopMax:I,scrollLeftMax:z}=g,k=I>0,Y=z>0,V=P.value;(V.vertical!==k||V.horizontal!==Y)&&(P.value={vertical:k,horizontal:Y})})},{immediate:!0}),He(P,g=>{let I=b(),{onScrollbarsChange:z}=l();z&&I.updatedAt&&I.dataArray.length&&z(g),I.notifyScrollbarsChange(g)});let E=null,N=()=>{let g=l(),I=[g.rowHeight,g.rowDetailHeight,g.isRowDetailExpanded,g.isRowDetailEnabled];return(!E||E.deps.some((z,k)=>z!==I[k]))&&(E={deps:I,value:lp({rowHeight:g.rowHeight,rowDetailHeight:g.rowDetailHeight,isRowDetailsExpanded:g.isRowDetailExpanded,isRowDetailsEnabled:g.isRowDetailEnabled,getDataSourceState:b})}),E.value},v=()=>N().computedRowHeight,D=()=>{let g=y.value,I=g.computedPinnedStartWidth??g.computedPinnedStartColumnsWidth,z=g.computedPinnedEndWidth??g.computedPinnedEndColumnsWidth;return{...g,scrollbars:P.value,multiRowSelector:w,multiCellSelector:T,computedRowHeight:v(),computedRowSizeCacheForDetails:N().computedRowSizeCacheForDetails,rowspan:xp(g.computedVisibleColumns,b),computedPinnedStartOverflow:I?g.computedPinnedStartColumnsWidth>I:!1,computedPinnedEndOverflow:z?g.computedPinnedEndColumnsWidth>z:!1,toggleGroupRow:k=>A.toggleGroupRow(k),columnSize:k=>Rp(g.computedVisibleColumns)(k)}},M=()=>b().getDataSourceMasterContextRef?.current?.()??void 0,A=Tc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,dataSourceApi:S}),x={getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},F={getComputed:D,getDataSourceMasterContext:M,dataSourceApi:S,api:A,getState:l,actions:a,getDataSourceState:b,dataSourceActions:e.dataSourceActions,cloneTreeSelection:g=>ti(g,b),cloneRowSelection:g=>Ao(g,b)},_=l().keyDown.onChange(g=>{Hc(F,g)}),O=l().cellClick.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,Y=D().computedVisibleColumns[k],V=Je(Y.id,F);I.key="",xc({...F,rowIndex:z,colIndex:k,column:Y,columnApi:V},I)}),L=l().cellMouseDown.onChange(g=>{if(!g)return;let{event:I,rowIndex:z,colIndex:k}=g,Y=D().computedVisibleColumns[k],V=Je(Y.id,F);Pc({...F,rowIndex:z,colIndex:k,column:Y,columnApi:V},I)}),K=g=>{l().keyDown(g)};l().onRowHeightCSSVarChange.onChange(g=>{g&&(a.rowHeight=g)}),l().onFlashingDurationCSSVarChange.onChange(g=>{let I=g?g*1:null;I!=null&&!isNaN(I)&&(a.flashingDurationCSSVarValue=I)}),l().onRowDetailHeightCSSVarChange.onChange(g=>{g&&(a.rowDetailHeight=g)}),l().onColumnHeaderHeightCSSVarChange.onChange(g=>{g&&(a.columnHeaderHeight=g)});let{MenuPortal:B}=hf({context:F,state:r}),{MenuPortal:G}=If({context:F,state:r}),{MenuPortal:le}=Rf({context:F,state:r}),{MenuPortal:Z}=yf({context:F,state:r}),Pe=g=>{let I=l(),z=g.target,k=Ts(z,ia(),I.domRef.current),Y,V,J,ce;k&&(V=Number(k.dataset.colIndex),ce=Number(k.dataset.rowIndex),Y=D().computedVisibleColumns[V].id,J=S.getRowInfoArray()[ce].id);let se={columnId:Y,colIndex:V,rowId:J,rowIndex:ce,event:g,target:k??g.target};k&&I.cellContextMenu(se),I.contextMenu(se)},me=ga(g=>{a.focused=g}),ve=ga(g=>{a.focusedWithin=g}),Ne=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(I.focused)return;me(!0),I.onSelfFocus?.(g),I.focusedWithin&&(ve(!1),I.onBlurWithin?.(g));return}I.focusedWithin||(ve(!0),I.onFocusWithin?.(g))},Me=g=>{let I=l();if(g.target===I.domRef.current||g.target===I.scrollerDOMRef.current){if(!I.focused)return;me(!1),I.onSelfBlur?.(g),I.focusedWithin&&(ve(!1),I.onBlurWithin?.(g));return}I.domRef.current?.contains(g.relatedTarget)||(ve(!1),I.onBlurWithin?.(g))},Ce=10,_e=(g,I)=>{let z=!1,k=null;return He([g,()=>u.value.dataArray.length],([Y],[V]=[void 0,void 0])=>{if(Y!=null&&Y!==V&&(z=!1,k!=null&&cancelAnimationFrame(k)),Y==null||z)return;let J=(ce=0)=>{ce++,k!=null&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{z=I(Y),!z&&ce<Ce&&J(ce)})};J()},{immediate:!0}),()=>{k!=null&&cancelAnimationFrame(k)}},ue=_e(()=>r.value.activeRowIndex,g=>A.scrollRowIntoView(g,{offset:0})),Q=_e(()=>r.value.activeCellIndex,g=>A.scrollCellIntoView(g[0],g[1],{offset:30})),H=()=>pc({getComputed:D,getState:l,getDataSourceState:b,getDataSourceMasterContext:M,actions:a,dataSourceActions:e.dataSourceActions,api:A,dataSourceApi:S},l().editingCell);He([()=>{let g=r.value.editingCell;return g&&!g.active?g.cancelled:void 0},()=>{let g=r.value.editingCell;return g&&!g.active&&g.accepted instanceof Error?g.accepted:void 0},()=>{let g=r.value.editingCell;return!!(g&&!g.active&&!g.cancelled&&g.accepted===!0)},()=>r.value.editingCell?.persisted,()=>r.value.editingCell?.active],([g,I,z,k,Y],[V,J,ce,se,fe])=>{if(g&&g!==V){let ae=l().editingCell,{onEditCancelled:ye}=l();if(ye){let Re=H();Re?ye({...Re,initialValue:ae.initialValue}):yo("onEditCancelled",ae)}}if(I&&I!==J){let ae=l().editingCell,{onEditRejected:ye}=l();if(ye){let Re=H();Re?ye({...Re,value:ae.value,error:I,initialValue:ae.initialValue}):yo("onEditRejected",ae)}}if(z&&z!==ce){let ae=l().editingCell,{value:ye,initialValue:Re}=ae,{onEditAccepted:re}=l();if(re){let rt=H();rt?re({...rt,value:ye,initialValue:Re}):yo("onEditAccepted",ae)}A.persistEdit({value:ye})}if(k&&k!==se){let ae=l().editingCell;if(ae){let ye=k instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(l()[ye]){let Re=H();if(!Re)yo(ye,ae);else{let re={...Re,value:ae.value,initialValue:ae.initialValue};k instanceof Error?l().onEditPersistError?.({...re,error:k}):l().onEditPersistSuccess?.(re)}}}}!Y&&fe&&A.focus()}),GC(()=>{let g=r.value,I=u.value,{computedVisibleColumns:z,computedPinnedStartColumns:k,computedPinnedEndColumns:Y}=y.value,V=g.brain;V.updateFixedCells({fixedColsStart:k.length,fixedColsEnd:Y.length});let J=v();V.update({colWidth:Rp(z),rowHeight:J,rows:I.dataArray.length,cols:z.length,rowspan:xp(z,d)})}),He(()=>r.value.wrapRowsHorizontally,(g,I)=>{if(I===g)return;let{brain:z,headerBrain:k,renderer:Y,onRenderUpdater:V}=l();z.destroy(),k.destroy(),Y.destroy(),V.destroy();let J=ra(Vd,!!g);a.brain=J.brain,a.headerBrain=J.headerBrain,a.renderer=J.renderer,a.onRenderUpdater=J.onRenderUpdater,a.headerRenderer=J.headerRenderer,a.headerOnRenderUpdater=J.headerOnRenderUpdater},{flush:"post"});let q=null,X=null,te=()=>{q&&(clearTimeout(q),q=null),X?.(),X=null};He([()=>r.value.brain,()=>r.value.wrapRowsHorizontally,()=>u.value.groupBy,()=>u.value.isTree,()=>r.value.wrapRowsHorizontally?r.value.repeatWrappedGroupRows:!1],([g,I,z,k,Y])=>{te();let V=e.dataSourceActions;if(!I){d().repeatWrappedGroupRows&&(V.repeatWrappedGroupRows=!1);return}let J=()=>{let{rowsPerPage:ce,repeatWrappedGroupRows:se}=d(),fe=!1,ae=g.rowsPerPage,ye=(z&&z.length>0||k)&&ae>0?ae:null;return ce!=ye&&(V.rowsPerPage=ye,fe=!0),se!=Y&&(V.repeatWrappedGroupRows=Y??!1,fe=!0),fe};J(),X=g.onVerticalRenderRangeChange(()=>{J()&&(q=setTimeout(()=>{a.forceBodyRerenderTimestamp=Date.now()}))})},{immediate:!0,flush:"post"}),Fa(te),He(()=>r.value.scrollStopDelay,g=>{r.value.brain.setScrollStopDelay(g),e.dataSourceActions.scrollStopDelayUpdatedByTable=g},{immediate:!0}),He(()=>r.value.ready,g=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(r.value.id,g,A,{dataSourceApi:e.dataSourceApi});let{onReady:I}=l();I&&I({api:A,dataSourceApi:S})},{immediate:!0,flush:"post"}),He(()=>!!r.value.bodySize.height,g=>{g&&(a.ready=!0)},{immediate:!0});let oe=null,he=null;He(()=>r.value.brain,g=>{oe?.(),oe=g.onVerticalRenderRangeChange(I=>{d().notifyRenderRangeChange({renderStartIndex:I[0],renderEndIndex:I[1]})}),he?.(),he=g.onRenderRangeChange(I=>{l().onRenderRangeChange?.(I)})},{immediate:!0});let ge=1,ne=0,W=null,ie=null;He(()=>r.value.brain,g=>{W?.(),ie?.(),W=g.onRenderCountChange(()=>{ne=g.scrollTopMax}),ie=g.onScrollStop(I=>{let{scrollTop:z,scrollLeft:k}=I,{onScrollToTop:Y,onScrollToBottom:V,onScrollStop:J}=l();z===0&&Y?.();let ce=l().scrollToBottomOffset??ge;if(z+ce>=ne){V?.();let{livePagination:fe,livePaginationCursor:ae,dataArray:ye}=d();fe&&(e.dataSourceActions.cursorId=ae!==void 0?Date.now():ye.length)}if(J){let fe=g.getRenderRange();J({scrollTop:z,scrollLeft:k,renderRange:fe,viewportSize:l().bodySize,firstVisibleRowIndex:fe.start[0],lastVisibleRowIndex:fe.end[0],firstVisibleColIndex:fe.start[1],lastVisibleColIndex:fe.end[1]})}})},{immediate:!0});let Te=null,Ie=null,Se=g=>{Te=g,r.value.scrollerDOMRef.current=g,Ie?.(),Ie=null,g&&(a.bodySize={width:g.clientWidth,height:g.clientHeight},Ie=_n(g,I=>{a.bodySize={width:Math.round(I.width),height:Math.round(I.height)}},{debounce:50}))};LC(()=>{Te&&(a.bodySize={width:Te.clientWidth,height:Te.clientHeight})}),Fa(()=>{Ie?.(),oe?.(),he?.(),_(),O(),L(),ue(),Q()});let We=()=>b().dataArray,Le=()=>y.value.computedColumnOrder,de=[Jd,`${mt}--hovered`],tt=kt(()=>{let g=r.value;return[g.showHoverRows,g.rowHoverClassName]},()=>{let g=r.value;if(!g.showHoverRows)return;let I=[];return g.rowHoverClassName&&(I=I.concat(g.rowHoverClassName)),I=I.concat(de),I.join(" ").split(" ").map(z=>z.trim()).filter(Boolean)},"hoverClassNames"),Ze=kt(()=>{let g=u.value;return[g.isNodeReadOnly,g.selectionMode,g.cellSelection]},()=>{let g=b();return{isNodeReadOnly:g.isNodeReadOnly,selectionMode:g.selectionMode,cellSelection:g.cellSelection}},"dataSourceStatePartialForCell"),dt=kt(()=>{let g=r.value,I=u.value;return[y.value,g.rowHeight,g.rowDetailHeight,g.onRowMouseEnter,g.onRowMouseLeave,g.isRowDetailExpanded,g.isRowDetailEnabled,g.groupRenderStrategy,g.wrapRowsHorizontally,g.showZebraRows,g.brain,g.rowStyle,g.rowClassName,g.cellStyle,g.cellClassName,g.repaintCellsKey,g.editingCell,g.updatedAt,I.rowInfoStore,Ze.value]},()=>{let{computedVisibleColumns:g,computedColumnsMap:I,fieldsToColumn:z}=y.value,k=l(),Y=k.showZebraRows,V=b().rowInfoStore,J=Ze.value;return ce=>{let{rowIndex:se,colIndex:fe,domRef:ae,hidden:ye,width:Re,heightWithRowspan:re,onMouseEnter:rt,onMouseLeave:_t}=ce,Mt=We()[se],yt=g[fe];if(!Mt||!yt)return null;let Ve=!1,Et=k.isRowDetailEnabled,Ft=k.isRowDetailExpanded;!Et||typeof Et=="function"&&!Et(Mt)?Ve=!1:Ft&&(Ve=Ft(Mt)?"expanded":"collapsed");let Ln=A.isEditorVisibleForCell({rowIndex:se,columnId:yt.id});return qe(op,{key:`${se}:${yt.id}`,rowIndex:se,rowHeight:re,width:Re,hidden:ye,domRef:ae,column:yt,columnsMap:I,fieldsToColumn:z,showZebraRows:Y,rowDetailState:Ve,inEditMode:Ln,rowIndexInHorizontalLayoutPage:k.wrapRowsHorizontally?k.brain.getRowIndexInPage(se):null,horizontalLayoutPageIndex:k.wrapRowsHorizontally?k.brain.getPageIndexForRow(se):null,rowStyle:k.rowStyle,rowClassName:k.rowClassName,cellStyle:k.cellStyle,cellClassName:k.cellClassName,repaintCellsKey:yt.repaintCellsKey!==void 0?yt.repaintCellsKey:k.repaintCellsKey,getData:We,rowInfoStore:V,renderingContext:x,getComputedVisibleColumns:C,getComputedColumnOrder:Le,dataSourceStatePartial:J,onMouseEnter:rt,onMouseLeave:_t})}},"body.renderCell"),gt=kt(()=>{let g=r.value;return[g.isRowDetailExpanded,g.rowDetailRenderer,g.rowDetailCache]},()=>{let g=l(),I=g.isRowDetailExpanded,z=g.rowDetailRenderer;if(!I||!z)return;let k=g.rowDetailCache;return Y=>{let{rowIndex:V,domRef:J}=Y,se=We()[V],fe=N().computedRowSizeCacheForDetails;if(!se||!I(se)||!fe)return qe("div",{ref:J,class:Dl.hidden});let{rowDetailHeight:ae,rowHeight:ye}=fe.getSize(V);return qe(Da,{rowInfo:se,rowDetailsCache:k,rowIndex:V,domRef:J,detailOffset:ye,rowDetailHeight:ae,rowDetailRenderer:z})}});return Ip(ro,{state:r,getState:l,actions:a,api:A,getComputed:D,getComputedVisibleColumns:C,dataSourceContext:e}),()=>{let g=r.value,I=y.value,z=Fs({computedVisibleColumns:I.computedVisibleColumns,computedPinnedStartColumns:I.computedPinnedStartColumns,computedPinnedEndColumns:I.computedPinnedEndColumns,computedPinnedStartColumnsWidth:I.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:I.computedPinnedEndColumnsWidth,computedUnpinnedColumnsWidth:I.computedUnpinnedColumnsWidth,bodySize:g.bodySize,activeCellIndex:g.activeCellIndex,brain:g.brain,scrollbars:P.value}),k=g.focused,Y=g.focusedWithin,V=I.computedPinnedStartWidth??I.computedPinnedStartColumnsWidth,J=I.computedPinnedEndWidth??I.computedPinnedEndColumnsWidth,ce=V?I.computedPinnedStartColumnsWidth>V:!1,se=J?I.computedPinnedEndColumnsWidth>J:!1,{autoFocus:fe,tabIndex:ae,className:ye,class:Re,style:re,onKeyDown:rt,onKeydown:_t,...Mt}=g.domProps??{},yt=ee(t.class,ye,Re,Fe,ms,g.wrapRowsHorizontally?`${Fe}--horizontal-layout`:null,I.computedPinnedStartColumnsWidth?`${Fe}--has-pinned-start ${gs}`:null,I.computedPinnedEndColumnsWidth?`${Fe}--has-pinned-end ${hs}`:null,k?`${Fe}--focused`:null,Y?`${Fe}--focused-within`:null,k&&g.focusedClassName?g.focusedClassName:null,Y&&g.focusedWithinClassName?g.focusedWithinClassName:null,ce?`${Fe}--has-pinned-start-overflow`:null,se?`${Fe}--has-pinned-end-overflow`:null,ys({horizontalLayout:!!g.wrapRowsHorizontally,hasPinnedStart:!!I.computedPinnedStartColumnsWidth,hasPinnedEnd:!!I.computedPinnedEndColumnsWidth,focused:k,focusedWithin:Y})),Ve={...t.style,...re,...z};k&&g.focusedStyle&&Object.assign(Ve,g.focusedStyle),Y&&g.focusedWithinStyle&&Object.assign(Ve,g.focusedWithinStyle);let Et=_t??rt,Ft=Et?Vt=>{K(Vt),Et(Vt)}:K,Ln=u.value.loading;return qe("div",{...t,...Mt,ref:Vt=>{g.domRef.current=Vt??null},"data-debug-id":g.debugId,class:yt,style:Ve,onKeydown:Ft,onFocusin:Ne,onFocusout:Me},[g.header?qe(yp,{wrapRowsHorizontally:!!g.wrapRowsHorizontally,bodyBrain:g.brain,headerBrain:g.headerBrain}):null,qe("div",{class:ee(Uf,gr),onContextmenu:Pe},[qe($f,{brain:g.brain,renderer:g.renderer,onRenderUpdater:g.onRenderUpdater,renderCell:dt.value,renderDetailRow:gt.value,cellHoverClassNames:tt.value,scrollStopDelay:g.scrollStopDelay,forceRerenderTimestamp:g.forceBodyRerenderTimestamp,scrollerRef:Se,tabIndex:ae??0,autoFocus:!!fe,activeRowIndex:g.ready&&g.keyboardNavigation==="row"?g.activeRowIndex??null:null,activeCellIndex:g.ready&&g.keyboardNavigation==="cell"&&!g.columnReorderDragColumnId?g.activeCellIndex??null:null,activeCellRowHeight:N().computedRowSizeCacheForDetails?.getRowHeight||v()}),qe(Bi,{visible:!!Ln},()=>g.loadingText)]),qe("div",{ref:Vt=>{g.portalDOMRef.current=Vt??null},class:ee(`${Fe}Portal`,Al[1e7],Rl.absolute,xl[0],vl[0])},[qe(B),qe(G),qe(le),qe(Z)]),g.rowHeightCSSVar?qe(bo,{key:"row-height",varName:g.rowHeightCSSVar,onChange:g.onRowHeightCSSVarChange}):null,qe(bo,{key:"flashing-duration",allowInts:!0,varName:xe.components.Cell.flashingDuration,onChange:g.onFlashingDurationCSSVarChange}),g.rowDetailHeightCSSVar?qe(bo,{key:"row-detail-height",varName:g.rowDetailHeightCSSVar,onChange:g.onRowDetailHeightCSSVarChange}):null,g.columnHeaderHeightCSSVar?qe(bo,{key:"column-header-height",varName:g.columnHeaderHeightCSSVar,onChange:g.onColumnHeaderHeightCSSVarChange}):null])}}});import{defineComponent as WC,h as jC,watch as $C}from"vue";var Pp=U(j.currentFlashingDuration),UC=({children:o})=>o,Dp=1e3,Ap={up:Bo({direction:"up"}).split(" "),down:Bo({direction:"down"}).split(" "),neutral:Bo({direction:"neutral"}).split(" ")},_p=(o={})=>{let{flashDuration:t,flashClassName:e,render:n=UC}=o;return WC({name:"FlashingColumnCell",inheritAttrs:!1,setup(i,{attrs:r,slots:a}){let l=To(),u=Be(),d=!0,s=null,c=l.value?.value,f,m,p=()=>{let y=l.value?.htmlElementRef.current;if(f&&(clearTimeout(f),f=void 0),m&&y){let C=Ap[m];y.classList.remove(...e?[e,...C]:C),y.style.removeProperty(Pp),m=void 0}},h=(y,C)=>{let b=l.value?.htmlElementRef.current;if(!b)return;p();let{flashingDurationCSSVarValue:S}=u.getState(),w=typeof S=="number"?S??t??Dp:t??Dp,T=typeof y=="number"?y>C?"up":"down":"neutral",P=Ap[T];b.style.setProperty(Pp,`${w}`),b.classList.add(...e?[e,...P]:P),m=T,f=setTimeout(p,w)};return $C(()=>{let y=l.value;return y?[y.column.id,y.rowInfo.id,y.value]:null},(y,C)=>{if(!y)return;let[b,S,w]=y,[T,P]=C??[];if(!(b===T&&S===P)){p(),d=!0,s=null,c=w;return}w!==c&&(d=!1,s=c,c=w,h(w,s))},{flush:"post"}),()=>{let y=l.value;return jC("div",{...r,class:ee(r.class),ref:y?.domRef},[n({children:a.default?a.default():null,oldValue:d?null:s})])}}})},qC=_p();import{defineComponent as Ep,h as Fp}from"vue";var Mp=o=>(e,{unfilteredTreePaths:n,treeSelectionState:i,prevTreeSelectionState:r,lastUpdatedNodeInfo:a})=>{let l=new Ue(r,{treePaths:n});i.forEachLeafNodePath((s,{selected:c})=>{l.setNodeSelection(s,c)}),a&&i.forEachLeafNodePath(s=>{l.setNodeSelection(s,a.selected)},a.nodePath);let d={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(d)};var YC=Ep({name:"TreeGrid",props:[...Na],setup(o,{slots:t}){return()=>Fp(Oa,{...o},t)}}),ZC=Ep({name:"TreeDataSource",props:[...Ur],setup(o,{slots:t}){return()=>Fp(qr,{...o,nodesKey:o.nodesKey??"children"},t)}});var XC={key:"*",when:o=>{let{activeCellIndex:t}=o.getState();if(t){let[e,n]=t,i=o.api.getColumnAtIndex(n);return i?o.api.isCellEditable({rowIndex:e,columnId:i.id}):!1}return!1},handler:(o,t)=>{let{key:e}=t;if(e!="Escape"&&e.length===1){let{activeCellIndex:n}=o.getState();if(n){let[i,r]=n,a=o.api.getColumnAtIndex(r);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:i,value:e,columnId:a.id})})}}}},JC={instantEdit:XC};var R0={CheckBox:qt,LoadMask:Bi,MenuIcon:oo};export{Ge as CellSelectionState,qr as DataSource,uo as DataSourceInjectionKeyForVue,$ as DeepMap,qC as FlashingColumnCell,ft as GroupRowsState,Oa as InfiniteTable,KC as InfiniteTableClassName,Da as InfiniteTableDetailRow,ro as InfiniteTableInjectionKeyForVue,At as Menu,Mr as NumberFilterEditor,st as RowDetailState,De as RowSelectionState,ao as StringFilterEditor,ZC as TreeDataSource,Qe as TreeExpandState,YC as TreeGrid,Ue as TreeSelectionState,R0 as components,_p as createFlashingColumnCellComponent,Qt as debounce,Yn as defaultFilterTypes,Mm as flatten,ir as group,JC as keyboardShortcuts,_u as toTreeDataArray,co as useDataSourceContext,$r as useGetMasterDetailContextForVue,To as useInfiniteColumnCell,Jf as useInfiniteColumnEditor,lo as useInfiniteColumnFilterEditor,Yo as useInfiniteHeaderCell,Be as useInfiniteTableContext,Dt as useOverlay,Mp as withSelectedLeafNodesOnly};
|
|
28
28
|
//!collapsed || lazyLoad;
|