@infinite-table/infinite-react 6.2.10 → 6.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ah=Object.create;var Cr=Object.defineProperty;var lh=Object.getOwnPropertyDescriptor;var sh=Object.getOwnPropertyNames;var uh=Object.getPrototypeOf,ch=Object.prototype.hasOwnProperty;var dh=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ph=(n,e)=>{for(var t in e)Cr(n,t,{get:e[t],enumerable:!0})},fs=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of sh(e))!ch.call(n,r)&&r!==t&&Cr(n,r,{get:()=>e[r],enumerable:!(o=lh(e,r))||o.enumerable});return n};var H=(n,e,t)=>(t=n!=null?ah(uh(n)):{},fs(e||!n||!n.__esModule?Cr(t,"default",{value:n,enumerable:!0}):t,n)),fh=n=>fs(Cr({},"__esModule",{value:!0}),n);var Ho=dh((qT,Us)=>{Us.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var LS={};ph(LS,{CellSelectionState:()=>Ee,DataClient:()=>na,DataSource:()=>Uy,DataSourceActionType:()=>Ip,DeepMap:()=>X,FixedSizeSet:()=>fr,FlashingColumnCell:()=>qm,GroupRowsState:()=>at,InfiniteTable:()=>$t,InfiniteTableClassName:()=>Ot,InfiniteTableComponent:()=>Vm,Menu:()=>At,RowDetailCache:()=>sn,RowDetailState:()=>gt,RowDisabledState:()=>lt,RowSelectionState:()=>Ce,TreeDataSource:()=>MS,TreeExpandState:()=>Qe,TreeGrid:()=>Km,TreeSelectionState:()=>$e,WeakFixedSizeSet:()=>mr,alignNode:()=>$l,components:()=>OS,createFlashingColumnCellComponent:()=>as,debounce:()=>Et,debug:()=>Xe,defaultFilterTypes:()=>eo,eventMatchesKeyboardShortcut:()=>Wi,filterTypes:()=>eo,flatten:()=>Wd,getComponentStateRoot:()=>_t,group:()=>Ri,interceptMap:()=>km,keyboardShortcuts:()=>Bm,multisort:()=>Vt,multisortNested:()=>wi,queryKeyToCacheKey:()=>Oo,toTreeDataArray:()=>Yd,useComponentState:()=>ze,useDataSourceInternal:()=>ln,useDataSourceState:()=>Co,useEffectWhen:()=>ra,useEffectWhenSameDeps:()=>Wm,useEffectWithChanges:()=>Fo,useEffectWithObject:()=>xy,useGridScroll:()=>ea,useInfiniteColumnCell:()=>Yn,useInfiniteColumnEditor:()=>fi,useInfiniteColumnFilterEditor:()=>Zo,useInfiniteHeaderCell:()=>Hn,useInfinitePortalContainer:()=>_m,useManagedDataSource:()=>Pl,useMasterRowInfo:()=>qy,useOverlay:()=>Gt,useOverlayPortal:()=>$f,usePrevious:()=>Qt,useRowInfoReducers:()=>Yy,useVisibleColumnSizes:()=>xm});module.exports=fh(LS);function Et(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var fe=H(require("react"));var J=(...n)=>n.filter(e=>!!`${e}`).join(" ");var yo=H(require("react")),ha=require("react");function ot(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var ms=(n,e)=>n-e;var ca=(n,e)=>ms(n.revision,e.revision),X=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,h=p===this.emptyKey;if(h&&!u)return;let g=h?[]:[...e,p],y=m?()=>this.visitWithNext(g,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let C=t(f.value,g,l,y,f);if(o&&C===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}static clone(e){let t=new X;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,o),r}getEntriesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,o),r}getUnnestedKeysStartingWith(e,t,o){let r=[],i=u=>{r.push(u)},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(ca).map(u=>u.keys):(this.visitWithNext(e,(u,c,d,p,f)=>{i({...f,keys:c})},!1,a,o,t),r.sort(ca).map(u=>u.keys))}getKeysStartingWith(e,t,o){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,o),r}getStartingWith(e,t,o,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,u=e.length;s<u;s++){let c=e[s];if(a=i.get(c),!a||!a.map)if(l=!0,s===u-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(o||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d?.()},!1,i,r,o)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=ot(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(ca);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};function De(){return globalThis}var Tr=["#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"],hs=Symbol("color"),Sr=new WeakMap;function da(n=Tr){Sr.set(n,n.map(e=>0))}da();var mh=(n=Tr)=>{let e=[];Sr.has(n)?e=Sr.get(n):(e=n.map(o=>0),Sr.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Tr[0]},bn=":",pa="*",gs="-",hh=",",gh="debug",yh="diffdebug",Ts=!1,Vo=new X,Rn=new Map;function ys(n,e){let t=n.split(bn),o=new X;o.set(t,!0);let r=e.split(bn),i=new Set(r).has(pa),a=r.indexOf(pa),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(bn)):!0}}function Cs(n,e){let t=`channel=${n}_permissions=${e}`;if(Rn.has(t))return Rn.get(t);let o=e.split(hh);function r(l){return Rn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(pa)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(gs);if(u&&(s=s.substring(gs.length)),ys(n,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),ys(n,s))return r(!u)}return r(!1)}var fa=()=>Xe.enable??(De()&&De().localStorage?.getItem(gh))??"",Ch=()=>Xe.diffenable??(De()&&De().localStorage?.getItem(yh))??`${Ts}`,br="",bs=Ts;function ma(n){bs=`${Ch()}`=="true",br!==n&&(br=n,Rn.clear())}function Rs(n){ma(fa()),typeof De()<"u"&&De().addEventListener&&De().addEventListener("storage",function(){ma(fa())});function e(t,o){let r=o?`${o}${bn}${t}`:t,i=r.split(bn);if(Vo.has(i))return Vo.get(i);let a=Vo.get(i.slice(0,-1)),l=(a?a.logFn:Xe.logFn)??ws,s=l,u,c=0,d=()=>u??Cs(r,br),p=mh(Xe.colors),f=Object.defineProperties((...m)=>{if(Cs(r,br)){let h=Date.now();if(c&&bs){let C=h-c;s(`%c[${r}]`,`color: ${p}`,`+${C}ms:`)}c=h;let g=[],y;if(m.forEach(C=>{if(C[hs])y===void 0&&(y=!0),g.push(...C);else{if(typeof C!="string"&&typeof C!="number"){y=!1;return}g.push(`${C}%s`)}}),y){let C=[`%c[${r}]%c %s`,`color: ${p}`,"",...g,""];s(...C)}else s(`%c[${r}]%c %s`,`color: ${p}`,"",...m)}},{channel:{value:r},color:{value:(m,...h)=>{let g=[`%c${h.join(" ")}%c%s`,`color: ${m}`,""];return g.toString=()=>h.join(" "),g[hs]=!0,g}},extend:{value:m=>e(m,r)},enabled:{get:()=>d()},logFn:{configurable:!1,get:()=>s,set:m=>{s=m??l}},destroy:{value:()=>{Vo.delete(i)}}});return Vo.set(i,f),f}return e(n)}var ws=console.log.bind(console),Ss;Object.defineProperty(Rs,"enable",{get:()=>Ss,set:n=>{Ss=n,ma(fa())}});var Xe=Rs;Xe.colors=Tr;Xe.logFn=ws;Xe.destroyAll=()=>{da(),da(Xe.colors),Vo.clear(),Rn.clear()};var Is=Xe("InfiniteTable"),dt=n=>{let e=Is.extend(n);return e.logFn=console.log.bind(console),e},Rr=n=>{let e=Is.extend(`${n}:error`);return e.logFn=console.error.bind(console),e},wn=()=>wn;wn.extend=()=>wn;var nt=class{constructor(e){this.debug=wn,this.error=wn}};var Sh=H(require("react")),Ut=require("react");var In=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?Et(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}},wr=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,Ut.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=In(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Ut.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,Ut.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var Th=Rr("CSSVariableWatch"),bh=dt("CSSVariableWatch"),Rh={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},wh=n=>{let e=(0,ha.useRef)(0),t=yo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);wr(n.ref,t,{earlyAttach:!0}),yo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o)return e.current=o,bh(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);Th(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Pn=n=>{let e=(0,ha.useRef)(null);wh({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return yo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:Rh},yo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var Pr=H(require("react"));var Ps=H(require("react")),ga;function xn(){return ga||(ga=Ps.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}var xs=H(require("react")),ya;function Ir(){return ya||(ya=xs.createContext(void 0))}function Co(){let n=xn();return Pr.useContext(n).componentState}function be(){let n=xn();return Pr.useContext(n)}function Le(){let n=Ir();return Pr.useContext(n)}var bo=H(require("react")),Rt=require("react");var xr=H(require("react"));function Ih(n){let{height:e,width:t,count:o}=n;return xr.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Ds=xr.memo(Ih);var vs="mlx2t3";var Dr=H(require("react")),Ls=require("react");var As=require("react"),Ms=(n,e)=>{(0,As.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Es={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Fs={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},_s={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Ca="_1ueijco1",Ns="_1ueijco0 _16lm1iw0";var Os=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Es[`${n}`]:e=J(Fs[`${n.horizontal}`],_s[`${n.vertical}`]),e};var Ph="InfiniteVirtualScrollContainer";var Vs=Dr.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,Ls.useRef)(null);return Ms(c,i),Dr.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:J(a,Ph,Ns,Os(r))},o)});var Lr=H(require("react")),qt=require("react");var zs=H(require("react")),zo=require("react");function xh(n){let[e,t]=(0,zo.useState)(n.updater.get),o=(0,zo.useRef)(null);return(0,zo.useEffect)(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var Yt=zs.memo(xh);function he(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Go(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Gs(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}function Y(n){return n.slice(4,-1)}var rt="Infinite",Pe={rootClassName:rt};var U={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)",columnZIndexAtIndex:"var(--_16hkbkch)",pinnedStartWidth:"var(--_16hkbkci)",pinnedEndWidth:"var(--_16hkbkcj)",pinnedEndOffset:"var(--_16hkbkck)",computedVisibleColumnsCount:"var(--_16hkbkcl)",baseZIndexForCells:"var(--_16hkbkcm)",bodyWidth:"var(--_16hkbkcn)",bodyHeight:"var(--_16hkbkco)",scrollbarWidthHorizontal:"var(--_16hkbkcp)",scrollbarWidthVertical:"var(--_16hkbkcq)",scrollLeft:"var(--_16hkbkcr)",scrollTop:"var(--_16hkbkcs)",virtualScrollLeftOffset:"var(--_16hkbkct)",virtualScrollTopOffset:"var(--_16hkbkcu)"};var Ks="true",le={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)",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:{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)",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)"}}},Hs="column-header-height";var Bs=`.${Pe.rootClassName}`;function Sa(n){return Go(n,Bs)}var ks=Y(U.scrollLeft),Dh=Y(U.scrollTop),vh=Y(U.columnWidthAtIndex),Ta=Y(U.columnOffsetAtIndex),Ws=Y(U.columnReorderEffectDurationAtIndex),Ah=Y(U.columnOffsetAtIndexWhileReordering),Mh=Y(U.columnZIndexAtIndex);function Kt(n,e,t){let o=t?Sa(t):document.querySelector(Bs);Eh(n,e,o)}function Eh(n,e,t){if(t){let o=n,r=U[o]?Y(U[o]):n;t.style.setProperty(r,`${e}`)}}function Ko(n,e){if(e)for(var t in n){let o=U[t]?Y(U[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function ba(n,e,t){Kt(`${Ta}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${ks}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Ra(n,e,t){Kt(`${Mh}-${n}`,`${e}`,t)}function Dn(n,e,t){Kt(`${Ah}-${n}`,typeof e=="number"?`calc( var(${Ta}-${n}) + ${e}px )`:e,t)}function vr(n,e,t){Kt(`${Ws}-${n}`,t??"",e)}function js(n,e){let t=`${Ws}-${n}`;Kt(t,le.components.Cell.reorderEffectDuration,e)}var ge={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${vh}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Kt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Ta}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Kt(this.varName.get(n),e,t)}}};function $s(n,e){Ko({[ks]:`${n.scrollLeft}px`,[Dh]:`${n.scrollTop}px`},e)}var xe=De().requestAnimationFrame||(n=>setTimeout(n,16)),bt=De().cancelAnimationFrame||(n=>clearTimeout(n));var Ys=H(Ho());var wa=(n,e)=>n-e,Ht={horizontal:!0,vertical:!0};function Ar(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var Mr={start:0,end:0},Ia=n=>{n()},Pa=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},qs=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},vn=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function Fh(n){return n.horizontalChange||n.verticalChange}var So=class extends nt{constructor(t){let o=`MatrixBrain${t?`:${t}`:""}`;super(o);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=Mr;this.verticalExtendRangeBy=Mr;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=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{vn(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ia:vn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ia:vn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Ht)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Ht)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=o.startIndex,u=o.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=Ht)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Ys.default)(a,t,wa);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:o};for(;f<=m;f++)if(d[f]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=f;let g=s(h);d[f]=f,p[f]=g;let y=f;for(;g>1;)y+=1,d[y]=f,p[y]=0,g-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Pa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=t||"MatrixBrain",this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Ht){t.vertical&&this.resetVertical(),t.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}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",h=typeof i=="number",g=m&&r!==this.rows,y=h&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),h&&(this.cols=i);let C=a!=null,T=l!=null,b=C&&a!==this.rowHeight,S=T&&l!==this.colWidth;C&&(this.rowHeight=a),T&&(this.colWidth=l);let w=t.rowspan!=null,R=t.colspan!=null,I=w&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let D=y||S||p||P,x=g||b||f||I;(o||Fh)({horizontalChange:D,verticalChange:x,colsChanged:y,colWidthChanged:S,widthChanged:p,colspanChanged:P,rowsChanged:g,rowHeightChanged:b,heightChanged:f,rowspanChanged:I})&&this.updateRenderCount({horizontal:D,vertical:x})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Ht){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Ht){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ia:vn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=Ar(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{vn(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Mr,this.verticalExtendRangeBy=Mr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Da=H(Ho());function Xs(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function Zs(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function An(n,e){for(let t of n)if(e(t))return t}var Js=H(require("react"));var Qs=new Map,_h=()=>{},xa=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=he();let o=Qs.get(e)??0,r=`${e}:GridCellReact:${o}`;Qs.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=he(),this.node=Js.createElement(Yt,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=_h,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},En=class extends nt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=he();this.cellAttachmentChangeSubscription=he();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,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 t=new xa(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=En.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/En.POOL_SIZE_INCREMENT)*En.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}},Mn=En;Mn.POOL_SIZE_INCREMENT=1;var Er=(n,e)=>n-e,Fr=class extends nt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new X;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,h=p>=l,g=f<a,y=f>=s;(m||h||g||y)&&u.add(c)}),u};this.debugId=t,this.pool=new Mn(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=An(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=An(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Er)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(Er)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Da.default)(o,t,Er);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Da.default)(o,t,Er);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;(l>=o||s>=r)&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return An(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return An(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}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(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var ou=H(Ho());var tu=H(require("react"));var eu=new Map,Nh=()=>{},va=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=he();let t=eu.get(e)??0,o=`${e}:ListRowReact:${t}`;eu.set(e,t+1),this.debugId=o,this.updater=he(),this.node=tu.createElement(Yt,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Nh,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},_n=class extends nt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=he();this.rowAttachmentChangeSubscription=he();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,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 t=new va(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=_n.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/_n.POOL_SIZE_INCREMENT)*_n.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}},Fn=_n;Fn.POOL_SIZE_INCREMENT=1;var _r=class extends nt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Fn(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,ou.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var nu=!0,To=Y(U.y),ru=Y(U.scrollTop),_b=Y(U.columnOffsetAtIndex),Aa=Y(U.columnOffsetAtIndexWhileReordering),Bo=class extends nt{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);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=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(To,i?`calc( ${r}px + var(${ru}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${To}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=ge.columnOffsets.get(r),d=`${Aa}-${r}`,p=s?`calc( ${a}px + var(${ru}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(To,p));let f=`translate3d(var(${d}, ${c}), var(${To}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let h=f+m.height;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollTop;if(l==="center"?g=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),this.brain.isHorizontalLayoutBrain){let y=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),C=this.getScrollPositionForScrollColumnIntoView(y,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});C&&(a=C.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let h=f+m.width;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollLeft;return l==="center"?g=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),{...i,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(o&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let g={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};xe(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,nu){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,nu&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.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=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(A=>{let F=i.getRowIndex(A);if(F!=null){let v=this.brain.getItemOffsetFor(F,"vertical");if(v==null)return;let E=A.getElement();if(!E)return;this.setDetailTransform(E,F,{y:v,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&$s(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,C]=h,[T,b]=g;function S(A,F,v){let E=r.getCellAt([A,F]);if(E==null)return;let O=o.getCellOffset(A,F),z=E.getElement();z&&O&&v(A,F,z,O)}let w=(A,F,v,{x:E,y:O})=>{this.setTransform(v,A,F,{x:E,y:O,scrollLeft:!0},s-F)},R=(A,F,v,E)=>{this.setTransform(v,A,F,{x:E.x,y:E.y,scrollTop:!0},c-A)},I=(A,F,v,{y:E})=>{let O=f[F];this.setTransform(v,A,F,{x:O,y:E,scrollLeft:!0},a-F)},P=(A,F,v,E)=>{this.setTransform(v,A,F,{x:E.x,y:m[A],scrollTop:!0},l-A)},D=(A,F,v,{x:E,y:O})=>{this.setTransform(v,A,F,{x:E,scrollLeft:!0,y:O,scrollTop:!0},1e5)},x=(A,F,v,{x:E})=>{this.setTransform(v,A,F,{x:E,scrollLeft:!0,y:m[A],scrollTop:!0},2e5)},M=(A,F,v,E)=>{this.setTransform(v,A,F,{x:f[F],y:E.y,scrollLeft:!0,scrollTop:!0},3e5)},_=(A,F,v)=>{this.setTransform(v,A,F,{x:f[F],y:m[A],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let A=y;A<T;A++){for(let F=0;F<s;F++)S(A,F,w);if(u){let F=a-u;for(let v=F;v<a;v++)S(A,v,I)}}if(c||d)for(let A=C;A<b;A++){for(let F=0;F<c;F++)S(F,A,R);if(d){let F=l-d;for(let v=F;v<l;v++)S(v,A,P)}}if(s&&c)for(let A=0;A<c;A++)for(let F=0;F<s;F++)S(A,F,D);if(s&&d){let A=l-d;for(let F=A;F<l;F++)for(let v=0;v<s;v++)S(F,v,x)}if(u&&c){let A=a-u;for(let F=0;F<c;F++)for(let v=A;v<a;v++)S(F,v,M)}if(u&&d){let A=l-d,F=a-u;for(let v=A;v<l;v++)for(let E=F;E<a;E++)S(v,E,_)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new Fr(o),this.cellManager.onCellAttachmentChange((s,u)=>{u?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new _r(o),this.rowManager.onRowAttachmentChange((s,u)=>{u?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),xe(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Sa(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let D=t.start[1],x=t.end[1];m.forEach(M=>{D<=M&&M<x||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let h=new Map,g=f.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([D,x])=>{h.set(`${D}:${x}`,!0)});let y=f.reduce((D,x)=>D+Pa(x),0),C=r?f.reduce((D,x)=>D+qs(x),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let S=Math.min(T*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>C&&(c.poolSize=C));let w=Xs(...f.map(D=>d.getCellsOutsideRenderRange(D)));w=Zs(w,D=>{let x=d.getCellPosition(D);return!(x&&h.has(`${x[0]}:${x[1]}`))}),d.detachCells(w),d.poolSize=S;let R=new Map,I=new Map;f.forEach(D=>{let{start:x,end:M}=D,[_,A]=x,[F,v]=M;for(let E=_;E<F;E++){for(let z=A;z<v;z++){let Z=`${E}:${z}`;if(R.has(Z))continue;R.set(Z,!0);let{rendered:oe,mapped:ce}=this.isCellRenderedAndMappedCorrectly(E,z);if(E===_||z===A){let G=this.isCellCovered(E,z);if(G&&h.has(`${G[0]}:${G[1]}`)){let k=d.getCellAt([E,z]);k!=null&&d.detachCell(k);continue}}if(oe&&!i&&ce)continue;let se;oe?se=d.getCellAt([E,z]):se=d.getCellFor([E,z],u?"row":"column"),se==null&&(se=d.getDetachedCell()),this.renderCellAt(E,z,se,o)}!r||I.has(E)||(I.set(E,!0),c.isRowAttachedAt(E)&&!i)||this.renderDetailRowAtElement(E,this.rowManager.getRowFor(E),r)}}),g.forEach(([D,x])=>{let{rendered:M,mapped:_}=this.isCellRenderedAndMappedCorrectly(D,x);if(M){if(i||!_){let F=[D,x],v=d.getCellAt(F);this.renderCellAt(D,x,v,o)}return}let A=d.getCellFor([D,x],u?"row":"column");A!=null&&this.renderCellAt(D,x,A,o)});let P=d.getAllCells().map(D=>D.getNode());return r&&c.getAllRows().forEach(D=>{P.push(D.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),h=!!a,{rowIndex:g,colIndex:y}=this.getCellRealCoordinates(t,o),C=i({rowIndex:g,colIndex:y,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(b=>{let S=b.getElement();S&&(S.style.position="absolute",S.style.left="0px",S.style.top="0px"),this.updateElementPosition(b)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:y}:void 0;if(!C){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(C,r,[t,o],T),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Nr=class extends Bo{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=le.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=ge.columnOffsets.get(l.colIndex),f=`${Aa}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(To,m));let h=`calc(var(${f}, ${p}) + ${d})`,g=`var(${To})`,y=`translate3d(${h}, ${g}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Or(n){let e=n.isHorizontalLayoutBrain?new Nr(n,`HorizontalLayoutTableRenderer:${n.name}`):new Bo(n,`ReactHeadlessTableRenderer:${n.name}`),t=he();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function Oh(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,qt.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:Or(e),[e,n.onRenderUpdater,n.renderer]);return(0,qt.useEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,qt.useEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,qt.useLayoutEffect)(()=>{let l=e.getRenderRange();i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o})},[i,e,t,o,a,r]),(0,qt.useEffect)(()=>e.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:u=>{let c=a.get();c&&u&&c.length===u.length||a(u)},renderCell:t,renderDetailRow:o})}),[t,o,e,a]),Lr.createElement(Yt,{updater:a})}var Vr=Lr.memo(Oh);var Nn=H(require("react")),ko=require("react");var zr=require("react"),Ft=()=>{let[n,e]=(0,zr.useState)(0);return[n,(0,zr.useCallback)(()=>{e(t=>t+1)},[e])]};function Lh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Vh(n){var e=Lh(n,"string");return typeof e=="symbol"?e:String(e)}function zh(n,e,t){return e=Vh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function au(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iu(Object(t),!0).forEach(function(o){zh(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):iu(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function lu(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Gh=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ye=n=>{var e=t=>{var o=n.defaultClassName,r=au(au({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)Gh(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return lu(n.variantClassNames,t=>lu(t,o=>o.split(" ")[0]))}},e};var su=ye({defaultClassName:"nxbq1c1 _16lm1iwl _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Gr="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1f _16lm1iw1d _16lm1iw18 _16lm1iwu";var uu=ye({defaultClassName:"j26lrx0 _16lm1iwl _16lm1iw2 _16lm1iw1d _16lm1iw1f",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Kh}=Pe,Hh=`${Kh}-ActiveRowIndicator`,Bh=`calc(${U.activeCellRowOffsetX} + var(${Y(U.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,kh={[Y(U.activeCellOffsetY)]:U.activeCellRowOffset,transform:`translate3d(${Bh}, calc( ${U.activeCellOffsetY} + var(${Y(U.scrollTopForActiveRow)}, 0px)), 0px)`,height:U.activeCellRowHeight,maxWidth:le.runtime.totalVisibleColumnsWidthVar},Wh=n=>{let{brain:e}=n,t=(0,ko.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Ft();return(0,ko.useLayoutEffect)(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${le.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Ko(d,c)},[n.activeRowIndex,e]),(0,ko.useEffect)(()=>{let a=u=>{Ko({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Nn.createElement("div",{className:Gr,"data-name":"active-row"},Nn.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Hh} ${uu({active:o})}`,style:o?kh:void 0}))},cu=Nn.memo(Wh);var On=H(require("react")),Wo=require("react");var{rootClassName:jh}=Pe,$h=`${jh}-ActiveCellIndicator`,Uh=Y(U.columnZIndexAtIndex),Yh=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;Ko({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},qh=n=>{let{brain:e}=n,[t,o]=Ft(),r=(0,Wo.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return(0,Wo.useLayoutEffect)(()=>{Yh(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),(0,Wo.useEffect)(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),On.createElement("div",{className:Gr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${Uh}-${n.activeCellIndex[1]})`}:void 0},On.createElement("div",{"data-name":"active-cell-indicator",className:`${$h} ${su({visible:i})}`}))},du=On.memo(qh);var pu="_1eexc2a7 _1eexc2a6",fu=ye({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"]]}),mu=ye({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 hu="_1eexc2a5",Kr=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Hr="_1eexc2a8";var Br=[hu,`${rt}DetachedCell`];var Xh=Y(U.virtualScrollLeftOffset),Zh=Y(U.virtualScrollTopOffset);function kr(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var Qh=J(vs,Ca);function gu(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...h}=n,{autoFocus:g}=h,y=(0,Rt.useRef)(null),[C,T]=(0,Rt.useState)({width:0,height:0});(0,Rt.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Rt.useEffect)(()=>{let w=y.current?.parentNode;return w?(g&&document.activeElement!==w&&w.focus(),In(w,()=>{let P={height:w.clientHeight,width:w.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=(0,Rt.useCallback)(w=>{requestAnimationFrame(()=>{let R=m?.current;if(!R){if(!y.current)return;y.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`);return}R.style.setProperty(Xh,`-${w.scrollLeft}px`),R.style.setProperty(Zh,`-${w.scrollTop}px`)})},[]),S=(0,Rt.useCallback)(w=>{e.setScrollPosition(w,b)},[e,b]);return(0,Rt.useEffect)(()=>{let w=e.onRenderCountChange(()=>{T(e.getVirtualizedContentSize())});return T(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),w},[e]),bo.createElement(Vs,{onContainerScroll:S,...h,ref:t},bo.createElement("div",{ref:y,className:Qh,"data-name":"scroll-transform-target"},bo.createElement(Vr,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Br}),c!=null?bo.createElement(du,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?bo.createElement(cu,{brain:e,activeRowIndex:u}):null,bo.createElement(Ds,{width:C.width,height:C.height}))}var jo=H(require("react")),je=require("react");function Ma(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var Ea=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Ln(n){return n!==void 0}function Xt(n,e){let t=e[n];return Ln(t)}var Zt=require("react");var yu=n=>{let e=(0,Zt.useCallback)(n,[]),t=(0,Zt.useRef)(!1),o=(0,Zt.useRef)(!1),r=(0,Zt.useRef)(),[i,a]=Ft();t.current&&(o.current=!0),(0,Zt.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Wr=require("react");function Ae(n){let e=(0,Wr.useRef)(n);return e.current=n,(0,Wr.useCallback)(()=>e.current,[])}var jr=require("react"),Qt=(n,e)=>{let t=(0,jr.useRef)(e===void 0?n:e);return(0,jr.useLayoutEffect)(()=>{t.current=n}),t.current};var Jh=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Fa;function Cu(){return Fa||(Fa=(0,je.createContext)(null))}function eg(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,u)=>{let c=u;return Object.defineProperty(s,u,{set:p=>{let f=t(),m=e(),h=m[c],g=!0;if(i&&typeof i[c]=="function"&&i[c](p,{actions:s,state:m})===!1&&(g=!1),g){let T=[p],b=`on${Ea(u)}Change`;if(a&&a[c]){let S=a[c](p,m);b=S.callbackName||b,T=S.callbackParams}Jh(f,b,T)}let y=o[c];typeof y=="function"&&(p=y(p));let C=!!r?.[c];Xt(u,f)&&!C||n({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function tg(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Xt(r,e)?e[r]:e[`default${Ea(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function _t(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,je.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,je.useRef)(new Set),l=(0,je.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Ae(s);function c(){let I={};l&&(I=tg(l,r,i));let P={...i,...I};if(n.mapPropsToState){let{fn:D,propertyReads:x}=Ma(n.mapPropsToState,{getProxyTargetFromArgs:_=>_.props,putProxyToArgs:(_,A)=>[{...A,props:_}]}),M=D({props:r,state:P,oldState:null,parentState:s});return a.current=new Set([...a.current,...x]),{...P,...M}}return P}let[d]=(0,je.useState)(c),p=Ae(r),f=(I,P)=>{if(P.type==="REPLACE_STATE")return P.payload;let D=u?.()??null,x=P.payload.mappedState,M=P.payload.updatedPropsToState,_={...I};if(x&&Object.assign(_,x),n.mapPropsToState){let{fn:F,propertyReads:v}=Ma(n.mapPropsToState,{getProxyTargetFromArgs:O=>O.props,putProxyToArgs:(O,z)=>[{...z,props:O}]}),E=F({props:p(),state:_,oldState:I,parentState:D});a.current=new Set([...a.current,...v]),Object.assign(_,E)}return P.type==="ASSIGN_STATE"&&Object.assign(_,P.payload),n.concludeReducer?n.concludeReducer({previousState:I,state:_,updatedProps:M,parentState:D}):_},[m,h]=(0,je.useReducer)(f,d),g=Ae(m),{allowedControlledPropOverrides:y}=n,C=(0,je.useMemo)(()=>eg(h,g,p,l,y,n.interceptActions,n.mappedCallbacks),[h,l,y]),T=Cu(),b=(0,je.useMemo)(()=>({componentState:m,componentActions:C,getComponentState:g,replaceState:I=>{h({type:"REPLACE_STATE",payload:I})},assignState:I=>{h({type:"ASSIGN_STATE",payload:I})}}),[m,C,g]),S=Qt(r),w=(0,je.useRef)(!1);w.current=!1;let R=n.layoutEffect?je.useLayoutEffect:je.useEffect;return R(()=>{let I=r,P={},D=0,x={},M=0,_={},A=0;if(new Set([...Object.keys(I),...Object.keys(S)]).forEach(E=>{let O=E,z=S[O],Z=I[O];if(O!=="children"&&z!==Z&&(_[O]={newValue:Z,oldValue:z},A++,Xt(O,r)||Xt(O,S)))if(l.hasOwnProperty(E)){let oe=Z,ce=l[E];typeof ce=="function"&&(oe=ce(Z)),m[O]!==oe&&(P[O]=oe,D++)}else a.current.has(E)&&(x[O]=I[O],M++)}),M>0||D>0){(n.debugName?dt(`${n.debugName}:rerender`):dt("rerender"))("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(x??{}));let O={payload:{mappedState:D?P:null,updatedPropsToState:M?x:null}};if(w.current=!0,h(O),n.onPropChange){for(var v in _)if(_.hasOwnProperty(v)){let{newValue:z,oldValue:Z}=_[v];n.onPropChange({name:v,newValue:z,oldValue:Z},r,C,m)}}n.onPropsChange&&A&&n.onPropsChange(_,r,C,m)}}),R(()=>{s!=null&&!w.current&&h({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),yu(()=>()=>{n.cleanup?.(g())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:jo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return jo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function ze(){let n=Cu();return jo.useContext(n)}var Fu=H(require("react"));var $r=()=>Pe;var Su="_16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",Tu={center:"_16lm1iw1r",stretch:"_16lm1iw1s"};var Nt="_16lm1iw24 _16lm1iw25 _16lm1iw1y",bu={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},$o={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var Ur={1:"_16lm1iwm",none:"_16lm1iwn"},Vn={column:"_16lm1iw1n",columnReverse:"_16lm1iw1o",row:"_16lm1iw1p",rowReverse:"_16lm1iw1q"},Ru={0:"_16lm1iw18","100%":"_16lm1iw19","50%":"_16lm1iw1a"},wu={center:"_16lm1iw1t",spaceBetween:"_16lm1iw1u",spaceAround:"_16lm1iw1v",start:"_16lm1iw1w",end:"_16lm1iw1x"},Iu={0:"_16lm1iw1f","100%":"_16lm1iw1g",auto:"_16lm1iw1h"};var Pu={none:"_16lm1iwd"},xu={hidden:"_16lm1iw1y",auto:"_16lm1iw1z",visible:"_16lm1iw20"};var zn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Du={0:"_16lm1iw1d","100%":"_16lm1iw1e"};var vu="_16lm1iwe",Au={none:"_16lm1iw17"};var Mu={visible:"_16lm1iw21",hidden:"_16lm1iw22"};var Eu={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function _u(n){let{rootClassName:e}=$r();return Fu.createElement("div",{...n,className:J(`${e}Footer`,zn.relative,$o.flex,Vn.row,n.className)})}var Te=H(require("react")),io=require("react"),yd=require("react-dom");function Yr(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}var Nu=H(require("react")),Me=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Nu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};var Gn=H(require("react")),Ou=n=>Gn.createElement(Me,{...n},Gn.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Gn.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Gn.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var _a=H(require("react")),Lu=n=>_a.createElement(Me,{...n},_a.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));var Na=H(require("react")),Oa=n=>Na.createElement(Me,{...n},Na.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var La=H(require("react")),Vu=n=>La.createElement(Me,{...n},La.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var Va=H(require("react")),zu=n=>Va.createElement(Me,{...n},Va.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var za=H(require("react")),Gu=n=>za.createElement(Me,{...n},za.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var Ga=H(require("react")),Ku=n=>Ga.createElement(Me,{...n},Ga.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Ka=H(require("react")),Hu=n=>Ka.createElement(Me,{...n},Ka.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var Ha=H(require("react")),Bu=n=>Ha.createElement(Me,{...n},Ha.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));var Za=H(require("react"));var Ze=H(require("react")),Kn=require("react");var Wu=require("react");var ku=require("react"),Ba;function Uo(){return Ba||(Ba=(0,ku.createContext)(null))}var Q=()=>{let n=Uo();return(0,Wu.useContext)(n)};var ju=require("react");var $u=()=>{let n=Uo(),{state:e}=(0,ju.useContext)(n);return e};var Yo=H(require("react")),Ro=require("react");var Uu="_1eexc2a6";var Yu=ye({defaultClassName:"_12zfob129 _16lm1iw19 _16lm1iw1c _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1w",variantClassNames:{filtered:{false:"_12zfob12a",true:"_12zfob12b"},verticalAlign:{start:"_12zfob12c",end:"_12zfob12d",center:"_12zfob12e"},align:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),qu="_12zfob1n _16lm1iw24 _16lm1iw25 _16lm1iw1y",Xu=ye({defaultClassName:"_12zfob1o",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},rowDisabled:{false:"_12zfob1w",true:"_12zfob1x"},firstRow:{false:"_12zfob1y",true:"_12zfob1z"},treeNode:{parent:"_12zfob110",leaf:"_12zfob111",false:"_12zfob112"},firstRowInHorizontalLayoutPage:{false:"_12zfob113",true:"_12zfob114"},groupRow:{false:"_12zfob115",true:"_12zfob116"},groupCell:{false:"_12zfob117",true:"_12zfob118"},align:{start:"_12zfob119",end:"_12zfob11a",center:"_12zfob11b"},verticalAlign:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},zebra:{false:"_12zfob11f",even:"_12zfob11g",odd:"_12zfob11h"},dragging:{true:"_12zfob11i",false:"_12zfob11j"},insideDisabledDraggingPage:{true:"_12zfob11k",false:"_12zfob11l"},first:{true:"_12zfob11m",false:"_12zfob11n"},last:{true:"_12zfob11o",false:"_12zfob11p"},groupByField:{true:"_12zfob11q",false:"_12zfob11r"},firstInCategory:{true:"_12zfob11s",false:"_12zfob11t"},lastInCategory:{true:"_12zfob11u",false:"_12zfob11v"},pinned:{start:"_12zfob11w",end:"_12zfob11x",false:"_12zfob11y"},filtered:{true:"_12zfob11z",false:"_12zfob120"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob121"],[{pinned:"end",firstInCategory:!0},"_12zfob122"],[{pinned:!1,lastInCategory:!0},"_12zfob123"]]}),Zu=ye({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),Qu="_12zfob12r _16lm1iw1c _16lm1iw19";var Ju="_12zfob17",ec="_12zfob12n _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1",tc=ye({defaultClassName:"_12zfob12o _16lm1iw1 _16lm1iw1d",variantClassNames:{disabled:{true:"_12zfob12p",false:"_12zfob12q"}},defaultVariants:{},compoundVariants:[]}),ka=ye({defaultClassName:"_12zfob12k _16lm1iwz _16lm1iw1p _16lm1iw1s _16lm1iw1",variantClassNames:{active:{true:"_12zfob12l",false:"_12zfob12m"}},defaultVariants:{},compoundVariants:[]}),oc="_12zfob12j _16lm1iwz _16lm1iw1p _16lm1iw1r",nc=ye({defaultClassName:"_12zfob124 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw1v _16lm1iw22",variantClassNames:{menuVisible:{true:"_12zfob125"},reserveSpaceWhenHidden:{true:"_12zfob126",false:"_12zfob127"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob128"]]}),rc="_12zfob18 _16lm1iw2",ic="_16lm1iw1",ac="_12zfob16",lc=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),sc="_12zfob12i _16lm1iw1y _16lm1iw1 _16lm1iwz _16lm1iw1p";var pt="InfiniteIcon";var uc="_6aunoi0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v _16lm1iw1r";var og={transition:"width 0.25s, opacity 0.25s"};function qo(n){let[e,t]=(0,Ro.useState)(!0),[o,r]=(0,Ro.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...og,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,Ro.useEffect)(()=>{if(!e)return;let h=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(h)}},[e]),(0,Ro.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Yo.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:J(l,pt,uc,`${pt}-filter`)},u?Yo.createElement("div",{"data-name":"index",style:m,className:Ju},s):null,Yo.createElement("div",{style:{width:p[0],...f}}),Yo.createElement("div",{style:{width:p[1],...f}}),Yo.createElement("div",{style:{width:p[2],...f}}))}var Wa=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,I)=>{let P=R.maxSize??r??void 0,D=R.minSize??o??void 0;s.push(D),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),D!=null&&R.size<D&&(R.size=D));let x=R.flex==0?null:R.flex;if(R.size==null&&x==null)throw`Items must specify either a size or a flex property. Item at index ${I} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,I)=>{if(R.flex!=null){let P=d*R.flex,D=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=!1,_=0;D!=null&&P>D&&(p[I]=!0,M=!0,_=D),x!=null&&P<x&&(f[I]=!0,M=!0,_=x),M&&(m+=1,l-=1,a-=R.flex,c-=_)}}),m&&(d=c/a);let h=[],g=0,y=c,C=a,T=0,b=0,S=[];return{items:t.map((R,I)=>{let P={...R},D=R.maxSize??r??void 0,x=R.minSize??o??void 0,M=0,_=p[I],A=f[I],F=_||A,v=R.size??0;if(R.flex!=null){if(F)A&&(M=x),_&&(M=D);else{g+=1;let E=O=>(D!=null&&O>D&&(O=D),x!=null&&O<x&&(O=x),O);g===l?M=E(y):(M=E(Math.round(R.flex*d)),b+=M,y=c-b,C-=R.flex,d=y/C)}v=M,P.flexSize=M}return h.push(M),S.push(v),P.computedSize=v,T+=v,P}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:S,remainingSize:Math.round(e-T)}};function qr(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var ja=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((D,x)=>(D[x]={...n.columnSizing[x]},D),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s?.computedWidth,g=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?.computedFlex?"flex":"width",T=!1,b=!1,S=r>0?1:-1,{value:w,clamped:R,diff:I}=qr(d+r,p,f,S);if(n.shareSpaceOnResize){if(s==null)return o[u]={...o[u],[m]:w},b=R==="min",T=R==="max",{adjustedDiff:w-d,reservedWidth:t,columnSizing:o,minReached:b,maxReached:T,constrained:b||T};let{value:D,clamped:x,diff:M}=qr(h-r,g,y,S);if(R&&x&&(Math.abs(I)>Math.abs(M)?x=!1:R=!1),!(!R&&!x)){if(R){let _=qr(h-r-I,g,y,S);D=_.value,x=_.clamped,M=_.diff}else if(x){let _=qr(d+r+M,p,f,S);w=_.value,R=_.clamped,I=_.diff}}o[u]={...o[u],[m]:w},o[c]={...o[c],[C]:D},b=R==="min"||x==="min",T=R==="max"||x==="max"}else o[u]={...o[u],[m]:w},b=R==="min",T=R==="max";let P=w-d;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:t-P,columnSizing:o,minReached:b,maxReached:T,constrained:b||T}};function cc(n,e){return n+e}function ng(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var dc=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Wa({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(cc,0)+r-u,0)}),d=a.map((y,C)=>c[C]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,C)=>{let T=a[C];if(!T.resizable){h.push(0);return}let b=s[C],S=l[C],w=ng(o),{maxReached:R,minReached:I,constrained:P,adjustedDiff:D}=ja({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:w});o[T.id]={...w[T.id],[b]:S+D},h.push(D),R||(f=!1),I||(p=!1),P||(m=!1)});let g=h.reduce(cc,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:o,reservedWidth:t-g}};var Xr;function Jt(){if(Xr!=null)return Xr;let n=De().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Xr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Xr}var pc=["start",void 0,"end"],fc=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:pc.indexOf(r)-pc.indexOf(i)}),n);function mc(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function $a(n,...e){return mc(t=>t!=null,n,...e)}function hc(n,e,...t){return mc((o,r)=>!(r in n),e,...t)}var Zr=Object.freeze({}),rg={string:Zr,number:{}};function Ua(n,e){let t=e.default||Zr;return n.type===void 0?t:n.type===null?Zr:typeof n.type=="string"?e[n.type]||rg[n.type]||Zr:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var Qr=!0,ig=!0,ag=!0,lg="string",Xo="unknown",sg=Rr("getComputedVisibleColumns"),ug=(n,e,t)=>n[t]!==!1,Ya=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},gc=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=eo,viewportReservedWidth:g,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:T,columnOrder:b,columnPinning:S,editable:w,columnDefaultEditable:R,columnDefaultFilterable:I,columnDefaultSortable:P,columnSizing:D,columnTypes:x,columnVisibility:M,columnVisibilityAssumeVisible:_})=>{let A=0,F=(d||[]).reduce((L,te)=>{let{id:W,field:de}=te;return de&&(L[de]=te),W&&(L[W]=te),L},{}),v=fc(b===!0?Object.keys(n):b,S),E=v.filter(L=>n[L]?ug(M,_,L):(sg(`Column with id "${L}" specified in columnOrder array cannot be found in the columns map.`),!1)),O=new Map,z=E.map((L,te)=>{let W=n[L];return O.set(L,te),W}),Z=(f??[]).reduce((L,te,W)=>(te.id?L[te.id]={sortInfo:te,index:W}:te.field&&(L[te.field]={sortInfo:te,index:W}),L),{});function oe(L){let te=n[L],W=Ua(te,x),de={minWidth:W?.minWidth,maxWidth:W?.maxWidth,width:W?.defaultWidth,flex:W?.defaultFlex},ke=$a({width:te?.defaultWidth,flex:te?.defaultFlex,minWidth:te?.minWidth,maxWidth:te?.maxWidth},D[L]);ke.width!=null&&delete de.flex,ke.flex!=null&&delete de.width,ke=$a(de,ke);let ne=ke.flex??void 0,We=ke.minWidth??te?.minWidth??t,ct=ke.maxWidth??te?.maxWidth??o,Mt=ne!=null?void 0:ke.width??(i?void 0:r);return!Mt&&ne==null&&(i?ne=i:Mt=We),{size:Mt,flex:ne,minSize:We,maxSize:ct}}let ce=Wa({availableSize:Math.max(e.width-(g??0)-(a??Jt()),0),maxSize:o,minSize:t,items:E.map(oe)}),{computedSizes:se,flexSizes:G,minSizes:k,maxSizes:re}=ce,ie=[],K=[],V=[],j=[];j.length=E.length;let q=new Map,$=new Map,N=0,ee=0,Se=0,Re=null,ue=[],B=0,ae=0,me=0;z.forEach((L,te)=>{let W=E[te],de=se[te],ke=ue[te]=Ya(W,S);ke==="start"?B+=de:ke==="end"?me+=de:ae+=de});let _e=e.width-me,Ne=[],Ie=new Map;E.forEach((L,te)=>{let W=z[te];Ie.set(L,W)});let Ke=[];Object.keys(n).forEach(L=>{let te=n[L];Ke.push(L),Ie.has(L)||Ie.set(L,te)});let He=new Map;Ie.forEach((L,te)=>{let W=O.get(te);W==null&&(W=-1);let de=W!=-1,ke=E[W+1],ne=Ua(L,x),We=W,ct=Z[te]?Z[te]:L.field?Z[L.field]??null:null,Mt=ct?.sortInfo??null,Sn=!!Mt,hr=Sn&&Mt.dir===1,ia=Sn&&!hr,aa=ct?.index??-1,Tn=de?{}:oe(te),Oe=de?se[W]:Tn.size||0,St=de&&G[W]||null,go=de?k[W]||0:Tn.minSize||0,Tt=de?re[W]||1e4:Tn.maxSize||1e4,Ue=de?Ya(te,S):!1,ls=de?W===E.length-1:!1,gr=We,Xm=de?Ue==="start"?ee:Ue==="end"?Se:A-ee:0;Ue=="start"?gr=de?We:-1:Ue==="end"?gr=de?We-(ie.length+V.length):-1:gr=de?We-ie.length:-1;let Zm=de?Ue==="start"||Ue===!1?A:_e+Se:-1,Qm=de?Ue!==Re:!1,Jm=de?ls||Ue!==Ya(ke,S):!1,ss=L.cssEllipsis??ne.cssEllipsis??l,eh=L.headerCssEllipsis??ne.cssEllipsis??L.cssEllipsis??ne.headerCssEllipsis??s??ss,yr=de&&(F[te]||L.field||L.groupByForColumn)&&(F[te]||F[L.field||L.groupByForColumn])||null,th=L.defaultFilterable??ne.defaultFilterable??I??!0,oh=w??L.defaultEditable??ne.defaultEditable??R??!1,la=L.dataType||ne.dataType||(Array.isArray(L.type)?L.type[0]:L.type)||lg,nh=L.sortType||ne.sortType||la,us=L.filterType||ne.filterType||la,cs=!1;if(yr!=null&&!yr.disabled){let ua=h[us];ua&&(!ua.emptyValues||!ua.emptyValues.includes(yr.filter.value))&&(cs=!0)}let ds=L.field??ne.field,ps=L.valueGetter??ne.valueGetter,sa=L.defaultSortable??ne.defaultSortable;sa==null&&!L.groupByForColumn&&ds==null&&ps==null&&(sa=!1);let rh=p??sa??P??Qr,ih=L.resizable??ne.resizable??y??ig,Ve={colType:ne,align:ne.align,headerAlign:ne.headerAlign,computedVisible:de,verticalAlign:ne.verticalAlign,defaultHiddenWhenGroupedBy:ne.defaultHiddenWhenGroupedBy,valueGetter:ps,valueFormatter:ne.valueFormatter,renderValue:ne.renderValue,render:ne.render,style:ne.style,contentFocusable:ne.contentFocusable,renderMenuIcon:ne.renderMenuIcon,renderSortIcon:ne.renderSortIcon,renderRowDetailIcon:ne.renderRowDetailIcon,renderSelectionCheckBox:ne.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ne.renderHeaderSelectionCheckBox,headerStyle:ne.headerStyle,headerClassName:ne.headerClassName,columnGroup:ne.columnGroup,getValueToEdit:ne.getValueToEdit,getValueToPersist:ne.getValueToPersist,shouldAcceptEdit:ne.shouldAcceptEdit,field:ds,...L,components:{...ne.components,...L.components},computedResizable:ih,computedMinWidth:go,computedMaxWidth:Tt,computedFlex:St,computedDataType:la,computedEditable:oh,computedSortType:nh,computedFilterType:us,cssEllipsis:ss,headerCssEllipsis:eh,computedFilterValue:yr,computedFiltered:cs,computedFilterable:th,computedWidth:Oe,computedAbsoluteOffset:Zm,computedPinningOffset:Xm,computedVisibleIndexInCategory:gr,computedOffset:A,computedSortable:rh,computedSortInfo:Mt,computedSortIndex:aa,computedMultiSort:m,computedSorted:Sn,computedSortedAsc:hr,computedSortedDesc:ia,computedVisibleIndex:We,computedPinned:Ue,computedDraggable:C??L.defaultDraggable??T??ag,computedFirstInCategory:Qm,computedLastInCategory:Jm,computedFirst:W===0,computedLast:ls,id:te,header:L.header??ne.header??L.name??L.field};de&&(A+=Oe,q.set(Ve.id,Ve),j[W]=Ve,Ue==="start"&&(ie.push(Ve),ee+=Ve.computedWidth),Ue==="end"&&(K.push(Ve),Se+=Ve.computedWidth),Ue||(V.push(Ve),N+=Ve.computedWidth),Re=Ue),Ve.groupByForColumn&&(Ve.computedSortType=L.sortType||ne.sortType||Xo,Ne.push(Ve)),$.set(Ve.id,Ve),Ve.field&&!Ve.groupByForColumn&&!He.has(Ve.field)&&He.set(Ve.field,Ve)}),Ne.forEach(L=>{L.computedSortable=yc(L,{fieldsToColumn:He,sortable:p,columnDefaultSortable:P})});let Be=new Map;Ke.forEach(L=>{let te=$.get(L);te&&Be.set(L,te)}),$.forEach(L=>{Be.has(L.id)||Be.set(L.id,L)});let st=u!=null?Math.min(u,ee):ee,ut=c!=null?Math.min(c,Se):Se;return{computedRemainingSpace:e.width-(B+me+ae),computedPinnedStartColumnsWidth:ee,computedPinnedEndColumnsWidth:Se,computedUnpinnedColumnsWidth:N,computedColumnOrder:v,computedPinnedStartColumns:ie,computedPinnedEndColumns:K,computedUnpinnedOffset:ee,computedPinnedEndOffset:ee+N,computedUnpinnedColumns:V,computedVisibleColumns:j,computedColumnsMap:$,computedColumnsMapInInitialOrder:Be,computedVisibleColumnsMap:q,computedPinnedEndWidth:ut,computedPinnedStartWidth:st,renderSelectionCheckBox:j.reduce((L,te)=>L||!!te.renderSelectionCheckBox,!1),fieldsToColumn:He}};function yc(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??Qr;return n.computedSortType!==Xo&&a?!0:s=>{let{column:u,api:c}=s,d=u.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,h;if(m){let g=o.get(m),y=g?c.getColumnApi(g.id):void 0;g&&y?h=y.isSortable():h=!1}return h===void 0&&f.valueGetter&&(h=!0),h??r??Qr},!0)}}function et(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Jr(n,e){let t=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let h=et(t.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});m=t.header({horizontalLayoutPageIndex:null,column:t,columnApi:h,dataSourceApi:s,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:m}})??null}return m}var Cc=H(require("react"));var ei=`${rt}HeaderCell__filter`,qa=`${rt}HeaderCell__filterOperator`,Xa=Cc.createContext(null);var cg=`${ei}__input`,ti=n=>n.stopPropagation();function Sc(n){let{filterOperatorMenuVisibleForColumnId:e}=$u(),{column:t}=Hn(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,Kn.useState)(!1),l=Ze.useCallback(()=>{a(!0)},[]),s=Ze.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return Ze.createElement("div",{onPointerUp:ti,onPointerDown:ti,onFocus:l,onBlur:s,className:`${ei} ${ka({active:u})}`,style:{height:n.columnHeaderHeight}},Ze.createElement(Xa.Provider,{value:n},Ze.createElement(r,null),Ze.createElement(o,null)))}function Tc(){let{columnApi:n,disabled:e,operator:t}=Zo(),o=t?.components?.Icon??qo;return Ze.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:J(qa,ec,e?`${qa}--disabled`:"")},Ze.createElement(o,{size:20,className:`${tc({disabled:e})}`}))}function bc(){return Ze.createElement("div",{onPointerUp:ti,onPointerDown:ti,className:`${ei} ${ka({active:!1})} ${Ru["50%"]}`})}function Zo(){let n=Q(),{column:e,columnApi:t}=Hn(),o=Jr(e,n),r=Ze.useContext(Xa),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,Kn.useState)(l?.filter.value??""),d=Ze.useCallback(g=>{c(g),r.onChange(g)},[r.onChange]),p=Ze.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),f=Ze.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,Kn.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let g=[...s.emptyValues][0];g!==u&&c(g)}},[l?.filter.value]);let m=r.operator,h=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${o}`,className:`${Qu} ${cg}`}}function Qo(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Zo();return Za.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function oi(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Zo();return Za.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function dg(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Qo},operators:[{name:"includes",components:{Icon:Ou},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Oa},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Bu},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Lu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:oi},operators:[{label:"Equals",components:{Icon:Oa},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Hu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:zu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Vu},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Ku},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:Gu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var eo=dg();function ni(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Wn=require("react");var Rc="_16lm1iw1",wc="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw0",Ic="_1yeub2vs",Pc="_1yeub2vr",xc=ye({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 Qa="_1yeub2vp";var AP=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Ja=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Bn={bodyWidth:{name:Y(le.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Y(le.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Y(le.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Y(le.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Y(le.runtime.browserScrollbarWidth),value:""}},pg=Y(U.scrollbarWidthHorizontal),Dc=Y(U.scrollbarWidthVertical),fg=Y(U.columnWidthAtIndex),mg=Y(U.columnZIndexAtIndex),vc=Y(U.scrollLeft),hg=Y(U.activeCellColWidth),Ac=Y(U.activeCellColOffset),_c=Y(U.baseZIndexForCells),gg=Y(U.pinnedStartWidth),Mc=Y(U.bodyWidth),yg=Y(U.bodyHeight),Ec=Y(U.pinnedEndOffset),Fc=Y(U.pinnedEndWidth),Cg=Y(U.computedVisibleColumnsCount);function el(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${_c}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Nc(n){let e=Jt(),{computed:t,state:o,actions:r,getState:i}=Q(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h,wrapRowsHorizontally:g}=o,{computedPinnedStartColumnsWidth:y,computedPinnedEndColumnsWidth:C,computedPinnedStartColumns:T,computedPinnedEndColumns:b,computedVisibleColumns:S,computedUnpinnedColumnsWidth:w,scrollbars:R}=t,I=[],P=S.reduce((v,E)=>{let O=E.computedVisibleIndex;v[ge.columnWidths.varName.get(O)]=E.computedWidth+"px",v[ge.columnOffsets.varName.get(O)]=E.computedPinned==="start"?`calc( ${E.computedOffset}px + var(${vc}) )`:E.computedPinned==="end"?`calc( var(${Ec}) ${I.length?"+":""} ${I.map(Z=>ge.columnWidths.get(Z.computedVisibleIndex)).join(" + ")} + var(${vc}) )`:`${E.computedOffset}px`;let z=el(E,{pinnedStartColsCount:T.length,visibleColsCount:S.length});return v[`${mg}-${O}`]=`${z}`,E.computedPinned==="end"&&I.push(E),v},{});if(m.width&&(P[Bn.browserScrollbarWidth.name]=`${Jt()}px`),P[Bn.bodyWidth.name]=`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,P[Bn.totalVisibleColumnsWidthValue.name]=`${y+C+w}px`,P[Bn.totalVisibleColumnsWidthVar.name]=`calc(${S.map((v,E)=>`var(${fg}-${E})`).join(" + ")})`,P[Bn.visibleColumnsCount.name]=S.length,h!=null){P[hg]=ge.columnWidths.get(h[1]);let v=ge.columnOffsets.get(h[1]);if(o.brain.isHorizontalLayoutBrain){let E=o.brain.getPageIndexForRow(h[0]);P[Ac]=E?`calc( ${le.runtime.totalVisibleColumnsWidthVar} * ${E} + ${v})`:v}else P[Ac]=v}P[Cg]=S.length,P[pg]=R.horizontal?`${e}px`:"0px",P[Dc]=R.vertical?`${e}px`:"0px",P[gg]="calc( "+T.map(v=>ge.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[Fc]="calc( "+b.map(v=>ge.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[_c]=S.length*10,P[Ec]=`calc( var(${Mc}) - var(${Fc}) - var(${Dc}) )`,P[Mc]=`${m.width}px`,P[yg]=`${m.height}px`;let D=Ja(v=>{r.focused=v}),x=Ja(v=>{r.focusedWithin=v}),A={...n,onFocus:v=>{if(n?.onFocus?.(v),v.target===s.current||v.target===u.current){if(i().focused)return;D(!0),p?.(v),l&&(x(!1),c?.(v));return}l||(x(!0),d?.(v))},onBlur:v=>{if(n?.onBlur?.(v),v.target===s.current||v.target===u.current){if(!i().focused)return;D(!1),f?.(v),l&&(x(!1),c?.(v));return}s.current?.contains(v.relatedTarget)||(x(!1),c?.(v))}},F=J(Ot,wc,g?`${Ot}--horizontal-layout`:null,A?.className,y?`${Ot}--has-pinned-start ${Pc}`:null,C?`${Ot}--has-pinned-end ${Ic}`:null,a?`${Ot}--focused`:null,l?`${Ot}--focused-within`:null,a&&o.focusedClassName?o.focusedClassName:null,l&&o.focusedWithinClassName?o.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Ot}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Ot}--has-pinned-end-overflow`:null,xc({horizontalLayout:!!g,hasPinnedStart:!!y,hasPinnedEnd:!!C,focused:a,focusedWithin:l}));return A.className=F,A.style={...n?.style,...P},a&&o.focusedStyle&&Object.assign(A.style,o.focusedStyle),l&&o.focusedWithinStyle&&Object.assign(A.style,o.focusedWithinStyle),A}var zc=H(Ho());function ri(n){return n.map(e=>e instanceof ft?e:new ft(null,[e]))}var ft=class{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new ft("+",[this,...e])}subtract(...e){return new ft("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new ft("*",[this,...e])}divide(...e){return new ft("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>Sg(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Sg(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Tg=(...n)=>new ft("+",ri(n)),Oc=(...n)=>new ft("-",ri(n)),bg=(...n)=>new ft("*",ri(n)),Rg=(...n)=>new ft("/",ri(n)),ii={add:Tg,subtract:Oc,minus:Oc,multiply:bg,divide:Rg};var kn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Lc=n=>{let e=null,t=null;return{stop(){e!==null&&bt(e),t!=null&&bt(t)},scroll(o){e!==null&&bt(e),t!=null&&bt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=xe(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=xe(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Vc=10,wg=Y(U.pinnedStartWidth);function Gc(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,setProxyPosition:d,api:p,horizontalLayoutPageIndex:f,pageWidth:m}=n;function h(K){let V=K==="start"?A:F;return x===_?V:_===K?V+P.computedWidth:x===K?V-P.computedWidth:V}function g(K){if(K.columnIndex===D||f!=null)return!0;let V=e[K.columnIndex];if(V.computedPinned)return!0;let j=l.getScrollPosition().scrollLeft,q=V.computedOffset+(f!=null&&m!=null?m*f:0);return q>=j+h("start")&&q+V.computedWidth<=j+c.width-h("end")}let y=(K,V)=>{let{restrictToParentGroup:j,dragColumn:q}=V,$=[];if(K.forEach(ee=>{if(ee.computedVisibleIndex===D)return;let Se={columnId:ee.id,columnIndex:ee.computedVisibleIndex,offsetX:ee.computedOffset+Math.round(ee.computedWidth/2)};g(Se)&&$.push(Se)}),j){let Se=function(ue,B,ae){let me=K[ue];me&&(me.columnGroup!==q.columnGroup&&ae.add(me.id),Se(ue+B,B,ae))};var N=Se;let ee=q.computedVisibleIndex,Re=new Set;Se(ee-1,-1,Re),Se(ee+1,1,Re),$=$.filter(ue=>!Re.has(ue.columnId))}return $},T=r.length,b={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},S={left:b.clientX-c.left-(b.clientX-s.left)+Vc,top:b.clientY-c.top-(b.clientY-s.top)+Vc},w=l.getScrollPosition(),R=e.map(K=>K.computedVisibleIndex),I=R,P=t.get(i),D=P.computedVisibleIndex,x=P?.computedPinned,M=D,_=x,A=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),v=b,E={x:0,y:0},O=1,z=0;function Z(K){let V=Math.round(K.clientX),j=Math.round(K.clientY);if(V===v.clientX&&j===v.clientY)return;v={clientX:V,clientY:j};let $=l.getScrollPosition().scrollLeft-w.scrollLeft;E.x=v.clientX-b.clientX,E.y=v.clientY-b.clientY,z=E.x+$,O=z<0?-1:1,d({left:S.left+E.x,top:S.top+E.y})}function oe(K){let V=0;x?x==="start"&&K.forEach((j,q)=>{V||e[j]?.computedPinned!=="start"&&(V=q)}):K.forEach((j,q)=>{e[j]?.computedPinned==="start"&&(V=q+1)}),T=V,ce("start",K,V)}function ce(K,V,j){if(K==="start"){let q=0;for(let $=0;$<j;$++){let N=V[$],ee=e[N];q+=ee.computedWidth}Kt(wg,`${q}px`,a)}}function se(K){if(K==null||K===M)return;M=K;let V=kn(R,D,M>D?M-1:M);T=0;let q=new Set;return V.forEach(($,N)=>{let ee=I[N];$!==ee&&q.add($),oe(V)}),I=V,G(q),{newColumnIndexes:V,indexesWithTransition:q,pinnedStartCount:T}}function G(K){e.forEach(V=>{let j=V.computedVisibleIndex;K.has(j)?js(j,a):vr(j,a);let q=j===D,$=O===-1?j<M||j>D:j<D||j>=M,N="";O===-1?N=q?ge.columnOffsets.get(M):$?ge.columnOffsets.get(j):ii.add(ge.columnOffsets.get(j),ge.columnWidths.get(D)).done():N=$?ge.columnOffsets.get(j):q?ii.add(ge.columnOffsets.get(M-1),ge.columnWidths.get(M-1)).minus(ge.columnWidths.get(D)).done():ii.minus(ge.columnOffsets.get(j),ge.columnWidths.get(D)).done(),Dn(j,N,a)})}let k=c.left+h("start"),re=c.right-h("end"),ie=Lc({scrollOffsetStart:k,scrollOffsetEnd:re});return Z(b),{speedScroller:ie,stop(){ie.stop()},onMove(K){Z(K),ie.scroll({mousePosition:v,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ee){p.scrollLeft=ee}});let V=y(e,{dragColumn:P,restrictToParentGroup:u==="group"}),j=O===-1?P.computedOffset+z:P.computedOffset+P.computedWidth+z,q=(0,zc.default)(V,j,({offsetX:ee},Se)=>ee<Se?-1:ee>Se?1:0);q<0&&(q=~q),V.length?q=V[q]?V[q].columnIndex:V[V.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),q=0),q===D+1&&(q=D),se(q);let $={};o.forEach(ee=>{$[ee.id]="end"});for(let ee=0;ee<T;ee++){let Se=I[ee],Re=e[Se];$[Re.id]="start"}let N=I.map(ee=>e[ee].id);return{columnPinning:$,columnOrder:N}}}}function to(n,e,t){if(n===e)return!0;if(!n||!e)return!1;var o=Object.keys(n),r=Object.keys(e);t&&(o=o.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=o.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=o[a];if(!(t&&t.has(l))&&(n[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function tl(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return kn(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return kn(o,c,u)}return e}var Ig=Y(U.baseZIndexForCells),Pg=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:to(n,e)},Kc=({columnId:n,domRef:e,horizontalLayoutPageIndex:t})=>{let[o,r]=(0,Wn.useState)(null),{actions:i,computed:a,getComputed:l,getState:s,api:u,state:{domRef:c}}=Q(),d=(0,Wn.useCallback)(f=>{let m=l().computedVisibleColumnsMap.get(n);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=s();u.toggleSortingForColumn(n,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),p=(0,Wn.useCallback)(f=>{let m=f.target?.tagName;if(m==="INPUT"||m==="BUTTON")return;let{brain:h,draggableColumnsRestrictTo:g}=s(),{computedVisibleColumns:y,computedVisibleColumnsMap:C,computedPinnedStartColumns:T,computedUnpinnedColumns:b,computedPinnedEndColumns:S}=l(),w=C.get(n);if(!w.computedDraggable){d(f);return}let R=e.current,I=R.getBoundingClientRect(),P=c.current.getBoundingClientRect(),D=h.getAvailableSize(),x=w.computedVisibleIndex,M=h.getVirtualColIndex(w.computedVisibleIndex,{pageIndex:t||0}),_=h.isHorizontalLayoutBrain?h.getPageWidth():null,A=R.style.cursor??"auto",F=!1,v=Gc({brain:h,horizontalLayoutPageIndex:t,pageWidth:_,draggableColumnsRestrictTo:g,computedPinnedEndColumns:S,computedPinnedStartColumns:T,computedUnpinnedColumns:b,computedVisibleColumns:y,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:I,dragColumnId:n,api:u,infiniteDOMNode:c.current,setProxyPosition:r,tableRect:P,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),E=null,O,z;function Z(se){let{columnPinning:G,columnOrder:k}=se;Pg(s().columnPinning,G)||(i.columnPinning=G);let re=l().computedColumnOrder;JSON.stringify(k,re)&&(y.forEach(ie=>{Dn(ie.computedVisibleIndex,"",c.current)}),i.columnOrder=tl({newColumnOrder:k,visibleColumnOrder:l().computedVisibleColumns.map(ie=>ie.id),existingColumnOrder:re,dragColumnId:n}))}let oe=se=>{let{headerBrain:G,brain:k}=s();if(!F){F=!0;let re=k.keepColumnRendered(M),ie=G.keepColumnRendered(M);if(k.isHorizontalLayoutBrain){let V=k.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),j=G.extendRenderRange({start:!0,end:!0,direction:"horizontal"});z=()=>{V(),j()}}O=()=>{re(),ie()},i.columnReorderDragColumnId=w.id,t!=null&&(i.columnReorderInPageIndex=t),Ra(x,`calc( var(${Ig}) + 10000 )`,c.current),c.current?.classList.add(Qa),R.style.cursor="grabbing"}E=v.onMove(se)},ce=se=>{let{multiSortBehavior:G}=s(),k=e.current;c.current?.classList.remove(Qa),v.stop(),h.update({...D}),O?.(),z?.(),y.forEach(ie=>{vr(ie.computedVisibleIndex,c.current),Dn(ie.computedVisibleIndex,"",c.current)}),Ra(x,el(w,{pinnedStartColsCount:T.length,visibleColsCount:y.length}),c.current),k.style.cursor=A,k.releasePointerCapture(se.pointerId),k.removeEventListener("pointermove",oe),k.removeEventListener("pointerup",ce),r(null);let re=u.getColumnApi(w.id)?.isSortable()??!1;!F&&re&&u.toggleSortingForColumn(w.id,{multiSortBehavior:G==="replace"&&(se.ctrlKey||se.metaKey)?"append":G}),E&&Z(E),i.columnReorderDragColumnId=!1,t!=null&&(i.columnReorderInPageIndex=null)};R.addEventListener("pointermove",oe),R.addEventListener("pointerup",ce),R.setPointerCapture(f.pointerId)},[n,t]);return{onPointerDown:a.computedVisibleColumnsMap.get(n)?.computedDraggable?p:d,proxyPosition:o}};var en=H(require("react"));var pe=H(require("react")),Ge=require("react");var Io=H(require("react"));var Hc=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var jn=H(require("react")),Wc=require("react");var Bc="_6rdmyg0 _16lm1iwn _16lm1iwi _16lm1iw9",kc=ye({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});var ai=`${pt}-expand-collapse`;function wo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,Wc.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Xt("expanded",n)||i(!r)};jn.useEffect(()=>{Xt("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return jn.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:J(n.className,Bc,kc({direction:t||"start",expanded:r,disabled:o}),`${pt}`,`${ai}`,`${ai}--${l}`,`${ai}--${t==="end"?"end":"start"}`,o?`${ai}--disabled`:"")},jn.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var li=H(require("react"));var jc="_16lm1iwb _16lm1iwn _16lm1iwi";var $c=n=>li.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:J(n.className,jc,"InfiniteIcon","InfiniteIcon-loading")},li.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},li.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Uc=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Yc="_7pupv00",qc=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Xc({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function si({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=J($o.flex,i.align==="end"?Vn.rowReverse:Vn.row,Tu.center,`${Po}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u)?Uc({align:a}):null);if(e==="multi-column"){if(n+1!==c.groupNesting&&c.isGroupRow)return u?Io.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return Io.createElement("div",{className:d},s,u,Io.createElement("div",{className:Nt},l??null))}}function ui({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return Hc(c)?f=Io.createElement($c,null):m&&(f=Io.createElement(wo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=Io.createElement(it,{render:o,renderParam:r})),f}}function Zc(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:si({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:ui({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function Qc(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:si({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:ui({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Jc(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var ci=H(require("react")),di=require("react");var ed="qz8ht90 _16lm1iwi";function xg(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:Dg}=_t({forwardProps:xg,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function vg(){let{componentState:n,componentActions:e}=ze(),{checked:t,domProps:o,disabled:r}=n,i=(0,di.useRef)(null);return(0,di.useEffect)(()=>{i.current.indeterminate=t==null},[t]),ci.createElement("input",{...o,className:J("InfiniteCheckBox",ed,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function oo(n){return ci.createElement(Dg,{...n},ci.createElement(vg,null))}function Ag(n){return typeof n.field=="string"}function td(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function mt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:h}=o(),g=r===f&&m==="row",y=!h||typeof h=="function"&&!h(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:C,formattedValueContext:{rawValue:T}}=Jo({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:n}),b=et(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:T}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:T}}function od(n){return rd(n.column,n.rowInfo)}function nd(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=td({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Jo(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:Mg({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function Mg(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:h}=f(),{indexInAll:g}=o,y=p(),{selectionMode:C,cellSelection:T}=y,b=td({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),S=d.toggleGroupRow,w=T?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:h&&h.primaryKey===o.id&&h.columnId===e.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:b,selectionMode:C,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:g,toggleGroupRow:S,toggleCurrentGroupRow:()=>{o.isGroupRow&&S(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function rd(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Ag(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Eg(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function Jo(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=rd(e,t),a=Eg(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Bt=H(require("react"));var{rootClassName:id}=Pe,xo=`${id}Cell`,ol=`${id}Cell_content`,Fg=Y(U.columnWidthAtIndex),_g=Y(U.columnReorderEffectDurationAtIndex);function Ng(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:h,...g}=n,y=m(),C={width:`var(${Fg}-${i.computedVisibleIndex})`,transition:`transform var(${_g}-${i.computedVisibleIndex}, 0s)`,...g.style},T={...g,style:C,"data-column-id":i.id,"data-z-index":C.zIndex,className:J(g.className,xo,pu),children:Bt.createElement(Bt.Fragment,null,d,Bt.createElement("div",{className:J(ol,e?Nt:xu.hidden,s),style:r},y),c)};u!=null&&(T["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?Bt.createElement(b,{...T,ref:a}):Bt.createElement("div",{...T,ref:a})}var pi=Bt.memo(Ng);var Do=H(require("react")),$n=require("react");function ad(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=fi(),i=(0,$n.useRef)(),a=Do.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=(0,$n.useCallback)(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?o():s.stopPropagation()},[]);return Do.createElement(Do.Fragment,null,Do.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(Su,Pu.none),type:"text",defaultValue:n,onChange:(0,$n.useCallback)(s=>{e(s.target.value)},[])}))}var{rootClassName:Og}=Pe,Lg=Y(U.columnZIndexAtIndex);function Vg({rowInfo:n}){return{[Y(le.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var Un=pe.createContext(null),Po=`${Og}ColumnCell`,zg=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return pe.createElement(wo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Gg={display:"inline-block",visibility:"visible"},nl=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return pe.createElement(wo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:Gg,expanded:o,onChange:t})},Kg=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||oo;return pe.createElement(c,{domProps:{className:Hr},disabled:e.isTreeNode?!u(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function rl(n,e){return n?typeof n=="function"?n(e):n:void 0}function il(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Hg(n){let{rowInfo:e,rowStyle:t,rowClassName:o,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:u,width:c,column:d,onMouseLeave:p,onMouseEnter:f,rowIndex:m,rowHeight:h,columnsMap:g,fieldsToColumn:y,domRef:C,hidden:T,showZebraRows:b}=n,S=pe.useRef(null),w=(0,Ge.useCallback)(Oe=>{S.current=Oe,C&&C(Oe)},[C]);if(!d)return pe.createElement("div",{ref:w},"no column");let{rowSelected:R}=e,{getState:I,actions:P,computed:D,api:x,getDataSourceMasterContext:M}=Q(),{componentState:_,getState:A,api:F,componentActions:v}=be(),{activeRowIndex:E,keyboardNavigation:O,columnReorderInPageIndex:z}=I(),Z=m===E&&O==="row",oe={getState:I,getDataSourceState:A,getDataSourceMasterContext:M,actions:P,dataSourceActions:v,api:x,dataSourceApi:F},ce=e.rowDisabled,se=D.computedVisibleColumns.map(Oe=>Oe.id),G=nd({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:u,columnsMap:g,visibleColumnsIds:se,fieldsToColumn:y,context:oe}),{stylingParam:k,renderParams:re,formattedValueContext:ie,renderFunctions:K,groupByColumnReference:V,inEdit:j}=G,{align:q,verticalAlign:$}=re,N=re,ee=pe.useRef(N),Se=(0,Ge.useCallback)(Oe=>{let St=d.computedVisibleIndex;I().cellClick({rowIndex:m,colIndex:St,event:Oe})},[m,d.computedVisibleIndex,O]),Re=(0,Ge.useCallback)(Oe=>{let St=d.computedVisibleIndex;if(I().cellMouseDown({rowIndex:m,colIndex:St,event:Oe}),O==="row"){ce||(P.activeRowIndex=m);return}O==="cell"&&(P.activeCellIndex=[m,St])},[m,ce,d.computedVisibleIndex,O]),{selectionMode:ue,cellSelection:B,isNodeReadOnly:ae}=_,me=N.cellSelected;N.domRef=w,N.htmlElementRef=S,N.toggleCurrentTreeNode=(0,Ge.useCallback)(N.toggleCurrentTreeNode,[e]),N.selectCell=(0,Ge.useCallback)(N.selectCell,[e]),N.deselectCell=(0,Ge.useCallback)(N.deselectCell,[e]),N.selectCurrentRow=(0,Ge.useCallback)(N.selectCurrentRow,[e]),N.deselectCurrentRow=(0,Ge.useCallback)(N.deselectCurrentRow,[e]),N.toggleCurrentGroupRow=(0,Ge.useCallback)(N.toggleCurrentGroupRow,[e]),N.toggleCurrentRowSelection=(0,Ge.useCallback)(N.toggleCurrentRowSelection,[e]),N.toggleCurrentGroupRowSelection=(0,Ge.useCallback)(N.toggleCurrentGroupRowSelection,[e]),N.toggleCurrentTreeNodeSelection=(0,Ge.useCallback)(N.toggleCurrentTreeNodeSelection,[e]);let _e=d.components?.Editor??ad,Ne=j?pe.createElement(sd,{contextValue:N},pe.createElement(_e,null)):null,Ie=(0,Ge.useCallback)(ot(()=>{if(T||j)return null;if(ee.current=N,K.renderGroupIcon&&(N.renderBag.groupIcon=pe.createElement(it,{render:K.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),K.renderSelectionCheckBox&&ue=="multi-row"&&(N.renderBag.selectionCheckBox=pe.createElement(it,{render:Kg,renderParam:N}),K.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=pe.createElement(it,{render:K.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),e.isTreeNode){let{isParentNode:go}=e,Tt;Tt=(go?K.renderTreeIconForParentNode:K.renderTreeIconForLeafNode)||typeof K.renderTreeIcon=="function"?K.renderTreeIcon:go&&K.renderTreeIcon===!0?nl:void 0,Tt===!0?Tt=nl:Tt&&(N.renderBag.treeIcon=pe.createElement(it,{render:nl,renderParam:N})),Tt&&(N.renderBag.treeIcon=pe.createElement(it,{render:Tt,renderParam:{...N,renderBag:{...N.renderBag}}}))}K.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=pe.createElement(it,{render:zg,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof K.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=pe.createElement(it,{render:K.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),K.renderValue&&(N.renderBag.value=pe.createElement(it,{render:K.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),e.isGroupRow&&K.renderGroupValue&&(N.renderBag.value=pe.createElement(it,{render:K.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!e.isGroupRow&&K.renderLeafValue&&(N.renderBag.value=pe.createElement(it,{render:K.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),ee.current=N;let Oe=N.renderBag.value;Oe instanceof Date&&(Oe=Oe.toLocaleDateString());let St=pe.createElement(pe.Fragment,null,q!=="end"?N.renderBag.treeIcon:null,q!=="end"?N.renderBag.groupIcon:null,q!=="end"?N.renderBag.rowDetailsIcon:null,q!=="end"?N.renderBag.selectionCheckBox:null,Oe,q==="end"?N.renderBag.selectionCheckBox:null,q==="end"?N.renderBag.rowDetailsIcon:null,q==="end"?N.renderBag.groupIcon:null,q==="end"?N.renderBag.treeIcon:null);return d.render?pe.createElement(it,{render:d.render,renderParam:{...N,renderBag:{...N.renderBag,all:St}}}):St}),[d,T,j,u,d.renderTreeIcon||d.renderTreeIconForParentNode?ae:!1,...Jc(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),Ke=D.computedVisibleColumns.map(Oe=>Oe.id),He=D.computedColumnOrder,Be={...ie,visibleColumnIds:Ke,allColumnIds:He,rowIndex:m,rowHasSelectedCells:!1};Object.defineProperty(Be,"rowHasSelectedCells",{get(){return e.hasSelectedCells(Ke)}});let st=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),ut=typeof o=="function"?o(Be):o,qe;V?.className&&(qe=rl(V.className,k)),s&&(qe=J(qe,rl(s,k))),d.className&&(qe=J(qe,rl(d.className,k))),st&&(qe=J(qe,qc({align:q})));let L;e.dataSourceHasGrouping&&d.groupByForColumn&&(L=Xc({rowInfo:e})),st&&(L=Vg({rowInfo:e})),t&&(L=typeof t=="function"?{...L,...t(Be)}:{...L,...t}),l&&(L=il(L,l,k)),V?.style&&(L=il(L,V.style,k)),d.style&&(L=il(L,d.style,k)),L=L||{},L.height=h,L.zIndex=`var(${Lg}-${d.computedVisibleIndex})`;let te=(0,Ge.useMemo)(()=>L,[L?JSON.stringify(L):null]),W=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:m)%2===1,de=b?W?"odd":"even":!1,ke=!1,ne=!1,We=!1,ct=!1;if(B&&me){let Oe=a(),St=Oe[e.indexInAll-1],go=Oe[e.indexInAll+1],Tt=D.computedVisibleColumns[d.computedVisibleIndex+1],Ue=D.computedVisibleColumns[d.computedVisibleIndex-1];ke=St?!B.isCellSelected(St.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?ne=!0:ne=Ue?!B.isCellSelected(e.id,Ue.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?We=!0:We=Tt?!B.isCellSelected(e.id,Tt.id):!0,ct=go?!B.isCellSelected(go.id,d.id):!0}let Mt=B&&me?{top:ke,left:ne,right:We,bottom:ct}:null,Sn=z!=null?i!==z:!1,hr=Ne,ia=Ie(),aa={domRef:w,cellType:"body",column:d,width:c,rowId:e.id,horizontalLayoutPageIndex:i,style:te,onMouseLeave:p,onMouseEnter:f,onClick:Se,afterChildren:hr,onMouseDown:Re,cssEllipsis:d.cssEllipsis??!0,className:J(Mt?mu(Mt):"",ni(d,[Po,xo],fu,{dragging:!1,insideDisabledDraggingPage:Sn,zebra:de,align:q,verticalAlign:$,rowDisabled:ce,rowActive:Z,cellSelected:me,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),qe,ut),renderChildren:(0,Ge.useCallback)(()=>ia,[Ie])},Tn=Un.Provider;return pe.createElement(Tn,{value:ee.current},pe.createElement(pi,{...aa}))}var ld=pe.memo(Hg);function Yn(){return(0,Ge.useContext)(Un)}function fi(){let{api:n,state:{editingValueRef:e,editingCell:t}}=Q(),{column:o,rowInfo:r}=Yn(),[i]=pe.useState(()=>t?.value),[a,l]=pe.useState(i),s=t?!t.active&&!!t.waiting:!1,u=pe.useCallback(f=>{e.current=f,l(f)},[]);pe.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function qn(n){return n.render(n.renderParam)??null}function it(n){let e=Un.Provider;return en.createElement(e,{value:n.renderParam},en.createElement(qn,{render:n.render,renderParam:n.renderParam}))}function sd(n){let e=Un.Provider;return en.createElement(e,{value:n.contextValue},n.children)}function no(n){let e=mi.Provider;return en.createElement(e,{value:n.renderParam},en.createElement(qn,{render:n.render,renderParam:n.renderParam}))}var ro=H(require("react"));var Bg={width:"100%",pointerEvents:"none"},al=`${pt}-menu`,ll=Yr({"data-name":""}),sl={[ll["data-name"]]:"menu-icon"};function Xn(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...Bg,borderTop:`${le.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return ro.createElement("div",{...o,style:e,...sl,onPointerDown:s=>s.stopPropagation(),className:J(t,nc({menuVisible:i,reserveSpaceWhenHidden:r}),pt,`${pt}-menu`)},a??ro.createElement(ro.Fragment,null,ro.createElement("div",{className:al,style:l}),ro.createElement("div",{className:al,style:l}),ro.createElement("div",{className:al,style:l})))}var tn=H(require("react")),Zn=require("react");var ud="_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";var kg={transition:"width 0.25s, opacity 0.25s"};function cd(n){let[e,t]=(0,Zn.useState)(!0),[o,r]=(0,Zn.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...kg,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,Zn.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let h=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),tn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,pt,ud,`${pt}-sort`)},c?tn.createElement("div",{"data-name":"index",style:g,className:ac},u):null,tn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:h}),tn.createElement("div",{style:{width:f[1],...m}}),tn.createElement("div",{style:{width:f[2],...m}}))}var md=H(require("react")),ul=require("react");var Qn=require("react"),Jn=H(require("react"));function dd(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){ge.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;ge.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?ba(l,i,o.current):ge.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){ba(u,i,o.current);continue}u.computedPinned!=="end"&&ge.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||ge.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function pd(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;ge.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&ge.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&ge.columnOffsets.set(c,d.computedOffset+s,u)}}}}var hi="zneyzh0 _16lm1iw2 _16lm1iw1d _16lm1iw1k _16lm1iw1i _16lm1iwk _16lm1iw1y",gi=ye({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1d _16lm1iw1i",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},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),yi=ye({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1f _16lm1iw1m",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Wg}=Pe,jg=`${Wg}HeaderCell_ResizeHandle`;function $g(n){let{state:{brain:e,headerBrain:t}}=Q(),o=(0,Qn.useRef)(null),[r,i]=(0,Qn.useState)(!1),a=(0,Qn.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=h=>{h.stopPropagation();let g=!!h.shiftKey,y=h.pointerId,C=h.clientX,T=h.target;if(e.isHorizontalLayoutBrain){let I=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{I(),P()}}T.setPointerCapture(y);let b=dd(n.columnIndex,{columns:n.columns,shareSpaceOnResize:g,domRef:o}),S=(I,{done:P}={})=>{s&&(I=I/(s+1),P&&(I=Math.round(I))),u==="end"&&(I*=-1);let{adjustedDiff:D,constrained:x}=n.computeResize({diff:I,shareSpaceOnResize:g});return a.current!==x&&i(x),b.resize(D),D},w=I=>{S(Math.round(I.clientX-C))},R=I=>{T.releasePointerCapture(y),T.removeEventListener("pointermove",w),T.removeEventListener("pointerup",R);let P=Math.round(I.clientX-C),D=S(P,{done:!0});p(),n.onResize({diff:D,shareSpaceOnResize:g})};T.addEventListener("pointermove",w),T.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return Jn.createElement("div",{ref:o,className:`${jg} ${hi} ${yi({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},Jn.createElement("div",{style:m,className:gi({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var fd=Jn.memo($g);function hd(n,e){let{computed:{computedVisibleColumns:t},getState:o,getComputed:r,actions:i}=Q(),a=(0,ul.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let d=o(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,h=r().computedVisibleColumns,g=!1,y=h.reduce((b,S)=>(S.computedFlex&&(b[S.id]={...p[S.id],flex:S.computedWidth},g=!0),b),{}),C=g?{...p,...y}:p;return ja({shareSpaceOnResize:c,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:u,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:C,items:h.map(b=>({id:b.id,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},[n]),l=(0,ul.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return n.computedResizable?md.createElement(fd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var vo=`${rt}HeaderCell`,gd=`${rt}HeaderWrapper`;var Ug=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||oo;return Te.createElement(s,{domProps:{className:Hr},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},mi=Te.createContext(null);var Yg=Y(U.columnZIndexAtIndex),cl=Te.createElement("div",{className:Ur[1]}),Cd=Yr({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function Sd(n){let e=n.column,{api:t,getComputed:o,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d,columnReorderInPageIndex:p},getDataSourceMasterContext:f}=Q(),{api:m,componentActions:h,getState:g,componentState:{filterDelay:y,filterTypes:C}}=be(),{allRowsSelected:T,someRowsSelected:b,selectionMode:S}=Co(),w=n.horizontalLayoutPageIndex,R=c===e.id,I=p!=null?w!==p:!1,{onResize:P,height:D,width:x,headerOptions:M,columnsMap:_}=n,A=e.computedSortInfo,F=e.header,v=(0,io.useCallback)(W=>{j.current=W,n.domRef?.(W)},[n.domRef]),E=M.alwaysReserveSpaceForSortIcon,O=e.headerAlign??e.align,z=(typeof O=="function"?O({isHeader:!0,column:e}):O)??"start",Z=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",oe=et(e,{actions:i,api:t,dataSourceActions:h,dataSourceApi:m,getComputed:o,getDataSourceState:g,getDataSourceMasterContext:f,getState:r}),ce=oe.isSortable(),se=ce&&(e.computedSorted||E)?Te.createElement(cd,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:le.spacing[2],marginInlineEnd:le.spacing[2]},className:`${vo}__sort-icon ${ic} ${lc({align:z})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,k=e.computedFilterable&&e.computedFiltered?Te.createElement(qo,null):null,re=e.headerCssEllipsis??e.cssEllipsis??!0,ie={reserveSpaceWhenHidden:z==="center",menuVisible:d===e.id,style:z==="end"?{marginInlineStart:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:le.spacing[2]}:{marginInlineEnd:`calc(${le.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:le.spacing[2]},domProps:{onMouseDown:W=>{W.stopPropagation(),oe.toggleContextMenu(W.target)}}},K=e.components?.MenuIcon||l?.MenuIcon||Xn,V=Te.createElement(K,{...ie}),j=(0,io.useRef)(null),q={horizontalLayoutPageIndex:w,dragging:R,domRef:v,htmlElementRef:j,insideColumnMenu:!1,column:e,columnsMap:_,columnSortInfo:A,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:b,allRowsSelected:T,selectionMode:S,api:t,dataSourceApi:m,columnApi:oe,renderBag:{sortIcon:se,filterIcon:k,menuIcon:V,menuIconProps:ie,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},$=q,N=()=>{let W={...q,renderBag:{...q.renderBag}};if(e.renderSortIcon&&(W.renderBag.sortIcon=Te.createElement(no,{render:e.renderSortIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderFilterIcon&&(W.renderBag.filterIcon=Te.createElement(no,{render:e.renderFilterIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),typeof e.renderMenuIcon=="function"&&(W.renderBag.menuIcon=Te.createElement(no,{render:We=>{if(typeof e.renderMenuIcon!="function")return null;let ct=e.renderMenuIcon(We);return ct?ct.type===K||ct.type===Xn?ct:Te.createElement(K,{...ie},ct):null},renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderSelectionCheckBox&&S==="multi-row"){W.renderBag.selectionCheckBox=Te.createElement(no,{render:Ug,renderParam:{...W,renderBag:{...W.renderBag}}});let We=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;We&&We!==!0&&(W.renderBag.selectionCheckBox=Te.createElement(no,{render:We,renderParam:{...W,renderBag:{...W.renderBag}}}))}F instanceof Function&&(W.renderBag.header=Te.createElement(no,{render:F,renderParam:{...W,renderBag:{...W.renderBag}}}));let de=e.renderMenuIcon===!1?null:W.renderBag.menuIcon,ke=re?Te.createElement("div",{className:Nt},W.renderBag.header):W.renderBag.header,ne=Te.createElement(Te.Fragment,null,z==="center"?cl:null,W.renderBag.selectionCheckBox,ke,W.renderBag.sortIcon,W.renderBag.filterIcon,z==="center"?cl:null,z!=="center"?cl:null,de);return e.renderHeader?Te.createElement(no,{render:e.renderHeader,renderParam:{...W,renderBag:{...W.renderBag,all:ne}}}):ne};(0,io.useEffect)(()=>{let W=null,de=j.current;return P&&de&&(W=In(de,P)),()=>{W?.()}},[j.current,n.onResize]);let ee={height:D};e.headerStyle&&(ee=typeof e.headerStyle=="function"?{...ee,...e.headerStyle($)||{}}:{...ee,...e.headerStyle});let Se=typeof e.headerClassName=="function"?e.headerClassName($):e.headerClassName,{onPointerDown:Re,proxyPosition:ue}=Kc({columnId:e.id,domRef:j,horizontalLayoutPageIndex:w}),B=null;R&&ue&&(B=Te.createElement("div",{key:e.id,className:`${vo}Proxy ${qu}`,style:{position:"absolute",height:D,width:x,left:ue.left??0,top:ue.top??0,zIndex:1e9}},$.renderBag.header),B=(0,yd.createPortal)(B,s.current));let ae=mi.Provider,me={filtered:e.computedFiltered,verticalAlign:Z,align:z},_e=Te.useMemo(()=>{let W=de=>{t.setColumnFilter(e.id,de)};return y>0?Et(W,{wait:y}):W},[y,e.id]),Ne=e.computedFilterType,Ie=C[Ne],Ke=e.computedFilterable?e.computedFilterValue?.filter.operator??Ie?.defaultOperator:void 0,He=e.computedFilterable&&Ie?Ie.operators.find(W=>W.name===Ke):void 0,Be=He?.components?.FilterEditor||Ie?.components?.FilterEditor||e.components?.FilterEditor||Qo,st=Ie?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,ut=hd(e,{horizontalLayoutPageIndex:w}),qe=`var(${Yg}-${e.computedVisibleIndex})`;ee.zIndex=qe;let L={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":z,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},te=e.computedFilterable?Te.createElement(Sc,{horizontalLayoutPageIndex:w,filterEditor:Be,filterOperatorSwitch:st??Tc,operator:He,filterTypes:C,onChange:_e,columnFilterType:Ne,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):Te.createElement(bc,null);return $.renderBag.filterEditor=te,Te.createElement(ae,{value:$},Te.createElement(pi,{domRef:v,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...L,"data-z-index":qe,style:ee,width:x,onPointerDown:Re,contentClassName:J(Yu(me),wu[z]),contentStyle:a?{height:D/2}:void 0,className:J(vo,Au.none,ce?bu.pointer:"",Se,ni(e,[vo,xo],Xu,{dragging:R,insideDisabledDraggingPage:I,align:z,verticalAlign:Z,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Uu),cssEllipsis:re,afterChildren:Te.createElement(Te.Fragment,null,a?te:null,ut),renderChildren:N}),B)}function Hn(){return(0,io.useContext)(mi)}var wt=H(require("react"));function Td(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",h=new Set,g=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,h);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let C=c.columnGroup,T,b=y;for(;C;){let S=e[C];if(S){h.add(C);let w=[p,...h];T=g.has(C)?i.get(C):void 0,T||(T={id:C,type:"group",ref:S,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[C],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(C)??0},r.set(w,T),i.set(C,T)),T.columnItems.push(y),T.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&T.children.push(b),b=T,C=S.columnGroup}else break}});let l=[],s=new X,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&bd(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function bd(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&bd(t.children),e+=o})}var Ao=H(require("react")),Ci=require("react");var pl=H(require("react"));var wd=H(require("react")),dl=require("react");var er=require("react"),tr=H(require("react"));var{rootClassName:qg}=Pe,Xg=`${qg}HeaderCell_ResizeHandle`;function Zg(n){let e=(0,er.useRef)(null),[t,o]=(0,er.useState)(!1),r=(0,er.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let h=!0,g=pd(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:S,adjustedDiffs:w,adjustedDiff:R}=n.computeResize(b);return r.current!==S&&o(S),g.resize(w),R},C=b=>{if(h){let S=n.groupColumns.reduce((I,P)=>I+P.computedWidth-P.computedMinWidth,0),w=n.brain.getAvailableSize(),R={width:w.width+S,height:w.height};n.brain.update(R),h=!1}y(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",C),m.removeEventListener("pointerup",T);let S=Math.round(b.clientX-f),w=y(S);n.onResize(w)};m.addEventListener("pointermove",C),m.addEventListener("pointerup",T)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:le.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return tr.createElement("div",{ref:e,className:`${Xg} ${hi} ${yi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},tr.createElement("div",{style:{...c,...n.style},className:gi({constrained:t})}))}var Rd=tr.memo(Zg);function Id(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=Q(),c=n[n.length-1],d=(0,dl.useCallback)(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:C,bodySize:T}=g,b=s().computedVisibleColumns,S=!1,w=b.reduce((P,D)=>(D.computedFlex&&(P[D.id]={...y[D.id],flex:D.computedWidth},S=!0),P),{}),R=S?{...y,...w}:y;return dc({availableSize:T.width,reservedWidth:C||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=(0,dl.useCallback)(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return n.some(h=>h.computedResizable)?wd.createElement(Rd,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var Pd=`${rt}HeaderGroup`,xd=Y(U.columnWidthAtIndex),Qg=Y(U.columnZIndexAtIndex);function Dd(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Id(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${xd}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${xd}-${u.computedVisibleIndex})`,d=`calc(var(${Qg}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,pl.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:J(oc,Pd),style:p,"data-z-index":d},pl.createElement("div",{className:J(`${Pd}__header-content`,Nt)},a),s)}var{rootClassName:Jg}=Pe,ey=[],vd=`${Jg}Header`,ty=Zu({overflow:!1});function oy(n){let{bodyBrain:e,columns:t,style:o,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=n,{computed:s,getState:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=Q(),{computedColumnsMap:f}=s,h={ref:(0,Ci.useRef)(null),className:J(vd,`${vd}--virtualized`,r,ty),style:{...o,height:i}},g=(0,Ci.useCallback)(y=>{let{rowIndex:C,colIndex:T,domRef:b,height:S,widthWithColspan:w,heightWithRowspan:R,hidden:I}=y,P=t[T];if(!P||I)return null;let D=c.isHorizontalLayoutBrain?c.getPageIndexForRow(C):null,x=a?a.pathsToCells.get([C,T]):null;if(x&&x.type==="group"){let M=x.columnItems.map(F=>F.ref),_={...x.ref,id:x.id,uniqueGroupId:x.uniqueGroupId,depth:x.depth,columns:M.map(F=>F.id),computedWidth:x.computedWidth,groupOffset:x.groupOffset};return u().columnGroupVisibility[x.id]!==!1?Ao.createElement(Dd,{horizontalLayoutPageIndex:D,bodyBrain:e,columnGroupsMaxDepth:l,domRef:b,columns:M,width:w,height:S,columnGroup:_}):null}return Ao.createElement(Sd,{domRef:b,column:P,horizontalLayoutPageIndex:D,headerOptions:d,width:w,height:R,columnsMap:f})},[d,t,i,a,l,p,c]);return Ao.createElement("div",{...h},Ao.createElement(Vr,{name:"header",renderCell:g,brain:c,cellHoverClassNames:ey,cellDetachedClassNames:Br}))}var Ad=Ao.memo(oy);function Md(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,r=Q(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:u,columnGroupsDepthsMap:c,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,h=m*u+(f?u:0),g=wt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return Td(l,p,c,d)},[l,p,c]),y=wt.useCallback(({rowIndex:R,colIndex:I})=>{let P=l[I],D=1,x=1;if(!P||!g)return{rowspan:D,colspan:x};let M=g.pathsToCells.get([R,I]);if(!M)return{rowspan:D,colspan:x};if(M.type==="column")return{colspan:x,rowspan:m-M.depth};let _=M.columnItems.findIndex(A=>A.id===P.id);return{rowspan:D,colspan:_===0?M.columnItems.length:1}},[p,d,l,g,m,c]),C=wt.useCallback(({rowIndex:R,colIndex:I})=>y({rowIndex:R,colIndex:I}).rowspan,[y]),T=wt.useCallback(({rowIndex:R,colIndex:I})=>y({rowIndex:R,colIndex:I}).colspan,[y]),b=wt.useCallback(R=>f?R<m-1?u:2*u:u,[m,f,u]);kr(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:C,colspan:T},{fixedColsEnd:a.length,fixedColsStart:i.length});let S=wt.createElement(Ad,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),w=o.vertical&&Jt()?wt.createElement("div",{className:rc,style:{zIndex:1e3,width:Jt()}}):null;return wt.createElement("div",{className:`${gd} ${sc}`,style:{height:h}},S,w)}var kt=H(require("react")),Nd=require("react");function Ed(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Fd={padding:le.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},ny={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},_d=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(Ed(t),o,"important")},Od=kt.forwardRef(function(e,t){let{rootClassName:o}=$r(),r=kt.useRef(null),i=kt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Nd.useEffect)(()=>{let a=()=>{setTimeout(()=>{_d(r.current,Fd),_d(r.current?.firstElementChild,ny)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),kt.createElement("div",{ref:i,...e,className:J(`${o}-Footer`,Rc,e.className),style:Fd},"Powered by"," ",kt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});var on=H(require("react"));var Ld={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i"},Vd="qy58ya3 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",zd="qy58ya4";var{rootClassName:ry}=Pe,fl=`${ry}-LoadMask`;function iy(n){let{visible:e,children:t="Loading"}=n;return on.createElement("div",{className:`${Ld[e?"visible":"hidden"]} ${fl}`},on.createElement("div",{className:`${Vd} ${fl}-Overlay`}),on.createElement("div",{className:`${zd} ${fl}-Text`},t))}var Si=on.memo(iy);function ml(n){return n.map(Lt)}function Lt(n){if(De().structuredClone)return De().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return ml(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(ml(Array.from(n)));if(n instanceof Map)return new Map(ml(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Lt(n[t]));return e}function or(n){return n}var Mo=Object.seal({data:null,field:null});var lo="____root____",Kd="____not_loaded_yet____";function ao(){return!1}function hl(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function Ti(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function Hd(n,e){let{reducers:t={},pivot:o,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=n,u=new X;function c(g,y,C,T=0,b=[]){let S=!C.length||T===C.length-1,w=y[s?.values||"values"]||{};for(let R in w)if(w.hasOwnProperty(R)){let I=R;b.push(I),d.set(b,!0),g.set(b,{reducerResults:w[R][s?.totals||"totals"]||{},items:[]}),S||c(g,w[R],C,T+1,b),b.pop()}}let d=o?new X:void 0,p=[],f=hl(t),m=Lt(f);e.visitDepthFirst((g,y,C,T)=>{let[b,...S]=y,w=g.children,R=u.get(S);if(R&&(R.cache=g.cache,R.childrenLoading=g.childrenLoading,R.childrenAvailable=g.childrenAvailable,R.error=g.error),S.length==r.length&&r.length){if(R){R.items=w;for(let P=0,D=S.length;P<D;P++){let x=S.slice(0,P),M=u.get(x);M&&(M.items=M.items||[],M.items=M.items.concat(w))}w=i.indexArray(w,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return T?.()}for(let I=0,P=w.length;I<P;I++){if(!w[I]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...S,`${Kd}${I}`],_);continue}let D=w[I].data,x=w[I].keys||[];if(x.length){let _=x[x.length-1];S.push(_)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:D,totalChildrenCount:w[I].totalChildrenCount,reducerResults:w[I].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(S,M),o){let _=M.pivotDeepMap=new X,A=w[I].pivot;c(_,A,o,0,p)}x.length&&S.pop()}T?.()});let h={deepMap:u,groupParams:n,initialData:e,reducerResults:m};return o&&(h.topLevelPivotColumns=d,h.pivot=o),h}function Gd(n,e,t,o,r,i,a,l,s,u=or){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&Ti(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],C=h?o[h]:null;g&&(Mo.data=o,Mo.field=h,C=g(Mo));let T=(y||u)(C,o);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Lt(s),items:[]}));let{reducerResults:b,items:S}=p.get(t);S.push(o),a&&Ti(o,r,a,b,e)}t.length=0}}function Bd(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let y=0,C=o.length;y<=C;y++){let T=o.slice(0,y),b=e.get(T),{reducerResults:S,items:w}=b;w.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&Ti(r,i,a,S,T)}return}let m=Lt(l),h=[];e.set(p,{items:h,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let g=u(r);if(!(!g||!Array.isArray(g))){for(let y=0,C=g.length;y<C;y++){let T=g[y];Bd(n,e,t,p,T,y,a,l)}a&&nr(a,m,h)}}function kd(n,e){let{reducers:t}=n,o=hl(t),r=Lt(o),i=new X,a=new X;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,u=e.length;s<u;s++)Bd(n,i,a,[],e[s],s,t,o);return t&&nr(t,r,e),{deepMap:i,treeParams:n,treePaths:a,initialData:e,reducerResults:r}}function Ri(n,e){let{groupBy:t,defaultToKey:o=or,pivot:r,reducers:i}=n,a=t.length,l=r?new X:void 0,s=new X,u=[],c=[],d=hl(i),p=Lt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Lt(d)};r&&(m.pivotDeepMap=new X),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let C=0;C<a;C++){let{field:T,groupField:b,valueGetter:S,toKey:w}=t[C],R=T?g[T]:null;S&&(Mo.data=g,Mo.field=T,R=S(Mo));let I=(w||o)(R,g);if(y[T||b]=I,u.push(I),!s.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Lt(d)};r&&(P.pivotDeepMap=new X),s.set(u,P)}Gd(s,u,c,g,m,r,i,l,d,o)}a||Gd(s,u,c,g,m,r,i,l,d,o),i&&Ti(g,m,i,p,u),u.length=0}i&&(s.visitDepthFirst((m,h,g,y)=>{nr(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:T},b,S,w)=>{nr(i,T,C),w?.()}),y?.()}),nr(i,p,e));let f={deepMap:s,groupParams:n,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function Wd(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function ay(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let C in i)if(i.hasOwnProperty(C)){let b=i[C].field;b&&(f[b]=u[C]),b&&p[b]==null&&(p[b]=u[C])}}let m=!0,h=o[o.length-1],g=h;if(p!=null){let C=t[o.length-1];C&&C.field&&(g=p[C.field]),C&&C.toKey&&(g=C.toKey(g,p)),g=g??h}return typeof g=="string"&&g.startsWith(Kd)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:ao,hasSelectedCells:ao,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function bi(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function nr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function jd(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:y}=r,{deepMap:C}=c,T=n.length,b=t[t.length-1],S=b?b.nodeExpanded:!0;for(let w=0;w<T;w++){let R=n[w],I=u(R,w),P=[...e,I];if(l(R)){let v={id:I,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:ao,hasSelectedCells:ao,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,w],indexInParent:w,indexInAll:S?i.length:-1};p&&(v.rowSelected=p(v)),d&&(v.rowDisabled=d(v)),f&&f(v);let E=g&&y!=null&&y>0&&v.indexInAll%y===0?v.indexInAll/y:null;for(let O=0,z=t.length;O<z;O++){let Z=t[O];if(S||(Z.collapsedLeafNodesCount+=1),Z.deepRowInfoArray.push(v),E!=null&&S){if(typeof g=="function"&&g(Z)!==!0)continue;let oe=bi(Z,v.indexInAll,E);i[oe.indexInAll]=oe,v.indexInAll++}}S&&(i[v.indexInAll]=v);continue}let M=C.get(P)?.totalLeafNodesCount??0,_={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:I,data:R,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...o,w],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:ao,hasSelectedCells:ao,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(_.rowSelected=p(_),h)){let v=h.getSelectionCountFor(_.nodePath);_.selectedLeafNodesCount=v.selectedCount,_.deselectedLeafNodesCount=v.deselectedCount}d&&(_.rowDisabled=d(_)),f&&f(_);let A=!0;if(m&&(_.selfExpanded=A=m(_)),S||(A=!1),_.nodeExpanded=A,S&&g&&y!=null&&y>0){let v=_.indexInAll,E=_.parentNodes;if(E.length>0&&v%y===0){let O=v/y,z=0;E.forEach(Z=>{typeof g=="function"&&g(Z)!==!0||(i.push(bi(Z,v+z,O)),z++,_.indexInAll++)})}}S&&(i[_.indexInAll]=_);let F=s(R);Array.isArray(F)&&jd(F,P,[...t,_],_.indexInParentNodes,r,i)}return i}function $d(n){let{dataArray:e}=n,t=[];return jd(e,[],[],[],n,t),{data:t}}function Ud(n){let{lazyLoad:e,groupResult:t,rowsPerPage:o,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:u,rowSelectionState:c,generateGroupRows:d,reducers:p={}}=n,{groupParams:f,deepMap:m,pivot:h}=t,{groupBy:g}=f,y=[],C=[],T=[],b=[];return m.visitDepthFirst((S,w,R,I)=>{let P=S.items,D=w.length,x=l?.isGroupRowCollapsed(w)??!1;b.push(R);let M=ay({lazyLoad:e,groupBy:g,parents:Array.from(T),reducers:p,indexInGroup:R,indexInParentGroups:Array.from(b),indexInAll:y.length,groupKeys:w,error:S.error,totalChildrenCount:S.totalChildrenCount,childrenLoading:(S.childrenLoading||!x&&!S.childrenAvailable)&&e,childrenAvailable:S.childrenAvailable,directChildrenCount:w.length===g.length?S.items.length:m.getDirectChildrenSizeFor(w),directChildrenLoadedCount:0},S);if(u&&(M.rowSelected=u(M),c)){let E=c.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=E.selectedCount,M.deselectedChildredCount=E.deselectedCount}s&&(M.rowDisabled=s(M));let _=T[T.length-1],A=_?.collapsed??!1;A&&(x=!0),M.collapsed=x;let F=d||x;if(A&&(F=!1),F){if(r&&o!=null&&o>0){let E=M.indexInAll,O=M.parents;if(O.length>0&&E%o===0){let z=E/o,Z=0;O.forEach(oe=>{typeof r=="function"&&r(oe)!==!0||(y.push(bi(oe,E+Z,z)),Z++,M.indexInAll++)})}}y.push(M),C.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(E=>{E.deepRowInfoArray.push(M),E.collapsedGroupsCount+=x?1:0}),_&&M.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),i&&i(M),T.push(M);let v=!0;if(v){if(I)I();else if(!h){let E=y.length;x||(y.length+=P.length);let O=0;for(let z=0,Z=P.length;z<Z;z++){let oe=P[z];if(!x&&r&&o!=null&&o>0){let k=E+z+O;if(k%o===0){let re=k/o;T.forEach(ie=>{if(typeof r=="function"&&r(ie)!==!0)return;let K=E+z+O;y[K]=bi(ie,K,re),O++,y.length++})}}let ce=E+z+O,G={id:oe?a(oe,ce):`${w}-${z}`,data:oe,isCellSelected:ao,hasSelectedCells:ao,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!oe,rowSelected:!1,rowDisabled:!1,rootGroupBy:g,collapsed:x,groupKeys:w,parents:Array.from(T),indexInParentGroups:[...b,z],indexInGroup:z,indexInAll:ce,groupBy:g,groupNesting:D+1,groupCount:M.groupCount};u&&(G.rowSelected=u(G)),s&&(G.rowDisabled=s(G)),i&&i(G),T.forEach((k,re)=>{re===T.length-1&&oe&&(k.directChildrenLoadedCount+=1),x&&(k.collapsedChildrenCount+=1),k.deepRowInfoArray.push(G)}),x||(y[E+z+O]=G)}}}T.pop(),b.pop()}),{data:y,groupRowsIndexes:C}}var Pp=H(require("react"));var ly=()=>{};function Yd(n,e){let t=new X,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,!0,1);for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function qd(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=ot(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let h=0,g=m.length;h<g;h++){let y=m[h];qd(n,e,d,y)}});p?(u?.(o),s?.(o,ly)):(l?.(o,f,i(o)),s?.(o,f))}function Xd(n,e,t){for(let o=0,r=t.length;o<r;o++)qd(n,e,[],t[o])}var sy=function(n,e){return n-e},uy=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},cy=function(n,e){return n-e},dy={number:sy,string:uy,date:cy},rr=dy;function Zd(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var Vt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get;return e.sort(Qd(Zd(n),o)),e},wi=(n,e,t)=>{let o=Qd(Zd(n),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(o):e=[...e].sort(o));let{nodesKey:a,toKey:l}=t,s=c=>c[a],u=c=>c[a]===void 0;return Xd({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(c,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(o):[...p].sort(o);c[a]=f}r||d()}},e),r&&(i?e.sort(o):e=[...e].sort(o)),e};Vt.knownTypes=rr;var py=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=Vt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(Vt.knownTypes).join(", ")}`)}return r||(r=rr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:o*u}},fy=n=>n.map(py).filter(e=>e instanceof Function),Qd=(n,e)=>{let t=fy(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var Ii=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new X(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new X(t.map(r=>[r,!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(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var at=class extends Ii{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function nn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||or)(l,n);return t.push(s),t},[])}var Ce=class{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new X;this.deselectedMap=new X;this.onlyUsePrimaryKeys=!1;this.selectionCache=new X;this.selectionCountCache=new X;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?nn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new Ce(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,p=this.deselectedMap.getKeysStartingWith(e,!0,1).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var my=dt("CellSelectionState"),hy="*",Ee=class{constructor(e){this.wildcard=hy;this.cache=new X;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),o)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(console.error("CellSelectionState.isCellSelected should not be called with wildcard"),my("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var ep=Xe("InfiniteTable");var gy="#eb9316";var tp="Warn",yy="Error",Cy="Info",Sy="Success",Ty="Logs",Pi=ep.extend(Ty),EM=Pi.extend(Cy),by=Pi.extend(tp),FM=Pi.extend(yy),_M=Pi.extend(Sy);var Ry=gy;var wy=(n,e)=>{e=e?e.extend(tp):by,e(ep.color(Ry,n))};var Jd=new X,Iy=(n,...e)=>{Jd.has(e)||(Jd.set(e,!0),n())};var xi=(n,e=n,t)=>{Iy(()=>wy(n,t),e,"warn")};function Di(n,e){return new Ce(n,tt(e))}function tt(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function op(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ce))throw"Invalid row selection";let a=new Ce(r,tt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Ce))throw"Invalid row selection";let a=new Ce(r,tt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ce))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?nn(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Ce))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?nn(d,u):[]}let c=new Ce(a,tt(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Ce))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?nn(d,u):[]}let c=new Ce(l,tt(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ce))throw"Invalid row selection";let s=new Ce(a,tt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ce))throw"Invalid row selection";let s=new Ce(a,tt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Ce))throw"Invalid row selection";let s=new Ce(a,tt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Ce(i,tt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Ce))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ce(r,tt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var gl=new WeakMap,Py=n=>n;function np(n,e=50,t){gl.set(n,{lastCallTime:0,lastCallArg:null});let o=t??Py;return r=>{let{lastCallTime:i,lastCallArg:a}=gl.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=to(o(a),o(r));s<e&&u||(gl.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var vi=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new X;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let h=!1;if(m!=null){let g=r(m),y=s?[...p,g]:void 0,C=s&&!!y,T=C?o?.getMutationsForNodePath(y):o?.getMutationsForPrimaryKey(g);if(T&&T.length){for(let b=0,S=T.length;b<S;b++){let w=T[b];if(w.type==="delete"&&!h&&(C?this.removeNodePath(y,t):this.remove(g),h=!0,d.splice(f,1),f--),w.type==="update"&&!h&&(m={...m,...w.data},d[f]=m),w.type==="update-children"&&!h){let R=w.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}w.type==="insert"&&(w.position==="before"?(d.splice(f,0,w.data),f--):d.splice(f+1,0,w.data))}C?o?.removeNodePathInfo(y):o?.removeInfo(g)}if(!h)if(C){this.addNodePath(y,m);let b=a(m),S=b?null:i(m);!b&&Array.isArray(S)&&(p.push(g),u&&(m[l]=S=S.concat()),c(S,p),p.pop())}else this.add(g,m)}}};c(e,[])}return e}}};var Ye=require("react");var Eo=require("react");function Fo(n,e){let t=(0,Eo.useRef)({}),o=(0,Eo.useRef)({}),r=o.current,i=(0,Eo.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Eo.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function xy(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Eo.useEffect)(n,t)}function yl(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Cl(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Sl(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function rp({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=ot(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Cl({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&g?.(),m.length===a){let y=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let b=T;T=m.join("/");let S=m[m.length-1];u[T]=Sl({header:`${S}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:S})}l.forEach((b,S)=>{let w=d?`${m[m.length-1]}`:b.name||b.id,R=Cl({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:S,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:T,header:w,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),I=`${b.id}:${m.join("/")}`;s[I]=R})}else{let y=m.join("/"),C=m.slice(0,-1);if(u[y]=Sl({columnGroup:C.length?C.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let T=e[m.length-1],b=C.length?C.join("/"):void 0;if(!d){let S=b;b=`total:${m.join("/")}`,u[b]=Sl({header:`${m[m.length-1]} total`,columnGroup:S,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((S,w)=>{let R=d?`${m[m.length-1]} total `:`${S.name||S.id} total`,I=Cl({columnGroup:b,header:R,pivotAggregator:S,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[S.id]:null});s[`total:${S.id}:${m.join("/")}`]=I})}}(t==="start"||t===!1)&&g?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var ip=Symbol("CLEAR"),Wt=class{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new X;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=ip,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(ip);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>X.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new Wt({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:X.clone(e.nodePathToData),o}};function so(n,e){return e().dataArray[n]}function Ai(n){return n().dataArray}var Qe=class{constructor(e){this.collapsedPathsMap=new X;this.expandedPathsMap=new X;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 t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Dy=(n,e)=>n.length-e.length,$e=class{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new X;this.cache=new X;let o=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(o)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let o=this.getTreeDeepMap().get(e);return o?o.items.length:1}static from(e,t){return new $e(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(Dy);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:h}=this.getSelectionStateForNode(f);if(c?(s-=h,u+=h):(u-=m,s+=m),t&&m>0&&h>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function Ei(n,e){return new $e(n,rn(e))}function rn(n){return()=>({treeDeepMap:(typeof n=="function"?n():n).treeDeepMap})}var Mi=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof $e))throw"Invalid tree selection";let a=new $e(r,rn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new Qe({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new Qe({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Qe(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Qe(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new Qe(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let o=this.getRowInfoByPath(e);return o?o.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?so(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof $e))throw"Invalid node selection";let o=new $e(e,rn(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof $e))throw"Invalid node selection";let o=new $e(e,rn(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof $e))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var an=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!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(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var lt=class extends an{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Tl=1e3;function ap(n){return new bl(n)}var bl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Ai(this.getState);this.getRowInfoByIndex=e=>so(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Tl:r;return isNaN(a)||(a=Tl),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new lt(o):new lt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new lt({enabledRows:!0,disabledRows:[]});return}let t=new lt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new lt({disabledRows:!0,enabledRows:[]});return}let t=new lt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Mi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?Wt.clone(t,{light:!0}):new Wt({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Tl,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function lp(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let h=m.field;if(h&&(h=Array.isArray(h)?h:[h],t=h.reduce((g,y)=>g||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let h=d[m];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function Fi(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function _i(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function Ni(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function wl(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var zt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function Rl(){return!1}function vy(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Rl,hasSelectedCells:Rl};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var Ay=ot(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
1
+ "use strict";var Dh=Object.create;var Fr=Object.defineProperty;var vh=Object.getOwnPropertyDescriptor;var Ah=Object.getOwnPropertyNames;var Eh=Object.getPrototypeOf,Mh=Object.prototype.hasOwnProperty;var _h=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Fh=(n,e)=>{for(var t in e)Fr(n,t,{get:e[t],enumerable:!0})},_s=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ah(e))!Mh.call(n,r)&&r!==t&&Fr(n,r,{get:()=>e[r],enumerable:!(o=vh(e,r))||o.enumerable});return n};var B=(n,e,t)=>(t=n!=null?Dh(Eh(n)):{},_s(e||!n||!n.__esModule?Fr(t,"default",{value:n,enumerable:!0}):t,n)),Oh=n=>_s(Fr({},"__esModule",{value:!0}),n);var Xo=_h((xb,uu)=>{uu.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var pS={};Fh(pS,{CellSelectionState:()=>Ne,DataClient:()=>ga,DataSource:()=>SC,DataSourceActionType:()=>$p,DeepMap:()=>q,FixedSizeSet:()=>Dr,FlashingColumnCell:()=>Ch,GroupRowsState:()=>lt,InfiniteTable:()=>Xt,InfiniteTableClassName:()=>Lt,InfiniteTableComponent:()=>lh,Menu:()=>Et,RowDetailCache:()=>Cn,RowDetailState:()=>ht,RowDisabledState:()=>st,RowSelectionState:()=>Se,TreeDataSource:()=>aS,TreeExpandState:()=>Ze,TreeGrid:()=>ch,TreeSelectionState:()=>We,WeakFixedSizeSet:()=>vr,alignNode:()=>cs,components:()=>dS,createFlashingColumnCellComponent:()=>xs,debounce:()=>_t,debug:()=>Ge,defaultFilterTypes:()=>ao,eventMatchesKeyboardShortcut:()=>oa,filterTypes:()=>ao,flatten:()=>ap,getComponentStateRoot:()=>Ot,group:()=>Oi,interceptMap:()=>ph,keyboardShortcuts:()=>dh,multisort:()=>zt,multisortNested:()=>Ni,queryKeyToCacheKey:()=>Wo,toTreeDataArray:()=>cp,useComponentState:()=>He,useDataSourceInternal:()=>yn,useDataSourceState:()=>Po,useEffectWhen:()=>ya,useEffectWhenSameDeps:()=>fh,useEffectWithChanges:()=>Ko,useEffectWithObject:()=>qy,useGridScroll:()=>pa,useInfiniteColumnCell:()=>ir,useInfiniteColumnEditor:()=>xi,useInfiniteColumnFilterEditor:()=>ln,useInfiniteHeaderCell:()=>Qn,useInfinitePortalContainer:()=>nh,useManagedDataSource:()=>kl,useMasterRowInfo:()=>RC,useOverlay:()=>Kt,useOverlayPortal:()=>mm,usePrevious:()=>ro,useRowInfoReducers:()=>bC,useVisibleColumnSizes:()=>Ym});module.exports=Oh(pS);function _t(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var he=B(require("react"));var ee=(...n)=>n.filter(e=>!!`${e}`).join(" ");var wo=B(require("react")),_a=require("react");function fe(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=null;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function et(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Fs=(n,e)=>n-e;var wa=(n,e)=>Fs(n.revision,e.revision),q=class{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,h=p===this.emptyKey;if(h&&!u)return;let g=h?[]:[...e,p],y=m?()=>this.visitWithNext(g,t,o,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let C=t(f.value,g,l,y,f);if(o&&C===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(p,d);if(o&&f===!0)return f}};this.fill(e)}static clone(e){let t=new q;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push(a)},t,o),r}getEntriesStartingWith(e,t,o){let r=[];return this.getStartingWith(e,(i,a)=>{r.push([i,a])},t,o),r}getUnnestedKeysStartingWith(e,t,o){let r=[],i=u=>{r.push(u)},a=this.map,l,s=!1;if(e.length)for(let u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-1){s=!0;break}else return[];a=l.map}else if(!t&&a.has(this.emptyKey))return[[]];return l&&l.value!==void 0&&(t||(i({...l,keys:e}),s=!0)),s?r.sort(wa).map(u=>u.keys):(this.visitWithNext(e,(u,c,d,p,f)=>{i({...f,keys:c})},!1,a,o,t),r.sort(wa).map(u=>u.keys))}getKeysStartingWith(e,t,o){let r=[];return this.getStartingWith(e,i=>{r.push(i)},t,o),r}getStartingWith(e,t,o,r){let i=this.map,a,l=!1;if(e.length)for(let s=0,u=e.length;s<u;s++){let c=e[s];if(a=i.get(c),!a||!a.map)if(l=!0,s===u-1){l=!0;break}else return;i=a.map}a&&a.value!==void 0&&(o||t(e,a.value)),!l&&this.visitWithNext(e,(s,u,c,d)=>{t(u,s),d?.()},!1,i,r,o)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let o=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((o,r)=>{let{map:i}=o;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let o=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.map,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.length-1],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],u=et(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}getArray(e){let t=[];return this.visit((o,r)=>{let i=e({...o,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(wa);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};function Me(){return globalThis}var Nr=["#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"],Os=Symbol("color"),Or=new WeakMap,Pa=fe();function xa(n=Nr){Or.set(n,n.map(e=>0))}xa();var Nh=(n=Nr)=>{let e=[];Or.has(n)?e=Or.get(n):(e=n.map(o=>0),Or.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??Nr[0]},_n=":",Da="*",Ns="-",Lh=",",Vh="debug",zh="diffdebug",Vs=!1,Mn=new q,Fn=new Map;function va(n,e){let t=n.split(_n),o=new q;o.set(t,!0);let r=e.split(_n),i=new Set(r).has(Da),a=r.indexOf(Da),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,i).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(_n)):!0}}function Gh(n,e){let t=`channel=${n}_permissions=${e}`;if(Fn.has(t))return Fn.get(t);let o=e.split(Lh);function r(l){return Fn.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Da)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Ns);if(u&&(s=s.substring(Ns.length)),va(n,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),va(n,s))return r(!u)}return r(!1)}var Aa=()=>Ge.enable??(Me()&&Me().localStorage?.getItem(Vh))??"",Kh=()=>Ge.diffenable??(Me()&&Me().localStorage?.getItem(zh))??`${Vs}`,Ea="",zs=Vs;function Ma(n){zs=`${Kh()}`=="true",Ea!==n&&(Ea=n,Fn.clear())}function Gs(n){Ma(Aa()),typeof Me()<"u"&&Me().addEventListener&&Me().addEventListener("storage",function(){Ma(Aa())});function e(t,o){let r=o?`${o}${_n}${t}`:t,i=r.split(_n),a=Mn.get(i);if(a)return a;let l=Mn.get(i.slice(0,-1)),s=(l?l.logFn:Ge.logFn)??Ks,u=s,c,d=0,p=()=>c??Gh(r,Ea),f=Nh(Ge.colors),m=Object.defineProperties((...h)=>{let g=Pa.getListenersCount(),y;if(g>0&&(y=y??Date.now(),Pa({color:f,channel:r,args:h,timestamp:y})),p()){if(y=y??Date.now(),d&&zs){let b=y-d;u(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let C=[],S;if(h.forEach(b=>{if(b[Os])S===void 0&&(S=!0),C.push(...b);else{if(typeof b!="string"&&typeof b!="number"){S=!1;return}C.push(`${b}%s`)}}),S){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...C,""];u(...b)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...h)}},{channel:{value:r},color:{value:(h,...g)=>{let y=[`%c${g.join(" ")}%c%s`,`color: ${h}`,""];return y.toString=()=>g.join(" "),y[Os]=!0,y}},extend:{value:h=>e(h,r)},enabled:{get:()=>p(),set:h=>{c=h}},logFn:{configurable:!1,get:()=>u,set:h=>{u=h??s}},destroy:{value:()=>{Mn.delete(i)}}});return Mn.set(i,m),m}return e(n)}var Ks=console.log.bind(console),Ls;Object.defineProperty(Gs,"enable",{get:()=>Ls,set:n=>{Ls=n,Ma(Aa())}});var Ge=Gs;Ge.colors=Nr;Ge.logFn=Ks;var Hh=(n,e)=>Pa.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;va(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ge.onLogIntent=Hh;Ge.destroyAll=()=>{xa(),xa(Ge.colors),Mn.clear(),Fn.clear()};var ct=n=>{let e=Ge(n?`${n}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Zt=n=>{let e=Ge(n?`${n}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},On=()=>On;On.extend=()=>On;var rt=class{constructor(e){this.debug=On,this.error=On}};var Bh=B(require("react")),Qt=require("react");var Nn=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?_t(e,{wait:o}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=n.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(n),()=>{a.disconnect()}},Lr=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,Qt.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Nn(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Qt.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,Qt.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var kh=Zt("CSSVariableWatch"),Wh=ct("CSSVariableWatch"),jh={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},$h=n=>{let e=(0,_a.useRef)(0),t=wo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);Lr(n.ref,t,{earlyAttach:!0}),wo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o)return e.current=o,Wh(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);kh(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},Ln=n=>{let e=(0,_a.useRef)(null);$h({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return wo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:jh},wo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var zr=B(require("react"));var Hs=B(require("react")),Fa;function Vn(){return Fa||(Fa=Hs.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}var Bs=B(require("react")),Oa;function Vr(){return Oa||(Oa=Bs.createContext(void 0))}function Po(){let n=Vn();return zr.useContext(n).componentState}function we(){let n=Vn();return zr.useContext(n)}function ze(){let n=Vr();return zr.useContext(n)}var vo=B(require("react")),It=require("react");var Gr=B(require("react"));function Uh(n){let{height:e,width:t,count:o}=n;return Gr.createElement("div",{"data-count":o,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var ks=Gr.memo(Uh);var Ws="mlx2t3";var Kr=B(require("react")),Qs=require("react");var js=require("react"),$s=(n,e)=>{(0,js.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Us={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Ys={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},qs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Na="_1ueijco1",Xs="_1ueijco0 _16lm1iw0";var Zs=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Us[`${n}`]:e=ee(Ys[`${n.horizontal}`],qs[`${n.vertical}`]),e};var Yh="InfiniteVirtualScrollContainer";var Js=Kr.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,Qs.useRef)(null);return $s(c,i),Kr.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:ee(a,Yh,Xs,Zs(r))},o)});var qr=B(require("react")),to=require("react");var eu=B(require("react")),Uo=require("react");function qh(n){let[e,t]=(0,Uo.useState)(n.updater.get),o=(0,Uo.useRef)(null);return(0,Uo.useEffect)(()=>{function r(a){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=n.updater.onChange(r);return()=>{o.current!=null&&cancelAnimationFrame(o.current),i()}},[n.updater,n.useraf]),e??null}var Jt=eu.memo(qh);function Yo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function tu(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}function X(n){return n.slice(4,-1)}var it="Infinite",ve={rootClassName:it};var Y={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)",columnZIndexAtIndex:"var(--_16hkbkch)",pinnedStartWidth:"var(--_16hkbkci)",pinnedEndWidth:"var(--_16hkbkcj)",pinnedEndOffset:"var(--_16hkbkck)",computedVisibleColumnsCount:"var(--_16hkbkcl)",baseZIndexForCells:"var(--_16hkbkcm)",bodyWidth:"var(--_16hkbkcn)",bodyHeight:"var(--_16hkbkco)",scrollbarWidthHorizontal:"var(--_16hkbkcp)",scrollbarWidthVertical:"var(--_16hkbkcq)",scrollLeft:"var(--_16hkbkcr)",scrollTop:"var(--_16hkbkcs)"};var ou="true",se={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)",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:{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)",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)"}}},nu="column-header-height";var ru=`.${ve.rootClassName}`;function La(n){return Yo(n,ru)}var iu=X(Y.scrollLeft),Xh=X(Y.scrollTop),Zh=X(Y.columnWidthAtIndex),Va=X(Y.columnOffsetAtIndex),au=X(Y.columnReorderEffectDurationAtIndex),Qh=X(Y.columnOffsetAtIndexWhileReordering),Jh=X(Y.columnZIndexAtIndex);function Ht(n,e,t){let o=t?La(t):document.querySelector(ru);eg(n,e,o)}function eg(n,e,t){if(t){let o=n,r=Y[o]?X(Y[o]):n;t.style.setProperty(r,`${e}`)}}function qo(n,e){if(e)for(var t in n){let o=Y[t]?X(Y[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function za(n,e,t){Ht(`${Va}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${iu}))`:`${n.computedAbsoluteOffset+e}px`,t)}function Ga(n,e,t){Ht(`${Jh}-${n}`,`${e}`,t)}function zn(n,e,t){Ht(`${Qh}-${n}`,typeof e=="number"?`calc( var(${Va}-${n}) + ${e}px )`:e,t)}function Hr(n,e,t){Ht(`${au}-${n}`,t??"",e)}function lu(n,e){let t=`${au}-${n}`;Ht(t,se.components.Cell.reorderEffectDuration,e)}var Te={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Zh}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Ht(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${Va}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Ht(this.varName.get(n),e,t)}}};function su(n,e){qo({[iu]:`${n.scrollLeft}px`,[Xh]:`${n.scrollTop}px`},e)}var Ae=Me().requestAnimationFrame||(n=>setTimeout(n,16)),Rt=Me().cancelAnimationFrame||(n=>clearTimeout(n));var cu=B(Xo());var Ka=(n,e)=>n-e,Bt={horizontal:!0,vertical:!0};function Br(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var Ha="DebugID=";function eo(n,e){return e&&e.startsWith(Ha)?e:e?`${Ha}${n}:${e}`:`${Ha}${n}`}var kr={start:0,end:0},Ba=n=>{n()},ka=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},du=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Gn=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function tg(n){return n.horizontalChange||n.verticalChange}var xo=class extends rt{constructor(t){let o=eo(t,`${t}:MatrixBrain`);super(o);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=kr;this.verticalExtendRangeBy=kr;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=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{Gn(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ba:Gn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ba:Gn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:o}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:o);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=Bt)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Bt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.startIndex,s=t.startIndex,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=o.startIndex,u=o.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=Bt)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof o!="function",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,endIndex:f}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,o),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,cu.default)(a,t,Ka);return p>=0?p:~p-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],u=i[t-1];s==null&&console.error(`Offset was not available for ${o==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,h={rowIndex:t,colIndex:o};for(;f<=m;f++)if(d[f]===void 0){h[r==="horizontal"?"colIndex":"rowIndex"]=f;let g=s(h);d[f]=f,p[f]=g;let y=f;for(;g>1;)y+=1,d[y]=f,p[y]=0,g-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,o,r),u||(u=s.get(l)),u[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,u=Math.min(t,r-1);for(;s<=u;s++)this.computeCacheFor(s,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ka;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=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Bt){t.vertical&&this.resetVertical(),t.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}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0}getVirtualColIndex(t,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",h=typeof i=="number",g=m&&r!==this.rows,y=h&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),h&&(this.cols=i);let C=a!=null,S=l!=null,b=C&&a!==this.rowHeight,T=S&&l!==this.colWidth;C&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,R=t.colspan!=null,w=I&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let x=y||T||p||P,D=g||b||f||w;(o||tg)({horizontalChange:x,verticalChange:D,colsChanged:y,colWidthChanged:T,widthChanged:p,colspanChanged:P,rowsChanged:g,rowHeightChanged:b,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:o}=t,r=o==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:o})}}updateRenderCount(t=Bt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Bt){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ba:Gn;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof o=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=Br(l,c)}else a=(o?Math.ceil(l/o):0)+1;return a+=s+u,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{Gn(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let o=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=kr,this.verticalExtendRangeBy=kr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ja=B(Xo());function pu(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function fu(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function Kn(n,e){for(let t of n)if(e(t))return t}var hu=B(require("react"));var mu=new Map,og=()=>{},Wa=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=fe();let o=mu.get(e)??0,r=`${e}:GridCellReact:${o}`;mu.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=fe(),this.node=hu.createElement(Jt,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=og,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Bn=class extends rt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=fe();this.cellAttachmentChangeSubscription=fe();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,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 t=new Wa(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,o=t.values().next().value;return o||(this.poolSize+=Bn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No cells available in the pool!"),o}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Bn.POOL_SIZE_INCREMENT)*Bn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}},Hn=Bn;Hn.POOL_SIZE_INCREMENT=1;var Wr=(n,e)=>n-e,jr=class extends rt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,h=p>=l,g=f<a,y=f>=s;(m||h||g||y)&&u.add(c)}),u};this.debugId=t,this.pool=new Hn(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Kn(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Kn(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+1},(s,u)=>{let c=[a,u],d=this.getCellAt(c);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Wr)}getColumnsWithCells(){let t=this.matrix.getUnnestedKeysStartingWith([],!0);return[...new Set(t.map(r=>r[1])).values()].sort(Wr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((o,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,ja.default)(o,t,Wr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,ja.default)(o,t,Wr);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;(l>=o||s>=r)&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return Kn(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return Kn(t,r=>this.getCellPosition(r)?.[1]===o)}getCellCountInMatrix(){return this.matrix.size}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(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Cu=B(Xo());var yu=B(require("react"));var gu=new Map,ng=()=>{},$a=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=fe();let t=gu.get(e)??0,o=`${e}:ListRowReact:${t}`;gu.set(e,t+1),this.debugId=o,this.updater=fe(),this.node=yu.createElement(Jt,{key:`detail-row-${o}`,name:`detail-row-${o}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=ng,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Wn=class extends rt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=fe();this.rowAttachmentChangeSubscription=fe();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,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 t=new $a(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,o=t.values().next().value;return o||(this.poolSize+=Wn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Wn.POOL_SIZE_INCREMENT)*Wn.POOL_SIZE_INCREMENT;let o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}},kn=Wn;kn.POOL_SIZE_INCREMENT=1;var $r=class extends rt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new kn(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,Cu.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Tu=!0,Do=X(Y.y),Su=X(Y.scrollTop),pR=X(Y.columnOffsetAtIndex),Ua=X(Y.columnOffsetAtIndexWhileReordering),Zo=class extends rt{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);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=(t,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Do,i?`calc( ${r}px + var(${Su}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Do}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Te.columnOffsets.get(r),d=`${Ua}-${r}`,p=s?`calc( ${a}px + var(${Su}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Do,p));let f=`translate3d(var(${d}, ${c}), var(${Do}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let u=r.getItemOffsetFor(t,"vertical"),c=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let h=f+m.height;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollTop;if(l==="center"?g=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),this.brain.isHorizontalLayoutBrain){let y=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),C=this.getScrollPositionForScrollColumnIntoView(y,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});C&&(a=C.scrollLeft)}return{scrollLeft:a,scrollTop:g}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let u=r.getItemOffsetFor(t,"horizontal"),c=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let h=f+m.width;l||(l=u>h-p?"end":u<f+d?"start":"end");let g=i.scrollLeft;return l==="center"?g=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,g+=u-f+s-d):(s+=c,g+=u-h+s+p),{...i,scrollLeft:g}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-o,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=u}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:u,end:c}=t,[d,p]=u,[f,m]=c,h=[];if(i&&(o&&h.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,i]}),r&&h.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),h.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(o&&h.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,l]}),r&&h.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),h.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),o){let g={start:[0,p],end:[o,m],rowFixed:"start",colFixed:!1};h.push(g)}if(r){let g={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};h.push(g)}return h};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(o<a&&(d=!0,p="start"),l&&!d){let f=s-l;o>=f&&(d=!0,p="end")}return{row:c?p:!1,col:d?p:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ae(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:u,y:c}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Tu){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;o&&(o.dataset.detailRowIndex=r,Tu&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.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=(t=this.brain.getScrollPosition())=>{let{brain:o,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let F=i.getRowIndex(E);if(F!=null){let v=this.brain.getItemOffsetFor(F,"vertical");if(v==null)return;let M=E.getElement();if(!M)return;this.setDetailTransform(M,F,{y:v,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&su(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:h,end:g}=this.brain.getRenderRange(),[y,C]=h,[S,b]=g;function T(E,F,v){let M=r.getCellAt([E,F]);if(M==null)return;let N=o.getCellOffset(E,F),G=M.getElement();G&&N&&v(E,F,G,N)}let I=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,y:N,scrollLeft:!0},s-F)},R=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:M.y,scrollTop:!0},c-E)},w=(E,F,v,{y:M})=>{let N=f[F];this.setTransform(v,E,F,{x:N,y:M,scrollLeft:!0},a-F)},P=(E,F,v,M)=>{this.setTransform(v,E,F,{x:M.x,y:m[E],scrollTop:!0},l-E)},x=(E,F,v,{x:M,y:N})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,F,v,{x:M})=>{this.setTransform(v,E,F,{x:M,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},A=(E,F,v,M)=>{this.setTransform(v,E,F,{x:f[F],y:M.y,scrollLeft:!0,scrollTop:!0},3e5)},_=(E,F,v)=>{this.setTransform(v,E,F,{x:f[F],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let E=y;E<S;E++){for(let F=0;F<s;F++)T(E,F,I);if(u){let F=a-u;for(let v=F;v<a;v++)T(E,v,w)}}if(c||d)for(let E=C;E<b;E++){for(let F=0;F<c;F++)T(F,E,R);if(d){let F=l-d;for(let v=F;v<l;v++)T(v,E,P)}}if(s&&c)for(let E=0;E<c;E++)for(let F=0;F<s;F++)T(E,F,x);if(s&&d){let E=l-d;for(let F=E;F<l;F++)for(let v=0;v<s;v++)T(F,v,D)}if(u&&c){let E=a-u;for(let F=0;F<c;F++)for(let v=E;v<a;v++)T(F,v,A)}if(u&&d){let E=l-d,F=a-u;for(let v=E;v<l;v++)for(let M=F;M<a;M++)T(v,M,_)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=o,this.cellManager=new jr(o),this.cellManager.onCellAttachmentChange((s,u)=>{u?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new $r(o),this.rowManager.onRowAttachmentChange((s,u)=>{u?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ae(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=La(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(A=>{x<=A&&A<D||f.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let h=new Map,g=f.map(this.getExtraSpanCellsForRange).flat();g&&g.forEach(([x,D])=>{h.set(`${x}:${D}`,!0)});let y=f.reduce((x,D)=>x+ka(D),0),C=r?f.reduce((x,D)=>x+du(D),0):0,S=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([S,b]);let T=Math.min(S*b,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>C&&(c.poolSize=C));let I=pu(...f.map(x=>d.getCellsOutsideRenderRange(x)));I=fu(I,x=>{let D=d.getCellPosition(x);return!(D&&h.has(`${D[0]}:${D[1]}`))}),d.detachCells(I),d.poolSize=T;let R=new Map,w=new Map;f.forEach(x=>{let{start:D,end:A}=x,[_,E]=D,[F,v]=A;for(let M=_;M<F;M++){for(let G=E;G<v;G++){let U=`${M}:${G}`;if(R.has(U))continue;R.set(U,!0);let{rendered:oe,mapped:ge}=this.isCellRenderedAndMappedCorrectly(M,G);if(M===_||G===E){let z=this.isCellCovered(M,G);if(z&&h.has(`${z[0]}:${z[1]}`)){let W=d.getCellAt([M,G]);W!=null&&d.detachCell(W);continue}}if(oe&&!i&&ge)continue;let ce;oe?ce=d.getCellAt([M,G]):ce=d.getCellFor([M,G],u?"row":"column"),ce==null&&(ce=d.getDetachedCell()),this.renderCellAt(M,G,ce,o)}!r||w.has(M)||(w.set(M,!0),c.isRowAttachedAt(M)&&!i)||this.renderDetailRowAtElement(M,this.rowManager.getRowFor(M),r)}}),g.forEach(([x,D])=>{let{rendered:A,mapped:_}=this.isCellRenderedAndMappedCorrectly(x,D);if(A){if(i||!_){let F=[x,D],v=d.getCellAt(F);this.renderCellAt(x,D,v,o)}return}let E=d.getCellFor([x,D],u?"row":"column");E!=null&&this.renderCellAt(x,D,E,o)});let P=d.getAllCells().map(x=>x.getNode());return r&&c.getAllRows().forEach(x=>{P.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}renderDetailRowAtElement(t,o,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:o.ref});if(o.isMounted()||o.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(u,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),u=this.brain.getRowspan(t,o),c=this.brain.getColspan(t,o),d=u===1?l:this.brain.getRowHeightWithSpan(t,o,u),p=c===1?s:this.brain.getColWidthWithSpan(t,o,c),{row:f,col:m}=this.isCellFixed(t,o),h=!!a,{rowIndex:g,colIndex:y}=this.getCellRealCoordinates(t,o),C=i({rowIndex:g,colIndex:y,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:h,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(b=>{let T=b.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(b)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:g,renderColIndex:y}:void 0;if(!C){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(C,r,[t,o],S),this.updateElementPosition(r,{hidden:h,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ur=class extends Zo{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=se.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Te.columnOffsets.get(l.colIndex),f=`${Ua}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Do,m));let h=`calc(var(${f}, ${p}) + ${d})`,g=`var(${Do})`,y=`translate3d(${h}, ${g}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Yr(n){let e=n.isHorizontalLayoutBrain?new Ur(n,`${n.name}:HorizontalLayoutTableRenderer`):new Zo(n,`${n.name}:ReactHeadlessTableRenderer`),t=fe();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function rg(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,to.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:Yr(e),[e,n.onRenderUpdater,n.renderer]);return(0,to.useEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,to.useEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,to.useLayoutEffect)(()=>{let l=e.getRenderRange();i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o})},[i,e,t,o,a,r]),(0,to.useEffect)(()=>e.onRenderRangeChange(s=>{i.renderRange(s,{force:!1,onRender:u=>{let c=a.get();c&&u&&c.length===u.length||a(u)},renderCell:t,renderDetailRow:o})}),[t,o,e,a]),qr.createElement(Jt,{updater:a})}var Xr=qr.memo(rg);var jn=B(require("react")),Qo=require("react");var Zr=require("react"),Ft=()=>{let[n,e]=(0,Zr.useState)(0);return[n,(0,Zr.useCallback)(()=>{e(t=>t+1)},[e])]};function ig(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ag(n){var e=ig(n,"string");return typeof e=="symbol"?e:String(e)}function lg(n,e,t){return e=ag(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Ru(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bu(Object(t),!0).forEach(function(o){lg(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bu(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Iu(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var sg=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},Ce=n=>{var e=t=>{var o=n.defaultClassName,r=Ru(Ru({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=n.variantClassNames[i][s];u&&(o+=" "+u)}}for(var[c,d]of n.compoundVariants)sg(c,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Iu(n.variantClassNames,t=>Iu(t,o=>o.split(" ")[0]))}},e};var wu=Ce({defaultClassName:"nxbq1c1 _16lm1iwl _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Qr="nxbq1c0 _16lm1iwl _16lm1iw4 _16lm1iw1f _16lm1iw1d _16lm1iw18 _16lm1iwu";var Pu=Ce({defaultClassName:"j26lrx0 _16lm1iwl _16lm1iw2 _16lm1iw1d _16lm1iw1f",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:ug}=ve,cg=`${ug}-ActiveRowIndicator`,dg=`calc(${Y.activeCellRowOffsetX} + var(${X(Y.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,pg={[X(Y.activeCellOffsetY)]:Y.activeCellRowOffset,transform:`translate3d(${dg}, calc( ${Y.activeCellOffsetY} + var(${X(Y.scrollTopForActiveRow)}, 0px)), 0px)`,height:Y.activeCellRowHeight,maxWidth:se.runtime.totalVisibleColumnsWidthVar},fg=n=>{let{brain:e}=n,t=(0,Qo.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Ft();return(0,Qo.useLayoutEffect)(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${se.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};qo(d,c)},[n.activeRowIndex,e]),(0,Qo.useEffect)(()=>{let a=u=>{qo({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),jn.createElement("div",{className:Qr,"data-name":"active-row"},jn.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${cg} ${Pu({active:o})}`,style:o?pg:void 0}))},xu=jn.memo(fg);var $n=B(require("react")),Jo=require("react");var{rootClassName:mg}=ve,hg=`${mg}-ActiveCellIndicator`,gg=X(Y.columnZIndexAtIndex),yg=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;qo({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},Cg=n=>{let{brain:e}=n,[t,o]=Ft(),r=(0,Jo.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return(0,Jo.useLayoutEffect)(()=>{yg(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),(0,Jo.useEffect)(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),$n.createElement("div",{className:Qr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${gg}-${n.activeCellIndex[1]})`}:void 0},$n.createElement("div",{"data-name":"active-cell-indicator",className:`${hg} ${wu({visible:i})}`}))},Du=$n.memo(Cg);var vu="_1eexc2a7 _1eexc2a6",Au=Ce({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=Ce({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 Mu="_1eexc2a5",Jr=Ce({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ei="_1eexc2a8";var ti=[Mu,`${it}DetachedCell`];function oi(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var Tg=ee(Ws,Na);function _u(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...h}=n,{autoFocus:g}=h,y=(0,It.useRef)(null),[C,S]=(0,It.useState)({width:0,height:0});(0,It.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,It.useEffect)(()=>{let I=y.current?.parentNode;return I?(g&&document.activeElement!==I&&I.focus(),Nn(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let b=(0,It.useCallback)(I=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),T=(0,It.useCallback)(I=>{e.setScrollPosition(I,b)},[e,b]);return(0,It.useEffect)(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),vo.createElement(Js,{onContainerScroll:T,...h,ref:t},vo.createElement("div",{ref:y,className:Tg,"data-name":"scroll-transform-target"},vo.createElement(Xr,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ti}),c!=null?vo.createElement(Du,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?vo.createElement(xu,{brain:e,activeRowIndex:u}):null,vo.createElement(ks,{width:C.width,height:C.height}))}var en=B(require("react")),ke=require("react");function Ya(n,e){let t=new Set;function o(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return n.apply(this,s)}return{fn:o,propertyReads:t}}var qa=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Un(n){return n!==void 0}function oo(n,e){let t=e[n];return Un(t)}var no=require("react");var Fu=n=>{let e=(0,no.useCallback)(n,[]),t=(0,no.useRef)(!1),o=(0,no.useRef)(!1),r=(0,no.useRef)(),[i,a]=Ft();t.current&&(o.current=!0),(0,no.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var ni=require("react");function Fe(n){let e=(0,ni.useRef)(n);return e.current=n,(0,ni.useCallback)(()=>e.current,[])}var ri=require("react"),ro=(n,e)=>{let t=(0,ri.useRef)(e===void 0?n:e);return(0,ri.useLayoutEffect)(()=>{t.current=n}),t.current};var Sg=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Xa;function Ou(){return Xa||(Xa=(0,ke.createContext)(null))}function bg(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,u)=>{let c=u;return Object.defineProperty(s,u,{set:p=>{let f=t(),m=e(),h=m[c],g=!0;if(i&&typeof i[c]=="function"&&i[c](p,{actions:s,state:m})===!1&&(g=!1),g){let S=[p],b=`on${qa(u)}Change`;if(a&&a[c]){let T=a[c](p,m);b=T.callbackName||b,S=T.callbackParams}Sg(f,b,S)}let y=o[c];typeof y=="function"&&(p=y(p));let C=!!r?.[c];oo(u,f)&&!C||n({payload:{updatedProps:null,mappedState:{[u]:p}}})}}),s},{})}function Rg(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=oo(r,e)?e[r]:e[`default${qa(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Ot(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,ke.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,ke.useRef)(new Set),l=(0,ke.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),u=Fe(s);function c(){let w={};l&&(w=Rg(l,r,i));let P={...i,...w};if(n.mapPropsToState){let{fn:x,propertyReads:D}=Ya(n.mapPropsToState,{getProxyTargetFromArgs:_=>_.props,putProxyToArgs:(_,E)=>[{...E,props:_}]}),A=x({props:r,state:P,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...P,...A}}return P}let[d]=(0,ke.useState)(c),p=Fe(r),f=(w,P)=>{if(P.type==="REPLACE_STATE")return P.payload;let x=u?.()??null,D=P.payload.mappedState,A=P.payload.updatedPropsToState,_={...w};if(D&&Object.assign(_,D),n.mapPropsToState){let{fn:F,propertyReads:v}=Ya(n.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),M=F({props:p(),state:_,oldState:w,parentState:x});a.current=new Set([...a.current,...v]),Object.assign(_,M)}return P.type==="ASSIGN_STATE"&&Object.assign(_,P.payload),n.concludeReducer?n.concludeReducer({previousState:w,state:_,updatedProps:A,parentState:x}):_},[m,h]=(0,ke.useReducer)(f,d),g=Fe(m),{allowedControlledPropOverrides:y}=n,C=(0,ke.useMemo)(()=>bg(h,g,p,l,y,n.interceptActions,n.mappedCallbacks),[h,l,y]),S=Ou(),b=(0,ke.useMemo)(()=>({componentState:m,componentActions:C,getComponentState:g,replaceState:w=>{h({type:"REPLACE_STATE",payload:w})},assignState:w=>{h({type:"ASSIGN_STATE",payload:w})}}),[m,C,g]),T=ro(r),I=(0,ke.useRef)(!1);I.current=!1;let R=n.layoutEffect?ke.useLayoutEffect:ke.useEffect;return R(()=>{let w=r,P={},x=0,D={},A=0,_={},E=0;if(new Set([...Object.keys(w),...Object.keys(T)]).forEach(M=>{let N=M,G=T[N],U=w[N];if(N!=="children"&&G!==U&&(_[N]={newValue:U,oldValue:G},E++,oo(N,r)||oo(N,T)))if(l.hasOwnProperty(M)){let oe=U,ge=l[M];typeof ge=="function"&&(oe=ge(U)),m[N]!==oe&&(P[N]=oe,x++)}else a.current.has(M)&&(D[N]=w[N],A++)}),A>0||x>0){(n.debugName?ct(typeof n.debugName=="function"?`${n.debugName(w)}:rerender`:`${n.debugName}:rerender`):ct("rerender"))("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?P:null,updatedPropsToState:A?D:null}};if(I.current=!0,h(N),n.onPropChange){for(var v in _)if(_.hasOwnProperty(v)){let{newValue:G,oldValue:U}=_[v];n.onPropChange({name:v,newValue:G,oldValue:U},r,C,m)}}n.onPropsChange&&E&&n.onPropsChange(_,r,C,m)}}),R(()=>{s!=null&&!I.current&&h({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Fu(()=>()=>{n.cleanup?.(g())}),{contextValue:b,ContextComponent:S}}return{ManagedComponentContextProvider:en.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return en.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function He(){let n=Ou();return en.useContext(n)}var Yu=B(require("react"));var ii=()=>ve;var Nu="_16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",Lu={center:"_16lm1iw1r",stretch:"_16lm1iw1s"};var Nt="_16lm1iw24 _16lm1iw25 _16lm1iw1y",Vu={pointer:"_16lm1iwi",default:"_16lm1iwj",colResize:"_16lm1iwk"},tn={flex:"_16lm1iwz",contents:"_16lm1iw10",none:"_16lm1iw11",block:"_16lm1iw12",grid:"_16lm1iw13",inlineBlock:"_16lm1iw14",inlineFlex:"_16lm1iw15",inlineGrid:"_16lm1iw16"};var ai={1:"_16lm1iwm",none:"_16lm1iwn"},Yn={column:"_16lm1iw1n",columnReverse:"_16lm1iw1o",row:"_16lm1iw1p",rowReverse:"_16lm1iw1q"},zu={0:"_16lm1iw18","100%":"_16lm1iw19","50%":"_16lm1iw1a"},Gu={center:"_16lm1iw1t",spaceBetween:"_16lm1iw1u",spaceAround:"_16lm1iw1v",start:"_16lm1iw1w",end:"_16lm1iw1x"},Ku={0:"_16lm1iw1f","100%":"_16lm1iw1g",auto:"_16lm1iw1h"};var Hu={none:"_16lm1iwd"},Bu={hidden:"_16lm1iw1y",auto:"_16lm1iw1z",visible:"_16lm1iw20"};var qn={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var ku={0:"_16lm1iw1d","100%":"_16lm1iw1e"};var Wu="_16lm1iwe",ju={none:"_16lm1iw17"};var $u={visible:"_16lm1iw21",hidden:"_16lm1iw22"};var Uu={1:"_16lm1iwo",10:"_16lm1iwp",100:"_16lm1iwq",1e3:"_16lm1iwr",1e4:"_16lm1iws",1e5:"_16lm1iwt",1e6:"_16lm1iwu",1e7:"_16lm1iwv","1k":"_16lm1iww","10k":"_16lm1iwx","100k":"_16lm1iwy"};function qu(n){let{rootClassName:e}=ii();return Yu.createElement("div",{...n,className:ee(`${e}Footer`,qn.relative,tn.flex,Yn.row,n.className)})}var Ie=B(require("react")),po=require("react"),Fd=require("react-dom");function li(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}var Xu=B(require("react")),Oe=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Xu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};var Xn=B(require("react")),Zu=n=>Xn.createElement(Oe,{...n},Xn.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Xn.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Xn.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var Za=B(require("react")),Qu=n=>Za.createElement(Oe,{...n},Za.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));var Qa=B(require("react")),Ja=n=>Qa.createElement(Oe,{...n},Qa.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var el=B(require("react")),Ju=n=>el.createElement(Oe,{...n},el.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var tl=B(require("react")),ec=n=>tl.createElement(Oe,{...n},tl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var ol=B(require("react")),tc=n=>ol.createElement(Oe,{...n},ol.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var nl=B(require("react")),oc=n=>nl.createElement(Oe,{...n},nl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var rl=B(require("react")),nc=n=>rl.createElement(Oe,{...n},rl.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var il=B(require("react")),rc=n=>il.createElement(Oe,{...n},il.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));var hl=B(require("react"));var Xe=B(require("react")),Zn=require("react");var ac=require("react");var ic=require("react"),al;function on(){return al||(al=(0,ic.createContext)(null))}var Z=()=>{let n=on();return(0,ac.useContext)(n)};var lc=require("react");var sc=()=>{let n=on(),{state:e}=(0,lc.useContext)(n);return e};var nn=B(require("react")),Ao=require("react");var uc="_1eexc2a6";var cc=Ce({defaultClassName:"_12zfob129 _16lm1iw19 _16lm1iw1c _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1w",variantClassNames:{filtered:{false:"_12zfob12a",true:"_12zfob12b"},verticalAlign:{start:"_12zfob12c",end:"_12zfob12d",center:"_12zfob12e"},align:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"}},defaultVariants:{},compoundVariants:[]}),dc="_12zfob1n _16lm1iw24 _16lm1iw25 _16lm1iw1y",pc=Ce({defaultClassName:"_12zfob1o",variantClassNames:{rowActive:{false:"_12zfob1p",true:"_12zfob1q"},cellSelected:{false:"_12zfob1r",true:"_12zfob1s"},rowSelected:{false:"_12zfob1t",true:"_12zfob1u",null:"_12zfob1v"},rowDisabled:{false:"_12zfob1w",true:"_12zfob1x"},firstRow:{false:"_12zfob1y",true:"_12zfob1z"},treeNode:{parent:"_12zfob110",leaf:"_12zfob111",false:"_12zfob112"},firstRowInHorizontalLayoutPage:{false:"_12zfob113",true:"_12zfob114"},groupRow:{false:"_12zfob115",true:"_12zfob116"},groupCell:{false:"_12zfob117",true:"_12zfob118"},align:{start:"_12zfob119",end:"_12zfob11a",center:"_12zfob11b"},verticalAlign:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},zebra:{false:"_12zfob11f",even:"_12zfob11g",odd:"_12zfob11h"},dragging:{true:"_12zfob11i",false:"_12zfob11j"},insideDisabledDraggingPage:{true:"_12zfob11k",false:"_12zfob11l"},first:{true:"_12zfob11m",false:"_12zfob11n"},last:{true:"_12zfob11o",false:"_12zfob11p"},groupByField:{true:"_12zfob11q",false:"_12zfob11r"},firstInCategory:{true:"_12zfob11s",false:"_12zfob11t"},lastInCategory:{true:"_12zfob11u",false:"_12zfob11v"},pinned:{start:"_12zfob11w",end:"_12zfob11x",false:"_12zfob11y"},filtered:{true:"_12zfob11z",false:"_12zfob120"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob121"],[{pinned:"end",firstInCategory:!0},"_12zfob122"],[{pinned:!1,lastInCategory:!0},"_12zfob123"]]}),fc=Ce({defaultClassName:"_12zfob19 _16lm1iw12 _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1a",end:"_12zfob1b",false:"_12zfob1c"},firstInCategory:{true:"_12zfob1d",false:"_12zfob1e"},lastInCategory:{true:"_12zfob1f",false:"_12zfob1g"},overflow:{true:"_12zfob1h",false:"_12zfob1i"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1j"],[{pinned:"start",firstInCategory:!0},"_12zfob1k"],[{overflow:!0,pinned:"end"},"_12zfob1l"],[{pinned:"end",lastInCategory:!0},"_12zfob1m"]]}),mc="_12zfob12r _16lm1iw1c _16lm1iw19";var hc="_12zfob17",gc="_12zfob12n _16lm1iwz _16lm1iw1p _16lm1iw1r _16lm1iw1",yc=Ce({defaultClassName:"_12zfob12o _16lm1iw1 _16lm1iw1d",variantClassNames:{disabled:{true:"_12zfob12p",false:"_12zfob12q"}},defaultVariants:{},compoundVariants:[]}),ll=Ce({defaultClassName:"_12zfob12k _16lm1iwz _16lm1iw1p _16lm1iw1s _16lm1iw1",variantClassNames:{active:{true:"_12zfob12l",false:"_12zfob12m"}},defaultVariants:{},compoundVariants:[]}),Cc="_12zfob12j _16lm1iwz _16lm1iw1p _16lm1iw1r",Tc=Ce({defaultClassName:"_12zfob124 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw1v _16lm1iw22",variantClassNames:{menuVisible:{true:"_12zfob125"},reserveSpaceWhenHidden:{true:"_12zfob126",false:"_12zfob127"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob128"]]}),Sc="_12zfob18 _16lm1iw2",bc="_16lm1iw1",Rc="_12zfob16",Ic=Ce({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),wc="_12zfob12i _16lm1iw1y _16lm1iw1 _16lm1iwz _16lm1iw1p";var dt="InfiniteIcon";var Pc="_6aunoi0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v _16lm1iw1r";var Ig={transition:"width 0.25s, opacity 0.25s"};function rn(n){let[e,t]=(0,Ao.useState)(!0),[o,r]=(0,Ao.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,u=s!=null&&s>0,c=n.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...Ig,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,Ao.useEffect)(()=>{if(!e)return;let h=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(h)}},[e]),(0,Ao.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return nn.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:ee(l,dt,Pc,`${dt}-filter`)},u?nn.createElement("div",{"data-name":"index",style:m,className:hc},s):null,nn.createElement("div",{style:{width:p[0],...f}}),nn.createElement("div",{style:{width:p[1],...f}}),nn.createElement("div",{style:{width:p[2],...f}}))}var sl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],u=[];t.forEach((R,w)=>{let P=R.maxSize??r??void 0,x=R.minSize??o??void 0;s.push(x),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),x!=null&&R.size<x&&(R.size=x));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 ${w} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=R.size??0});let c=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let P=d*R.flex,x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=!1,_=0;x!=null&&P>x&&(p[w]=!0,A=!0,_=x),D!=null&&P<D&&(f[w]=!0,A=!0,_=D),A&&(m+=1,l-=1,a-=R.flex,c-=_)}}),m&&(d=c/a);let h=[],g=0,y=c,C=a,S=0,b=0,T=[];return{items:t.map((R,w)=>{let P={...R},x=R.maxSize??r??void 0,D=R.minSize??o??void 0,A=0,_=p[w],E=f[w],F=_||E,v=R.size??0;if(R.flex!=null){if(F)E&&(A=D),_&&(A=x);else{g+=1;let M=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);g===l?A=M(y):(A=M(Math.round(R.flex*d)),b+=A,y=c-b,C-=R.flex,d=y/C)}v=A,P.flexSize=A}return h.push(A),T.push(v),P.computedSize=v,S+=v,P}),flexSizes:h,minSizes:s,maxSizes:u,computedSizes:T,remainingSize:Math.round(e-S)}};function si(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var ul=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((x,D)=>(x[D]={...n.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",h=s?.computedWidth,g=s?.computedMinWidth,y=s?.computedMaxWidth,C=s?.computedFlex?"flex":"width",S=!1,b=!1,T=r>0?1:-1,{value:I,clamped:R,diff:w}=si(d+r,p,f,T);if(n.shareSpaceOnResize){if(s==null)return o[u]={...o[u],[m]:I},b=R==="min",S=R==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:o,minReached:b,maxReached:S,constrained:b||S};let{value:x,clamped:D,diff:A}=si(h-r,g,y,T);if(R&&D&&(Math.abs(w)>Math.abs(A)?D=!1:R=!1),!(!R&&!D)){if(R){let _=si(h-r-w,g,y,T);x=_.value,D=_.clamped,A=_.diff}else if(D){let _=si(d+r+A,p,f,T);I=_.value,R=_.clamped,w=_.diff}}o[u]={...o[u],[m]:I},o[c]={...o[c],[C]:x},b=R==="min"||D==="min",S=R==="max"||D==="max"}else o[u]={...o[u],[m]:I},b=R==="min",S=R==="max";let P=I-d;return{adjustedDiff:P,reservedWidth:n.shareSpaceOnResize?t:t-P,columnSizing:o,minReached:b,maxReached:S,constrained:b||S}};function xc(n,e){return n+e}function wg(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Dc=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((y,C)=>(y[C]={...n.columnSizing[C]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((y,C)=>n.dragHandlePositionAfter-C).reverse(),a=i.map(y=>n.items[y]),l=a.map(y=>y.computedWidth),s=a.map(y=>y.computedFlex?"flex":"width"),u=0,{computedSizes:c}=sl({items:a.map(y=>(y.resizable===!1&&(u+=y.computedWidth),{maxSize:y.computedMaxWidth,minSize:y.computedMinWidth,flex:y.resizable?y.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(xc,0)+r-u,0)}),d=a.map((y,C)=>c[C]-y.computedWidth),p=!0,f=!0,m=!0,h=[];d.forEach((y,C)=>{let S=a[C];if(!S.resizable){h.push(0);return}let b=s[C],T=l[C],I=wg(o),{maxReached:R,minReached:w,constrained:P,adjustedDiff:x}=ul({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[C],shareSpaceOnResize:!1,items:n.items,columnSizing:I});o[S.id]={...I[S.id],[b]:T+x},h.push(x),R||(f=!1),w||(p=!1),P||(m=!1)});let g=h.reduce(xc,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:h,adjustedDiff:g,columnSizing:o,reservedWidth:t-g}};var ui;function io(){if(ui!=null)return ui;let n=Me().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),ui=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),ui}var vc=["start",void 0,"end"],Ac=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:vc.indexOf(r)-vc.indexOf(i)}),n);function Ec(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function cl(n,...e){return Ec(t=>t!=null,n,...e)}function Mc(n,e,...t){return Ec((o,r)=>!(r in n),e,...t)}var ci=Object.freeze({}),Pg={string:ci,number:{}};function dl(n,e){let t=e.default||ci;return n.type===void 0?t:n.type===null?ci:typeof n.type=="string"?e[n.type]||Pg[n.type]||ci:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var di=!0,xg=!0,Dg=!0,vg="string",an="unknown",Ag=Zt("getComputedVisibleColumns"),Eg=(n,e,t)=>n[t]!==!1,pl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},_c=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:u,pinnedEndMaxWidth:c,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:h=ao,viewportReservedWidth:g,resizableColumns:y,draggableColumns:C,columnDefaultDraggable:S,columnOrder:b,columnPinning:T,editable:I,columnDefaultEditable:R,columnDefaultFilterable:w,columnDefaultSortable:P,columnSizing:x,columnTypes:D,columnVisibility:A,columnVisibilityAssumeVisible:_})=>{let E=0,F=(d||[]).reduce((H,re)=>{let{id:K,field:ie}=re;return ie&&(H[ie]=re),K&&(H[K]=re),H},{}),v=Ac(b===!0?Object.keys(n):b,T),M=v.filter(H=>n[H]?Eg(A,_,H):(Ag(`Column with id "${H}" specified in columnOrder array cannot be found in the columns map.`),!1)),N=new Map,G=M.map((H,re)=>{let K=n[H];return N.set(H,re),K}),U=(f??[]).reduce((H,re,K)=>(re.id?H[re.id]={sortInfo:re,index:K}:re.field&&(H[re.field]={sortInfo:re,index:K}),H),{});function oe(H){let re=n[H],K=dl(re,D),ie={minWidth:K?.minWidth,maxWidth:K?.maxWidth,width:K?.defaultWidth,flex:K?.defaultFlex},ye=cl({width:re?.defaultWidth,flex:re?.defaultFlex,minWidth:re?.minWidth,maxWidth:re?.maxWidth},x[H]);ye.width!=null&&delete ie.flex,ye.flex!=null&&delete ie.width,ye=cl(ie,ye);let ae=ye.flex??void 0,Ye=ye.minWidth??re?.minWidth??t,Ct=ye.maxWidth??re?.maxWidth??o,Mt=ae!=null?void 0:ye.width??(i?void 0:r);return!Mt&&ae==null&&(i?ae=i:Mt=Ye),{size:Mt,flex:ae,minSize:Ye,maxSize:Ct}}let ge=sl({availableSize:Math.max(e.width-(g??0)-(a??io()),0),maxSize:o,minSize:t,items:M.map(oe)}),{computedSizes:ce,flexSizes:z,minSizes:W,maxSizes:le}=ge,ne=[],j=[],V=[],L=[];L.length=M.length;let Q=new Map,$=new Map,ue=0,J=0,O=0,Re=null,be=[],k=0,te=0,de=0;G.forEach((H,re)=>{let K=M[re],ie=ce[re],ye=be[re]=pl(K,T);ye==="start"?k+=ie:ye==="end"?de+=ie:te+=ie});let De=e.width-de,Pe=[],Ve=new Map;M.forEach((H,re)=>{let K=G[re];Ve.set(H,K)});let Ee=[];Object.keys(n).forEach(H=>{let re=n[H];Ee.push(H),Ve.has(H)||Ve.set(H,re)});let je=new Map;Ve.forEach((H,re)=>{let K=N.get(re);K==null&&(K=-1);let ie=K!=-1,ye=M[K+1],ae=dl(H,D),Ye=K,Ct=U[re]?U[re]:H.field?U[H.field]??null:null,Mt=Ct?.sortInfo??null,Io=!!Mt,$o=Io&&Mt.dir===1,Ar=Io&&!$o,Er=Ct?.index??-1,An=ie?{}:oe(re),Mr=ie?ce[K]:An.size||0,Ca=ie&&z[K]||null,Ta=ie?W[K]||0:An.minSize||0,Sa=ie?le[K]||1e4:An.maxSize||1e4,pe=ie?pl(re,T):!1,qe=ie?K===M.length-1:!1,Tt=Ye,bt=ie?pe==="start"?J:pe==="end"?O:E-J:0;pe=="start"?Tt=ie?Ye:-1:pe==="end"?Tt=ie?Ye-(ne.length+V.length):-1:Tt=ie?Ye-ne.length:-1;let En=ie?pe==="start"||pe===!1?E:De+O:-1,Th=ie?pe!==Re:!1,Sh=ie?qe||pe!==pl(ye,T):!1,Ds=H.cssEllipsis??ae.cssEllipsis??l,bh=H.headerCssEllipsis??ae.cssEllipsis??H.cssEllipsis??ae.headerCssEllipsis??s??Ds,_r=ie&&(F[re]||H.field||H.groupByForColumn)&&(F[re]||F[H.field||H.groupByForColumn])||null,Rh=H.defaultFilterable??ae.defaultFilterable??w??!0,Ih=I??H.defaultEditable??ae.defaultEditable??R??!1,ba=H.dataType||ae.dataType||(Array.isArray(H.type)?H.type[0]:H.type)||vg,wh=H.sortType||ae.sortType||ba,vs=H.filterType||ae.filterType||ba,As=!1;if(_r!=null&&!_r.disabled){let Ia=h[vs];Ia&&(!Ia.emptyValues||!Ia.emptyValues.includes(_r.filter.value))&&(As=!0)}let Es=H.field??ae.field,Ms=H.valueGetter??ae.valueGetter,Ra=H.defaultSortable??ae.defaultSortable;Ra==null&&!H.groupByForColumn&&Es==null&&Ms==null&&(Ra=!1);let Ph=p??Ra??P??di,xh=H.resizable??ae.resizable??y??xg,Ke={colType:ae,align:ae.align,headerAlign:ae.headerAlign,computedVisible:ie,verticalAlign:ae.verticalAlign,defaultHiddenWhenGroupedBy:ae.defaultHiddenWhenGroupedBy,valueGetter:Ms,valueFormatter:ae.valueFormatter,renderValue:ae.renderValue,render:ae.render,style:ae.style,contentFocusable:ae.contentFocusable,renderMenuIcon:ae.renderMenuIcon,renderSortIcon:ae.renderSortIcon,renderRowDetailIcon:ae.renderRowDetailIcon,renderSelectionCheckBox:ae.renderSelectionCheckBox,renderHeaderSelectionCheckBox:ae.renderHeaderSelectionCheckBox,headerStyle:ae.headerStyle,headerClassName:ae.headerClassName,columnGroup:ae.columnGroup,getValueToEdit:ae.getValueToEdit,getValueToPersist:ae.getValueToPersist,shouldAcceptEdit:ae.shouldAcceptEdit,field:Es,...H,components:{...ae.components,...H.components},computedResizable:xh,computedMinWidth:Ta,computedMaxWidth:Sa,computedFlex:Ca,computedDataType:ba,computedEditable:Ih,computedSortType:wh,computedFilterType:vs,cssEllipsis:Ds,headerCssEllipsis:bh,computedFilterValue:_r,computedFiltered:As,computedFilterable:Rh,computedWidth:Mr,computedAbsoluteOffset:En,computedPinningOffset:bt,computedVisibleIndexInCategory:Tt,computedOffset:E,computedSortable:Ph,computedSortInfo:Mt,computedSortIndex:Er,computedMultiSort:m,computedSorted:Io,computedSortedAsc:$o,computedSortedDesc:Ar,computedVisibleIndex:Ye,computedPinned:pe,computedDraggable:C??H.defaultDraggable??S??Dg,computedFirstInCategory:Th,computedLastInCategory:Sh,computedFirst:K===0,computedLast:qe,id:re,header:H.header??ae.header??H.name??H.field};ie&&(E+=Mr,Q.set(Ke.id,Ke),L[K]=Ke,pe==="start"&&(ne.push(Ke),J+=Ke.computedWidth),pe==="end"&&(j.push(Ke),O+=Ke.computedWidth),pe||(V.push(Ke),ue+=Ke.computedWidth),Re=pe),Ke.groupByForColumn&&(Ke.computedSortType=H.sortType||ae.sortType||an,Pe.push(Ke)),$.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!je.has(Ke.field)&&je.set(Ke.field,Ke)}),Pe.forEach(H=>{H.computedSortable=Fc(H,{fieldsToColumn:je,sortable:p,columnDefaultSortable:P})});let Je=new Map;Ee.forEach(H=>{let re=$.get(H);re&&Je.set(H,re)}),$.forEach(H=>{Je.has(H.id)||Je.set(H.id,H)});let Ue=u!=null?Math.min(u,J):J,ut=c!=null?Math.min(c,O):O;return{computedRemainingSpace:e.width-(k+de+te),computedPinnedStartColumnsWidth:J,computedPinnedEndColumnsWidth:O,computedUnpinnedColumnsWidth:ue,computedColumnOrder:v,computedPinnedStartColumns:ne,computedPinnedEndColumns:j,computedUnpinnedOffset:J,computedPinnedEndOffset:J+ue,computedUnpinnedColumns:V,computedVisibleColumns:L,computedColumnsMap:$,computedColumnsMapInInitialOrder:Je,computedVisibleColumnsMap:Q,computedPinnedEndWidth:ut,computedPinnedStartWidth:Ue,renderSelectionCheckBox:L.reduce((H,re)=>H||!!re.renderSelectionCheckBox,!1),fieldsToColumn:je}};function Fc(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??di;return n.computedSortType!==an&&a?!0:s=>{let{column:u,api:c}=s,d=u.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,h;if(m){let g=o.get(m),y=g?c.getColumnApi(g.id):void 0;g&&y?h=y.isSortable():h=!1}return h===void 0&&f.valueGetter&&(h=!0),h??r??di},!0)}}function tt(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function pi(n,e){let t=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:o,getComputed:r,getDataSourceState:i,actions:a,dataSourceActions:l,dataSourceApi:s}=e,u=i(),{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=u,f=r(),m=t.header&&typeof t.header!="function"?t.header:t.name||t.id||"";if(typeof t.header=="function"){let h=tt(t.id,{...e,actions:a,dataSourceActions:l,dataSourceApi:s});m=t.header({horizontalLayoutPageIndex:null,column:t,columnApi:h,dataSourceApi:s,insideColumnMenu:!0,dragging:!1,columnsMap:f.computedColumnsMap,columnSortInfo:t.computedSortInfo,columnFilterValue:t.computedFilterValue,filtered:t.computedFiltered,allRowsSelected:c,someRowsSelected:d,selectionMode:p,api:o,renderBag:{header:m}})??null}return m}var Oc=B(require("react"));var fi=`${it}HeaderCell__filter`,fl=`${it}HeaderCell__filterOperator`,ml=Oc.createContext(null);var Mg=`${fi}__input`,mi=n=>n.stopPropagation();function Nc(n){let{filterOperatorMenuVisibleForColumnId:e}=sc(),{column:t}=Qn(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,Zn.useState)(!1),l=Xe.useCallback(()=>{a(!0)},[]),s=Xe.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return Xe.createElement("div",{onPointerUp:mi,onPointerDown:mi,onFocus:l,onBlur:s,className:`${fi} ${ll({active:u})}`,style:{height:n.columnHeaderHeight}},Xe.createElement(ml.Provider,{value:n},Xe.createElement(r,null),Xe.createElement(o,null)))}function Lc(){let{columnApi:n,disabled:e,operator:t}=ln(),o=t?.components?.Icon??rn;return Xe.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:ee(fl,gc,e?`${fl}--disabled`:"")},Xe.createElement(o,{size:20,className:`${yc({disabled:e})}`}))}function Vc(){return Xe.createElement("div",{onPointerUp:mi,onPointerDown:mi,className:`${fi} ${ll({active:!1})} ${zu["50%"]}`})}function ln(){let n=Z(),{column:e,columnApi:t}=Qn(),o=pi(e,n),r=Xe.useContext(ml),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,Zn.useState)(l?.filter.value??""),d=Xe.useCallback(g=>{c(g),r.onChange(g)},[r.onChange]),p=Xe.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),f=Xe.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,Zn.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let g=[...s.emptyValues][0];g!==u&&c(g)}},[l?.filter.value]);let m=r.operator,h=m?.name;return{api:n.api,column:e,columnFilterValue:l,columnApi:t,operatorName:h,operator:m,value:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${o}`,className:`${mc} ${Mg}`}}function sn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=ln();return hl.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function hi(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=ln();return hl.createElement("input",{"aria-label":n,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:o})}function _g(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:sn},operators:[{name:"includes",components:{Icon:Zu},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ja},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:rc},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Qu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:hi},operators:[{label:"Equals",components:{Icon:Ja},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:nc},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:ec},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Ju},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:oc},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:tc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var ao=_g();function gi(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var tr=require("react");var zc="_16lm1iw1",Gc="_1yeub2v0 _16lm1iw1 _16lm1iwz _16lm1iw1n _16lm1iw0",Kc="_1yeub2vs",Hc="_1yeub2vr",Bc=Ce({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 gl="_1yeub2vp";var ax=Ce({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var yl=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Jn={bodyWidth:{name:X(se.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:X(se.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:X(se.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:X(se.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:X(se.runtime.browserScrollbarWidth),value:""}},Fg=X(Y.scrollbarWidthHorizontal),kc=X(Y.scrollbarWidthVertical),Og=X(Y.columnWidthAtIndex),Ng=X(Y.columnZIndexAtIndex),Wc=X(Y.scrollLeft),Lg=X(Y.activeCellColWidth),jc=X(Y.activeCellColOffset),qc=X(Y.baseZIndexForCells),Vg=X(Y.pinnedStartWidth),$c=X(Y.bodyWidth),zg=X(Y.bodyHeight),Uc=X(Y.pinnedEndOffset),Yc=X(Y.pinnedEndWidth),Gg=X(Y.computedVisibleColumnsCount);function Cl(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${qc}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Xc(n){let e=io(),{computed:t,state:o,actions:r,getState:i}=Z(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:u,onBlurWithin:c,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:h,wrapRowsHorizontally:g}=o,{computedPinnedStartColumnsWidth:y,computedPinnedEndColumnsWidth:C,computedPinnedStartColumns:S,computedPinnedEndColumns:b,computedVisibleColumns:T,computedUnpinnedColumnsWidth:I,scrollbars:R}=t,w=[],P=T.reduce((v,M)=>{let N=M.computedVisibleIndex;v[Te.columnWidths.varName.get(N)]=M.computedWidth+"px",v[Te.columnOffsets.varName.get(N)]=M.computedPinned==="start"?`calc( ${M.computedOffset}px + var(${Wc}) )`:M.computedPinned==="end"?`calc( var(${Uc}) ${w.length?"+":""} ${w.map(U=>Te.columnWidths.get(U.computedVisibleIndex)).join(" + ")} + var(${Wc}) )`:`${M.computedOffset}px`;let G=Cl(M,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return v[`${Ng}-${N}`]=`${G}`,M.computedPinned==="end"&&w.push(M),v},{});if(m.width&&(P[Jn.browserScrollbarWidth.name]=`${io()}px`),P[Jn.bodyWidth.name]=`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,P[Jn.totalVisibleColumnsWidthValue.name]=`${y+C+I}px`,P[Jn.totalVisibleColumnsWidthVar.name]=`calc(${T.map((v,M)=>`var(${Og}-${M})`).join(" + ")})`,P[Jn.visibleColumnsCount.name]=T.length,h!=null){P[Lg]=Te.columnWidths.get(h[1]);let v=Te.columnOffsets.get(h[1]);if(o.brain.isHorizontalLayoutBrain){let M=o.brain.getPageIndexForRow(h[0]);P[jc]=M?`calc( ${se.runtime.totalVisibleColumnsWidthVar} * ${M} + ${v})`:v}else P[jc]=v}P[Gg]=T.length,P[Fg]=R.horizontal?`${e}px`:"0px",P[kc]=R.vertical?`${e}px`:"0px",P[Vg]="calc( "+S.map(v=>Te.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[Yc]="calc( "+b.map(v=>Te.columnWidths.get(v.computedVisibleIndex)).join(" + ")+")",P[qc]=T.length*10,P[Uc]=`calc( var(${$c}) - var(${Yc}) - var(${kc}) )`,P[$c]=`${m.width}px`,P[zg]=`${m.height}px`;let x=yl(v=>{r.focused=v}),D=yl(v=>{r.focusedWithin=v}),E={...n,onFocus:v=>{if(n?.onFocus?.(v),v.target===s.current||v.target===u.current){if(i().focused)return;x(!0),p?.(v),l&&(D(!1),c?.(v));return}l||(D(!0),d?.(v))},onBlur:v=>{if(n?.onBlur?.(v),v.target===s.current||v.target===u.current){if(!i().focused)return;x(!1),f?.(v),l&&(D(!1),c?.(v));return}s.current?.contains(v.relatedTarget)||(D(!1),c?.(v))}},F=ee(Lt,Gc,g?`${Lt}--horizontal-layout`:null,E?.className,y?`${Lt}--has-pinned-start ${Hc}`:null,C?`${Lt}--has-pinned-end ${Kc}`:null,a?`${Lt}--focused`:null,l?`${Lt}--focused-within`:null,a&&o.focusedClassName?o.focusedClassName:null,l&&o.focusedWithinClassName?o.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Lt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Lt}--has-pinned-end-overflow`:null,Bc({horizontalLayout:!!g,hasPinnedStart:!!y,hasPinnedEnd:!!C,focused:a,focusedWithin:l}));return E.className=F,E.style={...n?.style,...P},a&&o.focusedStyle&&Object.assign(E.style,o.focusedStyle),l&&o.focusedWithinStyle&&Object.assign(E.style,o.focusedWithinStyle),E}var ed=B(Xo());function yi(n){return n.map(e=>e instanceof pt?e:new pt(null,[e]))}var pt=class{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new pt("+",[this,...e])}subtract(...e){return new pt("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new pt("*",[this,...e])}divide(...e){return new pt("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>Kg(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Kg(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Hg=(...n)=>new pt("+",yi(n)),Zc=(...n)=>new pt("-",yi(n)),Bg=(...n)=>new pt("*",yi(n)),kg=(...n)=>new pt("/",yi(n)),Ci={add:Hg,subtract:Zc,minus:Zc,multiply:Bg,divide:kg};var er=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Qc=n=>{let e=null,t=null;return{stop(){e!==null&&Rt(e),t!=null&&Rt(t)},scroll(o){e!==null&&Rt(e),t!=null&&Rt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft-p,e=Ae(()=>{i.scroll(o)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return o.scrollLeft=o.scrollLeft+p,t=Ae(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var Jc=10,Wg=X(Y.pinnedStartWidth);function td(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,setProxyPosition:d,api:p,horizontalLayoutPageIndex:f,pageWidth:m}=n;function h(j){let V=j==="start"?E:F;return D===_?V:_===j?V+P.computedWidth:D===j?V-P.computedWidth:V}function g(j){if(j.columnIndex===x||f!=null)return!0;let V=e[j.columnIndex];if(V.computedPinned)return!0;let L=l.getScrollPosition().scrollLeft,Q=V.computedOffset+(f!=null&&m!=null?m*f:0);return Q>=L+h("start")&&Q+V.computedWidth<=L+c.width-h("end")}let y=(j,V)=>{let{restrictToParentGroup:L,dragColumn:Q}=V,$=[];if(j.forEach(J=>{if(J.computedVisibleIndex===x)return;let O={columnId:J.id,columnIndex:J.computedVisibleIndex,offsetX:J.computedOffset+Math.round(J.computedWidth/2)};g(O)&&$.push(O)}),L){let O=function(be,k,te){let de=j[be];de&&(de.columnGroup!==Q.columnGroup&&te.add(de.id),O(be+k,k,te))};var ue=O;let J=Q.computedVisibleIndex,Re=new Set;O(J-1,-1,Re),O(J+1,1,Re),$=$.filter(be=>!Re.has(be.columnId))}return $},S=r.length,b={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},T={left:b.clientX-c.left-(b.clientX-s.left)+Jc,top:b.clientY-c.top-(b.clientY-s.top)+Jc},I=l.getScrollPosition(),R=e.map(j=>j.computedVisibleIndex),w=R,P=t.get(i),x=P.computedVisibleIndex,D=P?.computedPinned,A=x,_=D,E=l.getFixedStartColsWidth(),F=l.getFixedEndColsWidth(),v=b,M={x:0,y:0},N=1,G=0;function U(j){let V=Math.round(j.clientX),L=Math.round(j.clientY);if(V===v.clientX&&L===v.clientY)return;v={clientX:V,clientY:L};let $=l.getScrollPosition().scrollLeft-I.scrollLeft;M.x=v.clientX-b.clientX,M.y=v.clientY-b.clientY,G=M.x+$,N=G<0?-1:1,d({left:T.left+M.x,top:T.top+M.y})}function oe(j){let V=0;D?D==="start"&&j.forEach((L,Q)=>{V||e[L]?.computedPinned!=="start"&&(V=Q)}):j.forEach((L,Q)=>{e[L]?.computedPinned==="start"&&(V=Q+1)}),S=V,ge("start",j,V)}function ge(j,V,L){if(j==="start"){let Q=0;for(let $=0;$<L;$++){let ue=V[$],J=e[ue];Q+=J.computedWidth}Ht(Wg,`${Q}px`,a)}}function ce(j){if(j==null||j===A)return;A=j;let V=er(R,x,A>x?A-1:A);S=0;let Q=new Set;return V.forEach(($,ue)=>{let J=w[ue];$!==J&&Q.add($),oe(V)}),w=V,z(Q),{newColumnIndexes:V,indexesWithTransition:Q,pinnedStartCount:S}}function z(j){e.forEach(V=>{let L=V.computedVisibleIndex;j.has(L)?lu(L,a):Hr(L,a);let Q=L===x,$=N===-1?L<A||L>x:L<x||L>=A,ue="";N===-1?ue=Q?Te.columnOffsets.get(A):$?Te.columnOffsets.get(L):Ci.add(Te.columnOffsets.get(L),Te.columnWidths.get(x)).done():ue=$?Te.columnOffsets.get(L):Q?Ci.add(Te.columnOffsets.get(A-1),Te.columnWidths.get(A-1)).minus(Te.columnWidths.get(x)).done():Ci.minus(Te.columnOffsets.get(L),Te.columnWidths.get(x)).done(),zn(L,ue,a)})}let W=c.left+h("start"),le=c.right-h("end"),ne=Qc({scrollOffsetStart:W,scrollOffsetEnd:le});return U(b),{speedScroller:ne,stop(){ne.stop()},onMove(j){U(j),ne.scroll({mousePosition:v,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(J){p.scrollLeft=J}});let V=y(e,{dragColumn:P,restrictToParentGroup:u==="group"}),L=N===-1?P.computedOffset+G:P.computedOffset+P.computedWidth+G,Q=(0,ed.default)(V,L,({offsetX:J},O)=>J<O?-1:J>O?1:0);Q<0&&(Q=~Q),V.length?Q=V[Q]?V[Q].columnIndex:V[V.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),Q=0),Q===x+1&&(Q=x),ce(Q);let $={};o.forEach(J=>{$[J.id]="end"});for(let J=0;J<S;J++){let O=w[J],Re=e[O];$[Re.id]="start"}let ue=w.map(J=>e[J].id);return{columnPinning:$,columnOrder:ue}}}}function lo(n,e,t){if(n===e)return!0;if(!n||!e)return!1;var o=Object.keys(n),r=Object.keys(e);t&&(o=o.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=o.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=o[a];if(!(t&&t.has(l))&&(n[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Tl(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return o;if(a>i){let l=e.indexOf(r),s=e[l-1],u=o.indexOf(s),c=o.indexOf(r);return er(o,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=o.indexOf(s),c=o.indexOf(r);return er(o,c,u)}return e}var jg=X(Y.baseZIndexForCells),$g=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:lo(n,e)},od=({columnId:n,domRef:e,horizontalLayoutPageIndex:t})=>{let[o,r]=(0,tr.useState)(null),{actions:i,computed:a,getComputed:l,getState:s,api:u,state:{domRef:c}}=Z(),d=(0,tr.useCallback)(f=>{let m=l().computedVisibleColumnsMap.get(n);if(!m||!m.computedSortable)return;let{multiSortBehavior:h}=s();u.toggleSortingForColumn(n,{multiSortBehavior:h==="replace"&&(f.ctrlKey||f.metaKey)?"append":h})},[]),p=(0,tr.useCallback)(f=>{let m=f.target?.tagName;if(m==="INPUT"||m==="BUTTON")return;let{brain:h,draggableColumnsRestrictTo:g}=s(),{computedVisibleColumns:y,computedVisibleColumnsMap:C,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedPinnedEndColumns:T}=l(),I=C.get(n);if(!I.computedDraggable){d(f);return}let R=e.current,w=R.getBoundingClientRect(),P=c.current.getBoundingClientRect(),x=h.getAvailableSize(),D=I.computedVisibleIndex,A=h.getVirtualColIndex(I.computedVisibleIndex,{pageIndex:t||0}),_=h.isHorizontalLayoutBrain?h.getPageWidth():null,E=R.style.cursor??"auto",F=!1,v=td({brain:h,horizontalLayoutPageIndex:t,pageWidth:_,draggableColumnsRestrictTo:g,computedPinnedEndColumns:T,computedPinnedStartColumns:S,computedUnpinnedColumns:b,computedVisibleColumns:y,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:w,dragColumnId:n,api:u,infiniteDOMNode:c.current,setProxyPosition:r,tableRect:P,initialMousePosition:{clientX:f.clientX,clientY:f.clientY}}),M=null,N,G;function U(ce){let{columnPinning:z,columnOrder:W}=ce;$g(s().columnPinning,z)||(i.columnPinning=z);let le=l().computedColumnOrder;JSON.stringify(W,le)&&(y.forEach(ne=>{zn(ne.computedVisibleIndex,"",c.current)}),i.columnOrder=Tl({newColumnOrder:W,visibleColumnOrder:l().computedVisibleColumns.map(ne=>ne.id),existingColumnOrder:le,dragColumnId:n}))}let oe=ce=>{let{headerBrain:z,brain:W}=s();if(!F){F=!0;let le=W.keepColumnRendered(A),ne=z.keepColumnRendered(A);if(W.isHorizontalLayoutBrain){let V=W.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),L=z.extendRenderRange({start:!0,end:!0,direction:"horizontal"});G=()=>{V(),L()}}N=()=>{le(),ne()},i.columnReorderDragColumnId=I.id,t!=null&&(i.columnReorderInPageIndex=t),Ga(D,`calc( var(${jg}) + 10000 )`,c.current),c.current?.classList.add(gl),R.style.cursor="grabbing"}M=v.onMove(ce)},ge=ce=>{let{multiSortBehavior:z}=s(),W=e.current;c.current?.classList.remove(gl),v.stop(),h.update({...x}),N?.(),G?.(),y.forEach(ne=>{Hr(ne.computedVisibleIndex,c.current),zn(ne.computedVisibleIndex,"",c.current)}),Ga(D,Cl(I,{pinnedStartColsCount:S.length,visibleColsCount:y.length}),c.current),W.style.cursor=E,W.releasePointerCapture(ce.pointerId),W.removeEventListener("pointermove",oe),W.removeEventListener("pointerup",ge),r(null);let le=u.getColumnApi(I.id)?.isSortable()??!1;!F&&le&&u.toggleSortingForColumn(I.id,{multiSortBehavior:z==="replace"&&(ce.ctrlKey||ce.metaKey)?"append":z}),M&&U(M),i.columnReorderDragColumnId=!1,t!=null&&(i.columnReorderInPageIndex=null)};R.addEventListener("pointermove",oe),R.addEventListener("pointerup",ge),R.setPointerCapture(f.pointerId)},[n,t]);return{onPointerDown:a.computedVisibleColumnsMap.get(n)?.computedDraggable?p:d,proxyPosition:o}};var cn=B(require("react"));var me=B(require("react")),Be=require("react");var Mo=B(require("react"));var nd=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var or=B(require("react")),ad=require("react");var rd="_6rdmyg0 _16lm1iwn _16lm1iwi _16lm1iw9",id=Ce({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwg",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwh"]]});var Ti=`${dt}-expand-collapse`;function Eo(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,ad.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),oo("expanded",n)||i(!r)};or.useEffect(()=>{oo("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return or.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:ee(n.className,rd,id({direction:t||"start",expanded:r,disabled:o}),`${dt}`,`${Ti}`,`${Ti}--${l}`,`${Ti}--${t==="end"?"end":"start"}`,o?`${Ti}--disabled`:"")},or.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Si=B(require("react"));var ld="_16lm1iwb _16lm1iwn _16lm1iwi";var sd=n=>Si.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:ee(n.className,ld,"InfiniteIcon","InfiniteIcon-loading")},Si.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Si.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var ud=Ce({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),cd="_7pupv00",dd=Ce({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function pd({rowInfo:n}){return{[X(se.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function bi({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=o,d=ee(tn.flex,i.align==="end"?Yn.rowReverse:Yn.row,Lu.center,`${_o}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||u)?ud({align:a}):null);if(e==="multi-column"){if(n+1!==c.groupNesting&&c.isGroupRow)return u?Mo.createElement("div",{className:d},u):null}else e==="single-column"&&c.isGroupRow;return Mo.createElement("div",{className:d},s,u,Mo.createElement("div",{className:Nt},l??null))}}function Ri({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===n&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&n+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return nd(c)?f=Mo.createElement(sd,null):m&&(f=Mo.createElement(Eo,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),o&&(r.renderBag.groupIcon=f,f=Mo.createElement(at,{render:o,renderParam:r})),f}}function fd(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:bi({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Ri({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function md(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:bi({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:Ri({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function hd(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Ii=B(require("react")),wi=require("react");var gd="qz8ht90 _16lm1iwi";function Ug(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:Yg}=Ot({forwardProps:Ug,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function qg(){let{componentState:n,componentActions:e}=He(),{checked:t,domProps:o,disabled:r}=n,i=(0,wi.useRef)(null);return(0,wi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Ii.createElement("input",{...o,className:ee("InfiniteCheckBox",gd,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function so(n){return Ii.createElement(Yg,{...n},Ii.createElement(qg,null))}function Xg(n){return typeof n.field=="string"}function yd(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function ft(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:h}=o(),g=r===f&&m==="row",y=!h||typeof h=="function"&&!h(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:C,formattedValueContext:{rawValue:S}}=un({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:n}),b=tt(p.id,n);return c?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:y,data:u.data,rowActive:g,rowInfo:u,rowSelected:u.rowSelected,value:C,rawValue:S}}function Cd(n){return Sd(n.column,n.rowInfo)}function Td(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=yd({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=un(n),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:c,rowHasSelectedCells:!1},u,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:c,stylingParam:d,formattedValueContext:u,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:Zg({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function Zg(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=n,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:h}=f(),{indexInAll:g}=o,y=p(),{selectionMode:C,cellSelection:S}=y,b=yd({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,I=S?.isCellSelected(o.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...u,editError:h&&h.primaryKey===o.id&&h.columnId===e.id&&!h.active&&h.accepted instanceof Error?h.accepted:void 0,groupByColumn:b,selectionMode:C,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof c=="boolean"?`${c}`:c,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:g,toggleGroupRow:T,toggleCurrentGroupRow:()=>{o.isGroupRow&&T(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),R}function Sd(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Xg(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Qg(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:n,rawValue:n,field:e.field}}function un(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=Sd(e,t),a=Qg(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var kt=B(require("react"));var{rootClassName:bd}=ve,Fo=`${bd}Cell`,Sl=`${bd}Cell_content`,Jg=X(Y.columnWidthAtIndex),ey=X(Y.columnReorderEffectDurationAtIndex);function ty(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:h,...g}=n,y=m(),C={width:`var(${Jg}-${i.computedVisibleIndex})`,transition:`transform var(${ey}-${i.computedVisibleIndex}, 0s)`,...g.style},S={...g,style:C,"data-column-id":i.id,"data-z-index":C.zIndex,className:ee(g.className,Fo,vu),children:kt.createElement(kt.Fragment,null,d,kt.createElement("div",{className:ee(Sl,e?Nt:Bu.hidden,s),style:r},y),c)};u!=null&&(S["data-row-id"]=`${u}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?kt.createElement(b,{...S,ref:a}):kt.createElement("div",{...S,ref:a})}var Pi=kt.memo(ty);var Oo=B(require("react")),nr=require("react");function Rd(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=xi(),i=(0,nr.useRef)(),a=Oo.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=(0,nr.useCallback)(s=>{let{key:u}=s;u==="Enter"||u==="Tab"?t():u==="Escape"?o():s.stopPropagation()},[]);return Oo.createElement(Oo.Fragment,null,Oo.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:ee(Nu,Hu.none),type:"text",defaultValue:n,onChange:(0,nr.useCallback)(s=>{e(s.target.value)},[])}))}var{rootClassName:oy}=ve,ny=X(Y.columnZIndexAtIndex);function ry({rowInfo:n}){return{[X(se.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var rr=me.createContext(null),_o=`${oy}ColumnCell`,iy=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return me.createElement(Eo,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},ay={display:"inline-block",visibility:"visible"},bl=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return me.createElement(Eo,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:ay,expanded:o,onChange:t})},ly=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||so;return me.createElement(c,{domProps:{className:ei},disabled:e.isTreeNode?!u(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():o()},checked:e.rowSelected})};function Rl(n,e){return n?typeof n=="function"?n(e):n:void 0}function Il(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function sy(n){let{rowInfo:e,rowStyle:t,rowClassName:o,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:u,width:c,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:h,rowIndex:g,rowHeight:y,columnsMap:C,fieldsToColumn:S,domRef:b,hidden:T,showZebraRows:I}=n,R=me.useRef(null),w=(0,Be.useCallback)(pe=>{R.current=pe,b&&b(pe)},[b]);if(!d)return me.createElement("div",{ref:w},"no column");let{rowSelected:P}=e,{getState:x,actions:D,computed:A,api:_,getDataSourceMasterContext:E}=Z(),{componentState:F,getState:v,api:M,componentActions:N}=we(),{activeRowIndex:G,keyboardNavigation:U,columnReorderInPageIndex:oe}=x(),ge=g===G&&U==="row",ce={getState:x,getDataSourceState:v,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:_,dataSourceApi:M},z=e.rowDisabled,W=A.computedVisibleColumns.map(pe=>pe.id),le=Td({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:u,columnsMap:C,visibleColumnsIds:W,fieldsToColumn:S,context:ce}),{stylingParam:ne,renderParams:j,formattedValueContext:V,renderFunctions:L,groupByColumnReference:Q,inEdit:$}=le,{align:ue,verticalAlign:J}=j,O=j,Re=me.useRef(O),be=m&&f?pe=>{let Tt={...V,rowIndex:g};m(Tt,pe),f(pe)}:f,k=h&&p?pe=>{let qe={...V,rowIndex:g,rowInfo:e};h(qe,pe),p(pe)}:p,te=(0,Be.useCallback)(pe=>{let qe=d.computedVisibleIndex;x().cellClick({rowIndex:g,colIndex:qe,event:pe})},[g,d.computedVisibleIndex,U]),de=(0,Be.useCallback)(pe=>{let qe=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:g,colIndex:qe,event:pe}),U==="row"){z||(D.activeRowIndex=g);return}U==="cell"&&(D.activeCellIndex=[g,qe])},[g,z,d.computedVisibleIndex,U]),{selectionMode:De,cellSelection:Pe,isNodeReadOnly:Ve}=F,Ee=O.cellSelected;O.domRef=w,O.htmlElementRef=R,O.toggleCurrentTreeNode=(0,Be.useCallback)(O.toggleCurrentTreeNode,[e]),O.selectCell=(0,Be.useCallback)(O.selectCell,[e]),O.deselectCell=(0,Be.useCallback)(O.deselectCell,[e]),O.selectCurrentRow=(0,Be.useCallback)(O.selectCurrentRow,[e]),O.deselectCurrentRow=(0,Be.useCallback)(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=(0,Be.useCallback)(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=(0,Be.useCallback)(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=(0,Be.useCallback)(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=(0,Be.useCallback)(O.toggleCurrentTreeNodeSelection,[e]);let je=d.components?.Editor??Rd,Je=$?me.createElement(wd,{contextValue:O},me.createElement(je,null)):null,Ue=(0,Be.useCallback)(et(()=>{if(T||$)return null;if(Re.current=O,L.renderGroupIcon&&(O.renderBag.groupIcon=me.createElement(at,{render:L.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),L.renderSelectionCheckBox&&De=="multi-row"&&(O.renderBag.selectionCheckBox=me.createElement(at,{render:ly,renderParam:O}),L.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=me.createElement(at,{render:L.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:Tt}=e,bt;bt=(Tt?L.renderTreeIconForParentNode:L.renderTreeIconForLeafNode)||typeof L.renderTreeIcon=="function"?L.renderTreeIcon:Tt&&L.renderTreeIcon===!0?bl:void 0,bt===!0?bt=bl:bt&&(O.renderBag.treeIcon=me.createElement(at,{render:bl,renderParam:O})),bt&&(O.renderBag.treeIcon=me.createElement(at,{render:bt,renderParam:{...O,renderBag:{...O.renderBag}}}))}L.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=me.createElement(at,{render:iy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof L.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=me.createElement(at,{render:L.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),L.renderValue&&(O.renderBag.value=me.createElement(at,{render:L.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&L.renderGroupValue&&(O.renderBag.value=me.createElement(at,{render:L.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&L.renderLeafValue&&(O.renderBag.value=me.createElement(at,{render:L.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),Re.current=O;let pe=O.renderBag.value;pe instanceof Date&&(pe=pe.toLocaleDateString());let qe=me.createElement(me.Fragment,null,ue!=="end"?O.renderBag.treeIcon:null,ue!=="end"?O.renderBag.groupIcon:null,ue!=="end"?O.renderBag.rowDetailsIcon:null,ue!=="end"?O.renderBag.selectionCheckBox:null,pe,ue==="end"?O.renderBag.selectionCheckBox:null,ue==="end"?O.renderBag.rowDetailsIcon:null,ue==="end"?O.renderBag.groupIcon:null,ue==="end"?O.renderBag.treeIcon:null);return d.render?me.createElement(at,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:qe}}}):qe}),[d,T,$,u,d.renderTreeIcon||d.renderTreeIconForParentNode?Ve:!1,...hd(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),ut=A.computedVisibleColumns.map(pe=>pe.id),nt=A.computedColumnOrder,H={...V,visibleColumnIds:ut,allColumnIds:nt,rowIndex:g,rowHasSelectedCells:!1};Object.defineProperty(H,"rowHasSelectedCells",{get(){return e.hasSelectedCells(ut)}});let re=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),K=typeof o=="function"?o(H):o,ie;Q?.className&&(ie=Rl(Q.className,ne)),s&&(ie=ee(ie,Rl(s,ne))),d.className&&(ie=ee(ie,Rl(d.className,ne))),re&&(ie=ee(ie,dd({align:ue})));let ye;e.dataSourceHasGrouping&&d.groupByForColumn&&(ye=pd({rowInfo:e})),re&&(ye=ry({rowInfo:e})),t&&(ye=typeof t=="function"?{...ye,...t(H)}:{...ye,...t}),l&&(ye=Il(ye,l,ne)),Q?.style&&(ye=Il(ye,Q.style,ne)),d.style&&(ye=Il(ye,d.style,ne)),ye=ye||{},ye.height=y,ye.zIndex=`var(${ny}-${d.computedVisibleIndex})`;let ae=(0,Be.useMemo)(()=>ye,[ye?JSON.stringify(ye):null]),Ye=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:g)%2===1,Ct=I?Ye?"odd":"even":!1,Mt=!1,Io=!1,$o=!1,Ar=!1;if(Pe&&Ee){let pe=a(),qe=pe[e.indexInAll-1],Tt=pe[e.indexInAll+1],bt=A.computedVisibleColumns[d.computedVisibleIndex+1],En=A.computedVisibleColumns[d.computedVisibleIndex-1];Mt=qe?!Pe.isCellSelected(qe.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?Io=!0:Io=En?!Pe.isCellSelected(e.id,En.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?$o=!0:$o=bt?!Pe.isCellSelected(e.id,bt.id):!0,Ar=Tt?!Pe.isCellSelected(Tt.id,d.id):!0}let Er=Pe&&Ee?{top:Mt,left:Io,right:$o,bottom:Ar}:null,An=oe!=null?i!==oe:!1,Mr=Je,Ca=Ue(),Ta={domRef:w,cellType:"body",column:d,width:c,rowId:e.id,horizontalLayoutPageIndex:i,style:ae,onMouseLeave:k,onMouseEnter:be,onClick:te,afterChildren:Mr,onMouseDown:de,cssEllipsis:d.cssEllipsis??!0,className:ee(Er?Eu(Er):"",gi(d,[_o,Fo],Au,{dragging:!1,insideDisabledDraggingPage:An,zebra:Ct,align:ue,verticalAlign:J,rowDisabled:z,rowActive:ge,cellSelected:Ee,rowSelected:P,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),ie,K),renderChildren:(0,Be.useCallback)(()=>Ca,[Ue])},Sa=rr.Provider;return me.createElement(Sa,{value:Re.current},me.createElement(Pi,{...Ta}))}var Id=me.memo(sy);function ir(){return(0,Be.useContext)(rr)}function xi(){let{api:n,state:{editingValueRef:e,editingCell:t}}=Z(),{column:o,rowInfo:r}=ir(),[i]=me.useState(()=>t?.value),[a,l]=me.useState(i),s=t?!t.active&&!!t.waiting:!1,u=me.useCallback(f=>{e.current=f,l(f)},[]);me.useLayoutEffect(()=>{e.current=i},[]);let c=n.confirmEdit,d=n.cancelEdit,p=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function ar(n){return n.render(n.renderParam)??null}function at(n){let e=rr.Provider;return cn.createElement(e,{value:n.renderParam},cn.createElement(ar,{render:n.render,renderParam:n.renderParam}))}function wd(n){let e=rr.Provider;return cn.createElement(e,{value:n.contextValue},n.children)}function uo(n){let e=Di.Provider;return cn.createElement(e,{value:n.renderParam},cn.createElement(ar,{render:n.render,renderParam:n.renderParam}))}var co=B(require("react"));var uy={width:"100%",pointerEvents:"none"},wl=`${dt}-menu`,Pl=li({"data-name":""}),xl={[Pl["data-name"]]:"menu-icon"};function lr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...uy,borderTop:`${se.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return co.createElement("div",{...o,style:e,...xl,onPointerDown:s=>s.stopPropagation(),className:ee(t,Tc({menuVisible:i,reserveSpaceWhenHidden:r}),dt,`${dt}-menu`)},a??co.createElement(co.Fragment,null,co.createElement("div",{className:wl,style:l}),co.createElement("div",{className:wl,style:l}),co.createElement("div",{className:wl,style:l})))}var dn=B(require("react")),sr=require("react");var Pd="_1ek6mqy0 _16lm1iwz _16lm1iw1n _16lm1iw1 _16lm1iw1v";var cy={transition:"width 0.25s, opacity 0.25s"};function xd(n){let[e,t]=(0,sr.useState)(!0),[o,r]=(0,sr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=n,c=u!=null&&u>0,d=n.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...cy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,sr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==o){let C=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(C)}}return()=>{}},[i,e]);let h=()=>{let C=!(o===0&&i===0);C!==e&&t(C)};if(!e)return null;let g={};return i===-1&&(g.top="100%"),dn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:ee(s,dt,Pd,`${dt}-sort`)},c?dn.createElement("div",{"data-name":"index",style:g,className:Rc},u):null,dn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:h}),dn.createElement("div",{style:{width:f[1],...m}}),dn.createElement("div",{style:{width:f[2],...m}}))}var Ed=B(require("react")),Dl=require("react");var ur=require("react"),cr=B(require("react"));function Dd(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Te.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?za(l,i,o.current):Te.columnOffsets.set(a,l.computedOffset+i,o.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let u=e[l];if(u.computedPinned==="start"){za(u,i,o.current);continue}u.computedPinned!=="end"&&Te.columnOffsets.set(l,u.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Te.columnOffsets.set(l,u.computedOffset+i,o.current)}}}}}function vd(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,u=i.current;if(o.forEach((c,d)=>{s+=c;let p=n[d],f=r[p],m=f.computedWidth+c;Te.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Te.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&Te.columnOffsets.set(c,d.computedOffset+s,u)}}}}var vi="zneyzh0 _16lm1iw2 _16lm1iw1d _16lm1iw1k _16lm1iw1i _16lm1iwk _16lm1iw1y",Ai=Ce({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw1d _16lm1iw1i",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},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),Ei=Ce({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw1f _16lm1iw1m",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:dy}=ve,py=`${dy}HeaderCell_ResizeHandle`;function fy(n){let{state:{brain:e,headerBrain:t}}=Z(),o=(0,ur.useRef)(null),[r,i]=(0,ur.useState)(!1),a=(0,ur.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=h=>{h.stopPropagation();let g=!!h.shiftKey,y=h.pointerId,C=h.clientX,S=h.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),P()}}S.setPointerCapture(y);let b=Dd(n.columnIndex,{columns:n.columns,shareSpaceOnResize:g,domRef:o}),T=(w,{done:P}={})=>{s&&(w=w/(s+1),P&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:x,constrained:D}=n.computeResize({diff:w,shareSpaceOnResize:g});return a.current!==D&&i(D),b.resize(x),x},I=w=>{T(Math.round(w.clientX-C))},R=w=>{S.releasePointerCapture(y),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",R);let P=Math.round(w.clientX-C),x=T(P,{done:!0});p(),n.onResize({diff:x,shareSpaceOnResize:g})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return cr.createElement("div",{ref:o,className:`${py} ${vi} ${Ei({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},cr.createElement("div",{style:m,className:Ai({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Ad=cr.memo(fy);function Md(n,e){let{computed:{computedVisibleColumns:t},getState:o,getComputed:r,actions:i}=Z(),a=(0,Dl.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let d=o(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,h=r().computedVisibleColumns,g=!1,y=h.reduce((b,T)=>(T.computedFlex&&(b[T.id]={...p[T.id],flex:T.computedWidth},g=!0),b),{}),C=g?{...p,...y}:p;return ul({shareSpaceOnResize:c,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:u,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:C,items:h.map(b=>({id:b.id,computedFlex:b.computedFlex,computedWidth:b.computedWidth,computedMinWidth:b.computedMinWidth,computedMaxWidth:b.computedMaxWidth}))})},[n]),l=(0,Dl.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return n.computedResizable?Ed.createElement(Ad,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var No=`${it}HeaderCell`,_d=`${it}HeaderWrapper`;var my=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||so;return Ie.createElement(s,{domProps:{className:ei},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Di=Ie.createContext(null);var hy=X(Y.columnZIndexAtIndex),vl=Ie.createElement("div",{className:ai[1]}),Od=li({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":""});function Nd(n){let e=n.column,{api:t,getComputed:o,getState:r,actions:i,state:{showColumnFilters:a,components:l,portalDOMRef:s,columnHeaderHeight:u,columnReorderDragColumnId:c,columnMenuVisibleForColumnId:d,columnReorderInPageIndex:p},getDataSourceMasterContext:f}=Z(),{api:m,componentActions:h,getState:g,componentState:{filterDelay:y,filterTypes:C}}=we(),{allRowsSelected:S,someRowsSelected:b,selectionMode:T}=Po(),I=n.horizontalLayoutPageIndex,R=c===e.id,w=p!=null?I!==p:!1,{onResize:P,height:x,width:D,headerOptions:A,columnsMap:_}=n,E=e.computedSortInfo,F=e.header,v=(0,po.useCallback)(K=>{L.current=K,n.domRef?.(K)},[n.domRef]),M=A.alwaysReserveSpaceForSortIcon,N=e.headerAlign??e.align,G=(typeof N=="function"?N({isHeader:!0,column:e}):N)??"start",U=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",oe=tt(e,{actions:i,api:t,dataSourceActions:h,dataSourceApi:m,getComputed:o,getDataSourceState:g,getDataSourceMasterContext:f,getState:r}),ge=oe.isSortable(),ce=ge&&(e.computedSorted||M)?Ie.createElement(xd,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:se.spacing[2],marginInlineEnd:se.spacing[2]},className:`${No}__sort-icon ${bc} ${Ic({align:G})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,W=e.computedFilterable&&e.computedFiltered?Ie.createElement(rn,null):null,le=e.headerCssEllipsis??e.cssEllipsis??!0,ne={reserveSpaceWhenHidden:G==="center",menuVisible:d===e.id,style:G==="end"?{marginInlineStart:`calc(${se.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:se.spacing[2]}:{marginInlineEnd:`calc(${se.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:se.spacing[2]},domProps:{onMouseDown:K=>{K.stopPropagation(),oe.toggleContextMenu(K.target)}}},j=e.components?.MenuIcon||l?.MenuIcon||lr,V=Ie.createElement(j,{...ne}),L=(0,po.useRef)(null),Q={horizontalLayoutPageIndex:I,dragging:R,domRef:v,htmlElementRef:L,insideColumnMenu:!1,column:e,columnsMap:_,columnSortInfo:E,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:b,allRowsSelected:S,selectionMode:T,api:t,dataSourceApi:m,columnApi:oe,renderBag:{sortIcon:ce,filterIcon:W,menuIcon:V,menuIconProps:ne,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},$=Q,ue=()=>{let K={...Q,renderBag:{...Q.renderBag}};if(e.renderSortIcon&&(K.renderBag.sortIcon=Ie.createElement(uo,{render:e.renderSortIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderFilterIcon&&(K.renderBag.filterIcon=Ie.createElement(uo,{render:e.renderFilterIcon,renderParam:{...K,renderBag:{...K.renderBag}}})),typeof e.renderMenuIcon=="function"&&(K.renderBag.menuIcon=Ie.createElement(uo,{render:Ye=>{if(typeof e.renderMenuIcon!="function")return null;let Ct=e.renderMenuIcon(Ye);return Ct?Ct.type===j||Ct.type===lr?Ct:Ie.createElement(j,{...ne},Ct):null},renderParam:{...K,renderBag:{...K.renderBag}}})),e.renderSelectionCheckBox&&T==="multi-row"){K.renderBag.selectionCheckBox=Ie.createElement(uo,{render:my,renderParam:{...K,renderBag:{...K.renderBag}}});let Ye=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ye&&Ye!==!0&&(K.renderBag.selectionCheckBox=Ie.createElement(uo,{render:Ye,renderParam:{...K,renderBag:{...K.renderBag}}}))}F instanceof Function&&(K.renderBag.header=Ie.createElement(uo,{render:F,renderParam:{...K,renderBag:{...K.renderBag}}}));let ie=e.renderMenuIcon===!1?null:K.renderBag.menuIcon,ye=le?Ie.createElement("div",{className:Nt},K.renderBag.header):K.renderBag.header,ae=Ie.createElement(Ie.Fragment,null,G==="center"?vl:null,K.renderBag.selectionCheckBox,ye,K.renderBag.sortIcon,K.renderBag.filterIcon,G==="center"?vl:null,G!=="center"?vl:null,ie);return e.renderHeader?Ie.createElement(uo,{render:e.renderHeader,renderParam:{...K,renderBag:{...K.renderBag,all:ae}}}):ae};(0,po.useEffect)(()=>{let K=null,ie=L.current;return P&&ie&&(K=Nn(ie,P)),()=>{K?.()}},[L.current,n.onResize]);let J={height:x};e.headerStyle&&(J=typeof e.headerStyle=="function"?{...J,...e.headerStyle($)||{}}:{...J,...e.headerStyle});let O=typeof e.headerClassName=="function"?e.headerClassName($):e.headerClassName,{onPointerDown:Re,proxyPosition:be}=od({columnId:e.id,domRef:L,horizontalLayoutPageIndex:I}),k=null;R&&be&&(k=Ie.createElement("div",{key:e.id,className:`${No}Proxy ${dc}`,style:{position:"absolute",height:x,width:D,left:be.left??0,top:be.top??0,zIndex:1e9}},$.renderBag.header),k=(0,Fd.createPortal)(k,s.current));let te=Di.Provider,de={filtered:e.computedFiltered,verticalAlign:U,align:G},De=Ie.useMemo(()=>{let K=ie=>{t.setColumnFilter(e.id,ie)};return y>0?_t(K,{wait:y}):K},[y,e.id]),Pe=e.computedFilterType,Ve=C[Pe],Ee=e.computedFilterable?e.computedFilterValue?.filter.operator??Ve?.defaultOperator:void 0,je=e.computedFilterable&&Ve?Ve.operators.find(K=>K.name===Ee):void 0,Je=je?.components?.FilterEditor||Ve?.components?.FilterEditor||e.components?.FilterEditor||sn,Ue=Ve?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,ut=Md(e,{horizontalLayoutPageIndex:I}),nt=`var(${hy}-${e.computedVisibleIndex})`;J.zIndex=nt;let H={"data-field":`${e.field||""}`,"data-column-id":e.id,"data-header-align":G,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},re=e.computedFilterable?Ie.createElement(Nc,{horizontalLayoutPageIndex:I,filterEditor:Je,filterOperatorSwitch:Ue??Lc,operator:je,filterTypes:C,onChange:De,columnFilterType:Pe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:u}):Ie.createElement(Vc,null);return $.renderBag.filterEditor=re,Ie.createElement(te,{value:$},Ie.createElement(Pi,{domRef:v,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...H,"data-z-index":nt,style:J,width:D,onPointerDown:Re,contentClassName:ee(cc(de),Gu[G]),contentStyle:a?{height:x/2}:void 0,className:ee(No,ju.none,ge?Vu.pointer:"",O,gi(e,[No,Fo],pc,{dragging:R,insideDisabledDraggingPage:w,align:G,verticalAlign:U,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),uc),cssEllipsis:le,afterChildren:Ie.createElement(Ie.Fragment,null,a?re:null,ut),renderChildren:ue}),k)}function Qn(){return(0,po.useContext)(Di)}var wt=B(require("react"));function Ld(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((c,d)=>{let p=c.id,f=n[d-1],m=f?.id??"",h=new Set,g=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,h);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let C=c.columnGroup,S,b=y;for(;C;){let T=e[C];if(T){h.add(C);let I=[p,...h];S=g.has(C)?i.get(C):void 0,S||(S={id:C,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[C],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(C)??0},r.set(I,S),i.set(C,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),b&&!g.has(b.id)&&S.children.push(b),b=S,C=T.columnGroup}else break}});let l=[],s=new q,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&Vd(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=o+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Vd(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&Vd(t.children),e+=o})}var Lo=B(require("react")),Vo=require("react");var El=B(require("react"));var Gd=B(require("react")),Al=require("react");var dr=require("react"),pr=B(require("react"));var{rootClassName:gy}=ve,yy=`${gy}HeaderCell_ResizeHandle`;function Cy(n){let e=(0,dr.useRef)(null),[t,o]=(0,dr.useState)(!1),r=(0,dr.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let h=!0,g=vd(n.groupColumns.map(b=>b.computedVisibleIndex),{columns:n.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:T,adjustedDiffs:I,adjustedDiff:R}=n.computeResize(b);return r.current!==T&&o(T),g.resize(I),R},C=b=>{if(h){let T=n.groupColumns.reduce((w,P)=>w+P.computedWidth-P.computedMinWidth,0),I=n.brain.getAvailableSize(),R={width:I.width+T,height:I.height};n.brain.update(R),h=!1}y(Math.round(b.clientX-f))},S=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",C),m.removeEventListener("pointerup",S);let T=Math.round(b.clientX-f),I=y(T);n.onResize(I)};m.addEventListener("pointermove",C),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:se.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return pr.createElement("div",{ref:e,className:`${yy} ${vi} ${Ei({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},pr.createElement("div",{style:{...c,...n.style},className:Ai({constrained:t})}))}var zd=pr.memo(Cy);function Kd(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:u}=Z(),c=n[n.length-1],d=(0,Al.useCallback)(h=>{let g=l(),{columnSizing:y,viewportReservedWidth:C,bodySize:S}=g,b=s().computedVisibleColumns,T=!1,I=b.reduce((P,x)=>(x.computedFlex&&(P[x.id]={...y[x.id],flex:x.computedWidth},T=!0),P),{}),R=T?{...y,...I}:y;return Dc({availableSize:S.width,reservedWidth:C||0,dragHandleOffset:h,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:n.length,items:b.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=(0,Al.useCallback)(h=>{let{columnSizing:g,reservedWidth:y}=d(h);u.viewportReservedWidth=y,u.columnSizing=g},[d]);return n.some(h=>h.computedResizable)?Gd.createElement(zd,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:p}):null}var Hd=`${it}HeaderGroup`,Bd=X(Y.columnWidthAtIndex),Ty=X(Y.columnZIndexAtIndex);function kd(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Kd(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=o[0],c=o.length>1?"calc( "+o.map(f=>`var(${Bd}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Bd}-${u.computedVisibleIndex})`,d=`calc(var(${Ty}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,El.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:ee(Cc,Hd),style:p,"data-z-index":d},El.createElement("div",{className:ee(`${Hd}__header-content`,Nt)},a),s)}var{rootClassName:Sy}=ve,by=[],Wd=`${Sy}Header`,Ry=fc({overflow:!1});function Iy(n){let{bodyBrain:e,columns:t,style:o,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=n,{computed:s,getState:u,state:{headerBrain:c,headerOptions:d,showColumnFilters:p}}=Z(),{computedColumnsMap:f}=s,m=(0,Vo.useRef)(null),h=(0,Vo.useCallback)(C=>{m.current&&(m.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);(0,Vo.useEffect)(()=>{let C=c.onScroll(h);return h(c.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[c]);let g={ref:m,className:ee(Wd,`${Wd}--virtualized`,r,Ry),style:{...o,height:i}},y=(0,Vo.useCallback)(C=>{let{rowIndex:S,colIndex:b,domRef:T,height:I,widthWithColspan:R,heightWithRowspan:w,hidden:P}=C,x=t[b];if(!x||P)return null;let D=c.isHorizontalLayoutBrain?c.getPageIndexForRow(S):null,A=a?a.pathsToCells.get([S,b]):null;if(A&&A.type==="group"){let _=A.columnItems.map(v=>v.ref),E={...A.ref,id:A.id,uniqueGroupId:A.uniqueGroupId,depth:A.depth,columns:_.map(v=>v.id),computedWidth:A.computedWidth,groupOffset:A.groupOffset};return u().columnGroupVisibility[A.id]!==!1?Lo.createElement(kd,{horizontalLayoutPageIndex:D,bodyBrain:e,columnGroupsMaxDepth:l,domRef:T,columns:_,width:R,height:I,columnGroup:E}):null}return Lo.createElement(Nd,{domRef:T,column:x,horizontalLayoutPageIndex:D,headerOptions:d,width:R,height:w,columnsMap:f})},[d,t,i,a,l,p,c]);return Lo.createElement("div",{...g},Lo.createElement(Xr,{name:"header",renderCell:y,brain:c,cellHoverClassNames:by,cellDetachedClassNames:ti}))}var jd=Lo.memo(Iy);function $d(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,r=Z(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:u,columnGroupsDepthsMap:c,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,h=m*u+(f?u:0),g=wt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return Ld(l,p,c,d)},[l,p,c]),y=wt.useCallback(({rowIndex:R,colIndex:w})=>{let P=l[w],x=1,D=1;if(!P||!g)return{rowspan:x,colspan:D};let A=g.pathsToCells.get([R,w]);if(!A)return{rowspan:x,colspan:D};if(A.type==="column")return{colspan:D,rowspan:m-A.depth};let _=A.columnItems.findIndex(E=>E.id===P.id);return{rowspan:x,colspan:_===0?A.columnItems.length:1}},[p,d,l,g,m,c]),C=wt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).rowspan,[y]),S=wt.useCallback(({rowIndex:R,colIndex:w})=>y({rowIndex:R,colIndex:w}).colspan,[y]),b=wt.useCallback(R=>f?R<m-1?u:2*u:u,[m,f,u]);oi(e,{colWidth:s,rowHeight:b,rows:m,cols:l.length,height:h,rowspan:C,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=wt.createElement(jd,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:h,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:g}),I=o.vertical&&io()?wt.createElement("div",{className:Sc,style:{zIndex:1e3,width:io()}}):null;return wt.createElement("div",{className:`${_d} ${wc}`,style:{height:h}},T,I)}var Wt=B(require("react")),Xd=require("react");function Ud(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Yd={padding:se.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},wy={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},qd=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(Ud(t),o,"important")},Zd=Wt.forwardRef(function(e,t){let{rootClassName:o}=ii(),r=Wt.useRef(null),i=Wt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Xd.useEffect)(()=>{let a=()=>{setTimeout(()=>{qd(r.current,Yd),qd(r.current?.firstElementChild,wy)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Wt.createElement("div",{ref:i,...e,className:ee(`${o}-Footer`,zc,e.className),style:Yd},"Powered by"," ",Wt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});var pn=B(require("react"));var Qd={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i"},Jd="qy58ya3 _16lm1iw2 _16lm1iw1d _16lm1iw1f _16lm1iw1k _16lm1iw1i",ep="qy58ya4";var{rootClassName:Py}=ve,Ml=`${Py}-LoadMask`;function xy(n){let{visible:e,children:t="Loading"}=n;return pn.createElement("div",{className:`${Qd[e?"visible":"hidden"]} ${Ml}`},pn.createElement("div",{className:`${Jd} ${Ml}-Overlay`}),pn.createElement("div",{className:`${ep} ${Ml}-Text`},t))}var Mi=pn.memo(xy);function _l(n){return n.map(Vt)}function Vt(n){if(Me().structuredClone)return Me().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return _l(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(_l(Array.from(n)));if(n instanceof Map)return new Map(_l(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=Vt(n[t]));return e}function fr(n){return n}var zo=Object.seal({data:null,field:null});var mo="____root____",op="____not_loaded_yet____";function fo(){return!1}function Fl(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function _i(n,e,t,o,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function np(n,e){let{reducers:t={},pivot:o,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=n,u=new q;function c(g,y,C,S=0,b=[]){let T=!C.length||S===C.length-1,I=y[s?.values||"values"]||{};for(let R in I)if(I.hasOwnProperty(R)){let w=R;b.push(w),d.set(b,!0),g.set(b,{reducerResults:I[R][s?.totals||"totals"]||{},items:[]}),T||c(g,I[R],C,S+1,b),b.pop()}}let d=o?new q:void 0,p=[],f=Fl(t),m=Vt(f);e.visitDepthFirst((g,y,C,S)=>{let[b,...T]=y,I=g.children,R=u.get(T);if(R&&(R.cache=g.cache,R.childrenLoading=g.childrenLoading,R.childrenAvailable=g.childrenAvailable,R.error=g.error),T.length==r.length&&r.length){if(R){R.items=I;for(let P=0,x=T.length;P<x;P++){let D=T.slice(0,P),A=u.get(D);A&&(A.items=A.items||[],A.items=A.items.concat(I))}I=i.indexArray(I,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let w=0,P=I.length;w<P;w++){if(!I[w]){let _={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...T,`${op}${w}`],_);continue}let x=I[w].data,D=I[w].keys||[];if(D.length){let _=D[D.length-1];T.push(_)}let A={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:I[w].totalChildrenCount,reducerResults:I[w].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(T,A),o){let _=A.pivotDeepMap=new q,E=I[w].pivot;c(_,E,o,0,p)}D.length&&T.pop()}S?.()});let h={deepMap:u,groupParams:n,initialData:e,reducerResults:m};return o&&(h.topLevelPivotColumns=d,h.pivot=o),h}function tp(n,e,t,o,r,i,a,l,s,u=fr){let{items:c,reducerResults:d,pivotDeepMap:p}=n.get(e);if(c.push(o),a&&_i(o,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:h,valueGetter:g,toKey:y}=i[f],C=h?o[h]:null;g&&(zo.data=o,zo.field=h,C=g(zo));let S=(y||u)(C,o);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Vt(s),items:[]}));let{reducerResults:b,items:T}=p.get(t);T.push(o),a&&_i(o,r,a,b,e)}t.length=0}}function rp(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=n,d=c(r),p=[...o,d],f=s(r);if(t.set(p,!0),f){for(let y=0,C=o.length;y<=C;y++){let S=o.slice(0,y),b=e.get(S),{reducerResults:T,items:I}=b;I.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&_i(r,i,a,T,S)}return}let m=Vt(l),h=[];e.set(p,{items:h,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let g=u(r);if(!(!g||!Array.isArray(g))){for(let y=0,C=g.length;y<C;y++){let S=g[y];rp(n,e,t,p,S,y,a,l)}a&&mr(a,m,h)}}function ip(n,e){let{reducers:t}=n,o=Fl(t),r=Vt(o),i=new q,a=new q;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,u=e.length;s<u;s++)rp(n,i,a,[],e[s],s,t,o);return t&&mr(t,r,e),{deepMap:i,treeParams:n,treePaths:a,initialData:e,reducerResults:r}}function Oi(n,e){let{groupBy:t,defaultToKey:o=fr,pivot:r,reducers:i}=n,a=t.length,l=r?new q:void 0,s=new q,u=[],c=[],d=Fl(i),p=Vt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Vt(d)};r&&(m.pivotDeepMap=new q),s.set(u,m)}for(let m=0,h=e.length;m<h;m++){let g=e[m],y={};for(let C=0;C<a;C++){let{field:S,groupField:b,valueGetter:T,toKey:I}=t[C],R=S?g[S]:null;T&&(zo.data=g,zo.field=S,R=T(zo));let w=(I||o)(R,g);if(y[S||b]=w,u.push(w),!s.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Vt(d)};r&&(P.pivotDeepMap=new q),s.set(u,P)}tp(s,u,c,g,m,r,i,l,d,o)}a||tp(s,u,c,g,m,r,i,l,d,o),i&&_i(g,m,i,p,u),u.length=0}i&&(s.visitDepthFirst((m,h,g,y)=>{mr(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:C,reducerResults:S},b,T,I)=>{mr(i,S,C),I?.()}),y?.()}),mr(i,p,e));let f={deepMap:s,groupParams:n,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function ap(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function Dy(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let C in i)if(i.hasOwnProperty(C)){let b=i[C].field;b&&(f[b]=u[C]),b&&p[b]==null&&(p[b]=u[C])}}let m=!0,h=o[o.length-1],g=h;if(p!=null){let C=t[o.length-1];C&&C.field&&(g=p[C.field]),C&&C.toKey&&(g=C.toKey(g,p)),g=g??h}return typeof g=="string"&&g.startsWith(op)&&(m=!1,g=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:fo,hasSelectedCells:fo,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:g,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Fi(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function mr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function lp(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:h,repeatWrappedGroupRows:g,rowsPerPage:y}=r,{deepMap:C}=c,S=n.length,b=t[t.length-1],T=b?b.nodeExpanded:!0;for(let I=0;I<S;I++){let R=n[I],w=u(R,I),P=[...e,w];if(l(R)){let v={id:w,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:fo,hasSelectedCells:fo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,I],indexInParent:I,indexInAll:T?i.length:-1};p&&(v.rowSelected=p(v)),d&&(v.rowDisabled=d(v)),f&&f(v);let M=g&&y!=null&&y>0&&v.indexInAll%y===0?v.indexInAll/y:null;for(let N=0,G=t.length;N<G;N++){let U=t[N];if(T||(U.collapsedLeafNodesCount+=1),U.deepRowInfoArray.push(v),M!=null&&T){if(typeof g=="function"&&g(U)!==!0)continue;let oe=Fi(U,v.indexInAll,M);i[oe.indexInAll]=oe,v.indexInAll++}}T&&(i[v.indexInAll]=v);continue}let A=C.get(P)?.totalLeafNodesCount??0,_={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:w,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...o,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:fo,hasSelectedCells:fo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(_.rowSelected=p(_),h)){let v=h.getSelectionCountFor(_.nodePath);_.selectedLeafNodesCount=v.selectedCount,_.deselectedLeafNodesCount=v.deselectedCount}d&&(_.rowDisabled=d(_)),f&&f(_);let E=!0;if(m&&(_.selfExpanded=E=m(_)),T||(E=!1),_.nodeExpanded=E,T&&g&&y!=null&&y>0){let v=_.indexInAll,M=_.parentNodes;if(M.length>0&&v%y===0){let N=v/y,G=0;M.forEach(U=>{typeof g=="function"&&g(U)!==!0||(i.push(Fi(U,v+G,N)),G++,_.indexInAll++)})}}T&&(i[_.indexInAll]=_);let F=s(R);Array.isArray(F)&&lp(F,P,[...t,_],_.indexInParentNodes,r,i)}return i}function sp(n){let{dataArray:e}=n,t=[];return lp(e,[],[],[],n,t),{data:t}}function up(n){let{lazyLoad:e,groupResult:t,rowsPerPage:o,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:u,rowSelectionState:c,generateGroupRows:d,reducers:p={}}=n,{groupParams:f,deepMap:m,pivot:h}=t,{groupBy:g}=f,y=[],C=[],S=[],b=[];return m.visitDepthFirst((T,I,R,w)=>{let P=T.items,x=I.length,D=l?.isGroupRowCollapsed(I)??!1;b.push(R);let A=Dy({lazyLoad:e,groupBy:g,parents:Array.from(S),reducers:p,indexInGroup:R,indexInParentGroups:Array.from(b),indexInAll:y.length,groupKeys:I,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!D&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:I.length===g.length?T.items.length:m.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},T);if(u&&(A.rowSelected=u(A),c)){let M=c.getSelectionCountFor(A.groupKeys);A.selectedChildredCount=M.selectedCount,A.deselectedChildredCount=M.deselectedCount}s&&(A.rowDisabled=s(A));let _=S[S.length-1],E=_?.collapsed??!1;E&&(D=!0),A.collapsed=D;let F=d||D;if(E&&(F=!1),F){if(r&&o!=null&&o>0){let M=A.indexInAll,N=A.parents;if(N.length>0&&M%o===0){let G=M/o,U=0;N.forEach(oe=>{typeof r=="function"&&r(oe)!==!0||(y.push(Fi(oe,M+U,G)),U++,A.indexInAll++)})}}y.push(A),C.push(y.length-1)}A.collapsedChildrenCount=0,S.forEach(M=>{M.deepRowInfoArray.push(A),M.collapsedGroupsCount+=D?1:0}),_&&A.selfLoaded&&e&&(_.directChildrenLoadedCount+=1),i&&i(A),S.push(A);let v=!0;if(v){if(w)w();else if(!h){let M=y.length;D||(y.length+=P.length);let N=0;for(let G=0,U=P.length;G<U;G++){let oe=P[G];if(!D&&r&&o!=null&&o>0){let W=M+G+N;if(W%o===0){let le=W/o;S.forEach(ne=>{if(typeof r=="function"&&r(ne)!==!0)return;let j=M+G+N;y[j]=Fi(ne,j,le),N++,y.length++})}}let ge=M+G+N,z={id:oe?a(oe,ge):`${I}-${G}`,data:oe,isCellSelected:fo,hasSelectedCells:fo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!oe,rowSelected:!1,rowDisabled:!1,rootGroupBy:g,collapsed:D,groupKeys:I,parents:Array.from(S),indexInParentGroups:[...b,G],indexInGroup:G,indexInAll:ge,groupBy:g,groupNesting:x+1,groupCount:A.groupCount};u&&(z.rowSelected=u(z)),s&&(z.rowDisabled=s(z)),i&&i(z),S.forEach((W,le)=>{le===S.length-1&&oe&&(W.directChildrenLoadedCount+=1),D&&(W.collapsedChildrenCount+=1),W.deepRowInfoArray.push(z)}),D||(y[M+G+N]=z)}}}S.pop(),b.pop()}),{data:y,groupRowsIndexes:C}}var Up=B(require("react"));var vy=()=>{};function cp(n,e){let t=new q,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){let s=i(l);for(let u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,!0,1);for(let c of u){let d=[...l,c[c.length-1]],p=t.get(d),f=p?p[o]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[o]=f),s.push(p)}return s}return a([],[])}function dp(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(o),d=[...t,c],p=r(o),f=et(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let h=0,g=m.length;h<g;h++){let y=m[h];dp(n,e,d,y)}});p?(u?.(o),s?.(o,vy)):(l?.(o,f,i(o)),s?.(o,f))}function pp(n,e,t){for(let o=0,r=t.length;o<r;o++)dp(n,e,[],t[o])}var Ay=function(n,e){return n-e},Ey=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},My=function(n,e){return n-e},_y={number:Ay,string:Ey,date:My},hr=_y;function fp(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var zt=(n,e,t)=>{let o=typeof t=="function"?t:t?.get;return e.sort(mp(fp(n),o)),e},Ni=(n,e,t)=>{let o=mp(fp(n),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(o):e=[...e].sort(o));let{nodesKey:a,toKey:l}=t,s=c=>c[a],u=c=>c[a]===void 0;return pp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(c,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(o):[...p].sort(o);c[a]=f}r||d()}},e),r&&(i?e.sort(o):e=[...e].sort(o)),e};zt.knownTypes=hr;var Fy=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=zt.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(zt.knownTypes).join(", ")}`)}return r||(r=hr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:o*u}},Oy=n=>n.map(Fy).filter(e=>e instanceof Function),mp=(n,e)=>{let t=Oy(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var Li=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new q(o.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new q(t.map(r=>[r,!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(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var lt=class extends Li{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function fn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||fr)(l,n);return t.push(s),t},[])}var Se=class{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new q;this.deselectedMap=new q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new q;this.selectionCountCache=new q;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?fn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,!0,1)||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],!0,1)||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new Se(e,t,o)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,!0).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let o=this.selectionCountCache.get(e);if(o!=null)return o;let r=this.getGroupByLength();if(e.length>r){let u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,!0,1).length,p=this.deselectedMap.getKeysStartingWith(e,!0,1).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var Ny="*",Ne=class{constructor(e){this.wildcard=Ny;this.cache=new q;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 t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)return;let l=[];if(r){let u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(u=>{this.cache.delete(u)}),this.cache.delete(s),o)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,o){if(o){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(o){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(o){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,o=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),o&&o.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let o=this.selectedRowsToColumns.get(e);if(o){if(o.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>o.has(r)):!1}return!1}error(e){Zt(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),u=this.deselectedRowsToColumns.get(this.wildcard),c=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var Ly=Ge("InfiniteTable"),Vy="#dc3545",zy="#eb9316";var gp="Warn",yp="Error",Gy="Info",Ky="Success",Hy="Logs",Vi=Ly.extend(Hy),sM=Vi.extend(Gy),By=Vi.extend(gp),ky=Vi.extend(yp),uM=Vi.extend(Ky);var Wy=zy,jy=Vy;var $y=(n,e)=>{e=e?e.extend?e.extend(gp):e:By,e(typeof e.color=="function"?e.color(Wy,n):n)},Uy=(n,e)=>{e=e?e.extend?e.extend(yp):e:ky,e(typeof e.color=="function"?e.color(jy,n):n)};var hp=new q,Cp=(n,...e)=>{hp.has(e)||(hp.set(e,!0),n())};var mn=(n,e=n,t)=>{Cp(()=>$y(n,t),e,"warn")},Tp=(n,e=n,t)=>{Cp(()=>Uy(n,t),e,"error")};function zi(n,e){return new Se(n,ot(e))}function ot(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Sp(n){let{getDataSourceState:e,dataSourceActions:t}=n;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Se))throw"Invalid row selection";let a=new Se(r,ot(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Se))throw"Invalid row selection";let a=new Se(r,ot(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Se))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?fn(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Se))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?fn(d,u):[]}let c=new Se(a,ot(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Se))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?fn(d,u):[]}let c=new Se(l,ot(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,ot(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,ot(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Se))throw"Invalid row selection";let s=new Se(a,ot(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Se(i,ot(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Se))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Se(r,ot(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var Ol=new WeakMap,Yy=n=>n;function bp(n,e=50,t){Ol.set(n,{lastCallTime:0,lastCallArg:null});let o=t??Yy;return r=>{let{lastCallTime:i,lastCallArg:a}=Ol.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=lo(o(a),o(r));s<e&&u||(Ol.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Gi=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let u=o&&!o.isEmpty();if(u&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let c=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}o?.removeInfo(void 0)}}else{let c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let h=!1;if(m!=null){let g=r(m),y=s?[...p,g]:void 0,C=s&&!!y,S=C?o?.getMutationsForNodePath(y):o?.getMutationsForPrimaryKey(g);if(S&&S.length){for(let b=0,T=S.length;b<T;b++){let I=S[b];if(I.type==="delete"&&!h&&(C?this.removeNodePath(y,t):this.remove(g),h=!0,d.splice(f,1),f--),I.type==="update"&&!h&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!h){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}C?o?.removeNodePathInfo(y):o?.removeInfo(g)}if(!h)if(C){this.addNodePath(y,m);let b=a(m),T=b?null:i(m);!b&&Array.isArray(T)&&(p.push(g),u&&(m[l]=T=T.concat()),c(T,p),p.pop())}else this.add(g,m)}}};c(e,[])}return e}}};var $e=require("react");var Go=require("react");function Ko(n,e){let t=(0,Go.useRef)({}),o=(0,Go.useRef)({}),r=o.current,i=(0,Go.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Go.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=n(s,r)),i.current={},o.current={},u},l)}function qy(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Go.useEffect)(n,t)}function Nl(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function Ll(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Vl(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function Rp({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},u={},c=et(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Ll({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:h})=>h.isGroupRow?h.reducerResults?.[f.id]:null})})});(!a&&t==="start"||o==="start")&&c();let d=!i&&l.length===1;return n.visitDepthFirst((f,m,h,g)=>{if(m=[...m],t==="end"&&g?.(),m.length===a){let y=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let b=S;S=m.join("/");let T=m[m.length-1];u[S]=Vl({header:`${T}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((b,T)=>{let I=d?`${m[m.length-1]}`:b.name||b.id,R=Ll({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,defaultSortable:!1,columnGroup:S,header:I,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),w=`${b.id}:${m.join("/")}`;s[w]=R})}else{let y=m.join("/"),C=m.slice(0,-1);if(u[y]=Vl({columnGroup:C.length?C.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],b=C.length?C.join("/"):void 0;if(!d){let T=b;b=`total:${m.join("/")}`,u[b]=Vl({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,I)=>{let R=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,w=Ll({columnGroup:b,header:R,pivotAggregator:T,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&g?.()}),(!a&&t==="end"||o==="end")&&c(),{columns:s,columnGroups:u}}var Ip=Symbol("CLEAR"),jt=class{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Ip,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Ip);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let o=new jt({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),o}};function ho(n,e){return e().dataArray[n]}function Ki(n){return n().dataArray}var Ze=class{constructor(e){this.collapsedPathsMap=new q;this.expandedPathsMap=new q;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 t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:o,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?o.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?o.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Xy=(n,e)=>n.length-e.length,We=class{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;let o=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(o)}getTreeDeepMap(){return this.getConfig().treeDeepMap}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let o=this.getTreeDeepMap().get(e);return o?o.items.length:1}static from(e,t){return new We(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getUnnestedKeysStartingWith(e,!0).sort(Xy);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:h}=this.getSelectionStateForNode(f);if(c?(s-=h,u+=h):(u-=m,s+=m),t&&m>0&&h>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function Bi(n,e){return new We(n,hn(e))}function hn(n){return()=>({treeDeepMap:(typeof n=="function"?n():n).treeDeepMap})}var Hi=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof We))throw"Invalid tree selection";let a=new We(r,hn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new Ze({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new Ze({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new Ze(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new Ze(o.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let o=this.getRowInfoByPath(e);return o?o.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?ho(o,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof We))throw"Invalid node selection";let o=new We(e,hn(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof We))throw"Invalid node selection";let o=new We(e,hn(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof We))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var gn=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!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(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var st=class extends gn{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var zl=1e3;function wp(n){return new Gl(n)}var Gl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Ki(this.getState);this.getRowInfoByIndex=e=>ho(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),o=t.getDataForNodePath(e);return o||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?zl:r;return isNaN(a)||(a=zl),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=o?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let o=this.getState().rowDisabledState,r=o?new st(o):new st({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new st({enabledRows:!0,disabledRows:[]});return}let t=new st(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new st({disabledRows:!0,enabledRows:[]});return}let t=new st(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new Hi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:o,nodesKey:r}=this.getState(),i=t?jt.clone(t,{light:!0}):new jt({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??zl,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,o.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===void 0&&l(!1)},r)});return o.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Pp(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:u,filterValue:c,aggregationReducers:d,nodesKey:p,isTree:f}=n;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let h=m.field;if(h&&(h=Array.isArray(h)?h:[h],t=h.reduce((g,y)=>g||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)o=!0;else for(let m of u)if(m.field&&l.has(m.field)){o=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let h=d[m];if(h.field){if(l.has(h.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:o,filterValue:i,aggregationReducers:a,tree:r}}function ki(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Wi(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function ji(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Hl(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var Gt=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function Kl(){return!1}function Zy(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Kl,hasSelectedCells:Kl};return o&&(a.rowSelected=o(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var Qy=et(()=>{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,17 +10,21 @@ function treeFilterFunction({ data }) {
10
10
 
11
11
  Make sure you avoid mutations.
12
12
 
13
- `)});function sp(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=sp({...n,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:o(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&Ay(),l.push(f))}return l}function My(n){let{filterTypes:e,operatorsByFilterType:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,{dataArray:u}=n;o&&(u=u.filter((d,p,f)=>o({data:d,index:p,dataArray:f,primaryKey:r(d,p)}))),i&&(u=sp({...n,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let c=wl(n.filterValue,e)||[];return c&&c.length?u.filter((d,p,f)=>{let m={data:d,index:p,dataArray:f,primaryKey:r(d,p),field:void 0};for(let h=0,g=c.length;h<g;h++){let y=c[h],{disabled:C,field:T,valueGetter:b,filter:{type:S,value:w,operator:R}}=y,I=e[S];if(C||!I)continue;let P=t[S]?.[R];if(!P)continue;let x=b||I.valueGetter||(({data:_,field:A})=>A?_[A]:_);m.field=T;let M=m;if(M.filterValue=w,M.currentValue=x(M),M.emptyValues=I.emptyValues,!P.fn(M))return!1}return!0}):u}function up(n){let{state:e,previousState:t}=n,o=lp(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=zt(t,e,["refetchKey"]),s=zt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new X,s=!0);let c=e.cache?Wt.clone(e.cache):void 0;c&&!c.isEmpty()&&(s=!0);let d=e.toPrimaryKey,p=e.nodesKey,f=e.isTree,m=p?B=>B[p]:void 0,h=p?B=>B[p]===void 0:void 0,g,y;s&&(e.indexer.clear(),e.lazyLoad||(g=c?.getMutations(),y=c?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:c,getNodeChildren:m,isLeafNode:h,nodesKey:p}),f&&e.waitForNodePathPromises.visit(({value:B},ae)=>{B&&e.indexer.getDataForNodePath(ae)!==void 0&&B.resolve(!0)}))),c&&(c.clear(),e.cache=void 0);let{filterFunction:T,treeFilterFunction:b,filterValue:S,filterTypes:w,operatorsByFilterType:R}=e,I=!!T||!!b||Array.isArray(S)&&S.length,P=I&&e.filterMode==="local",D=zt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=s||D,M=zt(t,e,["sortInfo"]),_=s||D||M,A=e.filterMode==="local"&&(x||!e.lastFilterDataArray),F=a&&(_||!e.lastSortDataArray||o.sortInfo),v=e.groupBy,E=e.pivotBy,O=!f&&(v.length>0||!!E),z=f,Z=zt(t,e,["rowDisabledState","isRowDisabled"]),oe=zt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),ce=zt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),se=s||_||zt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),G=s||_||zt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),k=zt(t,e,["rowInfoReducers"]),re=O&&(se||!e.lastGroupDataArray||o.groupBy)||oe||Z||k,ie=z&&(G||o.tree||!e.lastTreeDataArray)||ce||Z||k,K=Date.now(),V=e.originalDataArray;if(I||(e.unfilteredCount=V.length),P&&(e.unfilteredCount=V.length,V=A?My({getNodeChildren:m,isLeafNode:h,nodesKey:p,treeFilterFunction:b,dataArray:V,toPrimaryKey:d,filterTypes:w,operatorsByFilterType:R,filterFunction:T,filterValue:S}):e.lastFilterDataArray,e.lastFilterDataArray=V,e.filteredAt=K),e.filteredCount=V.length,e.postFilterDataArray=V,a){let B=Vt.knownTypes;Vt.knownTypes={...B,...e.sortTypes},F?e.sortFunction?V=e.sortFunction(r,[...V]):f?V=wi(r,V,{inplace:!1,isLeafNode:h,getNodeChildren:m,toKey:d,nodesKey:p}):V=Vt(r,[...V]):V=e.lastSortDataArray,Vt.knownTypes=B,e.lastSortDataArray=V,e.sortedAt=K}e.postSortDataArray=V;let j=e.dataArray,q=e.rowSelection instanceof Ce?e.rowSelection:void 0,$=e.treeExpandState instanceof Qe?e.treeExpandState:void 0,N=e.cellSelection instanceof Ee?e.cellSelection:void 0;q?.xcache();let ee=e.selectionMode==="single-row"?B=>B.id===e.rowSelection:e.selectionMode==="multi-row"?B=>{let ae=q;return B.isGroupRow?ae.getGroupRowSelectionState(B.groupKeys):ae.isRowSelected(B.id,B.dataSourceHasGrouping?B.groupKeys:void 0)}:void 0,Se=e.isRowDisabled||Rl;e.isRowSelected&&e.selectionMode==="multi-row"&&(ee=B=>e.isRowSelected(B,q,e.selectionMode));let Re;e.isNodeExpanded&&(Re=B=>e.isNodeExpanded(B,$)),e.isNodeCollapsed&&(Re=B=>!e.isNodeExpanded(B,$)),Re||(Re=ae=>$.isNodeExpanded(ae.nodePath));let ue=e.rowInfoReducers;if(O){if(re){let B=e.aggregationReducers,ae=e.lazyLoad?Hd({groupBy:v,pivot:E,mappings:e.pivotMappings,reducers:B,indexer:e.indexer,toPrimaryKey:d,cache:c},e.originalLazyGroupData):Ri({groupBy:v,pivot:E,reducers:B},V);e.groupDeepMap=ae.deepMap,q&&(q.getConfig=tt(e));let me=Object.keys(ue||{}),_e=Fi(ue),Ne={reducers:ue,results:_e,reducerKeys:me,rowInfo:{}},Ie=_e?ut=>{Ne.rowInfo=ut,_i(Ne)}:void 0,Ke=N?ut=>{ut.isCellSelected=qe=>N.isCellSelected(ut.id,qe)}:void 0,He=Ie||Ke?yl(Ie,Ke):void 0,Be=Ud({groupResult:ae,lazyLoad:!!e.lazyLoad,reducers:B,toPrimaryKey:d,isRowSelected:ee,rowSelectionState:q,withRowInfo:He,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});j=Be.data,e.rowInfoReducerResults=Ni({reducers:ue,results:_e,array:j}),e.groupRowsIndexesInDataArray=Be.groupRowsIndexes,e.reducerResults=ae.reducerResults;let st=E?rp({deepMap:ae.topLevelPivotColumns,pivotBy:E,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=st?.columns,e.pivotColumnGroups=st?.columnGroups}else j=e.lastGroupDataArray;e.lastGroupDataArray=j,e.groupedAt=K}else if(z){if(ie){let B=e.aggregationReducers,ae={isLeafNode:h,getNodeChildren:m,toKey:d,reducers:B},me=kd(ae,V);e.treeDeepMap=me.deepMap,e.treePaths=me.treePaths;let _e=e.selectionMode==="multi-row"?cp(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=_e;let Ne=Object.keys(ue||{}),Ie=Fi(ue),Ke={reducers:ue,results:Ie,reducerKeys:Ne,rowInfo:{}},He=Ie?te=>{Ke.rowInfo=te,_i(Ke)}:void 0,Be=N?te=>{te.isCellSelected=W=>N.isCellSelected(te.id,W)}:void 0,st=He||Be?yl(He,Be):void 0,ut=e.selectionMode==="single-row"?te=>te.id===e.treeSelection:e.selectionMode==="multi-row"?te=>_e.isNodeSelected(te.nodePath):void 0,qe=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;j=$d({treeResult:me,treeParams:ae,dataArray:V,reducers:B,toPrimaryKey:d,isNodeSelected:ut,isNodeExpanded:Re,treeSelectionState:_e,withRowInfo:st,repeatWrappedGroupRows:qe,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=Ni({reducers:ue,results:Ie,array:j}),e.reducerResults=me.reducerResults,e.totalLeafNodesCount=me.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=K}else j=e.lastTreeDataArray;e.lastTreeDataArray=j}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||se||oe||Z||k){let ae=Object.keys(ue||{}),me=Fi(ue),_e={reducers:ue,results:me,reducerKeys:ae,rowInfo:{}};j=V.map((Ne,Ie)=>{let Ke=vy(Ne,Ne?d(Ne):Ie,Ie,ee,Se,N);return me&&(_e.rowInfo=Ke,_i(_e)),Ke}),e.rowInfoReducerResults=Ni({reducers:ue,results:me,array:j})}if(e.postGroupDataArray=j,j!==e.dataArray&&(e.updatedAt=K),e.dataArray=j,e.reducedAt=K,e.selectionMode==="multi-row")if(O&&e.lazyLoad){let B=!0,ae=!1;e.dataArray.forEach(me=>{if(!me.isTreeNode&&me.isGroupRow&&me.groupKeys.length===1){let{rowSelected:_e}=me;_e!==!0&&(B=!1),(_e===!0||_e===null)&&(ae=!0)}}),e.allRowsSelected=B,e.someRowsSelected=ae}else{let B=e.isTree?e.totalLeafNodesCount:e.filteredCount,ae=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=B===ae,e.someRowsSelected=ae>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:K,mutations:g?.size?g:void 0,treeMutations:y?.size?y:void 0}),e}function It(){let n=De().performance?.now();return`${Date.now()}:${n}`}var Ey=!0,Fy=()=>new Promise(n=>{xe(n)}),_y={originalDataArray:!0,changes:!0},Ny={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function jt(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=pp(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!_y[l]){let s=l,u=Ny[s],c=r[s],d=a[s];(u?u(c,d):c===d)||(i[s]=!0)}return r.changes=i,r}function _o(n,e,t,o,r){let i=jt(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[lo,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Ey,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=It()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){let C=[lo,...h],T=g.data,b={cache:!!g.cache,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??T.length,totalCountUnfiltered:g.totalCount??T.length,children:T,error:g.error},S=[];if(i.lazyLoadBatchSize&&!y){let R=f.get(C),I=!R,P=hc({children:!0},R||{},b);I&&(P.chidren=[]),P.children.length=P.totalCount;let D=i.lazyLoadStartIndex??0,x=Math.min(g.totalCount??T.length,D+i.lazyLoadBatchSize);for(let M=D;M<x;M++){let _=b.children[M-D];if(!_)throw`lazily loaded item not found at index ${M-D}`;P.children[M]=_,_.dataset&&S.push({keys:_.keys,dataset:_.dataset})}I&&f.set(C,P)}else b.children.forEach(R=>{R&&R.dataset&&S.push({keys:R.keys,dataset:R.dataset})}),b.children.length=b.totalCount,f.set(C,b);let w=!1;if(!h||!h.length){let R=f.get([lo]);t.originalDataArray=[...R.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=It()),S.length){let R=h;S.forEach(({keys:I,dataset:P})=>{m(I,P,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function pp(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(wl(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function dp(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function fp(n){let{getComponentState:e,componentActions:t,componentState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=o,[C,T]=(0,Ye.useState)({vertical:!1,horizontal:!1}),b=(0,Ye.useRef)(C);(0,Ye.useEffect)(()=>(a.onChange(D=>{D&&(b.current=D,T(D))}),()=>a.destroy()),[a]),(0,Ye.useEffect)(()=>{if(!m)return;let D=requestAnimationFrame(()=>{b.current?.vertical||h&&(t.cursorId=h)});return()=>cancelAnimationFrame(D)},[h]),(0,Ye.useEffect)(()=>{if(!m||h!==void 0)return;let D=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(D)},[i.length,h]),(0,Ye.useEffect)(()=>{let D=e(),{livePaginationCursor:x,livePagination:M,dataArray:_}=D;!C.vertical&&M&&(x?t.cursorId=x:x===void 0&&_.length&&(t.cursorId=_.length))},[C.vertical]);let S=(0,Ye.useMemo)(()=>pp(p,{filterTypes:g,filterMode:f}),[p,f,g]),w={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?S:null,cursorId:m?y:null},R=(0,Ye.useRef)(!0);Oy(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null});let I=Ae(Le()),P=(0,Ye.useRef)([]);Fo(()=>{let D=e(),x=I(),{isDetail:M,isDetailReady:_}=dp(x,e);if(M&&!_)return;let A=Date.now(),F=P.current;F.length>=10&&F.splice(0,1),F.push(A),A-F[0]<200&&F.length>=10&&console.warn(`The "data" prop of your DataSource seems to be updating too frequently.
14
- Make sure you don't pass a new reference on every render. ERROR_CODE = DS001
15
- See http://infinite-table.com/docs/reference/error-codes#DS001 for more info.`),typeof D.data!="function"&&_o(D.data,D,t,void 0,x)},{data:r}),Fo(D=>{let x=Object.keys(D),M=!1;if(x.length===1){if(M=!!D.cursorId,D.filterValue&&e().filterMode==="local")return;let E=e().data;if(Array.isArray(E)&&D.refetchKey){t.originalDataArray=E;return}}let _=I(),{isDetail:A,isDetailReady:F}=dp(_,e);if(A&&!F)return;let v=e();typeof v.data=="function"&&_o(v.data,v,t,{append:M},_)},{...w,data:r}),Fo(()=>{let D=e();if(R.current){R.current=!1;let x=jt(D,void 0,I());t.dataParams=x}},w)}function Oy(n,e){let{getComponentState:t,componentActions:o,componentState:r}=n;(0,Ye.useEffect)(()=>{o.lazyLoadCacheOfLoadedBatches=new X},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=(0,Ye.useRef)(null),f=(h,g,y=t().lazyLoadCacheOfLoadedBatches)=>{let C=t();if(h=h||p.current,!h)return;let{renderStartIndex:T,renderEndIndex:b}=h,{lazyLoadBatchSize:S,lazyLoad:w}=C;w&&((!S||S<=0)&&(!C.groupBy||C.groupBy.length===0)||Ly({startIndex:T,endIndex:b,lazyLoadBatchSize:S,componentState:C,componentActions:o,dismissLoadedRows:g?.dismissLoadedRows??!1},y))},m=(0,Ye.useMemo)(()=>Et(f,{wait:d}),[d]);Fo(h=>{if(a)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&f(s.get()),s.onChange(g=>{p.current=g,f(g)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:c}),(0,Ye.useEffect)(()=>{i&&i>0&&m()},[u])}function Ly(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:h=>s[h].data!=null,c=!l,d=new X,p=["_______xxx______"];for(let h=t;h<=o;h++){let g=s[h];if(!g)continue;let y=u(h),C=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&C.pop();let T=C.length?C:p,b=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let S={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:g.groupKeys,append:c},w=g.groupKeys,R=d.get(w);if(!R?.[g.id]){let I=!R;R=R||{},R[g.id]||(R[g.id]=S),I&&d.set(w,R)}}if(!y&&r!=null){let S=d.get(T),w=Math.floor(b/r)*r,R=b-w,I=s[g.indexInAll-R].indexInAll,P=u(I),D=s[I].id;if(P||S?.[D])continue;let x=!S;S=S||{};let M={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:C,append:c};S[D]||(S[D]=M),x&&d.set(T,S)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(h=>{m.push(...Object.values(h))}),m.reduce((h,g)=>{let y=[...g.groupKeys,g.lazyLoadStartIndex];if(e&&e.has(y))return h;e?.set(y,!0);let C=[i.data,i,a,g];return h.then(()=>Fy()).then(()=>_o(...C))},f)}var Vy=Object.freeze([]),mp=(n,e)=>{let t=n??Vy,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var Il=dt("DataSource"),zy=Symbol("cursorId"),hp=n=>n.totalLeafNodesCount===0,Gy=n=>n.isParentNode?!hp(n):!0;function gp(){let n=Date.now(),e=[],t=[],o=new X;return{indexer:new vi,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 X,waitForNodePathPromises:new X,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new X,dataParams:void 0,onCleanup:he(),notifyScrollbarsChange:he(),notifyScrollStop:he(),notifyRenderRangeChange:he(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:o,originalLazyGroupDataChangeDetect:0,originalDataArray:e,cursorId:zy,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:t,unfilteredCount:t.length,filteredCount:t.length,updatedAt:n,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:n,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0}}function Ky(n){let e={...n};return delete e.originalDataArray,e}var Hy=[],yp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear()},Cp=(n,e)=>({onDataParamsChange:t=>t?np(t,100,Ky):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??hp,isNodeSelectable:t=>t??Gy,data:1,debugId:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,debugMode:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...eo,...t}),sortTypes:t=>({...rr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugMode&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugMode&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof lt)return t;let o=n.propsCache.get("rowDisabledState")??Pt,r=o.get(t);return r||(r=new lt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>mp(t,n.propsCache.get("sortInfo")),groupBy:t=>t??Hy});function By(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Pt=new WeakMap;function ky(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var Wy={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function cp(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
13
+ `)});function xp(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=xp({...n,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:o(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&Qy(),l.push(f))}return l}function Jy(n){let{filterTypes:e,operatorsByFilterType:t,filterFunction:o,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=n,{dataArray:u}=n;o&&(u=u.filter((d,p,f)=>o({data:d,index:p,dataArray:f,primaryKey:r(d,p)}))),i&&(u=xp({...n,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let c=Hl(n.filterValue,e)||[];return c&&c.length?u.filter((d,p,f)=>{let m={data:d,index:p,dataArray:f,primaryKey:r(d,p),field:void 0};for(let h=0,g=c.length;h<g;h++){let y=c[h],{disabled:C,field:S,valueGetter:b,filter:{type:T,value:I,operator:R}}=y,w=e[T];if(C||!w)continue;let P=t[T]?.[R];if(!P)continue;let D=b||w.valueGetter||(({data:_,field:E})=>E?_[E]:_);m.field=S;let A=m;if(A.filterValue=I,A.currentValue=D(A),A.emptyValues=w.emptyValues,!P.fn(A))return!1}return!0}):u}function Dp(n){let{state:e,previousState:t}=n,o=Pp(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=Gt(t,e,["refetchKey"]),s=Gt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new q,s=!0);let c=e.cache?jt.clone(e.cache):void 0;c&&!c.isEmpty()&&(s=!0);let d=e.toPrimaryKey,p=e.nodesKey,f=e.isTree,m=p?k=>k[p]:void 0,h=p?k=>k[p]===void 0:void 0,g,y;s&&(e.indexer.clear(),e.lazyLoad||(g=c?.getMutations(),y=c?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:c,getNodeChildren:m,isLeafNode:h,nodesKey:p}),f&&e.waitForNodePathPromises.visit(({value:k},te)=>{k&&e.indexer.getDataForNodePath(te)!==void 0&&k.resolve(!0)}))),c&&(c.clear(),e.cache=void 0);let{filterFunction:S,treeFilterFunction:b,filterValue:T,filterTypes:I,operatorsByFilterType:R}=e,w=!!S||!!b||Array.isArray(T)&&T.length,P=w&&e.filterMode==="local",x=Gt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=s||x,A=Gt(t,e,["sortInfo"]),_=s||x||A,E=e.filterMode==="local"&&(D||!e.lastFilterDataArray),F=a&&(_||!e.lastSortDataArray||o.sortInfo),v=e.groupBy,M=e.pivotBy,N=!f&&(v.length>0||!!M),G=f,U=Gt(t,e,["rowDisabledState","isRowDisabled"]),oe=Gt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),ge=Gt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ce=s||_||Gt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),z=s||_||Gt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),W=Gt(t,e,["rowInfoReducers"]),le=N&&(ce||!e.lastGroupDataArray||o.groupBy)||oe||U||W,ne=G&&(z||o.tree||!e.lastTreeDataArray)||ge||U||W,j=Date.now(),V=e.originalDataArray;if(w||(e.unfilteredCount=V.length),P){e.unfilteredCount=V.length;let k=j;E?(e.devToolsDetected&&(k=Date.now()),V=Jy({getNodeChildren:m,isLeafNode:h,nodesKey:p,treeFilterFunction:b,dataArray:V,toPrimaryKey:d,filterTypes:I,operatorsByFilterType:R,filterFunction:S,filterValue:T}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-k)):V=e.lastFilterDataArray,e.lastFilterDataArray=V,e.filteredAt=j}if(e.filteredCount=V.length,e.postFilterDataArray=V,a){let k=zt.knownTypes;if(zt.knownTypes={...k,...e.sortTypes},F){let te=j;if(e.devToolsDetected&&(te=Date.now()),e.sortFunction?V=e.sortFunction(r,[...V]):f?V=Ni(r,V,{inplace:!1,isLeafNode:h,getNodeChildren:m,toKey:d,nodesKey:p}):V=zt(r,[...V]),e.devToolsDetected){let de=Date.now()-te;e.debugTimings.set("sort",de)}}else V=e.lastSortDataArray;zt.knownTypes=k,e.lastSortDataArray=V,e.sortedAt=j}e.postSortDataArray=V;let L=e.dataArray,Q=e.rowSelection instanceof Se?e.rowSelection:void 0,$=e.treeExpandState instanceof Ze?e.treeExpandState:void 0,ue=e.cellSelection instanceof Ne?e.cellSelection:void 0;Q?.xcache();let J=e.selectionMode==="single-row"?k=>k.id===e.rowSelection:e.selectionMode==="multi-row"?k=>{let te=Q;return k.isGroupRow?te.getGroupRowSelectionState(k.groupKeys):te.isRowSelected(k.id,k.dataSourceHasGrouping?k.groupKeys:void 0)}:void 0,O=e.isRowDisabled||Kl;e.isRowSelected&&e.selectionMode==="multi-row"&&(J=k=>e.isRowSelected(k,Q,e.selectionMode));let Re;e.isNodeExpanded&&(Re=k=>e.isNodeExpanded(k,$)),e.isNodeCollapsed&&(Re=k=>!e.isNodeExpanded(k,$)),Re||(Re=te=>$.isNodeExpanded(te.nodePath));let be=e.rowInfoReducers;if(N){if(le){let k=j;e.devToolsDetected&&(k=Date.now());let te=e.aggregationReducers,de=e.lazyLoad?np({groupBy:v,pivot:M,mappings:e.pivotMappings,reducers:te,indexer:e.indexer,toPrimaryKey:d,cache:c},e.originalLazyGroupData):Oi({groupBy:v,pivot:M,reducers:te},V);e.groupDeepMap=de.deepMap,Q&&(Q.getConfig=ot(e));let De=Object.keys(be||{}),Pe=ki(be),Ve={reducers:be,results:Pe,reducerKeys:De,rowInfo:{}},Ee=Pe?nt=>{Ve.rowInfo=nt,Wi(Ve)}:void 0,je=ue?nt=>{nt.isCellSelected=H=>ue.isCellSelected(nt.id,H)}:void 0,Je=Ee||je?Nl(Ee,je):void 0,Ue=up({groupResult:de,lazyLoad:!!e.lazyLoad,reducers:te,toPrimaryKey:d,isRowSelected:J,rowSelectionState:Q,withRowInfo:Je,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});L=Ue.data,e.rowInfoReducerResults=ji({reducers:be,results:Pe,array:L}),e.groupRowsIndexesInDataArray=Ue.groupRowsIndexes,e.reducerResults=de.reducerResults;let ut=M?Rp({deepMap:de.topLevelPivotColumns,pivotBy:M,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=ut?.columns,e.pivotColumnGroups=ut?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-k)}else L=e.lastGroupDataArray;e.lastGroupDataArray=L,e.groupedAt=j}else if(G){if(ne){let k=j;e.devToolsDetected&&(k=Date.now());let te=e.aggregationReducers,de={isLeafNode:h,getNodeChildren:m,toKey:d,reducers:te},De=ip(de,V);e.treeDeepMap=De.deepMap,e.treePaths=De.treePaths;let Pe=e.selectionMode==="multi-row"?vp(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=Pe;let Ve=Object.keys(be||{}),Ee=ki(be),je={reducers:be,results:Ee,reducerKeys:Ve,rowInfo:{}},Je=Ee?K=>{je.rowInfo=K,Wi(je)}:void 0,Ue=ue?K=>{K.isCellSelected=ie=>ue.isCellSelected(K.id,ie)}:void 0,ut=Je||Ue?Nl(Je,Ue):void 0,nt=e.selectionMode==="single-row"?K=>K.id===e.treeSelection:e.selectionMode==="multi-row"?K=>Pe.isNodeSelected(K.nodePath):void 0,H=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;L=sp({treeResult:De,treeParams:de,dataArray:V,reducers:te,toPrimaryKey:d,isNodeSelected:nt,isNodeExpanded:Re,treeSelectionState:Pe,withRowInfo:ut,repeatWrappedGroupRows:H,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=ji({reducers:be,results:Ee,array:L}),e.reducerResults=De.reducerResults,e.totalLeafNodesCount=De.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=j,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-k)}else L=e.lastTreeDataArray;e.lastTreeDataArray=L}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||ce||oe||U||W){let te=Object.keys(be||{}),de=ki(be),De={reducers:be,results:de,reducerKeys:te,rowInfo:{}};L=V.map((Pe,Ve)=>{let Ee=Zy(Pe,Pe?d(Pe):Ve,Ve,J,O,ue);return de&&(De.rowInfo=Ee,Wi(De)),Ee}),e.rowInfoReducerResults=ji({reducers:be,results:de,array:L})}if(e.postGroupDataArray=L,L!==e.dataArray&&(e.updatedAt=j),e.dataArray=L,e.reducedAt=j,e.selectionMode==="multi-row")if(N&&e.lazyLoad){let k=!0,te=!1;e.dataArray.forEach(de=>{if(!de.isTreeNode&&de.isGroupRow&&de.groupKeys.length===1){let{rowSelected:De}=de;De!==!0&&(k=!1),(De===!0||De===null)&&(te=!0)}}),e.allRowsSelected=k,e.someRowsSelected=te}else{let k=e.isTree?e.totalLeafNodesCount:e.filteredCount,te=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=k===te,e.someRowsSelected=te>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:j,mutations:g?.size?g:void 0,treeMutations:y?.size?y:void 0}),e}function Pt(){let n=Me().performance?.now();return`${Date.now()}:${n}`}function eC(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
16
14
 
15
+ ERROR_CODE = ${n}
17
16
 
18
- `);let o=rn(t);if(n instanceof $e)return n.setConfigFn(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??Wy,i=Pt.get(r);return i&&i.setConfigFn(o),i=i??new $e(r,o),Pt.set(r,i),i}function Sp(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Ln(e.sortInfo),a=Ln(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((A,F)=>{let v=l[F].operators;A[F]=A[F]||{};let E=A[F];return v.forEach(O=>{E[O.name]=O}),A},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let A=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(A!==void 0&&(A&&typeof A=="object"?c="multi-row":c="single-row"),!c){let F=u.treeSelection??u.defaultTreeSelection;F!==void 0&&(c=typeof F=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Ce({selectedRows:[],deselectedRows:[],defaultSelection:!1},tt(t)):c==="single-row"||f instanceof Ce?d=f:d=new Ce(f,tt(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ee;else if(m instanceof Ee)p=m;else{let A=Pt.get(m)??new Ee(m);Pt.set(m,A),p=A}let h=t.primaryKey,g=typeof h=="function"?A=>h(A):A=>A[h],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof Qe)){let A=Pt.get(y)??new Qe(y);Pt.set(y,A),y=A}y=y||new Qe({defaultExpanded:!0,collapsedPaths:[]});let C=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(C&&!(C instanceof at)){let A=Pt.get(C)??new at(C);Pt.set(C,A),C=A}C=C||new at(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=ky(e.shouldReloadData||{}),b=e.groupMode??(T.groupBy!=null?T.groupBy?"remote":"local":void 0),S=e.sortMode??T.sortInfo!=null?T.sortInfo?"remote":"local":void 0,w=e.filterMode??T.filterValue!=null?T.filterValue?"remote":"local":void 0;e.groupMode&&xi('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",Il),e.sortMode&&xi('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",Il),e.filterMode&&xi('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",Il);let R=typeof e.data=="function"?b??"local":"local",I=e.sortFunction?"local":S??(i?"remote":"local"),P=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":w??(typeof e.data=="function"?"remote":"local"),D=T.pivotBy?"remote":"local",x=t.rowDisabledState,M=e.isRowDisabled;if(!M&&x){let A=Pt.get(x);A?M=A:(M=F=>x.isRowDisabled(F.id),Pt.set(x,M))}let _={isTree:r,selectionMode:c,groupRowsState:C,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:T?.filterValue??P==="remote",sortInfo:T?.sortInfo??I==="remote",groupBy:T?.groupBy??R==="remote",pivotBy:T?.pivotBy??D==="remote"},isRowDisabled:M,rowSelection:d,cellSelection:p,groupMode:R,sortMode:I,filterMode:P,pivotMode:D,toPrimaryKey:g,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let A=!o||o.originalDataArray!==t.originalDataArray,F=typeof e.livePaginationCursor=="function"?A?By(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;_.livePaginationCursor=F}return _}var jy=dt("DataSource:fullLazyLoad");function Tp(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&jy('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new at({collapsedRows:!0,expandedRows:[]})))}var $y=dt("DataSource:dataParams");function bp(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,{selectionMode:"single-row"}]}:{callbackParams:[n.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ee?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Rp(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&xe(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&xe(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&xe(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&xe(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=jt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>to(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:($y("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function wp(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}var ht=H(require("react"));function ln(n){let e=Le(),t=Ae(e),o=!!e,r=o?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Pl(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Ae(s),[d]=(0,ht.useState)(()=>ap({getState:c,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:c,assignState:u,api:d},f=Ae(i),m=Ae(p),h=xn(),g=(0,ht.useCallback)(({children:y})=>(typeof y=="function"&&(y=y(c())),ht.default.createElement(a.Provider,{key:r,value:f()},ht.default.createElement(h.Provider,{value:m()},y))),[a,o,r]);return(0,ht.useLayoutEffect)(()=>{e&&e.registerDetail(p)},[]),(0,ht.useLayoutEffect)(()=>()=>{let y=c();y.onCleanup(y)},[]),fp({componentState:s,componentActions:l,getComponentState:c}),(0,ht.useEffect)(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),(0,ht.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:g,state:p.componentState}}var gt=class extends an{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var xl=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??xl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}},ir=xl;ir.DEFAULT_SIZE=10;var Dl=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Oi=class{constructor(e){this.storage=new ir(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},vl=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},sn=class{constructor(e){this.cacheStorage=e===!1?new Dl:e===!0?new vl:typeof e=="number"?new Oi(e):new Oi(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var Ip=(e=>(e.INIT="INIT",e))(Ip||{});var{useManagedComponent:Pl}=_t({debugName:"DataSource",initSetupState:gp,forwardProps:Cp,concludeReducer:up,mapPropsToState:Sp,onPropChange:Tp,cleanup:yp,interceptActions:Rp(),mappedCallbacks:bp()});function Uy(n){let{DataSource:e}=ln(n);return Pp.createElement(e,null,n.children??null)}function Yy(){let{rowInfoReducerResults:n}=Co();return n}function qy(){let n=Le();if(n)return n.masterRowInfo}function Al(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let h=l[u+f*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function Ml(n){if(n==null)return!1;let e=n;return!0}function Li(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function El(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function xp(n,e,t){if(El(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,h=Math.min(f,m),g=Math.max(f,m),y=[];for(let C=d;C<=p;C++)for(let T=h;T<=g;T++){let b=C*o+T;if(C===d)for(let S=s;S<r;S++)y.push({rowIndex:b,colIndex:S});else if(C===p)for(let S=0;S<=c;S++)y.push({rowIndex:b,colIndex:S});else for(let S=0;S<r;S++)y.push({rowIndex:b,colIndex:S})}return y}function Xy(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Fl=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??so(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let i=this.getDataSourceState().cellSelection;if(!i)return;let a=new Ee(i),[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,h=so(l,this.getDataSourceState),g=so(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,C=g.indexInAll,[T,b]=Li({rowIndex:y,colIndex:f},{rowIndex:C,colIndex:m});for(let S=T.rowIndex;S<=b.rowIndex;S++)for(let w=T.colIndex;w<=b.colIndex;w++){let R={rowIndex:S,colIndex:w},[I,P]=this.getCellSelectionPosition(R);o?a.selectCell(I,P):a.deselectCell(I,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Ai(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=Xy(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let o=new Ee(t);o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let o=new Ee(t);o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[o,r]=this.getCellSelectionPosition(e),i=e.clear?new Ee:new Ee(t);i.selectCell(o,r),this.dataSourceActions.cellSelection=i};this.deselectCell=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let[o,r]=this.getCellSelectionPosition(e),i=new Ee(t);i.deselectCell(o,r),this.dataSourceActions.cellSelection=i};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState().cellSelection;if(!o)return;let r=new Ee(o);r.selectColumn(e),this.dataSourceActions.cellSelection=r};this.deselectColumn=e=>{let t=this.getDataSourceState().cellSelection;if(!t)return;let o=new Ee(t);o.deselectColumn(e),this.dataSourceActions.cellSelection=o};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Dp(n){return new Fl(n)}function vp(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new gt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new gt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new gt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new gt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function uo(n,e,t){return Math.min(Math.max(n,e),t)}function Vi(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return uo(a,r,i)}function Zy(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),h=p,g=m-f-1,y=0,C=u-1,T={ArrowDown:()=>{p=Vi(o,p,1)},ArrowUp:()=>{p=Vi(o,p,-1)},ArrowLeft:()=>{let S=s[p];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;p-w>=y?p=p-w:T.ArrowUp();return}return S&&S.isGroupRow?i.collapseGroupRow(S.groupKeys):S&&i.rowDetailApi.isRowDetailEnabledForRow(S.id)?i.rowDetailApi.collapseRowDetail(S.id):!1},ArrowRight:()=>{let S=s[p];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;p+w<=C?p=p+w:T.ArrowDown();return}return S&&S.isGroupRow?i.expandGroupRow(S.groupKeys):S&&i.rowDetailApi.isRowDetailEnabledForRow(S.id)?i.rowDetailApi.expandRowDetail(S.id):!1},Enter:()=>{let S=s[p];return S&&S.isGroupRow?i.toggleGroupRow(S.groupKeys):S&&S.isTreeNode&&S.isParentNode?a.treeApi.toggleNode(S.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(S.id)?i.rowDetailApi.toggleRowDetail(S.id):!1},PageDown:()=>{p=Math.min(p+g,u-1)},PageUp:()=>{p=Math.max(p-g,y)},End:()=>{p=C},Home:()=>{p=y}},b=T[l];return b?(b(),h!==p?(r.activeRowIndex=p,!0):!1):!1}function _l(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,C]}=p.getRenderRange(),T=y-h-1,b=C-g-1,S=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,R=0,I=0;f=uo(f,0,S),m=uo(m,0,w);let P={ArrowDown:()=>{f=uo(f+1,R,S)},ArrowUp:()=>{f=uo(f-1,R,S)},ArrowLeft:()=>{if(m===I)if(f!==R&&(m=w),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:P.ArrowUp()}else P.ArrowUp();else m=uo(m-1,I,w)},ArrowRight:()=>{if(m===w)if(f!==S&&(m=I),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=S?f=f+x:P.ArrowDown()}else P.ArrowDown();else m=uo(m+1,I,w)},Enter:()=>{let x=u[f];return x&&x.isGroupRow?t.toggleGroupRow(x.groupKeys):x&&x.isTreeNode&&x.isParentNode?a.treeApi.toggleNode(x.nodePath):x&&t.rowDetailApi.isRowDetailEnabledForRow(x.id)?t.rowDetailApi.toggleRowDetail(x.id):!1},PageDown:()=>{s?m=Math.min(m+b,w):f=Math.min(f+T,S)},PageUp:()=>{s?m=Math.max(m-b,I):f=Math.max(f-T,R)},End:()=>{s?m=w:f=S},Home:()=>{s?m=I:f=R}},D=P[l];return D?(D(),[f,m]):!1}function Qy(n,e){let t=_l(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var Jy={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Ap(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!Jy[t]?!1:i!=null&&l==="row"?Zy(n,e):a!=null&&l==="cell"?Qy(n,e):!1}var Nl=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Vi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=_l(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Mp(n){return new Nl(n)}function Ep(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Ol=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...mt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),u;try{u=await s(a)}catch(d){u=d}let c=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...mt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(mt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>et(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",h=Jo({column:u,rowInfo:c,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new at(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new at(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[lo,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||_o(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=X.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=It())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let h=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=h||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=op({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Mp({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=vp({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Dp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.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(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(Al(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Al(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??od({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(mt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Ml);c.length&&(s=c);let d=i.computedSortType;u.length&&d===Xo&&(d=u.flatMap(m=>{let h=m.field??m.groupField,g=h?r.get(h):null;return g?g.computedSortType:Xo}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Ep(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Ep(d,l)?(u=!0,t):d),u||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(Ml),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}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(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Fp(n){return new Ol(n)}var No=require("react");var eC=10;function tC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${xo} > .${ol}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${vo}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Nt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let h=De().getComputedStyle(c);s[p]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+eC}if(m+=s[p],d){let h=0;c.childNodes.forEach(g=>{if(g!==u){let y=g,C=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(C)&&(C=0),h+=C,C>0){let T=De().getComputedStyle(y);h+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=h}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function _p(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=ze(),[a,l]=(0,No.useState)(0),s=typeof r=="object"?r.key:r,u=Ae(s),c=(0,No.useRef)(null);(0,No.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,No.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let h=tC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=n().columnSizing,C={...y},T=!1;g.forEach(b=>{C[b]={width:h[b]},T=T||C[b].width!==y[b]?.width}),T&&(e.columnSizing=C)},[s,o,a])}var zp=require("react"),xt=require("react"),zi=H(require("react"));function Np(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return kr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var lr=H(require("react"));var Op=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var ar=require("react");function oC(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function nC(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=wp(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function rC(n,e){let t=(0,ar.useRef)(!1);return{currentRowCache:(0,ar.useMemo)(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Lp(n){let{rowDetailsCache:e,rowInfo:t}=n,{getState:o,componentActions:r}=be(),{getState:i}=Q(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=rC(t.id,e),s=(0,ar.useMemo)(()=>{let u=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:ot(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}oC(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&nC(t.id,{detailState:d.getState(),masterActions:r,masterState:o(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:iC}=Pe,aC=`${iC}RowDetail`;function lC(n){let e=Ir(),{domRef:t,rowDetailRenderer:o,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=n,{masterDetailContextValue:s,currentRowCache:u}=Lp({rowDetailsCache:l,rowInfo:i});return lr.createElement(e.Provider,{value:s},lr.createElement("div",{ref:t,className:J(aC,Op({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${U.bodyWidth} - ${U.scrollbarWidthVertical})`,height:r}},o(i,u)))}var Vp=lr.memo(lC);var sC=1;function Gp(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,state:i,getState:a}=Q(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:C,componentActions:T,api:b}=be(),{dataArray:S,isNodeReadOnly:w}=y,R=Ae(S),{rowHeight:I,rowDetailHeight:P,groupRenderStrategy:D,brain:x,showZebraRows:M,rowDetailRenderer:_,isRowDetailExpanded:A,isRowDetailEnabled:F,cellClassName:v,cellStyle:E,rowStyle:O,rowDetailCache:z,rowClassName:Z,onScrollToTop:oe,onScrollToBottom:ce,onScrollStop:se,scrollToBottomOffset:G,wrapRowsHorizontally:k,ready:re}=i,ie=y.updatedAt;Np({columnSize:g,brain:x,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:S,bodySize:t,rowspan:m});let K=(0,xt.useRef)(0);(0,xt.useEffect)(()=>x.onRenderCountChange(()=>{K.current=x.scrollTopMax}),[x]),(0,xt.useEffect)(()=>x.onRenderRangeChange($=>{a().onRenderRangeChange?.($)}),[x]),(0,xt.useEffect)(()=>x.onScrollStop($=>{let{scrollTop:N,scrollLeft:ee}=$;if(N===0&&oe?.(),N+(G??sC)>=K.current){ce?.();let{livePagination:ue,livePaginationCursor:B,dataArray:ae}=C();ue&&(T.cursorId=B!==void 0?Date.now():ae.length)}if(se){let ue=x.getRenderRange();se({scrollTop:N,scrollLeft:ee,renderRange:ue,viewportSize:a().bodySize,firstVisibleRowIndex:ue.start[0],lastVisibleRowIndex:ue.end[0],firstVisibleColIndex:ue.start[1],lastVisibleColIndex:ue.end[1]})}}),[x,oe,ce,se]),(0,xt.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,xt.useEffect)(()=>{let{onReady:$}=a();$&&$({api:o,dataSourceApi:b})},[re]);let[,V]=Ft();(0,xt.useEffect)(()=>{V()},[y]);let j=(0,xt.useCallback)($=>{let{rowIndex:N,colIndex:ee,heightWithRowspan:Se,domRef:Re,hidden:ue,width:B,onMouseLeave:ae,onMouseEnter:me}=$,Ne=R()[N],Ie=u[ee];if(!Ne)return null;let Ke=p?p.getRowHeight(N):Se,He=!1;!F||typeof F=="function"&&!F(Ne)?He=!1:A&&(He=A(Ne)?"expanded":"collapsed");let Be=k?x.getRowIndexInPage(N):null,st=k?x.getPageIndexForRow(N):null;return zi.createElement(ld,{...{getData:R,virtualized:!0,showZebraRows:M,groupRenderStrategy:D,rowIndexInHorizontalLayoutPage:Be,horizontalLayoutPageIndex:st,rowIndex:N,rowInfo:Ne,hidden:ue,toggleGroupRow:h,rowHeight:Ke,rowDetailState:He,onMouseEnter:me,onMouseLeave:ae,domRef:Re,width:B,column:Ie,columnsMap:c,fieldsToColumn:f,rowStyle:O,rowClassName:Z,cellStyle:E,cellClassName:v}})},[I,P,p,d,A,R,u,c,f,D,k,h,M,x,ie,w,O,Z,v,E]),q=(0,zp.useMemo)(()=>{if(A)return $=>{let{rowIndex:N,domRef:ee}=$,Re=R()[N];if(!Re||!A(Re)||!p)return zi.createElement("div",{ref:ee,className:Mu.hidden});let{rowDetailHeight:ue,rowHeight:B}=p.getSize(N);return zi.createElement(Vp,{rowInfo:Re,rowDetailsCache:z,rowIndex:N,domRef:ee,detailOffset:B,rowDetailHeight:ue,rowDetailRenderer:_})}},[re,j,_,P,A,z]);return{renderCell:j,renderDetailRow:q}}var cn=require("react");var Gi=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!El(e,t,r)){xp(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Li(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Kp(n,e){return n<e?[n,e]:[e,n]}var Ki=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=Kp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Kp(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var Hp=require("react");function Bp(n){let{getState:e}=be();return(0,Hp.useMemo)(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var kp=require("react");var qN=dt("useColumnSizeFn");function Wp(n){return(0,kp.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var Dt=require("react");var co=require("react");var uC={scrollLeft:0,scrollTop:0},sr=class{constructor(){this.scrollPosition=uC;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function jp(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var $p=H(require("react"));function Up(n){return(e,t)=>$p.createElement(n,{key:e.id,rowInfo:e,cache:t})}var ur=class extends So{constructor(t,o){super(`HorizontalLayout${t?`:${t}`:""}`);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=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=Ar(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",h=f&&o!==this.initialRows,g=m&&r!==this.initialCols;f&&h&&(this.initialRows=o,this.rows=o),m&&g&&(this.initialCols=r,this.cols=r);let y=i!=null,C=a!=null,T=y&&i!==this.rowHeight,b=C&&a!==this.initialColWidth;y&&(this.rowHeight=i),C&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let S=h||T||p,w=g||b||d||S;(w||S)&&this.updateRenderCount({horizontal:w,vertical:S})}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(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Ht){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{xe(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var Yp={};function Ll(n){return`.${Po}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function Vl(n,e){let t=e?new ur(n,{isHeader:!1}):new So(n),o=e?new ur("header",{isHeader:!0,masterBrain:t}):new So("header");t.onScroll(a=>{o.setScrollPosition({scrollLeft:a.scrollLeft,scrollTop:0})});let{renderer:r,onRenderUpdater:i}=Or(t);return t.onAvailableSizeChange(a=>{o.update({width:a.width})}),{brain:t,headerBrain:o,renderer:r,onRenderUpdater:i}}function qp({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}=Vl(n,!!e),l=(0,co.createRef)();return{renderer:i,onRenderUpdater:a,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:s=>{if(!l.current)return null;let u=Ll(s);return l.current.querySelector(u)||null},brain:o,headerBrain:r,domRef:l,columnMenuTargetRef:(0,co.createRef)(),editingValueRef:(0,co.createRef)(),scrollerDOMRef:(0,co.createRef)(),portalDOMRef:(0,co.createRef)(),focusDetectDOMRef:(0,co.createRef)(),activeCellIndicatorDOMRef:(0,co.createRef)(),onColumnMenuClick:he(),cellContextMenu:he(),contextMenu:he(),onFilterOperatorMenuClick:he(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:he(),onRowHeightCSSVarChange:he(),onRowDetailHeightCSSVarChange:he(),onColumnHeaderHeightCSSVarChange:he(),cellClick:he(),cellMouseDown:he(),keyDown:he(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new sr,pinnedEndScrollListener:new sr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Xp=n=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,debugMode: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,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new sn(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Yp,columnGroupVisibility:e=>e??Yp,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function cC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Zp=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.onRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Qp(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Hi=new WeakMap;function Jp(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var ef=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?jp(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=cC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=Hi.get(d);h||(h=Up(d),Hi.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof gt)&&(u=new gt(u)),u=u||new gt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Hi.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&Hi.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1;return{isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||le.components.Header.columnHeaderHeight:""}};function tf(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function of(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var nf=require("react");function zl(){let{getState:n,componentActions:e,getDataSourceMasterContext:t}=be();return(0,nf.useCallback)(r=>{let i=n(),a=new at(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[lo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||_o(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=X.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=It())}},[])}function dC(n){return(0,Dt.useMemo)(()=>Qp(n),[n])}function rf(){let{componentState:{groupBy:n},componentActions:e}=be(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:o,pivotGrandTotalColumnPosition:r}}=ze();(0,Dt.useEffect)(()=>{e.generateGroupRows=t!=="inline"},[t]),(0,Dt.useEffect)(()=>{e.pivotTotalColumnPosition=o},[o]),(0,Dt.useEffect)(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=dC(n);pC(i);let{toggleGroupRow:a}=fC();return mC(i),{toggleGroupRow:a}}function pC(n){let e=zl(),{componentActions:t,componentState:{columns:o,groupRenderStrategy:r,isTree:i}}=ze();function a(l,s,u,c){let d={};if(u==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},h=s.get(f.field);if(h&&u==="inline"){let{groupIndex:y}=h;m={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:C})=>C.isGroupRow?C.groupKeys?.[y]:C.value,rowspan:({rowInfo:C,dataArray:T})=>{if(C.isTreeNode||!C.isGroupRow)return 1;let b=T[C.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let S=b.indexInParentGroups||[],w=C.indexInParentGroups||[],R=!1;for(let D=0;D<=y;D++){let x=S[D];if(w[D]!==x){R=!0;break}}if(!R)return 1;let I=C.parents[y];return I?I.groupCount-(I.collapsedChildrenCount||0)+(I.collapsedGroupsCount||0):1},renderGroupIcon:ui({groupIndexForColumn:y,groupRenderStrategy:u,toggleGroupRow:c,initialRenderGroupIcon:f.renderGroupIcon}),render:si({groupIndexForColumn:y,groupRenderStrategy:u})}}let g={...m,...f};d[p]=g}),Object.keys(d).length===0?void 0:d}(0,Dt.useEffect)(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(o,n,r,e)})()},[o,n,r,e])}function fC(){let{componentState:{groupBy:n,pivotBy:e,selectionMode:t}}=be(),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=ze(),f=zl();return(0,Dt.useEffect)(()=>{(()=>{let{columns:h,groupColumnIds:g}=hC({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let C=new Set(y),T=!1;g.forEach(b=>{C.has(b)||(T=!0,y=[b,...y])}),T&&(o.columnOrder=y)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function mC(n){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:o,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=be(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=ze();(0,Dt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let m=l(),h=tf(c,n),g=of({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:o,groupByMap:n});to(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,o,n,c,p?e:null,p?r:null,p?t:null,p]),(0,Dt.useEffect)(()=>{let m=o.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:C}=h,T={...g},b={...y},S=!1,w=new Set,R=new Set;Object.keys(c).forEach(I=>{let P=c[I];if(P.defaultHiddenWhenGroupedBy||C!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&m||(P.defaultHiddenWhenGroupedBy===!0||C)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((x,M)=>x||n.has(M),!1)){if(b[I]!==!1){if(g[I]===!1)return;b[I]=!1,S=!0,w.add(I)}}else b[I]===!1&&(delete b[I],S=!0,R.add(I))}),S&&(s.columnVisibilityForGrouping=b,R.forEach(I=>{delete T[I]}),w.forEach(I=>{T[I]=!1}),s.columnVisibility=T)},[c,u,o,n,d])}function hC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=Zc({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),C=y.id||`group-by-${m.field||m.groupField}`;f.push(C),p[C]=y});else if(u==="single-column"&&t.length){let m=Qc({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:u,selectionMode:r},c,i),h=m.id||"group-by";f.push(h),p[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,C=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||C&&l===!1)return;let T={...g};s&&(typeof s=="function"?T={...T,...s({column:T,pivotBy:o,groupBy:t})}:T={...T,...s}),T.inheritFromColumn!==!1&&(T={...typeof T.inheritFromColumn=="string"?d[T.inheritFromColumn]:T.pivotAggregator?.field?m[T.pivotAggregator?.field]:void 0,...T}),!T.render&&T.renderValue&&(T.render=b=>T.renderValue(b)),p[h]=T})}else Object.keys(d).forEach(m=>{let h=d[m];p[m]=h});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var af=require("react");var lf=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,columnDefaultDraggable:c,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:h,columnPinning:g,editable:y,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultSortable:b,scrollbarWidth:S,columnTypes:w,pinnedEndMaxWidth:R,pinnedStartMaxWidth:I,viewportReservedWidth:P,resizableColumns:D,columnVisibility:x,columnVisibilityAssumeVisible:M,columnSizing:_})=>{let{computedRemainingSpace:F,computedColumnOrder:v,computedVisibleColumns:E,computedVisibleColumnsMap:O,computedPinnedStartColumns:z,computedPinnedEndColumns:Z,computedUnpinnedColumns:oe,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:se,computedUnpinnedColumnsWidth:G,computedUnpinnedOffset:k,computedPinnedEndOffset:re,computedPinnedEndWidth:ie,computedPinnedStartWidth:K,renderSelectionCheckBox:V,computedColumnsMap:j,computedColumnsMapInInitialOrder:q,fieldsToColumn:$}=(0,af.useMemo)(()=>gc({columns:n,scrollbarWidth:S,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:P,resizableColumns:D,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:R,pinnedStartMaxWidth:I,draggableColumns:u,columnDefaultDraggable:c,columnOrder:h,columnPinning:g,columnDefaultEditable:C,columnDefaultFilterable:T,columnDefaultSortable:b,editable:y,columnSizing:_,columnTypes:w,columnVisibility:x,columnVisibilityAssumeVisible:M??!0}),[n,e.width,t,o,r,P,S,a,d,p,f,m,h,x,M,c,u,D,R,I,_,w,g,C,T,y,1]);return{renderSelectionCheckBox:V,columns:n,computedColumnsMap:j,computedPinnedEndWidth:ie,computedPinnedStartWidth:K,computedRemainingSpace:F,computedUnpinnedOffset:k,computedPinnedEndOffset:re,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:se,computedUnpinnedColumnsWidth:G,computedPinnedStartColumns:z,computedPinnedEndColumns:Z,computedUnpinnedColumns:oe,computedVisibleColumns:E,computedVisibleColumnsMap:O,computedColumnOrder:v,computedColumnsMapInInitialOrder:q,fieldsToColumn:$}};var sf=require("react"),Gl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function gC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function uf(n){return(0,sf.useMemo)(()=>{let e=new Gl;return{computedRowHeight:gC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var un=require("react");var yC={vertical:!1,horizontal:!1};function cf(n){let{getComponentState:e}=ze(),{getState:t}=be(),[o,r]=(0,un.useState)(yC);return(0,un.useEffect)(()=>n.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=n;r({vertical:i>0,horizontal:a>0})}),[n]),(0,un.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function df(){let{componentActions:n,componentState:e}=ze(),{componentActions:t,componentState:o,getState:r,api:i}=be(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:u,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,columnTypes:f,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:C,bodySize:T,showSeparatePivotColumnForSingleAggregation:b}=e;(0,cn.useState)(()=>{e.onRowHeightCSSVarChange.onChange(B=>{B&&(n.rowHeight=B)}),e.onFlashingDurationCSSVarChange.onChange(B=>{let ae=B?B*1:null;ae!=null&&!isNaN(ae)&&(n.flashingDurationCSSVarValue=ae)}),e.onRowDetailHeightCSSVarChange.onChange(B=>{B&&(n.rowDetailHeight=B)}),e.onColumnHeaderHeightCSSVarChange.onChange(B=>{B&&(n.columnHeaderHeight=B)})}),(0,cn.useEffect)(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:S,filterValue:w,filterTypes:R}=o,{toggleGroupRow:I}=rf(),P=e.computedColumns,{computedColumnOrder:D,computedVisibleColumns:x,computedVisibleColumnsMap:M,computedPinnedStartColumns:_,computedPinnedEndColumns:A,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:E,computedUnpinnedColumnsWidth:O,computedUnpinnedOffset:z,computedPinnedEndOffset:Z,computedRemainingSpace:oe,computedPinnedStartWidth:ce,computedPinnedEndWidth:se,renderSelectionCheckBox:G,computedColumnsMap:k,computedColumnsMapInInitialOrder:re,fieldsToColumn:ie}=lf({columns:P,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:T,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:o.sortInfo??void 0,multiSort:S,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:w,filterTypes:R,columnSizing:u,columnTypes:f}),K=Bp(x),V=Wp(x),j=cf(C),q=ce?v>ce:!1,$=se?E>se:!1,[N]=(0,cn.useState)(()=>new Ki({isRowDisabledAt:ae=>r().dataArray[ae]?.rowDisabled??!1,getIdForIndex:ae=>r().dataArray[ae]?.id??-1})),ee=Ae(x),[Se]=(0,cn.useState)(()=>new Gi({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:B=>ee()[B]?.id||""})),{computedRowHeight:Re,computedRowSizeCacheForDetails:ue}=uf({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:N,multiCellSelector:Se,computedRowSizeCacheForDetails:ue,computedRowHeight:Re,scrollbars:j,columnSize:V,rowspan:K,toggleGroupRow:I,computedColumnsMap:k,computedColumnsMapInInitialOrder:re,renderSelectionCheckBox:G,computedPinnedStartOverflow:q,computedPinnedEndOverflow:$,computedPinnedStartWidth:ce,computedPinnedEndWidth:se,computedVisibleColumns:x,computedColumnOrder:D,computedRemainingSpace:oe,computedVisibleColumnsMap:M,computedPinnedStartColumns:_,computedPinnedEndColumns:A,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:E,computedUnpinnedColumnsWidth:O,computedUnpinnedOffset:z,computedPinnedEndOffset:Z,fieldsToColumn:ie}}var mf=require("react");function CC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function SC(){return 4294967295}function TC(n,e,t){return e=e>>>8^n[t^e&255],e}function bC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function Kl(n,e=3988292384){var t=CC(e),o=0,r;for(o=SC(),r=0;r<n.length;r++)o=TC(t,o,n.charCodeAt(r));return o=bC(o),`${o}`}var RC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},pf=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+4*2,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},ff=(n="",e,t)=>{let o;try{o=wC(n)}catch{return pf(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(pf([`
19
- Your Infinite Table license has expired on ${i.toDateString()}.
20
- `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},wC=n=>{let e="",t=n.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(Kl(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Kl(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),RC(t)};var IC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,PC=/(https):\/\/\S+(\.csb\.app)/g,hf=typeof window<"u"?window.location.origin:"",xC=()=>{let[n,e,t]=Array.from(IC.exec(hf)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},DC=()=>{let[n,e,t]=Array.from(PC.exec(hf)||[]);return e==="https"&&t===".csb.app"},vC=DC()||xC(),gf=(n="")=>{let t=!!Le();return(0,mf.useMemo)(()=>{if(t)return!0;let r=ff(n,{publishedAt:1624970570587,version:"6.2.10"});return!n&&!r&&vC?!0:r},[n,t])};var dn=require("react");var AC=10;function yf(n,e,t){let o=(0,dn.useRef)(!1),r=(0,dn.useRef)(null);(0,dn.useEffect)(()=>{n!=null&&(o.current=!1,bt(r.current))},[n]),(0,dn.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,bt(r.current),r.current=xe(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<AC&&a(l)})};var i=a;a()}return()=>{bt(r.current)}},[n,e])}var pn=require("react"),MC=10;function Cf(n,e,t){let o=(0,pn.useRef)(!1),r=(0,pn.useRef)(null);(0,pn.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,pn.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<MC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}var Sf=n=>`--infinite-${n}`;var fn=require("react");function Tf(n,e){Hl(n,e),FC(n,e),e.detail===2&&EC(n,e),n.getState().onCellClick?.(n,e)}function EC(n,e){let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function FC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f}=o(),{rowsPerPage:m}=f,h=p.length,g=new Ee(c);d.cellSelectionState=g;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let C=!!o().wrapRowsHorizontally;d.multiSelectClick(y,C?{horizontalLayout:C,rowsPerPage:m,columnsPerSet:h}:{horizontalLayout:C})}else d.resetClick(y);l.cellSelection=g}function Hl(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=o(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:g}=c;if(g=l(g),s.rowSelectionState=g,g&&typeof g=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=g,!0}else if(d==="single-row"){let y=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function bf(n,e){e.detail!==2&&void 0}var _C={Enter:!0," ":!0,a:!0};function Rf(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:u,ctrlKey:c,metaKey:d}=e;if(!_C[u])return!1;let p=t(),f=o(),{activeRowIndex:m,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:y}=p,{selectionMode:C,groupBy:T,rowSelection:b,treeSelectionState:S,isTree:w}=f;if(y===!1)return!1;let R=g==="row"&&m!=null?m:g==="cell"&&h!=null?h[0]:null,I=R!=null?f.dataArray[R]:null;if(!I||R==null)return!1;if(C==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(I.id),!0;if(C!=="multi-row")return!1;if(u==="a"&&(c||d)){if(w&&S){let D=s(S);return D.selectAll(),r.treeSelection=D,!0}let P=l(b);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(T.length)return I.isGroupRow&&I.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(I.groupKeys):i.rowSelectionApi.toggleRowSelection(I.id),!0;if(w){if(I.isTreeNode&&I.nodePath)return a.treeApi.toggleNodeSelection(I.nodePath),!0}else{let P={...e},{renderSelectionCheckBox:D}=n.getComputed();return D&&(P.metaKey=!1,P.ctrlKey=!0),Hl({...n,rowIndex:R},P)}}return!1}var wf=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),If=n=>Array.from(n.querySelectorAll(wf)).filter(t=>!!t.offsetParent),Bi=n=>n.querySelector(wf);var xf=H(Ho());async function Pf(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var NC=10,OC=(n,e)=>n-e;function ki(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=et(p.id,e);return p.contentFocusable({column:p,...Jo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:h,api:i,dataSourceApi:a})}function Bl(n,e,t){let o=t.getState().editingCell;return LC(n,e,t,{isCellFocusable:ki,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function Df(n,e,t){let o=(0,xf.default)(t,n+e,OC);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=Df;function LC(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:Df(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function vf(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=ki(e,n)?e:Bl(e,-1,n);if(t){await kl([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Bi(o)?.focus()}}async function kl([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=NC,l=null,s=!1;function u(c=0){c++,bt(l),l=xe(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Pf(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var VC=`.${Po}`;function Af(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Go(o,VC),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:c}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&ki({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:Bl({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=If(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return kl([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;Bi(c)?.focus()}),!0}var Mf={control:"ctrl"},Ef={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},zC={esc:"escape"},_f={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Nf=Object.keys(_f),Wl=new Set(Nf),GC=new Set(["shift","alt"]);function Wi(n,e){return Array.isArray(e)?e.some(t=>Ff(n,t)):Ff(n,e)}function Ff(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>Ef[p]),i=o.map(p=>Mf[p]||Ef[p]||zC[p]||p),a=i.filter(p=>Wl.has(p)),l=i.filter(p=>!Wl.has(p)),s=Nf.reduce((p,f)=>(p[f]=_f[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!GC.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Wl.has(t)||t==="meta"||Mf[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Of(n,e){let t={...n,cloneRowSelection:a=>Di(a,n.getDataSourceState),cloneTreeSelection:a=>Ei(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Rf(t,e)&&e.preventDefault(),(Af(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Ap(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!Wi(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function KC(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Q(),{getState:i,componentActions:a,api:l}=be();return(0,fn.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Ei(c,i),cloneRowSelection:c=>Di(c,i)}),[n,e,i,a,t,l,o])}function HC(){let n=KC();(0,fn.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{Of(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=et(s.id,n);Tf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=et(c.id,n);bf({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function BC(){let{getState:n}=Q();return{onKeyDown:(0,fn.useCallback)(t=>{n().keyDown(t)},[])}}function Lf(){return HC(),BC()}var ql=require("react");var ve=H(require("react")),yt=require("react"),Wf=require("react-dom");var Fe=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Fe(e)}static from(e){return new Fe(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function Vf(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function zf(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function kC(n,e,t){let o=Vf(n,t),r=Vf(e,t);return o===r?zf(t,e)-zf(t,n):o-r}function WC(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>kC(o,r,t)),e}function Gf(n,e){n=WC(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(jC([t,i,a],e))return!0}return!1}function jC(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var mn=class{containsPoint(e){return Gf(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var po=class extends mn{constructor(t){super();this.points=t.map(Fe.clone)}static clone(t){return new po(t)}getPoints(){return this.points}shift(t){return this.points.forEach(o=>{o.shift(t)}),this}};var we=class extends mn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new we(t)}static clone(t){return new we(t)}static from(t){return we.clone(t)}static fromPoint(t){return we.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new po(this.getPoints()).containsPoint(t)}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}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Fe.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function jl(n){return!!n.tagName}function Bf(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=we.from(jl(e)?e.getBoundingClientRect():e),a=we.from(jl(t)?t.getBoundingClientRect():t),l=o?we.from(jl(o)?o.getBoundingClientRect():o):null;if(!l)return{...Kf({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Kf({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function Kf(n){let e=we.from(n.targetRect),t=we.from(n.anchorRect),o=n.constrainRect?we.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=Hf(e,i),s=Hf(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Hf(n,e){return e==="TopLeft"?Fe.from({top:n.top,left:n.left}):e==="TopCenter"?Fe.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Fe.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Fe.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Fe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Fe.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Fe.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Fe.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Fe.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var ji="__is_infinite_menu_component";function $C(n){return n&&typeof n.then=="function"||n instanceof Promise}function jf(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function kf(n){return typeof n=="function"&&(n=n()),$C(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&jf(n)&&(n=n.getBoundingClientRect()),n?we.from(n):null}async function UC(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),jf(o)&&(r=o),r||null}return t(await e)}function YC(n){return ve.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function qC(n){let e=ve.useRef(null);return(0,yt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&$l(e.current,t)}),[n.realign]),ve.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,yt.useCallback)(t=>{t&&$l(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function $l(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await kf(t)||void 0,a=o?await kf(o):void 0,l=we.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Bf({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;n.style.transform=`translate3d(${m}px,${h}px, 0px)`}}}function $f(n,e){let[t,o]=(0,yt.useState)(null);return(0,yt.useLayoutEffect)(()=>{async function r(){let i=e?await UC(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?(0,Wf.createPortal)(n,t):ve.createElement(ve.Fragment,null):e===null||e===!1?n:ve.createElement(YC,null,n)}function XC(n){if(ve.Children.count(n)===1){let e=ve.Children.only(n);if(ve.isValidElement(e))return e.props.id||e.key}return null}function ZC(n,e,t){if(ve.Children.count(n)===1){let o=ve.Children.only(n);if(ve.isValidElement(o)&&o.type[ji]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),ve.cloneElement(o,r)}}return n}globalThis.allhandles={};globalThis.thehandles={};function Gt(n){let e=n,[t]=(0,yt.useState)(()=>new Map),[o,r]=(0,yt.useState)(null),[i,a]=(0,yt.useState)(0),l=(0,yt.useCallback)(()=>{let m=[];for(let[h,g]of t)m.push(ve.createElement(qC,{...g,key:g.key}));return m},[]),[s,u]=Ft(),c=$f(l(),n.portalContainer),d=(0,yt.useCallback)((m,h)=>{let y=`${h.id||XC(m)||It()}`,C=t.get(y),T=w=>()=>{let R=typeof w=="function"?w():w;return ZC(R,e.portalContainer,h.constrainTo??e.constrainTo)},b=T(m),S=(w,R)=>{if(!C)return;let I=T(w);Object.assign(C,{children:I}),u(),!!!R?.skipRealign&&(r(C.key),a(Date.now()))};return C?(Object.assign(C,h),S(m),S):(C={key:y,children:b,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:he()},t.set(C.key,C),u(),S)},[t,e.portalContainer,u]);ve.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return ve.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var lm=H(require("react"));var yn=H(require("react"));var hn=H(require("react"));var cr=H(require("react"));function $i(n){return null}$i.defaultProps={__is_menu_item:!0};var Uf="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1n _16lm1iw8",Yf=ye({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1r _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},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"]]}),qf="db3arf1",Xf="db3arfd";var QC="-";function JC(){return cr.createElement("hr",{className:Xf})}var Ui=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===QC?cr.createElement(JC,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Zf(n,e){return cr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===$i)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),Ui(n,o)}return Ui(n,t)})||[]}var Qf="submenu";function Jf(){let n=hn.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:It(),focused:!1,destroyed:!1,domRef:n}}var em=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),eS=[{name:"label"}],tm=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,u=e.id||t.generatedId;s&&(u=`${s}-${u}`);let c=[...e.columns||eS],d={columns:c,keyboardActiveItemKey:r,activeItemKey:o,menuId:u},p=[];i?p=i.map(Ui.bind(null,d)):!i&&typeof a!="function"&&(p=Zf(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Qf)&&c.push({name:Qf,render:({domProps:h,item:g})=>g.menu?hn.createElement("div",{...h},hn.createElement(wo,{expanded:!1})):hn.createElement("div",{...h})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};var vt=H(require("react")),Je=require("react");var dr=class extends po{constructor(e){super(e.slice(0,3))}};var tS=250;function oS(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}xe(i)};xe(()=>{i()})})}var nS=De(),Yi=class{constructor(e){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||tS;this.getPointerMoveTarget=()=>document.documentElement||nS;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Fe({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new dr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new dr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,oS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Fe({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var qi=require("react"),Ul=(0,qi.createContext)(null);function Yl(){return(0,qi.useContext)(Ul)}var gn=require("react");function om(){let n=(0,gn.useRef)(!0);return(0,gn.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,gn.useCallback)(()=>n.current,[])}function rS(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=n.menu;return c?(typeof c=="function"&&(c=c()),vt.createElement(At,{key:u,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),o(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function iS(n,e){let t=nm(n,e);if(!t.length)return null;let o=we.from(t[0]?.getBoundingClientRect()),r=we.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function nm(n,e){let t=Go(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function aS(n,e){let t=nm(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function lS({onItemActivate:n}){let{getState:e}=Yl(),[{onItemEnter:t,onItemLeave:o}]=(0,Je.useState)(()=>new Yi({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?we.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,Je.useCallback)(t,[]),onItemLeave:(0,Je.useCallback)(o,[])}}function rm(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=Yl(),C=(0,Je.useCallback)(G=>{g.keyboardActiveItemKey=G},[]),T=(0,Je.useCallback)(G=>{g.activeItemKey=G},[]),b=om(),[S,w]=(0,Je.useState)(null),R=null;(0,Je.useLayoutEffect)(()=>{let{runtimeItems:G}=y(),k=G.filter(re=>re.type==="item"&&i===re.key)[0];if(!k||!k.menu){w(null),x();return}if(k){let re=iS(r,k.key);re&&P(()=>rS(k,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:T,setKeyboardActiveItemKey:C,parentMenuId:r,onHideIntent:Z,api:oe}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let I=(G,k)=>{C(k.key),T(k.key),k.originalMenuItem.onClick&&k.originalMenuItem.onClick(G);let re={key:k.key,item:k.originalMenuItem,hideMenu:Z};k.originalMenuItem.onAction&&k.originalMenuItem.onAction(re),u&&u(re),k.originalMenuItem.hideMenuOnAction&&Z()},{showOverlay:P,portal:D,clearAll:x}=Gt({portalContainer:!1}),{onItemEnter:M,onItemLeave:_}=lS({onItemActivate:G=>{if(!b())return;let k=G?G.key:null;T(k)}});R=o.map((G,k)=>vt.createElement(sS,{key:G.type==="item"?G.key:k,onItemEnter:(re,ie)=>{M(re.key,ie)},onItemLeave:(re,ie)=>{_(re.key,ie)},columns:t,active:G.type==="item"&&G.key===i,keyboardActive:G.type==="item"&&G.key===a,item:G,index:k,onClick:I}));let A=t.map(G=>G.width||(typeof G.flex=="number"?`${G.flex}fr`:G.flex)||"auto").join(" "),F={...e.style,gridTemplateColumns:A,gridTemplateRows:o.map(()=>"auto").join(" ")};c||(F.whiteSpace="nowrap");function v(G){let{runtimeItems:k,runtimeSelectableItems:re}=y(),ie=k.findIndex($=>$.type==="item"&&$.key===a),K=a,V=k[ie],j={ArrowUp:()=>{let $=k.slice(0,ie).filter(N=>N.type==="item"&&!N.disabled).pop();$&&$.type==="item"&&$.key&&(K=$.key)},ArrowDown:()=>{let $=k.slice(ie+1).filter(N=>N.type==="item"&&!N.disabled)[0];$&&$.type==="item"&&$.key&&(K=$.key)},Home:()=>{j.PageUp()},End:()=>{j.PageDown()},PageUp:()=>{K=re[0].key},PageDown:()=>{K=re[re.length-1].key},ArrowLeft:()=>{T(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{V&&(T(V.key),xe(()=>{b()&&S&&S.getParentMenuId()===y().menuId&&S.focus()}))},Enter:()=>{if(V)if(V.originalMenuItem?.menu){if(V&&V.originalMenuItem.menu&&S){j.ArrowLeft();return}V&&T(V.key)}else I(G,V)}," ":()=>{if(!V)return;V.originalMenuItem.menu||I(G,V);let $=aS(r,V.key);$&&$.click()},Escape:()=>{j.ArrowLeft();let $=y();$.parentMenuId||$.onHideIntent?.($)}},q=j[G.key];q&&(q(),G.preventDefault()),K!=a&&C(K)}function E(){g.focused=!1}let O=(0,Je.useCallback)(function(){g.focused=!0,setTimeout(()=>{z.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&C(y().runtimeSelectableItems[0]?.key??null)})},[]),z=(0,Je.useRef)(!0),Z=(0,Je.useCallback)(()=>{let G=y();G.onHideIntent?.(G)},[y]),[oe]=(0,Je.useState)(()=>({hideMenu:Z,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),O())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),ce=(0,Je.useCallback)(G=>{G?(h.current=G,d?.(y(),oe),f&&oe.focus()):(p?.(y()),h.current=G)},[]),se=vt.createElement("div",{className:$o.contents},vt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:ce,onKeyDown:G=>{e.onKeyDown?.(G),v(G)},onMouseDown:G=>{z.current=!1,e.onMouseDown?.(G)},onMouseUp:G=>{z.current=!0,e.onMouseUp?.(G)},onFocus:O,onBlur:E,className:J(Uf,e.className,"InfiniteMenu"),style:F},R),D);return s?null:se}function sS(n){let[e,t]=vt.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=vt.createElement("div",{style:r.style},r.value);else{let c=0;u=o.map((d,p)=>{let f=r.value,m=d.field||d.name,h=p+1,g=h+r.span;if(h<c)return null;c=g;let C={style:{...d.style,...r.style,gridColumnStart:h,gridColumnEnd:g},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:J(Yf({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:T=>{r.disabled||n.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||n.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||n.onClick(T,r)}};return d.render?vt.createElement(qn,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:C}}):vt.createElement("div",{key:`${s}-${m}`,...C},f[m])}).filter(Boolean)}return vt.createElement("div",{className:qf},u)}var{ManagedComponentContextProvider:uS}=_t({initSetupState:Jf,forwardProps:em,mapPropsToState:tm,layoutEffect:!0});function cS(n){let{componentActions:e,componentState:t}=ze(),o=Ae(t);return yn.createElement(Ul.Provider,{value:{componentActions:e,componentState:t,getState:o}},yn.createElement(rm,{domProps:n.domProps}))}function At(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y,...C}=n;return yn.createElement(uS,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},yn.createElement(cS,{domProps:C}))}At[ji]=!0;var im=H(require("react"));function am(n,e){let{columnApi:t,column:o,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=Jr(d,e);u.push({key:p,label:f,check:im.createElement(oo,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function sm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??At,s=o().computedColumnsMap.get(n);if(!s)return null;let u={column:s,columnApi:et(s.id,e),...e},c=am([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:lm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var dS=`[${ll["data-name"]}="${sl["data-name"]}"]`;function pS(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${Cd["data-column-id"]}="${e}"] ${dS}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>sm(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function um(){let n=Q(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Gt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});(0,ql.useEffect)(()=>{let{actions:u,getState:c}=n,d=c();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,u.contextMenuVisibleFor=null,u.cellContextMenuVisibleFor=null,u.filterOperatorMenuVisibleForColumnId=null,u.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return(0,ql.useEffect)(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),o.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),pS({columnId:u,context:n,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}var cm=H(require("react")),dm=require("react");var fS={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function pm(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Q(),{getState:a,getDataSourceMasterContext:l}=be(),{focusDetectDOMRef:s}=n(),u=(0,dm.useCallback)(async()=>{vf({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return cm.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:fS})}var Cn=require("react");function mS(){let n=Q(),{getState:e}=n,{editingCell:t}=e(),o=t&&!t.active?t.cancelled:void 0;(0,Cn.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...mt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function hS(){let n=Q(),{getState:e,state:{editingCell:t}}=n,o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Cn.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...mt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function gS(){let n=Q(),{state:{editingCell:e}}=n,t=e?.active,o=Qt(t);(0,Cn.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function yS(){let n=Q(),{state:{editingCell:e},getState:t}=n,o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Cn.useEffect)(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,u={...mt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(u),n.api.persistEdit({value:i})}},[o])}function CS(){let n=Q(),{state:{editingCell:e},getState:t}=n,o=e?e.persisted:void 0;(0,Cn.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d={...mt({rowIndex:l,columnId:s,...n}),value:u,initialValue:c};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function fm(){mS(),hS(),yS(),CS(),gS()}var Ql=require("react");var fo=H(require("react"));var Xl=H(require("react")),mm=n=>Xl.createElement(Me,{...n},Xl.createElement("path",{d:"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 Zl=H(require("react")),hm=n=>Zl.createElement(Me,{...n},Zl.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function gm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??At,f=o().computedColumnsMap.get(n);if(!f)return null;let m=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let C=y.operators.map(R=>{let I=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===I:I===y.defaultOperator,D=R.components?.Icon??qo;return{key:I,icon:fo.createElement(D,null),label:fo.createElement(fo.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(n,I)},checked:P?fo.createElement(hm,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:fo.createElement(mm,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(n)}},"-"],...C],S={column:f,api:u,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},w=d?d(b,S):b;return fo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:h,onHideIntent:R=>{h(R),t?.()}})}var Xi=10;function ym(){let n=Q(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Gt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Ql.useEffect)(()=>{let{actions:l,getState:s}=n;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,h=we.from(m.getBoundingClientRect());h.top-=Xi,h.left-=Xi,h.width+=2*Xi,h.height+=2*Xi,r(()=>gm(p.id,n,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),(0,Ql.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var pr=require("react");var os=H(require("react"));var Jl=H(require("react"));function Zi(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function es(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function ts(n,e,t){if(!n)return null;let o=he();return n.then(r=>{let{items:i,columns:a}=Zi(r);i&&i.length&&o(Jl.createElement(t,{...e,items:i||[],columns:a}))}),Jl.createElement(Yt,{updater:o})}function Cm(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??At,{computedColumnsMap:d}=a(),p=d.get(o),f={...mt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=es({onHideIntent:t}),h=u(f,e),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:f,menu:ts(h,m,c),preventDefault:g};let{items:y,columns:C}=Zi(h);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:g,menu:os.createElement(c,{...m,columns:C,items:y}),cellContext:f}}function Sm(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??At,{computedColumnsMap:s}=r(),u=n.columnId?s.get(n.columnId):void 0,c=u?{...n,...mt({...e,rowIndex:n.rowIndex,columnId:u.id})}:n;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=es({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:ts(p,d,l),preventDefault:f};let{items:m,columns:h}=Zi(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:os.createElement(l,{...d,columns:h,items:m}),cellContext:c}}var Qi=5,Tm=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function bm(){let n=Q(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Gt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,pr.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:u}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=Cm(d,n,f),y=we.fromPoint({top:p.clientY,left:p.clientX});y.width+=Qi,y.height+=Qi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Tm}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:C}=s();C&&C({...h,getState:s,getDataSourceState:u},p)})},[]),(0,pr.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Rm(){let n=Q(),e=Le(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Gt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,pr.useEffect)(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:h}=Sm(c,n,p),g={top:d.clientY,left:d.clientX},y=we.fromPoint(g);y.width+=Qi,y.height+=Qi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Tm}),h&&d.preventDefault(),l.contextMenuVisibleFor={point:g,...c};let{onContextMenu:C}=s();C&&C({...n,...m},d)})},[]),(0,pr.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var wm=require("react"),Im=H(require("react"));var Ji=require("react");function ea(n,e){let{state:{brain:t}}=Q(),o=(0,Ji.useCallback)(n,e);(0,Ji.useEffect)(()=>t.onScroll(o),[t,o])}var ns="yzx0vj0";function Pm(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,wm.useRef)(null);ea(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=le.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=le.runtime.bodyWidth),o==="column"?l.minWidth=le.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=le.runtime.bodyWidth),t==="column"?l.maxWidth=le.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=le.runtime.bodyWidth),Im.createElement("div",{ref:a,...i,className:i.className?J(i.className,ns):ns,style:l},i.children)}var SS=Y(U.columnWidthAtIndex),TS=Y(U.columnOffsetAtIndex);function xm(){return Q().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${SS}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${TS}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var ta="InfiniteTable";var Dm=require("react");function vm(){let{state:n,getState:e,actions:t}=Q(),{wrapRowsHorizontally:o}=n,r=Qt(o);(0,Dm.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=Vl(ta,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater}},[r,o])}var Am=require("react");function Mm(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=Q(),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,Am.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),h=!1,g=l.rowsPerPage,y=(r&&r.length>0||i)&&g>0?g:null;return f!=y&&(t.rowsPerPage=y,h=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,h=!0),h};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var Em=H(require("react"));var bS=ot(()=>{console.warn(`It appears you have not loaded the CSS file for InfiniteTable.
17
+ See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function Ap(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=eC(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function tC(n){return{message:n.join(""),type:"warning"}}function oC(n){return{message:n.join(""),type:"error"}}var nC=Ap({DS001:tC`The "data" prop of your DataSource seems to be updating too frequently.
18
+ Make sure you don't pass a new reference on every render.`}),rC=Ap({CSS001_CSS:oC`It appears you have not loaded the CSS file for InfiniteTable.
21
19
  In most environments, you should be able to fix this by adding the following line:
22
-
20
+
23
21
  import '@infinite-table/infinite-react/index.css'
22
+ `}),Ep={...nC,...rC};var $t=new Map,Ut=new Map,go=new Map,Yt=new Map;var St=new Map,Mp=n=>{St.delete(n),go.delete(n),$t.delete(n),Yt.delete(n),Ut.delete(n)};function Bl(n,e,t){let o=St.get(n);if(!o)return;let r=go.get(n);(!r||!Object.hasOwn(r,e))&&go.set(n,{...r||{},[e]:o.getState()[e]}),$t.set(n,{...$t.get(n)||{},[e]:t}),o.actions[e]=t}function $i(n,e,t){let o=St.get(n);if(!o)return;let r=Yt.get(n);(!r||!Object.hasOwn(r,e))&&Yt.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),Ut.set(n,{...Ut.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var iC=n=>{let e=n.type==="error"?Zt(n.debugId):ct(n.debugId),t=n.type==="error"?Tp:mn,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
24
23
 
25
- `)}),RS=Y(le.loaded);function Fm(){let{getState:n}=Q();Em.useEffect(()=>{wS(n)},[])}function wS(n){let e=n(),{debugMode:t,domRef:o}=e;t&&o.current&&getComputedStyle(o.current).getPropertyValue(RS)!==`${Ks}`&&bS()}function _m(){let n=Le(),e=n?n.getMasterState():null,t=Q().getState();return(e||t).portalDOMRef.current}var Ot=Pe.rootClassName,IS=[Yc,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:PS}=_t({initSetupState:qp,forwardProps:Xp,mapPropsToState:ef,cleanup:Zp,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Jp(),getParentState:()=>Co(),debugName:ta});function Om(){let n=Q(),{state:e,getComputed:t}=n,{header:o,brain:r,headerBrain:i,wrapRowsHorizontally:a}=e,{scrollbars:l}=t();return o?fe.createElement(Md,{wrapRowsHorizontally:!!a,bodyBrain:r,headerBrain:i,scrollbars:l}):null}var Nm=J(`${rt}Body`,zn.relative,Ur[1],vu);function xS(n){return fe.createElement("div",{...n,className:n.className?J(Nm,n.className):Nm})}function Lm(){let n=Q(),e=Le(),{state:t,getComputed:o,api:r}=n,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:T,domProps:b,domRef:S}=t,w=m?.LoadMask??Si,R=o(),{computedRowHeight:I,computedRowSizeCacheForDetails:P}=R,D=P?.getRowHeight||I,{componentState:{loading:x}}=be(),M=fe.useCallback(E=>{let O=n.getState(),z=E.target;if(!e&&E._from_row_detail)return;e&&(E._from_row_detail=!0);let Z=Gs(z,Ll(),O.domRef.current),oe,ce,se,G;Z&&(ce=Number(Z.dataset.colIndex),G=Number(Z.dataset.rowIndex),oe=n.getComputed().computedVisibleColumns[ce].id,se=n.dataSourceApi.getRowInfoArray()[G].id);let k={columnId:oe,colIndex:ce,rowId:se,rowIndex:G,event:E,target:Z??E.target};Z&&O.cellContextMenu(k),O.contextMenu(k)},[]),{renderCell:_,renderDetailRow:A}=Gp({imperativeApi:r,getComputed:o,domRef:S,bodySize:h,computed:R}),{autoFocus:F,tabIndex:v}=b??{};return vm(),fe.createElement(xS,{onContextMenu:M},fe.createElement(gu,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:v??0,autoFocus:F??void 0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:D,renderCell:_,renderDetailRow:y?A:void 0,cellHoverClassNames:C?IS:void 0,scrollerDOMRef:f,scrollVarHostRef:S}),fe.createElement(w,{visible:x},c))}var Vm=fe.memo(function(){let e=Q(),t=Le(),{state:o,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=be(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:h,rowDetailHeightCSSVar:g,columnHeaderHeightCSSVar:y,scrollStopDelay:C,brain:T,activeRowIndex:b,activeCellIndex:S}=o,{licenseKey:w}=o;!w&&$t.licenseKey&&(w=$t.licenseKey),Cf(b,a.length,r),yf(S,a.length,r);let{onKeyDown:R}=Lf();fe.useEffect(()=>{let O=l(),z=Et(Z=>{O.notifyRenderRangeChange({renderStartIndex:Z[0],renderEndIndex:Z[1]})},{wait:C});return T.onVerticalRenderRangeChange(z)},[T,C]);let I=gf(w),{autoFocus:P,tabIndex:D,...x}=o.domProps??{},M=Nc(x);fe.useEffect(()=>{T.setScrollStopDelay(C),s.scrollStopDelayUpdatedByTable=C},[C]),_p(),Mm(),fm();let{menuPortal:_}=um(),{menuPortal:A}=bm(),{menuPortal:F}=Rm(),{menuPortal:v}=ym();fe.useEffect(()=>{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(o.id,o.ready,e.api,e)},[o.ready]),Fm(),fe.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let E=i??fe.createElement(fe.Fragment,null,fe.createElement(Om,null),fe.createElement(Lm,null));return fe.createElement("div",{onKeyDown:R,ref:u,...M},E,fe.createElement("div",{ref:c,className:J(`${rt}Portal`,Eu[1e7],zn.absolute,Du[0],Iu[0])},_,A,F,v),h?fe.createElement(Pn,{key:"row-height",varName:h,onChange:d}):null,fe.createElement(Pn,{key:"flashing-duration",allowInts:!0,varName:le.components.Cell.flashingDuration,onChange:p}),g?fe.createElement(Pn,{key:"row-detail-height",varName:g,onChange:f}):null,y?fe.createElement(Pn,{key:"column-header-height",varName:y,onChange:m}):null,I?null:fe.createElement(Od,null),fe.createElement(pm,null))});function DS({children:n}){let{componentActions:e,componentState:t}=ze(),{scrollerDOMRef:o,scrollTopKey:r}=t,i=df(),a=Ae(i),l=Ae(t),s=Le(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=be(),[f]=fe.useState(()=>Fp({getComputed:a,getState:l,getDataSourceState:u,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:c})),m={actions:e,state:t,computed:i,dataSourceActions:c,getDataSourceMasterContext:d,getDataSourceState:u,getComputed:a,getState:l,api:f,dataSourceApi:p,children:n};wr(o,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),fe.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[r,o]);let h=Uo();return fe.createElement(h.Provider,{value:m},fe.createElement(Vm,null))}var vS=40,AS=Sf(Hs),$t=function(n){return fe.createElement(PS,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:vS,columnHeaderHeight:AS,...n},fe.createElement(DS,{children:n.children}))};$t.Header=Om;$t.Body=Lm;$t.HScrollSyncContent=Pm;$t.Footer=()=>fe.createElement(_u,null);var zm=H(require("react"));function MS(n){let{DataSource:e}=ln({nodesKey:"children",...n});return zm.createElement(e,null,n.children??null)}var Gm=H(require("react"));function Km(n){return Gm.createElement($t,{...n})}var Hm=Xe("InfiniteTable:DataQuery"),oa=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{Hm(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),Hm(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||""}};function Oo(n){if(Array.isArray(n))return n.map(Oo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Oo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var mo=class{constructor(e){this.queryCache=new X;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Oo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new oa(e.name||"");return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Oo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Oo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Oo(e);this.queryCache.delete(t)};if(this.options=e,mo.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}mo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=mo.clients.get(e);t&&t.destroy()}static destroyAll(){mo.clients.forEach(e=>{mo.destroy(e.name)})}destroy(){mo.clients.delete(this.options.name)}},na=mo;na.clients=new Map;var ES={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},Bm={instantEdit:ES};var FS=require("react");function km(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var rs=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??rs.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}},fr=rs;fr.DEFAULT_SIZE=10;var is=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??is.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},mr=is;mr.DEFAULT_SIZE=10;var Lo=require("react"),_S=(n,e)=>n.every((t,o)=>t===e[o]),Wm=(n,e)=>{let t=(0,Lo.useRef)(e),o=_S(e,t.current),r=(0,Lo.useRef)(!0);t.current=e;let i=(0,Lo.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,Lo.useRef)(n);l.current=n,(0,Lo.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var ho=require("react"),jm=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),ra=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,ho.useRef)(t),a=(0,ho.useRef)(o),l=jm(t,i.current,r),s=!jm(o,a.current,r),u=(0,ho.useRef)(!0);i.current=t,a.current=o;let c=(0,ho.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,ho.useRef)(n);p.current=n,l&&s&&(u.current=!1),(0,ho.useEffect)(()=>{if(!u.current)return p.current()},d)};var Ct=H(require("react"));var $m=Y(U.currentFlashingDuration),NS=({children:n})=>Ct.createElement(Ct.Fragment,null,n),Um=1e3,Ym={up:Kr({direction:"up"}).split(" "),down:Kr({direction:"down"}).split(" "),neutral:Kr({direction:"neutral"}).split(" ")},as=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=NS}=n;return Ct.forwardRef((i,a)=>{let l=Yn(),{state:{flashingDurationCSSVarValue:s}}=Q(),u=typeof s=="number"?s??e??Um:e??Um,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,h=f.id,g=p.id,y=Ct.useRef(!0),C=Ct.useRef(d),T=y.current?null:C.current;y.current=!1;let b=Ct.useRef(),S=Ct.useRef(),w=Ct.useRef();return ra(()=>{if(d===C.current)return;let R=()=>{let x=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),S.current&&x){let M=S.current,_=Ym[M];x.classList.remove(...t?[t,..._]:_),x.style.removeProperty($m),S.current=void 0}};C.current=d;let I=m.current;if(!I)return;R();let P=typeof d=="number"?d>T?"up":"down":"neutral",D=Ym[P];return I.style.setProperty($m,`${u}`),I.classList.add(...t?[t,...D]:D),S.current=P,b.current=setTimeout(R,u),R},{same:[g,h],different:[d]}),Ct.createElement("div",{ref:c,...i,className:J(i.className)},o({children:i.children,oldValue:T}))})},qm=as();var OS={CheckBox:oo,LoadMask:Si,MenuIcon:Xn,StringFilterEditor:Qo,NumberFilterEditor:oi};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceState,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes});
24
+ Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},gr=n=>{let{debugId:e,key:t}=n,o=Ep[t];if(o&&(iC({...o,debugId:e}),e&&t)){let r=St.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),yr(e))}};globalThis.logDevToolsWarning=gr;var yr=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=St.get(n);t&&e(n,t)};var _p=!0,aC=()=>new Promise(n=>{Ae(n)}),lC={originalDataArray:!0,changes:!0},sC={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function qt(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=Op(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!lC[l]){let s=l,u=sC[s],c=r[s],d=a[s];(u?u(c,d):c===d)||(i[s]=!0)}return r.changes=i,r}function Ho(n,e,t,o,r){let i=qt(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[mo,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.children,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:_p,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Pt()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(h,g,y){let C=[mo,...h],S=g.data,b={cache:g.cache??_p,childrenLoading:!1,childrenAvailable:!0,totalCount:g.totalCount??S.length,totalCountUnfiltered:g.totalCount??S.length,children:S,error:g.error},T=[];if(i.lazyLoadBatchSize&&!y){let R=f.get(C),w=!R,P=Mc({children:!0},R||{},b);w&&(P.chidren=[]),P.children.length=P.totalCount;let x=i.lazyLoadStartIndex??0,D=Math.min(g.totalCount??S.length,x+i.lazyLoadBatchSize);for(let A=x;A<D;A++){let _=b.children[A-x];if(!_)throw`lazily loaded item not found at index ${A-x}`;P.children[A]=_,_.dataset&&T.push({keys:_.keys,dataset:_.dataset})}w&&f.set(C,P)}else b.children.forEach(R=>{R&&R.dataset&&T.push({keys:R.keys,dataset:R.dataset})}),b.children.length=b.totalCount,f.set(C,b);let I=!1;if(!h||!h.length){let R=f.get([mo]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Pt()),T.length){let R=h;T.forEach(({keys:w,dataset:P})=>{m(w,P,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Op(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(Hl(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function Fp(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function Np(n){let{getComponentState:e,componentActions:t,componentState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:h,filterTypes:g,cursorId:y}=o,[C,S]=(0,$e.useState)({vertical:!1,horizontal:!1}),b=(0,$e.useRef)(C);(0,$e.useEffect)(()=>(a.onChange(x=>{x&&(b.current=x,S(x))}),()=>a.destroy()),[a]),(0,$e.useEffect)(()=>{if(!m)return;let x=requestAnimationFrame(()=>{b.current?.vertical||h&&(t.cursorId=h)});return()=>cancelAnimationFrame(x)},[h]),(0,$e.useEffect)(()=>{if(!m||h!==void 0)return;let x=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,h]),(0,$e.useEffect)(()=>{let x=e(),{livePaginationCursor:D,livePagination:A,dataArray:_}=x;!C.vertical&&A&&(D?t.cursorId=D:D===void 0&&_.length&&(t.cursorId=_.length))},[C.vertical]);let T=(0,$e.useMemo)(()=>Op(p,{filterTypes:g,filterMode:f}),[p,f,g]),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?T:null,cursorId:m?y:null},R=(0,$e.useRef)(!0);uC(n,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null});let w=Fe(ze()),P=(0,$e.useRef)([]);Ko(()=>{let x=e(),D=w(),{isDetail:A,isDetailReady:_}=Fp(D,e);if(A&&!_)return;let E=Date.now(),F=P.current;F.length>=10&&F.splice(0,1),F.push(E),E-F[0]<200&&F.length>=10&&gr({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&Ho(x.data,x,t,void 0,D)},{data:r}),Ko(x=>{let D=Object.keys(x),A=!1;if(D.length===1){if(A=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let M=e().data;if(Array.isArray(M)&&x.refetchKey){t.originalDataArray=M;return}}let _=w(),{isDetail:E,isDetailReady:F}=Fp(_,e);if(E&&!F)return;let v=e();typeof v.data=="function"&&Ho(v.data,v,t,{append:A},_)},{...I,data:r}),Ko(()=>{let x=e();if(R.current){R.current=!1;let D=qt(x,void 0,w());t.dataParams=D}},I)}function uC(n,e){let{getComponentState:t,componentActions:o,componentState:r}=n;(0,$e.useEffect)(()=>{o.lazyLoadCacheOfLoadedBatches=new q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=(0,$e.useRef)(null),f=(h,g,y=t().lazyLoadCacheOfLoadedBatches)=>{let C=t();if(h=h||p.current,!h)return;let{renderStartIndex:S,renderEndIndex:b}=h,{lazyLoadBatchSize:T,lazyLoad:I}=C;I&&((!T||T<=0)&&(!C.groupBy||C.groupBy.length===0)||cC({startIndex:S,endIndex:b,lazyLoadBatchSize:T,componentState:C,componentActions:o,dismissLoadedRows:g?.dismissLoadedRows??!1},y))},m=(0,$e.useMemo)(()=>_t(f,{wait:d}),[d]);Ko(h=>{if(a)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&f(s.get()),s.onChange(g=>{p.current=g,f(g)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:c}),(0,$e.useEffect)(()=>{i&&i>0&&m()},[u])}function cC(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,u=l?()=>!1:h=>s[h].data!=null,c=!l,d=new q,p=["_______xxx______"];for(let h=t;h<=o;h++){let g=s[h];if(!g)continue;let y=u(h),C=g.dataSourceHasGrouping&&g.groupKeys?[...g.groupKeys]:[];g.isGroupRow&&g.dataSourceHasGrouping&&g.groupKeys&&C.pop();let S=C.length?C:p,b=g.dataSourceHasGrouping?g.indexInGroup:g.indexInAll;if(g.isGroupRow&&!g.collapsed&&!g.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:g.groupKeys,append:c},I=g.groupKeys,R=d.get(I);if(!R?.[g.id]){let w=!R;R=R||{},R[g.id]||(R[g.id]=T),w&&d.set(I,R)}}if(!y&&r!=null){let T=d.get(S),I=Math.floor(b/r)*r,R=b-I,w=s[g.indexInAll-R].indexInAll,P=u(w),x=s[w].id;if(P||T?.[x])continue;let D=!T;T=T||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:C,append:c};T[x]||(T[x]=A),D&&d.set(S,T)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(h=>{m.push(...Object.values(h))}),m.reduce((h,g)=>{let y=[...g.groupKeys,g.lazyLoadStartIndex];if(e&&e.has(y))return h;e?.set(y,!0);let C=[i.data,i,a,g];return h.then(()=>aC()).then(()=>Ho(...C))},f)}var dC=Object.freeze([]),Lp=(n,e)=>{let t=n??dC,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};var pC=Symbol("cursorId"),Vp=n=>n.totalLeafNodesCount===0,fC=n=>n.isParentNode?!Vp(n):!0;function zp(n){let e=Date.now(),t=[],o=[],r=new q;return{logger:ct(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new Gi,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 q,waitForNodePathPromises:new q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new q,dataParams:void 0,onCleanup:fe(),notifyScrollbarsChange:fe(),notifyScrollStop:fe(),notifyRenderRangeChange:fe(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:pC,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,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 mC(n){let e={...n};return delete e.originalDataArray,e}var hC=[],Gp=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear()},Kp=(n,e)=>({onDataParamsChange:t=>t?bp(t,100,mC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Vp,isNodeSelectable:t=>t??fC,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...ao,...t}),sortTypes:t=>({...hr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof st)return t;let o=n.propsCache.get("rowDisabledState")??xt,r=o.get(t);return r||(r=new st(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>Lp(t,n.propsCache.get("sortInfo")),groupBy:t=>t??hC});function gC(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var xt=new WeakMap;function yC(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var CC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function vp(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
25
+
26
+
27
+ `);let o=hn(t);if(n instanceof We)return n.setConfigFn(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??CC,i=xt.get(r);return i&&i.setConfigFn(o),i=i??new We(r,o),xt.set(r,i),i}function Hp(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Un(e.sortInfo),a=Un(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((E,F)=>{let v=l[F].operators;E[F]=E[F]||{};let M=E[F];return v.forEach(N=>{M[N.name]=N}),E},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let E=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(E!==void 0&&(E&&typeof E=="object"?c="multi-row":c="single-row"),!c){let F=u.treeSelection??u.defaultTreeSelection;F!==void 0&&(c=typeof F=="object"?"multi-row":"single-row")}c=c??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Se({selectedRows:[],deselectedRows:[],defaultSelection:!1},ot(t)):c==="single-row"||f instanceof Se?d=f:d=new Se(f,ot(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new Ne;else if(m instanceof Ne)p=m;else{let E=xt.get(m)??new Ne(m);xt.set(m,E),p=E}let h=t.primaryKey,g=typeof h=="function"?E=>h(E):E=>E[h],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof Ze)){let E=xt.get(y)??new Ze(y);xt.set(y,E),y=E}y=y||new Ze({defaultExpanded:!0,collapsedPaths:[]});let C=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(C&&!(C instanceof lt)){let E=xt.get(C)??new lt(C);xt.set(C,E),C=E}C=C||new lt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=yC(e.shouldReloadData||{}),b=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&mn('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&mn('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&mn('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let R=typeof e.data=="function"?b??"local":"local",w=e.sortFunction?"local":T??(i?"remote":"local"),P=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",D=t.rowDisabledState,A=e.isRowDisabled;if(!A&&D){let E=xt.get(D);E?A=E:(A=F=>D.isRowDisabled(F.id),xt.set(D,A))}let _={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:C,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:S?.filterValue??P==="remote",sortInfo:S?.sortInfo??w==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:p,groupMode:R,sortMode:w,filterMode:P,pivotMode:x,toPrimaryKey:g,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let E=!o||o.originalDataArray!==t.originalDataArray,F=typeof e.livePaginationCursor=="function"?E?gC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;_.livePaginationCursor=F}if(t.devToolsDetected&&t.debugId){let E=Ut.get(t.debugId);E&&(_={..._,...E})}return _}var TC=ct("DataSource:fullLazyLoad");function Bp(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&TC('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new lt({collapsedRows:!0,expandedRows:[]})))}function kp(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,{selectionMode:"single-row"}]}:{callbackParams:[n.getState(),{selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:e.__apiRef.current}]},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof Ne?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Wp(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=qt(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>lo(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(ct(eo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function jp(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}var mt=B(require("react"));function yn(n){let e=ze(),t=Fe(e),o=!!e,r=o?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=kl(n),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Fe(s),[d]=(0,mt.useState)(()=>wp({getState:c,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:c,assignState:u,api:d},f=Fe(i),m=Fe(p),h=Vn(),g=(0,mt.useCallback)(({children:y})=>(typeof y=="function"&&(y=y(c())),mt.default.createElement(a.Provider,{key:r,value:f()},mt.default.createElement(h.Provider,{value:m()},y))),[a,o,r]);return(0,mt.useLayoutEffect)(()=>{e&&e.registerDetail(p)},[]),(0,mt.useLayoutEffect)(()=>()=>{let y=c();y.onCleanup(y)},[]),Np({componentState:s,componentActions:l,getComponentState:c}),(0,mt.useEffect)(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),(0,mt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:g,state:p.componentState}}var ht=class extends gn{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var Wl=class{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Wl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}},Cr=Wl;Cr.DEFAULT_SIZE=10;var jl=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ui=class{constructor(e){this.storage=new Cr(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},$l=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},Cn=class{constructor(e){this.cacheStorage=e===!1?new jl:e===!0?new $l:typeof e=="number"?new Ui(e):new Ui(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var $p=(e=>(e.INIT="INIT",e))($p||{});var{useManagedComponent:kl}=Ot({debugName:"DataSource",initSetupState:zp,forwardProps:Kp,concludeReducer:Dp,mapPropsToState:Hp,onPropChange:Bp,cleanup:Gp,interceptActions:Wp(),mappedCallbacks:kp()});function SC(n){let{DataSource:e}=yn(n);return Up.createElement(e,null,n.children??null)}function bC(){let{rowInfoReducerResults:n}=Po();return n}function RC(){let n=ze();if(n)return n.masterRowInfo}function Ul(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(f,m){let h=l[u+f*m],g=a.get(h);if(g&&g.renderMenuIcon!==!1)return h}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(o.columnMenuVisibleForColumnId=p),p}function Yl(n){if(n==null)return!1;let e=n;return!0}function Yi(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function ql(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function Yp(n,e,t){if(ql(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:u,colIndex:c}=a,d=Math.floor(l/o),p=Math.floor(u/o),f=l%o,m=u%o,h=Math.min(f,m),g=Math.max(f,m),y=[];for(let C=d;C<=p;C++)for(let S=h;S<=g;S++){let b=C*o+S;if(C===d)for(let T=s;T<r;T++)y.push({rowIndex:b,colIndex:T});else if(C===p)for(let T=0;T<=c;T++)y.push({rowIndex:b,colIndex:T});else for(let T=0;T<r;T++)y.push({rowIndex:b,colIndex:T})}return y}function IC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var Xl=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??ho(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ne(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,h=ho(l,this.getDataSourceState),g=ho(u,this.getDataSourceState);if(!h||!g)return;let y=h.indexInAll,C=g.indexInAll,[S,b]=Yi({rowIndex:y,colIndex:f},{rowIndex:C,colIndex:m});for(let T=S.rowIndex;T<=b.rowIndex;T++)for(let I=S.colIndex;I<=b.colIndex;I++){let R={rowIndex:T,colIndex:I},[w,P]=this.getCellSelectionPosition(R);o?a.selectCell(w,P):a.deselectCell(w,P)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=Ki(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let u=IC(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ne(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new Ne(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ne:new Ne(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ne(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new Ne(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new Ne(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function qp(n){return new Xl(n)}function Xp(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new ht({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new ht({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new ht(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new ht(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function yo(n,e,t){return Math.min(Math.max(n,e),t)}function qi(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return yo(a,r,i)}function wC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),h=p,g=m-f-1,y=0,C=u-1,S={ArrowDown:()=>{p=qi(o,p,1)},ArrowUp:()=>{p=qi(o,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=y?p=p-I:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=C?p=p+I:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[p];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{p=Math.min(p+g,u-1)},PageUp:()=>{p=Math.max(p-g,y)},End:()=>{p=C},Home:()=>{p=y}},b=S[l];return b?(b(),h!==p?(r.activeRowIndex=p,!0):!1):!1}function Zl(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,u=i().dataArray,c=o(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[h,g],end:[y,C]}=p.getRenderRange(),S=y-h-1,b=C-g-1,T=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,w=0;f=yo(f,0,T),m=yo(m,0,I);let P={ArrowDown:()=>{f=yo(f+1,R,T)},ArrowUp:()=>{f=yo(f-1,R,T)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=R?f=f-D:P.ArrowUp()}else P.ArrowUp();else m=yo(m-1,w,I)},ArrowRight:()=>{if(m===I)if(f!==T&&(m=w),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=T?f=f+D:P.ArrowDown()}else P.ArrowDown();else m=yo(m+1,w,I)},Enter:()=>{let D=u[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+b,I):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-S,R)},End:()=>{s?m=I:f=T},Home:()=>{s?m=w:f=R}},x=P[l];return x?(x(),[f,m]):!1}function PC(n,e){let t=Zl(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var xC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Zp(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!xC[t]?!1:i!=null&&l==="row"?wC(n,e):a!=null&&l==="cell"?PC(n,e):!1}var Ql=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=qi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Zl(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Qp(n){return new Ql(n)}function Jp(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var Jl=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...ft({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),u;try{u=await s(a)}catch(d){u=d}let c=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:c},Promise.resolve(c)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...ft({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let u=l.computedEditable(ft({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>tt(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",h=un({column:u,rowInfo:c,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:h.formattedValueContext.value,formattedValue:h.formattedValue,rawValue:h.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new lt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),o=new lt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[mo,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Ho(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Pt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,o={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let h=i.computedVisibleColumnsMap.get(t);if(!h)return!1;a=h.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){o=o||{};let h=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=h||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(o.offset||0),m=u.scrollTop>p+(o.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=Sp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Qp({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Xp({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=qp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.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(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(Ul(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Ul(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Cd({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(ft({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,o);return}let l=i.groupByForColumn,s=i.field,u=l?Array.isArray(l)?l:[l]:[],c=u.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Yl);c.length&&(s=c);let d=i.computedSortType;u.length&&d===an&&(d=u.flatMap(m=>{let h=m.field??m.groupField,g=h?r.get(h):null;return g?g.computedSortType:an}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,o)}setSortInfoForColumn(e,t,o){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Jp(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:Jp(d,l)?(u=!0,t):d),u||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),u=s.name,c;o.computedFilterValue?(c={...o.computedFilterValue,filter:{...o.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:o.valueGetter},o.field&&(c.field=o.field)),c.id=o.id,this.setFilterValueForColumn(e,c)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],u=o.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(Yl),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}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(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let u=o.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),u=o.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function ef(n){return new Jl(n)}var Bo=require("react");var DC=10;function vC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${Fo} > .${Sl}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${No}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Nt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let h=Me().getComputedStyle(c);s[p]=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10)+parseInt(h.borderLeftWidth,10)+parseInt(h.borderRightWidth,10)+DC}if(m+=s[p],d){let h=0;c.childNodes.forEach(g=>{if(g!==u){let y=g,C=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(C)&&(C=0),h+=C,C>0){let S=Me().getComputedStyle(y);h+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=h}r&&r.has(p)||o&&!o.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function tf(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=He(),[a,l]=(0,Bo.useState)(0),s=typeof r=="object"?r.key:r,u=Fe(s),c=(0,Bo.useRef)(null);(0,Bo.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,Bo.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),c.current=s;let h=vC(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),g=Object.keys(h);if(!g.length)return;let y=n().columnSizing,C={...y},S=!1;g.forEach(b=>{C[b]={width:h[b]},S=S||C[b].width!==y[b]?.width}),S&&(e.columnSizing=C)},[s,o,a])}var lf=require("react"),Dt=require("react"),Xi=B(require("react"));function of(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return oi(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var Sr=B(require("react"));var nf=Ce({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Tr=require("react");function AC(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function EC(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=jp(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(n,l),r.detailDataSourcesStateToRestore=a}function MC(n,e){let t=(0,Tr.useRef)(!1);return{currentRowCache:(0,Tr.useMemo)(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function rf(n){let{rowDetailsCache:e,rowInfo:t}=n,{getState:o,componentActions:r}=we(),{getState:i}=Z(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=MC(t.id,e),s=(0,Tr.useMemo)(()=>{let u=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:et(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}AC(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&EC(t.id,{detailState:d.getState(),masterActions:r,masterState:o(),cacheEntryForRow:p})})}),shouldRestoreState:u}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:_C}=ve,FC=`${_C}RowDetail`;function OC(n){let e=Vr(),{domRef:t,rowDetailRenderer:o,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=n,{masterDetailContextValue:s,currentRowCache:u}=rf({rowDetailsCache:l,rowInfo:i});return Sr.createElement(e.Provider,{value:s},Sr.createElement("div",{ref:t,className:ee(FC,nf({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${Y.bodyWidth} - ${Y.scrollbarWidthVertical})`,height:r}},o(i,u)))}var af=Sr.memo(OC);var NC=1;function sf(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,state:i,getState:a}=Z(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedColumnsMap:c,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:h,columnSize:g}=e,{componentState:y,getState:C,componentActions:S,api:b}=we(),{dataArray:T,isNodeReadOnly:I}=y,R=Fe(T),{rowHeight:w,rowDetailHeight:P,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:A,brain:_,showZebraRows:E,rowDetailRenderer:F,isRowDetailExpanded:v,isRowDetailEnabled:M,cellClassName:N,cellStyle:G,rowStyle:U,rowDetailCache:oe,rowClassName:ge,onScrollToTop:ce,onScrollToBottom:z,onScrollStop:W,scrollToBottomOffset:le,wrapRowsHorizontally:ne,ready:j}=i,V=y.updatedAt;of({columnSize:g,brain:_,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:u,computedRowHeight:d,dataArray:T,bodySize:t,rowspan:m});let L=(0,Dt.useRef)(0);(0,Dt.useEffect)(()=>_.onRenderCountChange(()=>{L.current=_.scrollTopMax}),[_]),(0,Dt.useEffect)(()=>_.onRenderRangeChange(J=>{a().onRenderRangeChange?.(J)}),[_]),(0,Dt.useEffect)(()=>_.onScrollStop(J=>{let{scrollTop:O,scrollLeft:Re}=J;if(O===0&&ce?.(),O+(le??NC)>=L.current){z?.();let{livePagination:te,livePaginationCursor:de,dataArray:De}=C();te&&(S.cursorId=de!==void 0?Date.now():De.length)}if(W){let te=_.getRenderRange();W({scrollTop:O,scrollLeft:Re,renderRange:te,viewportSize:a().bodySize,firstVisibleRowIndex:te.start[0],lastVisibleRowIndex:te.end[0],firstVisibleColIndex:te.start[1],lastVisibleColIndex:te.end[1]})}}),[_,ce,z,W]),(0,Dt.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,Dt.useEffect)(()=>{let{onReady:J}=a();J&&J({api:o,dataSourceApi:b})},[j]);let[,Q]=Ft();(0,Dt.useEffect)(()=>{Q()},[y]);let $=(0,Dt.useCallback)(J=>{let{rowIndex:O,colIndex:Re,heightWithRowspan:be,domRef:k,hidden:te,width:de,onMouseLeave:De,onMouseEnter:Pe}=J,Ee=R()[O],je=u[Re];if(!Ee)return null;let Je=p?p.getRowHeight(O):be,Ue=!1;!M||typeof M=="function"&&!M(Ee)?Ue=!1:v&&(Ue=v(Ee)?"expanded":"collapsed");let ut=ne?_.getRowIndexInPage(O):null,nt=ne?_.getPageIndexForRow(O):null;return Xi.createElement(Id,{...{getData:R,virtualized:!0,showZebraRows:E,groupRenderStrategy:A,rowIndexInHorizontalLayoutPage:ut,horizontalLayoutPageIndex:nt,rowIndex:O,rowInfo:Ee,hidden:te,toggleGroupRow:h,rowHeight:Je,rowDetailState:Ue,onMouseEnter:Pe,onMouseLeave:De,onRowMouseEnter:x,onRowMouseLeave:D,domRef:k,width:de,column:je,columnsMap:c,fieldsToColumn:f,rowStyle:U,rowClassName:ge,cellStyle:G,cellClassName:N}})},[w,P,x,D,p,d,v,R,u,c,f,A,ne,h,E,_,V,I,U,ge,N,G]),ue=(0,lf.useMemo)(()=>{if(v)return J=>{let{rowIndex:O,domRef:Re}=J,k=R()[O];if(!k||!v(k)||!p)return Xi.createElement("div",{ref:Re,className:$u.hidden});let{rowDetailHeight:te,rowHeight:de}=p.getSize(O);return Xi.createElement(af,{rowInfo:k,rowDetailsCache:oe,rowIndex:O,domRef:Re,detailOffset:de,rowDetailHeight:te,rowDetailRenderer:F})}},[j,$,F,P,v,oe]);return{renderCell:$,renderDetailRow:ue}}var Sn=require("react");var Zi=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,o,r){if(r.horizontalLayout&&!ql(e,t,r)){Yp(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Yi(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function uf(n,e){return n<e?[n,e]:[e,n]}var Qi=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[o,r]=uf(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=uf(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var cf=require("react");function df(n){let{getState:e}=we();return(0,cf.useMemo)(()=>n.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,u=n[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var pf=require("react");var LN=ct("useColumnSizeFn");function ff(n){return(0,pf.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var vt=require("react");var Co=require("react");var LC={scrollLeft:0,scrollTop:0},br=class{constructor(){this.scrollPosition=LC;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let o=0,r=t.length;o<r;o++)t[o](e)}};function mf(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var hf=B(require("react"));function gf(n){return(e,t)=>hf.createElement(n,{key:e.id,rowInfo:e,cache:t})}var Rr=class extends xo{constructor(t,o){super(`${t}: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=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=Br(u,c.concat(c)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof o=="number",m=typeof r=="number",h=f&&o!==this.initialRows,g=m&&r!==this.initialCols;f&&h&&(this.initialRows=o,this.rows=o),m&&g&&(this.initialCols=r,this.cols=r);let y=i!=null,C=a!=null,S=y&&i!==this.rowHeight,b=C&&a!==this.initialColWidth;y&&(this.rowHeight=i),C&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=h||S||p,I=g||b||d||T;(I||T)&&this.updateRenderCount({horizontal:I,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(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Bt){let o=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/o);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*o,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(o=>{Ae(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var yf={};function es(n){return`.${_o}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function ts(n,e){let t=eo(n),o=e?new Rr(t,{isHeader:!1}):new xo(t),r=e?new Rr(t,{isHeader:!0,masterBrain:o}):new xo(t);o.onScroll(l=>{r.setScrollPosition({scrollLeft:l.scrollLeft,scrollTop:0})});let{renderer:i,onRenderUpdater:a}=Yr(o);return o.onAvailableSizeChange(l=>{r.update({width:l.width})}),{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}}function Cf({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a}=ts(n,!!e),l=(0,Co.createRef)();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,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:s=>{if(!l.current)return null;let u=es(s);return l.current.querySelector(u)||null},brain:o,headerBrain:r,domRef:l,columnMenuTargetRef:(0,Co.createRef)(),editingValueRef:(0,Co.createRef)(),scrollerDOMRef:(0,Co.createRef)(),portalDOMRef:(0,Co.createRef)(),focusDetectDOMRef:(0,Co.createRef)(),activeCellIndicatorDOMRef:(0,Co.createRef)(),onColumnMenuClick:fe(),cellContextMenu:fe(),contextMenu:fe(),onFilterOperatorMenuClick:fe(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:fe(),onRowHeightCSSVarChange:fe(),onRowDetailHeightCSSVarChange:fe(),onColumnHeaderHeightCSSVarChange:fe(),cellClick:fe(),cellMouseDown:fe(),keyDown:fe(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new br,pinnedEndScrollListener:new br,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Tf=n=>({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,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Cn(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??yf,columnGroupVisibility:e=>e??yf,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function VC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Sf=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.onRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function bf(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Ji=new WeakMap;function Rf(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var If=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?mf(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=VC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let g=Ji.get(d);g||(g=gf(d),Ji.set(d,g)),c=g}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof ht)&&(u=new ht(u)),u=u||new ht({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Ji.get(u),f||(f=g=>u.isRowDetailsExpanded(g.id),typeof u=="object"&&Ji.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,h={isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||se.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let g=$t.get(t.debugId);g&&(h={...h,...g})}return h};function wf(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function Pf(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===s-1))break}return Object.keys(o).forEach(d=>{let p=o[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var xf=require("react");function os(){let{getState:n,componentActions:e,getDataSourceMasterContext:t}=we();return(0,xf.useCallback)(r=>{let i=n(),a=new lt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[mo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Ho(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Pt())}},[])}function zC(n){return(0,vt.useMemo)(()=>bf(n),[n])}function Df(){let{componentState:{groupBy:n},componentActions:e}=we(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:o,pivotGrandTotalColumnPosition:r}}=He();(0,vt.useEffect)(()=>{e.generateGroupRows=t!=="inline"},[t]),(0,vt.useEffect)(()=>{e.pivotTotalColumnPosition=o},[o]),(0,vt.useEffect)(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=zC(n);GC(i);let{toggleGroupRow:a}=KC();return HC(i),{toggleGroupRow:a}}function GC(n){let e=os(),{componentActions:t,componentState:{columns:o,groupRenderStrategy:r,isTree:i}}=He();function a(l,s,u,c){let d={};if(u==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},h=s.get(f.field);if(h&&u==="inline"){let{groupIndex:y}=h;m={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:C})=>C.isGroupRow?C.groupKeys?.[y]:C.value,rowspan:({rowInfo:C,dataArray:S})=>{if(C.isTreeNode||!C.isGroupRow)return 1;let b=S[C.indexInAll-1]||{indexInParentGroups:[]};if(!b||!b.dataSourceHasGrouping)return 1;let T=b.indexInParentGroups||[],I=C.indexInParentGroups||[],R=!1;for(let x=0;x<=y;x++){let D=T[x];if(I[x]!==D){R=!0;break}}if(!R)return 1;let w=C.parents[y];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:Ri({groupIndexForColumn:y,groupRenderStrategy:u,toggleGroupRow:c,initialRenderGroupIcon:f.renderGroupIcon}),render:bi({groupIndexForColumn:y,groupRenderStrategy:u})}}let g={...m,...f};d[p]=g}),Object.keys(d).length===0?void 0:d}(0,vt.useEffect)(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(o,n,r,e)})()},[o,n,r,e])}function KC(){let{componentState:{groupBy:n,pivotBy:e,selectionMode:t}}=we(),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=He(),f=os();return(0,vt.useEffect)(()=>{(()=>{let{columns:h,groupColumnIds:g}=BC({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});o.columnsWhenGrouping=h;let y=p().columnOrder;if(g.length&&Array.isArray(y)){let C=new Set(y),S=!1;g.forEach(b=>{C.has(b)||(S=!0,y=[b,...y])}),S&&(o.columnOrder=y)}})()},[r,n,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function HC(n){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:o,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=we(),{getComponentState:l,componentActions:s,componentState:{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=He();(0,vt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let m=l(),h=wf(c,n),g=Pf({computedGroupColumns:h,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:o,groupByMap:n});lo(m.columnVisibility,g)||(s.columnVisibility=g)},[a,f,i,o,n,c,p?e:null,p?r:null,p?t:null,p]),(0,vt.useEffect)(()=>{let m=o.length>0,h=l(),{columnVisibility:g,columnVisibilityForGrouping:y,hideColumnWhenGrouped:C}=h,S={...g},b={...y},T=!1,I=new Set,R=new Set;Object.keys(c).forEach(w=>{let P=c[w];if(P.defaultHiddenWhenGroupedBy||C!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&m||(P.defaultHiddenWhenGroupedBy===!0||C)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((D,A)=>D||n.has(A),!1)){if(b[w]!==!1){if(g[w]===!1)return;b[w]=!1,T=!0,I.add(w)}}else b[w]===!1&&(delete b[w],T=!0,R.add(w))}),T&&(s.columnVisibilityForGrouping=b,R.forEach(w=>{delete S[w]}),I.forEach(w=>{S[w]=!1}),s.columnVisibility=S)},[c,u,o,n,d])}function BC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=n;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,h,g)=>{let y=fd({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:h,groupCount:g.length,groupRenderStrategy:u,selectionMode:r},c,i),C=y.id||`group-by-${m.field||m.groupField}`;f.push(C),p[C]=y});else if(u==="single-column"&&t.length){let m=md({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:u,selectionMode:r},c,i),h=m.id||"group-by";f.push(h),p[h]=m}if(e){let m={};Object.keys(d).forEach(h=>{let g=d[h];g.field&&(m[g.field]=g)}),Object.keys(e).forEach(h=>{let g=e[h],y=g.pivotTotalColumn&&g.columnGroup,C=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||C&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=b=>S.renderValue(b)),p[h]=S})}else Object.keys(d).forEach(m=>{let h=d[m];p[m]=h});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var vf=require("react");var Af=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:u,columnDefaultDraggable:c,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:h,columnPinning:g,editable:y,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,scrollbarWidth:T,columnTypes:I,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,viewportReservedWidth:P,resizableColumns:x,columnVisibility:D,columnVisibilityAssumeVisible:A,columnSizing:_})=>{let{computedRemainingSpace:F,computedColumnOrder:v,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedPinnedStartColumns:G,computedPinnedEndColumns:U,computedUnpinnedColumns:oe,computedPinnedStartColumnsWidth:ge,computedPinnedEndColumnsWidth:ce,computedUnpinnedColumnsWidth:z,computedUnpinnedOffset:W,computedPinnedEndOffset:le,computedPinnedEndWidth:ne,computedPinnedStartWidth:j,renderSelectionCheckBox:V,computedColumnsMap:L,computedColumnsMapInInitialOrder:Q,fieldsToColumn:$}=(0,vf.useMemo)(()=>_c({columns:n,scrollbarWidth:T,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:P,resizableColumns:x,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:R,pinnedStartMaxWidth:w,draggableColumns:u,columnDefaultDraggable:c,columnOrder:h,columnPinning:g,columnDefaultEditable:C,columnDefaultFilterable:S,columnDefaultSortable:b,editable:y,columnSizing:_,columnTypes:I,columnVisibility:D,columnVisibilityAssumeVisible:A??!0}),[n,e.width,t,o,r,P,T,a,d,p,f,m,h,D,A,c,u,x,R,w,_,I,g,C,S,y,1]);return{renderSelectionCheckBox:V,columns:n,computedColumnsMap:L,computedPinnedEndWidth:ne,computedPinnedStartWidth:j,computedRemainingSpace:F,computedUnpinnedOffset:W,computedPinnedEndOffset:le,computedPinnedStartColumnsWidth:ge,computedPinnedEndColumnsWidth:ce,computedUnpinnedColumnsWidth:z,computedPinnedStartColumns:G,computedPinnedEndColumns:U,computedUnpinnedColumns:oe,computedVisibleColumns:M,computedVisibleColumnsMap:N,computedColumnOrder:v,computedColumnsMapInInitialOrder:Q,fieldsToColumn:$}};var Ef=require("react"),ns=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function kC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?o(d):0;return e&&e.rowHeight.set(c,p),p}:o;let l=typeof o=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function Mf(n){return(0,Ef.useMemo)(()=>{let e=new ns;return{computedRowHeight:kC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var Tn=require("react");var WC={vertical:!1,horizontal:!1};function _f(n){let{getComponentState:e}=He(),{getState:t}=we(),[o,r]=(0,Tn.useState)(WC);return(0,Tn.useEffect)(()=>n.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=n;r({vertical:i>0,horizontal:a>0})}),[n]),(0,Tn.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function Ff(){let{componentActions:n,componentState:e}=He(),{componentActions:t,componentState:o,getState:r,api:i}=we(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:u,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,columnTypes:f,rowHeight:m,rowDetailHeight:h,isRowDetailExpanded:g,isRowDetailEnabled:y,brain:C,bodySize:S,showSeparatePivotColumnForSingleAggregation:b}=e;(0,Sn.useState)(()=>{e.onRowHeightCSSVarChange.onChange(k=>{k&&(n.rowHeight=k)}),e.onFlashingDurationCSSVarChange.onChange(k=>{let te=k?k*1:null;te!=null&&!isNaN(te)&&(n.flashingDurationCSSVarValue=te)}),e.onRowDetailHeightCSSVarChange.onChange(k=>{k&&(n.rowDetailHeight=k)}),e.onColumnHeaderHeightCSSVarChange.onChange(k=>{k&&(n.columnHeaderHeight=k)})}),(0,Sn.useEffect)(()=>{t.showSeparatePivotColumnForSingleAggregation=b},[b]);let{multiSort:T,filterValue:I,filterTypes:R}=o,{toggleGroupRow:w}=Df(),P=e.computedColumns,{computedColumnOrder:x,computedVisibleColumns:D,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:U,computedRemainingSpace:oe,computedPinnedStartWidth:ge,computedPinnedEndWidth:ce,renderSelectionCheckBox:z,computedColumnsMap:W,computedColumnsMapInInitialOrder:le,fieldsToColumn:ne}=Af({columns:P,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:S,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:o.sortInfo??void 0,multiSort:T,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:c,columnDefaultEditable:d,columnDefaultFilterable:p,filterValue:I,filterTypes:R,columnSizing:u,columnTypes:f}),j=df(D),V=ff(D),L=_f(C),Q=ge?v>ge:!1,$=ce?M>ce:!1,[ue]=(0,Sn.useState)(()=>new Qi({isRowDisabledAt:te=>r().dataArray[te]?.rowDisabled??!1,getIdForIndex:te=>r().dataArray[te]?.id??-1})),J=Fe(D),[O]=(0,Sn.useState)(()=>new Zi({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:k=>J()[k]?.id||""})),{computedRowHeight:Re,computedRowSizeCacheForDetails:be}=Mf({rowDetailHeight:h,rowHeight:m,isRowDetailsExpanded:g,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:ue,multiCellSelector:O,computedRowSizeCacheForDetails:be,computedRowHeight:Re,scrollbars:L,columnSize:V,rowspan:j,toggleGroupRow:w,computedColumnsMap:W,computedColumnsMapInInitialOrder:le,renderSelectionCheckBox:z,computedPinnedStartOverflow:Q,computedPinnedEndOverflow:$,computedPinnedStartWidth:ge,computedPinnedEndWidth:ce,computedVisibleColumns:D,computedColumnOrder:x,computedRemainingSpace:oe,computedVisibleColumnsMap:A,computedPinnedStartColumns:_,computedPinnedEndColumns:E,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:v,computedPinnedEndColumnsWidth:M,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:G,computedPinnedEndOffset:U,fieldsToColumn:ne}}var Lf=require("react");function jC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function $C(){return 4294967295}function UC(n,e,t){return e=e>>>8^n[t^e&255],e}function YC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function rs(n,e=3988292384){var t=jC(e),o=0,r;for(o=$C(),r=0;r<n.length;r++)o=UC(t,o,n.charCodeAt(r));return o=YC(o),`${o}`}var qC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Of=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+4*2,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},Nf=(n="",e,t)=>{let o;try{o=XC(n)}catch{return Of(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(o.end);return i<r?(Of([`
28
+ Your Infinite Table license has expired on ${i.toDateString()}.
29
+ `,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},XC=n=>{let e="",t=n.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let u=t[s];if(rs(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(rs(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),qC(t)};var ZC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,QC=/(https):\/\/\S+(\.csb\.app)/g,Vf=typeof window<"u"?window.location.origin:"",JC=()=>{let[n,e,t]=Array.from(ZC.exec(Vf)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},eT=()=>{let[n,e,t]=Array.from(QC.exec(Vf)||[]);return e==="https"&&t===".csb.app"},tT=eT()||JC(),zf=(n="")=>{let t=!!ze();return(0,Lf.useMemo)(()=>{if(t)return!0;let r=Nf(n,{publishedAt:1624970570587,version:"6.2.12"});return!n&&!r&&tT?!0:r},[n,t])};var bn=require("react");var oT=10;function Gf(n,e,t){let o=(0,bn.useRef)(!1),r=(0,bn.useRef)(null);(0,bn.useEffect)(()=>{n!=null&&(o.current=!1,Rt(r.current))},[n]),(0,bn.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Rt(r.current),r.current=Ae(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<oT&&a(l)})};var i=a;a()}return()=>{Rt(r.current)}},[n,e])}var Rn=require("react"),nT=10;function Kf(n,e,t){let o=(0,Rn.useRef)(!1),r=(0,Rn.useRef)(null);(0,Rn.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,Rn.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<nT&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}var Hf=n=>`--infinite-${n}`;var In=require("react");function Bf(n,e){is(n,e),iT(n,e),e.detail===2&&rT(n,e),n.getState().onCellClick?.(n,e)}function rT(n,e){let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function iT(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=o(),{rowsPerPage:h}=f,g=p.length,y=new Ne(c);y.debugId=m??"",d.cellSelectionState=y;let C={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(C);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(C,S?{horizontalLayout:S,rowsPerPage:h,columnsPerSet:g}:{horizontalLayout:S})}else d.resetClick(C);l.cellSelection=y}function is(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=o(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:g}=c;if(g=l(g),s.rowSelectionState=g,g&&typeof g=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=g,!0}else if(d==="single-row"){let y=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function kf(n,e){e.detail!==2&&void 0}var aT={Enter:!0," ":!0,a:!0};function Wf(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:u,ctrlKey:c,metaKey:d}=e;if(!aT[u])return!1;let p=t(),f=o(),{activeRowIndex:m,activeCellIndex:h,keyboardNavigation:g,keyboardSelection:y}=p,{selectionMode:C,groupBy:S,rowSelection:b,treeSelectionState:T,isTree:I}=f;if(y===!1)return!1;let R=g==="row"&&m!=null?m:g==="cell"&&h!=null?h[0]:null,w=R!=null?f.dataArray[R]:null;if(!w||R==null)return!1;if(C==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(w.id),!0;if(C!=="multi-row")return!1;if(u==="a"&&(c||d)){if(I&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let P=l(b);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(S.length)return w.isGroupRow&&w.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(w.groupKeys):i.rowSelectionApi.toggleRowSelection(w.id),!0;if(I){if(w.isTreeNode&&w.nodePath)return a.treeApi.toggleNodeSelection(w.nodePath),!0}else{let P={...e},{renderSelectionCheckBox:x}=n.getComputed();return x&&(P.metaKey=!1,P.ctrlKey=!0),is({...n,rowIndex:R},P)}}return!1}var jf=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),$f=n=>Array.from(n.querySelectorAll(jf)).filter(t=>!!t.offsetParent),ea=n=>n.querySelector(jf);var Yf=B(Xo());async function Uf(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var lT=10,sT=(n,e)=>n-e;function ta(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=o(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[n.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===n.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=u[n.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",h=tt(p.id,e);return p.contentFocusable({column:p,...un({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:h,api:i,dataSourceApi:a})}function as(n,e,t){let o=t.getState().editingCell;return uT(n,e,t,{isCellFocusable:ta,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function qf(n,e,t){let o=(0,Yf.default)(t,n+e,sT);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=qf;function uT(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),u=n.rowIndex,c=n.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:qf(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function Xf(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=ta(e,n)?e:as(e,-1,n);if(t){await ls([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;ea(o)?.focus()}}async function ls([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=lT,l=null,s=!1;function u(c=0){c++,Rt(l),l=Ae(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&c<a&&u(c),s){try{await Uf(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var cT=`.${_o}`;function Zf(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Yo(o,cT),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:c}=n.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&ta({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:as({rowIndex:l,colIndex:s},t,n);if(!u){if(t===-1)r.focus();else{let c=$f(document.body),d=n.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return ls([u.rowIndex,u.colIndex],n).then(()=>{let c=n.getState().getDOMNodeForCell(u);if(!c)return;ea(c)?.focus()}),!0}var Qf={control:"ctrl"},Jf={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},dT={esc:"escape"},tm={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},om=Object.keys(tm),ss=new Set(om),pT=new Set(["shift","alt"]);function oa(n,e){return Array.isArray(e)?e.some(t=>em(n,t)):em(n,e)}function em(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(p=>p.toLowerCase().trim()),r=o.find(p=>Jf[p]),i=o.map(p=>Qf[p]||Jf[p]||dT[p]||p),a=i.filter(p=>ss.has(p)),l=i.filter(p=>!ss.has(p)),s=om.reduce((p,f)=>(p[f]=tm[f](n),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!pT.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||ss.has(t)||t==="meta"||Qf[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function nm(n,e){let t={...n,cloneRowSelection:a=>zi(a,n.getDataSourceState),cloneTreeSelection:a=>Bi(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Wf(t,e)&&e.preventDefault(),(Zf(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Zp(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,u=n.getComputed().computedVisibleColumns[s];u.computedEditable&&n.api.startEdit({rowIndex:l,columnId:u.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!oa(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function fT(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=Z(),{getState:i,componentActions:a,api:l}=we();return(0,In.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Bi(c,i),cloneRowSelection:c=>zi(c,i)}),[n,e,i,a,t,l,o])}function mT(){let n=fT();(0,In.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{nm(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],u=tt(s.id,n);Bf({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=n.getComputed().computedVisibleColumns[u],d=tt(c.id,n);kf({...n,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function hT(){let{getState:n}=Z();return{onKeyDown:(0,In.useCallback)(t=>{n().keyDown(t)},[])}}function rm(){return mT(),hT()}var fs=require("react");var _e=B(require("react")),gt=require("react"),pm=require("react-dom");var Le=class{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new Le(e)}static from(e){return new Le(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,o=e.left-this.left;return{top:t,left:o}}};function im(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function am(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function gT(n,e,t){let o=im(n,t),r=im(e,t);return o===r?am(t,e)-am(t,n):o-r}function yT(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>gT(o,r,t)),e}function lm(n,e){n=yT(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(CT([t,i,a],e))return!0}return!1}function CT(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var wn=class{containsPoint(e){return lm(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var To=class extends wn{constructor(t){super();this.points=t.map(Le.clone)}static clone(t){return new To(t)}getPoints(){return this.points}shift(t){return this.points.forEach(o=>{o.shift(t)}),this}};var xe=class extends wn{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new xe(t)}static clone(t){return new xe(t)}static from(t){return xe.clone(t)}static fromPoint(t){return xe.from({top:t.top,left:t.left,width:0,height:0})}containsPoint(t){return new To(this.getPoints()).containsPoint(t)}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}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Le.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};function us(n){return!!n.tagName}function cm(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=xe.from(us(e)?e.getBoundingClientRect():e),a=xe.from(us(t)?t.getBoundingClientRect():t),l=o?xe.from(us(o)?o.getBoundingClientRect():o):null;if(!l)return{...sm({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=sm({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function sm(n){let e=xe.from(n.targetRect),t=xe.from(n.anchorRect),o=n.constrainRect?xe.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=um(e,i),s=um(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function um(n,e){return e==="TopLeft"?Le.from({top:n.top,left:n.left}):e==="TopCenter"?Le.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?Le.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?Le.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?Le.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?Le.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?Le.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?Le.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):Le.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var na="__is_infinite_menu_component";function TT(n){return n&&typeof n.then=="function"||n instanceof Promise}function fm(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function dm(n){return typeof n=="function"&&(n=n()),TT(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&fm(n)&&(n=n.getBoundingClientRect()),n?xe.from(n):null}async function ST(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),fm(o)&&(r=o),r||null}return t(await e)}function bT(n){return _e.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function RT(n){let e=_e.useRef(null);return(0,gt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&cs(e.current,t)}),[n.realign]),_e.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,gt.useCallback)(t=>{t&&cs(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function cs(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await dm(t)||void 0,a=o?await dm(o):void 0,l=xe.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=cm({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=n.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=n.offsetParent;if(c){let d=c.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,h=s.top-f;n.style.transform=`translate3d(${m}px,${h}px, 0px)`}}}function mm(n,e){let[t,o]=(0,gt.useState)(null);return(0,gt.useLayoutEffect)(()=>{async function r(){let i=e?await ST(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?(0,pm.createPortal)(n,t):_e.createElement(_e.Fragment,null):e===null||e===!1?n:_e.createElement(bT,null,n)}function IT(n){if(_e.Children.count(n)===1){let e=_e.Children.only(n);if(_e.isValidElement(e))return e.props.id||e.key}return null}function wT(n,e,t){if(_e.Children.count(n)===1){let o=_e.Children.only(n);if(_e.isValidElement(o)&&o.type[na]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),_e.cloneElement(o,r)}}return n}globalThis.allhandles={};globalThis.thehandles={};function Kt(n){let e=n,[t]=(0,gt.useState)(()=>new Map),[o,r]=(0,gt.useState)(null),[i,a]=(0,gt.useState)(0),l=(0,gt.useCallback)(()=>{let m=[];for(let[h,g]of t)m.push(_e.createElement(RT,{...g,key:g.key}));return m},[]),[s,u]=Ft(),c=mm(l(),n.portalContainer),d=(0,gt.useCallback)((m,h)=>{let y=`${h.id||IT(m)||Pt()}`,C=t.get(y),S=I=>()=>{let R=typeof I=="function"?I():I;return wT(R,e.portalContainer,h.constrainTo??e.constrainTo)},b=S(m),T=(I,R)=>{if(!C)return;let w=S(I);Object.assign(C,{children:w}),u(),!!!R?.skipRealign&&(r(C.key),a(Date.now()))};return C?(Object.assign(C,h),T(m),T):(C={key:y,children:b,alignPosition:h.alignPosition,alignTo:h.alignTo,constrainTo:h.constrainTo,realign:fe()},t.set(C.key,C),u(),T)},[t,e.portalContainer,u]);_e.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),u())},f=()=>{t.clear(),u()};return _e.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var Am=B(require("react"));var Dn=B(require("react"));var Pn=B(require("react"));var Ir=B(require("react"));function ra(n){return null}ra.defaultProps={__is_menu_item:!0};var hm="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw16 _16lm1iw1n _16lm1iw8",gm=Ce({defaultClassName:"db3arf2 _16lm1iwz _16lm1iw1r _16lm1iw17",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwj _16lm1iw17",false:"_16lm1iwi"},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"]]}),ym="db3arf1",Cm="db3arfd";var PT="-";function xT(){return Ir.createElement("hr",{className:Cm})}var ia=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===PT?Ir.createElement(xT,null):r:null;return i!=null?{type:"item",parentMenuId:o,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Tm(n,e){return Ir.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===ra)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),ia(n,o)}return ia(n,t)})||[]}var Sm="submenu";function bm(){let n=Pn.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Pt(),focused:!1,destroyed:!1,domRef:n}}var Rm=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),DT=[{name:"label"}],Im=n=>{let{props:e,state:t}=n,{activeItemKey:o,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,u=e.id||t.generatedId;s&&(u=`${s}-${u}`);let c=[...e.columns||DT],d={columns:c,keyboardActiveItemKey:r,activeItemKey:o,menuId:u},p=[];i?p=i.map(ia.bind(null,d)):!i&&typeof a!="function"&&(p=Tm(d,a)),l&&p.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!c.find(h=>h.name==Sm)&&c.push({name:Sm,render:({domProps:h,item:g})=>g.menu?Pn.createElement("div",{...h},Pn.createElement(Eo,{expanded:!1})):Pn.createElement("div",{...h})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:c,menuId:u}};var At=B(require("react")),Qe=require("react");var wr=class extends To{constructor(e){super(e.slice(0,3))}};var vT=250;function AT(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ae(i)};Ae(()=>{i()})})}var ET=Me(),aa=class{constructor(e){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||vT;this.getPointerMoveTarget=()=>document.documentElement||ET;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Le({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new wr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new wr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,AT(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Le({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var la=require("react"),ds=(0,la.createContext)(null);function ps(){return(0,la.useContext)(ds)}var xn=require("react");function wm(){let n=(0,xn.useRef)(!0);return(0,xn.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,xn.useCallback)(()=>n.current,[])}function MT(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=n.menu;return c?(typeof c=="function"&&(c=c()),At.createElement(Et,{key:u,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),o(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function _T(n,e){let t=Pm(n,e);if(!t.length)return null;let o=xe.from(t[0]?.getBoundingClientRect()),r=xe.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function Pm(n,e){let t=Yo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function FT(n,e){let t=Pm(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function OT({onItemActivate:n}){let{getState:e}=ps(),[{onItemEnter:t,onItemLeave:o}]=(0,Qe.useState)(()=>new aa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?xe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,Qe.useCallback)(t,[]),onItemLeave:(0,Qe.useCallback)(o,[])}}function xm(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:h},componentActions:g,getState:y}=ps(),C=(0,Qe.useCallback)(z=>{g.keyboardActiveItemKey=z},[]),S=(0,Qe.useCallback)(z=>{g.activeItemKey=z},[]),b=wm(),[T,I]=(0,Qe.useState)(null),R=null;(0,Qe.useLayoutEffect)(()=>{let{runtimeItems:z}=y(),W=z.filter(le=>le.type==="item"&&i===le.key)[0];if(!W||!W.menu){I(null),D();return}if(W){let le=_T(r,W.key);le&&P(()=>MT(W,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:C,parentMenuId:r,onHideIntent:U,api:oe}),{id:`${r}-submenu`,alignTo:le,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(z,W)=>{C(W.key),S(W.key),W.originalMenuItem.onClick&&W.originalMenuItem.onClick(z);let le={key:W.key,item:W.originalMenuItem,hideMenu:U};W.originalMenuItem.onAction&&W.originalMenuItem.onAction(le),u&&u(le),W.originalMenuItem.hideMenuOnAction&&U()},{showOverlay:P,portal:x,clearAll:D}=Kt({portalContainer:!1}),{onItemEnter:A,onItemLeave:_}=OT({onItemActivate:z=>{if(!b())return;let W=z?z.key:null;S(W)}});R=o.map((z,W)=>At.createElement(NT,{key:z.type==="item"?z.key:W,onItemEnter:(le,ne)=>{A(le.key,ne)},onItemLeave:(le,ne)=>{_(le.key,ne)},columns:t,active:z.type==="item"&&z.key===i,keyboardActive:z.type==="item"&&z.key===a,item:z,index:W,onClick:w}));let E=t.map(z=>z.width||(typeof z.flex=="number"?`${z.flex}fr`:z.flex)||"auto").join(" "),F={...e.style,gridTemplateColumns:E,gridTemplateRows:o.map(()=>"auto").join(" ")};c||(F.whiteSpace="nowrap");function v(z){let{runtimeItems:W,runtimeSelectableItems:le}=y(),ne=W.findIndex($=>$.type==="item"&&$.key===a),j=a,V=W[ne],L={ArrowUp:()=>{let $=W.slice(0,ne).filter(ue=>ue.type==="item"&&!ue.disabled).pop();$&&$.type==="item"&&$.key&&(j=$.key)},ArrowDown:()=>{let $=W.slice(ne+1).filter(ue=>ue.type==="item"&&!ue.disabled)[0];$&&$.type==="item"&&$.key&&(j=$.key)},Home:()=>{L.PageUp()},End:()=>{L.PageDown()},PageUp:()=>{j=le[0].key},PageDown:()=>{j=le[le.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(g.destroyed=!0)},ArrowRight:()=>{V&&(S(V.key),Ae(()=>{b()&&T&&T.getParentMenuId()===y().menuId&&T.focus()}))},Enter:()=>{if(V)if(V.originalMenuItem?.menu){if(V&&V.originalMenuItem.menu&&T){L.ArrowLeft();return}V&&S(V.key)}else w(z,V)}," ":()=>{if(!V)return;V.originalMenuItem.menu||w(z,V);let $=FT(r,V.key);$&&$.click()},Escape:()=>{L.ArrowLeft();let $=y();$.parentMenuId||$.onHideIntent?.($)}},Q=L[z.key];Q&&(Q(),z.preventDefault()),j!=a&&C(j)}function M(){g.focused=!1}let N=(0,Qe.useCallback)(function(){g.focused=!0,setTimeout(()=>{G.current&&h.current&&h.current===document.activeElement&&y().keyboardActiveItemKey==null&&C(y().runtimeSelectableItems[0]?.key??null)})},[]),G=(0,Qe.useRef)(!0),U=(0,Qe.useCallback)(()=>{let z=y();z.onHideIntent?.(z)},[y]),[oe]=(0,Qe.useState)(()=>({hideMenu:U,focus:()=>{h.current&&(h.current.focus(),setTimeout(()=>{h.current&&h.current!==document.activeElement&&h.current.focus()},10),N())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),ge=(0,Qe.useCallback)(z=>{z?(h.current=z,d?.(y(),oe),f&&oe.focus()):(p?.(y()),h.current=z)},[]),ce=At.createElement("div",{className:tn.contents},At.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:ge,onKeyDown:z=>{e.onKeyDown?.(z),v(z)},onMouseDown:z=>{G.current=!1,e.onMouseDown?.(z)},onMouseUp:z=>{G.current=!0,e.onMouseUp?.(z)},onFocus:N,onBlur:M,className:ee(hm,e.className,"InfiniteMenu"),style:F},R),x);return s?null:ce}function NT(n){let[e,t]=At.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=At.createElement("div",{style:r.style},r.value);else{let c=0;u=o.map((d,p)=>{let f=r.value,m=d.field||d.name,h=p+1,g=h+r.span;if(h<c)return null;c=g;let C={style:{...d.style,...r.style,gridColumnStart:h,gridColumnEnd:g},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:ee(gm({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?At.createElement(ar,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:C}}):At.createElement("div",{key:`${s}-${m}`,...C},f[m])}).filter(Boolean)}return At.createElement("div",{className:ym},u)}var{ManagedComponentContextProvider:LT}=Ot({initSetupState:bm,forwardProps:Rm,mapPropsToState:Im,layoutEffect:!0});function VT(n){let{componentActions:e,componentState:t}=He(),o=Fe(t);return Dn.createElement(ds.Provider,{value:{componentActions:e,componentState:t,getState:o}},Dn.createElement(xm,{domProps:n.domProps}))}function Et(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:h,onHideIntent:g,__is_infinite_menu_component:y,...C}=n;return Dn.createElement(LT,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...n},Dn.createElement(VT,{domProps:C}))}Et[na]=!0;var Dm=B(require("react"));function vm(n,e){let{columnApi:t,column:o,getComputed:r,api:i}=e,l=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...l,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((d,p)=>{let f=pi(d,e);u.push({key:p,label:f,check:Dm.createElement(so,{key:d.id,disabled:d.computedVisible&&i.getVisibleColumnsCount()===1,checked:d.computedVisible,onChange:m=>{let h=!!m;i.setVisibilityForColumn(d.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Em(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Et,s=o().computedColumnsMap.get(n);if(!s)return null;let u={column:s,columnApi:tt(s.id,e),...e},c=vm([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Am.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var zT=`[${Pl["data-name"]}="${xl["data-name"]}"]`;function GT(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){o(),a.columnMenuVisibleForColumnId=null}let c=n.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${Od["data-column-id"]}="${e}"] ${zT}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Em(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function Mm(){let n=Z(),e=ze(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});(0,fs.useEffect)(()=>{let{actions:u,getState:c}=n,d=c();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,u.contextMenuVisibleFor=null,u.cellContextMenuVisibleFor=null,u.filterOperatorMenuVisibleForColumnId=null,u.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return(0,fs.useEffect)(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=t();if(u){let p=function(f){f.__insideMenu!==!0&&(a(),o.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),GT({columnId:u,context:n,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}var _m=B(require("react")),Fm=require("react");var KT={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Om(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=Z(),{getState:a,getDataSourceMasterContext:l}=we(),{focusDetectDOMRef:s}=n(),u=(0,Fm.useCallback)(async()=>{Xf({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return _m.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:KT})}var vn=require("react");function HT(){let n=Z(),{getState:e}=n,{editingCell:t}=e(),o=t&&!t.active?t.cancelled:void 0;(0,vn.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...ft({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function BT(){let n=Z(),{getState:e,state:{editingCell:t}}=n,o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,vn.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...ft({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function kT(){let n=Z(),{state:{editingCell:e}}=n,t=e?.active,o=ro(t);(0,vn.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function WT(){let n=Z(),{state:{editingCell:e},getState:t}=n,o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,vn.useEffect)(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,u={...ft({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(u),n.api.persistEdit({value:i})}},[o])}function jT(){let n=Z(),{state:{editingCell:e},getState:t}=n,o=e?e.persisted:void 0;(0,vn.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:u,initialValue:c}=r,d={...ft({rowIndex:l,columnId:s,...n}),value:u,initialValue:c};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function Nm(){HT(),BT(),WT(),jT(),kT()}var gs=require("react");var So=B(require("react"));var ms=B(require("react")),Lm=n=>ms.createElement(Oe,{...n},ms.createElement("path",{d:"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 hs=B(require("react")),Vm=n=>hs.createElement(Oe,{...n},hs.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function zm(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??Et,f=o().computedColumnsMap.get(n);if(!f)return null;let m=R=>{R.__insideMenu=!0},h=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:g}=i(),y=g[f.computedFilterType];if(!y)return null;let C=y.operators.map(R=>{let w=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===y.defaultOperator,x=R.components?.Icon??rn;return{key:w,icon:So.createElement(x,null),label:So.createElement(So.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(n,w)},checked:P?So.createElement(Vm,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:So.createElement(Lm,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(n)}},"-"],...C],T={column:f,api:u,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:g},I=d?d(b,T):b;return So.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:h,onHideIntent:R=>{h(R),t?.()}})}var sa=10;function Gm(){let n=Z(),e=ze(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,gs.useEffect)(()=>{let{actions:l,getState:s}=n;return s().onFilterOperatorMenuClick.onChange(c=>{if(!c)return;let{target:d,column:p}=c;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,h=xe.from(m.getBoundingClientRect());h.top-=sa,h.left-=sa,h.width+=2*sa,h.height+=2*sa,r(()=>zm(p.id,n,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:h,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),(0,gs.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var Pr=require("react");var Ss=B(require("react"));var ys=B(require("react"));function ua(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Cs(n){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),n.onHideIntent?.()}}}function Ts(n,e,t){if(!n)return null;let o=fe();return n.then(r=>{let{items:i,columns:a}=ua(r);i&&i.length&&o(ys.createElement(t,{...e,items:i||[],columns:a}))}),ys.createElement(Jt,{updater:o})}function Km(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??Et,{computedColumnsMap:d}=a(),p=d.get(o),f={...ft({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=Cs({onHideIntent:t}),h=u(f,e),g=h instanceof Promise||Array.isArray(h)?!0:!!(h&&Array.isArray(h.items));if(h instanceof Promise)return{cellContext:f,menu:Ts(h,m,c),preventDefault:g};let{items:y,columns:C}=ua(h);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:g,menu:Ss.createElement(c,{...m,columns:C,items:y}),cellContext:f}}function Hm(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??Et,{computedColumnsMap:s}=r(),u=n.columnId?s.get(n.columnId):void 0,c=u?{...n,...ft({...e,rowIndex:n.rowIndex,columnId:u.id})}:n;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=Cs({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:Ts(p,d,l),preventDefault:f};let{items:m,columns:h}=ua(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Ss.createElement(l,{...d,columns:h,items:m}),cellContext:c}}var ca=5,Bm=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function km(){let n=Z(),e=ze(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Pr.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:u}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:h,preventDefault:g}=Km(d,n,f),y=xe.fromPoint({top:p.clientY,left:p.clientX});y.width+=ca,y.height+=ca,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Bm}),g&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:C}=s();C&&C({...h,getState:s,getDataSourceState:u},p)})},[]),(0,Pr.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Wm(){let n=Z(),e=ze(),{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=Kt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Pr.useEffect)(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:h}=Hm(c,n,p),g={top:d.clientY,left:d.clientX},y=xe.fromPoint(g);y.width+=ca,y.height+=ca,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Bm}),h&&d.preventDefault(),l.contextMenuVisibleFor={point:g,...c};let{onContextMenu:C}=s();C&&C({...n,...m},d)})},[]),(0,Pr.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var jm=require("react"),$m=B(require("react"));var da=require("react");function pa(n,e){let{state:{brain:t}}=Z(),o=(0,da.useCallback)(n,e);(0,da.useEffect)(()=>t.onScroll(o),[t,o])}var bs="yzx0vj0";function Um(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,jm.useRef)(null);pa(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=se.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=se.runtime.bodyWidth),o==="column"?l.minWidth=se.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=se.runtime.bodyWidth),t==="column"?l.maxWidth=se.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=se.runtime.bodyWidth),$m.createElement("div",{ref:a,...i,className:i.className?ee(i.className,bs):bs,style:l},i.children)}var $T=X(Y.columnWidthAtIndex),UT=X(Y.columnOffsetAtIndex);function Ym(){return Z().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${$T}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${UT}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var fa="InfiniteTable";var qm=require("react");function Xm(){let{state:n,getState:e,actions:t}=Z(),{wrapRowsHorizontally:o}=n,r=ro(o);(0,qm.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=ts(fa,!!o);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater}},[r,o])}var Zm=require("react");function Qm(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=Z(),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,Zm.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=o(),h=!1,g=l.rowsPerPage,y=(r&&r.length>0||i)&&g>0?g:null;return f!=y&&(t.rowsPerPage=y,h=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,h=!0),h};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var ko=require("react");var xr=Ce({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Jm="_143ofgf5",eh="_143ofgf3";var YT=X(se.loaded),Rs={source:"infinite-table-page",target:"infinite-table-devtools-background"};function th(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Rs,url:Is(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Rs,url:Is(),type:t,payload:{debugId:o,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var Is=et(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function qT(n){window.postMessage(n)}var XT=et(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){St.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(th({type:"update",debugId:e},t))}else Mp(e),window.postMessage(th({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ge.onLogIntent("*",e=>{qT({...Rs,url:Is(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),n});function oh(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=Z(),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(YT)!==`${ou}`&&gr({debugId:i,key:"CSS001_CSS"}),(0,ko.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),JT()}var ma=fe(),ZT={revertAll:n=>{let e=St.get(n.debugId);if(e){let t=go.get(n.debugId);go.delete(n.debugId),$t.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=Yt.get(n.debugId);Yt.delete(n.debugId),Ut.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=St.get(n.debugId);if(e){let t=n.property,o=$t.get(n.debugId),r=go.get(n.debugId),i=Ut.get(n.debugId),a=Yt.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let u=Yt.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:n=>{let e=St.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),yr(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),yr(n.debugId))}}},discardAllWarnings:n=>{let e=St.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),yr(n.debugId))},setColumnVisibility:n=>{Bl(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{$i(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Bl(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{$i(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{$i(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=St.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${xr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(xr.classNames.base),r.innerHTML=[`<div class="${eh}"></div>`,`<div class="${Jm}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(xr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(xr.classNames.variants.active.true)}}}}};function QT(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&n.data.target==="infinite-table-page"&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(XT(),ma(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=ZT[e];t&&t(n.data.payload)}})}QT();function JT(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=Z(),s=n().debugId,u=(0,ko.useRef)(s);return u.current=s,(0,ko.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},p=ma.get();if(p){d(p);return}return ma.onChange(f=>{f&&d(f)})},[]),(0,ko.useEffect)(()=>{let c=u.current;if(!c)return;let d=ma.get();d&&d(c,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,ko.useEffect)(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function nh(){let n=ze(),e=n?n.getMasterState():null,t=Z().getState();return(e||t).portalDOMRef.current}var Lt=ve.rootClassName,eS=[cd,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:tS}=Ot({initSetupState:Cf,forwardProps:Tf,mapPropsToState:If,cleanup:Sf,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Rf(),getParentState:()=>Po(),debugName:n=>eo(n.debugId,fa)});function ih(){let n=Z(),{state:e,getComputed:t}=n,{header:o,brain:r,headerBrain:i,wrapRowsHorizontally:a}=e,{scrollbars:l}=t();return o?he.createElement($d,{wrapRowsHorizontally:!!a,bodyBrain:r,headerBrain:i,scrollbars:l}):null}var rh=ee(`${it}Body`,qn.relative,ai[1],Wu);function oS(n){return he.createElement("div",{...n,className:n.className?ee(rh,n.className):rh})}function ah(){let n=Z(),e=ze(),{state:t,getComputed:o,api:r}=n,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:h,activeCellIndex:g,rowDetailRenderer:y,showHoverRows:C,wrapRowsHorizontally:S,domProps:b,domRef:T}=t,I=m?.LoadMask??Mi,R=o(),{computedRowHeight:w,computedRowSizeCacheForDetails:P}=R,x=P?.getRowHeight||w,{componentState:{loading:D}}=we(),A=he.useCallback(M=>{let N=n.getState(),G=M.target;if(!e&&M._from_row_detail)return;e&&(M._from_row_detail=!0);let U=tu(G,es(),N.domRef.current),oe,ge,ce,z;U&&(ge=Number(U.dataset.colIndex),z=Number(U.dataset.rowIndex),oe=n.getComputed().computedVisibleColumns[ge].id,ce=n.dataSourceApi.getRowInfoArray()[z].id);let W={columnId:oe,colIndex:ge,rowId:ce,rowIndex:z,event:M,target:U??M.target};U&&N.cellContextMenu(W),N.contextMenu(W)},[]),{renderCell:_,renderDetailRow:E}=sf({imperativeApi:r,getComputed:o,domRef:T,bodySize:h,computed:R}),{autoFocus:F,tabIndex:v}=b??{};return Xm(),he.createElement(oS,{onContextMenu:A},he.createElement(_u,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:v??0,autoFocus:F??void 0,activeRowIndex:t.ready&&s==="row"?u:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?g:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:_,renderDetailRow:y?E:void 0,cellHoverClassNames:C?eS:void 0,scrollerDOMRef:f,scrollVarHostRef:T}),he.createElement(I,{visible:D},c))}var lh=he.memo(function(){let e=Z(),t=ze(),{state:o,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=we(),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:h,rowDetailHeightCSSVar:g,columnHeaderHeightCSSVar:y,scrollStopDelay:C,brain:S,activeRowIndex:b,activeCellIndex:T}=o,{licenseKey:I}=o;!I&&Xt.licenseKey&&(I=Xt.licenseKey),Kf(b,a.length,r),Gf(T,a.length,r);let{onKeyDown:R}=rm();he.useEffect(()=>{let G=l(),U=_t(oe=>{G.notifyRenderRangeChange({renderStartIndex:oe[0],renderEndIndex:oe[1]})},{wait:C});return S.onVerticalRenderRangeChange(U)},[S,C]);let w=zf(I),{autoFocus:P,tabIndex:x,...D}=o.domProps??{},A=Xc(D);he.useEffect(()=>{S.setScrollStopDelay(C),s.scrollStopDelayUpdatedByTable=C},[C]),tf(),Qm(),Nm();let{menuPortal:_}=Mm(),{menuPortal:E}=km(),{menuPortal:F}=Wm(),{menuPortal:v}=Gm();he.useEffect(()=>{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(o.id,o.ready,e.api,e)},[o.ready]);let M=oh();he.useEffect(()=>{t&&(c.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??he.createElement(he.Fragment,null,he.createElement(ih,null),he.createElement(ah,null));return he.createElement("div",{"data-debug-id":M,onKeyDown:R,ref:u,...A},N,he.createElement("div",{ref:c,className:ee(`${it}Portal`,Uu[1e7],qn.absolute,ku[0],Ku[0])},_,E,F,v),h?he.createElement(Ln,{key:"row-height",varName:h,onChange:d}):null,he.createElement(Ln,{key:"flashing-duration",allowInts:!0,varName:se.components.Cell.flashingDuration,onChange:p}),g?he.createElement(Ln,{key:"row-detail-height",varName:g,onChange:f}):null,y?he.createElement(Ln,{key:"column-header-height",varName:y,onChange:m}):null,w?null:he.createElement(Zd,null),he.createElement(Om,null))});function nS({children:n}){let{componentActions:e,componentState:t}=He(),{scrollerDOMRef:o,scrollTopKey:r}=t,i=Ff(),a=Fe(i),l=Fe(t),s=ze(),{getState:u,componentActions:c,getDataSourceMasterContext:d,api:p}=we(),[f]=he.useState(()=>ef({getComputed:a,getState:l,getDataSourceState:u,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:c})),m={actions:e,state:t,computed:i,dataSourceActions:c,getDataSourceMasterContext:d,getDataSourceState:u,getComputed:a,getState:l,api:f,dataSourceApi:p,children:n};Lr(o,g=>{let y={width:g.width,height:g.height};e.bodySize=y},{earlyAttach:!0,debounce:50}),he.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[r,o]);let h=on();return he.createElement(h.Provider,{value:m},he.createElement(lh,null))}var rS=40,iS=Hf(nu),Xt=function(n){return he.createElement(tS,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:rS,columnHeaderHeight:iS,...n},he.createElement(nS,{children:n.children}))};Xt.Header=ih;Xt.Body=ah;Xt.HScrollSyncContent=Um;Xt.Footer=()=>he.createElement(qu,null);var sh=B(require("react"));function aS(n){let{DataSource:e}=yn({nodesKey:"children",...n});return sh.createElement(e,null,n.children??null)}var uh=B(require("react"));function ch(n){return uh.createElement(Xt,{...n})}var ha=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,o(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ge(`${e}:DataQuery`)}};function Wo(n){if(Array.isArray(n))return n.map(Wo);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=Wo(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var bo=class{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Wo(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new ha(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Wo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Wo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Wo(e);this.queryCache.delete(t)};if(this.options=e,bo.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}bo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=bo.clients.get(e);t&&t.destroy()}static destroyAll(){bo.clients.forEach(e=>{bo.destroy(e.name)})}destroy(){bo.clients.delete(this.options.name)}},ga=bo;ga.clients=new Map;var lS={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},dh={instantEdit:lS};var sS=require("react");function ph(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var ws=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ws.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}},Dr=ws;Dr.DEFAULT_SIZE=10;var Ps=class{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ps.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}},vr=Ps;vr.DEFAULT_SIZE=10;var jo=require("react"),uS=(n,e)=>n.every((t,o)=>t===e[o]),fh=(n,e)=>{let t=(0,jo.useRef)(e),o=uS(e,t.current),r=(0,jo.useRef)(!0);t.current=e;let i=(0,jo.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,jo.useRef)(n);l.current=n,(0,jo.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Ro=require("react"),mh=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),ya=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,Ro.useRef)(t),a=(0,Ro.useRef)(o),l=mh(t,i.current,r),s=!mh(o,a.current,r),u=(0,Ro.useRef)(!0);i.current=t,a.current=o;let c=(0,Ro.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,Ro.useRef)(n);p.current=n,l&&s&&(u.current=!1),(0,Ro.useEffect)(()=>{if(!u.current)return p.current()},d)};var yt=B(require("react"));var hh=X(Y.currentFlashingDuration),cS=({children:n})=>yt.createElement(yt.Fragment,null,n),gh=1e3,yh={up:Jr({direction:"up"}).split(" "),down:Jr({direction:"down"}).split(" "),neutral:Jr({direction:"neutral"}).split(" ")},xs=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=cS}=n;return yt.forwardRef((i,a)=>{let l=ir(),{state:{flashingDurationCSSVarValue:s}}=Z(),u=typeof s=="number"?s??e??gh:e??gh,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,h=f.id,g=p.id,y=yt.useRef(!0),C=yt.useRef(d),S=y.current?null:C.current;y.current=!1;let b=yt.useRef(),T=yt.useRef(),I=yt.useRef();return ya(()=>{if(d===C.current)return;let R=()=>{let D=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),T.current&&D){let A=T.current,_=yh[A];D.classList.remove(...t?[t,..._]:_),D.style.removeProperty(hh),T.current=void 0}};C.current=d;let w=m.current;if(!w)return;R();let P=typeof d=="number"?d>S?"up":"down":"neutral",x=yh[P];return w.style.setProperty(hh,`${u}`),w.classList.add(...t?[t,...x]:x),T.current=P,b.current=setTimeout(R,u),R},{same:[g,h],different:[d]}),yt.createElement("div",{ref:c,...i,className:ee(i.className)},o({children:i.children,oldValue:S}))})},Ch=xs();var dS={CheckBox:so,LoadMask:Mi,MenuIcon:lr,StringFilterEditor:sn,NumberFilterEditor:hi};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceState,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes});
26
30
  //!collapsed || lazyLoad;