@infinite-table/infinite-react 10.1.5 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/index.d.ts +158 -135
- package/index.dev.js +677 -524
- package/index.dev.mjs +687 -534
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
- package/theme/balsam.css +209 -19
- package/theme/minimalist.css +205 -33
- package/theme/ocean.css +205 -29
- package/theme/shadcn.css +102 -7
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var _b=Object.create;var Ri=Object.defineProperty;var Ob=Object.getOwnPropertyDescriptor;var Fb=Object.getOwnPropertyNames;var Nb=Object.getPrototypeOf,Lb=Object.prototype.hasOwnProperty;var kb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),zb=(o,e)=>{for(var t in e)Ri(o,t,{get:e[t],enumerable:!0})},Tu=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fb(e))!Lb.call(o,r)&&r!==t&&Ri(o,r,{get:()=>e[r],enumerable:!(n=Ob(e,r))||n.enumerable});return o};var B=(o,e,t)=>(t=o!=null?_b(Nb(o)):{},Tu(e||!o||!o.__esModule?Ri(t,"default",{value:o,enumerable:!0}):t,o)),Vb=o=>Tu(Ri({},"__esModule",{value:!0}),o);var an=kb((NE,vp)=>{"use strict";vp.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});var QI={};zb(QI,{AutoScroller:()=>mn,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>vt,DataClient:()=>du,DataSource:()=>SR,DataSourceActionType:()=>dh,DeepMap:()=>Z,DragDropProvider:()=>ta,DragInteractionTarget:()=>ir,DragList:()=>Wo,FixedSizeSet:()=>Fl,FlashingColumnCell:()=>fb,GroupRowsState:()=>Dt,INTERNAL_MatrixDebugger:()=>gb,InfiniteTable:()=>so,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>ob,Menu:()=>Ut,RowDetailCache:()=>pr,RowDetailState:()=>Mt,RowDisabledState:()=>xt,RowSelectionState:()=>_e,TreeDataSource:()=>jI,TreeExpandState:()=>ut,TreeGrid:()=>ib,TreeSelectionState:()=>Qe,WeakFixedSizeSet:()=>Ll,alignNode:()=>yl,components:()=>ZI,createDefaultProxy:()=>Us,createFlashingColumnCellComponent:()=>pu,debounce:()=>Ft,debug:()=>$e,defaultDragProxyMove:()=>$s,defaultFilterFunction:()=>mc,defaultFilterTypes:()=>No,defaultTreeFilterFunction:()=>Ba,eventMatchesKeyboardShortcut:()=>ml,filterDataArray:()=>Ac,filterTypes:()=>No,flatten:()=>nf,getComponentStateRoot:()=>Lt,group:()=>ua,interceptMap:()=>lb,keyboardShortcuts:()=>ab,multisort:()=>no,multisortNested:()=>Xa,queryKeyToCacheKey:()=>An,toTreeDataArray:()=>Ig,useComponentState:()=>kt,useDataSourceApi:()=>uh,useDataSourceInternal:()=>dr,useDataSourceSelector:()=>Fe,useDataSourceState:()=>Za,useDragDropProvider:()=>po,useDragListContext:()=>gn,useEffectWhen:()=>zl,useEffectWhenSameDeps:()=>sb,useEffectWithChanges:()=>In,useEffectWithObject:()=>uR,useGridScroll:()=>Dl,useInfiniteColumnApi:()=>tb,useInfiniteColumnCell:()=>Ur,useInfiniteColumnEditor:()=>ga,useInfiniteColumnFilterEditor:()=>jn,useInfiniteHeaderCell:()=>Nr,useInfinitePortalContainer:()=>PS,useInfiniteTableApi:()=>eb,useLayoutEffectWithChanges:()=>cR,useManagedDataSource:()=>Oc,useMasterRowInfo:()=>Mo,useOverlay:()=>ao,useOverlayPortal:()=>xy,usePrevious:()=>Oo,useRowInfoReducers:()=>bR,useVisibleColumnSizes:()=>SS,withSelectedLeafNodesOnly:()=>uu});module.exports=Vb(QI);function Ft(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var xe=B(require("react"));var J=(...o)=>o.filter(e=>!!`${e}`).join(" ");var tn=B(require("react")),Xl=require("react");var Gb=B(require("react")),Do=require("react");var Fn=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Ft(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}};var Ii=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,Do.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=Fn(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Do.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,Do.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Te(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;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 mt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Cu=(o,e)=>o-e;var vi=(o,e)=>Cu(o.revision,e.revision),Z=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],y=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let S=t(f.value,h,l,y,f);if(n&&S===!0)return!0;l++}else y?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(vi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(vi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(vi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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 n=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=mt(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,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 n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}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(vi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=Z;function Ee(){return globalThis}var Di=["#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"],wu=Symbol("color"),Pi=new WeakMap,Bl=Te();function Wl(o=Di){Pi.set(o,o.map(e=>0))}Wl();var Hb=(o=Di)=>{let e=[];Pi.has(o)?e=Pi.get(o):(e=o.map(n=>0),Pi.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??Di[0]},Pr=":",jl="*",Ru="-",Kb=",",Bb="debug",Wb="diffdebug",vu=!1,vr=new Z,Dr=new Map;function Ul(o,e){let t=o.split(Pr),n=new Z;n.set(t,!0);let r=e.split(Pr),i=new Set(r).has(jl),a=r.indexOf(jl),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Pr)):!0}}function Pu(o,e){let t=`channel=${o}_permissions=${e}`;if(Dr.has(t))return Dr.get(t);let n=e.split(Kb);function r(l){return Dr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(jl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Ru);if(c&&(s=s.substring(Ru.length)),Ul(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Ul(o,s))return r(!c)}return r(!1)}var $l=()=>$e.enable??(Ee()&&Ee().localStorage?.getItem(Bb))??"",jb=()=>$e.diffenable??(Ee()&&Ee().localStorage?.getItem(Wb))??`${vu}`,Yl="",Du=vu;function ql(o){Du=`${jb()}`=="true",Yl!==o&&(Yl=o,Dr.clear())}function xu(o){ql($l()),typeof Ee()<"u"&&Ee().addEventListener&&Ee().addEventListener("storage",function(){ql($l())});function e(t,n){let r=n?`${n}${Pr}${t}`:t,i=r.split(Pr),a=vr.get(i);if(a)return a;let l=vr.get(i.slice(0,-1)),s=(l?l.logFn:$e.logFn)??Eu,c=s,u,d=0,p=()=>u??Pu(r,Yl),f=Hb($e.colors),m=Object.defineProperties((...g)=>{let h=Bl.getListenersCount(),y;if(h>0&&(y=y??Date.now(),Bl({color:f,channel:r,args:g,timestamp:y})),p()){if(y=y??Date.now(),d&&Du){let b=y-d;c(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=y;let S=[],T;if(g.forEach(b=>{if(b[wu])T===void 0&&(T=!0),S.push(...b);else{if(typeof b!="string"&&typeof b!="number"){T=!1;return}S.push(`${b}%s`)}}),T){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...S,""];c(...b)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let y=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return y.toString=()=>h.join(" "),y[wu]=!0,y}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{vr.delete(i)}}});return vr.set(i,m),m}return e(o)}var Eu=console.log.bind(console),Iu;Object.defineProperty(xu,"enable",{get:()=>Iu,set:o=>{Iu=o,ql($l())}});var $e=xu;$e.colors=Di;$e.logFn=Eu;var Ub=(o,e)=>Bl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Ul(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});$e.onLogIntent=Ub;$e.isChannelEnabled=Pu;$e.destroyAll=()=>{Wl(),Wl($e.colors),vr.clear(),Dr.clear()};var Nt=o=>{let e=$e(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},xo=o=>{let e=$e(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},xr=()=>xr;xr.extend=()=>xr;var bt=class{constructor(e){this.debug=xr,this.error=xr}};var Mu=xo("CSSVariableWatch"),Au=Nt("CSSVariableWatch"),_u={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Ou(o){return o.startsWith("var(")||o.startsWith("calc(")?o:`var(${o})`}var $b=o=>{let e=(0,Xl.useRef)(0),t=tn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Ii(o.ref,t,{earlyAttach:!0}),tn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,Au(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);Mu(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Er=o=>{let e=(0,Xl.useRef)(null);$b({...o,ref:e});let t=Ou(o.varName),{allowInts:n=!1}=o;return tn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:_u},tn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var kn=require("react");function Eo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var co=require("react");function Tt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(o[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Fu(o,e,t){let n=(0,co.useRef)(e);n.current=e;let r=(0,co.useRef)(t);r.current=t;let i=(0,co.useRef)(void 0),a=(0,co.useRef)(!1),l=(0,co.useCallback)(()=>{let s=o.getSnapshot(),c=n.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[o]);return(0,co.useSyncExternalStore)(o.subscribe,l,l)}function xi(o,e){return Fu(o,e,Object.is)}function Nn(o,e){return Fu(o,e,Tt)}var Nu=B(require("react")),Zl;function Ln(){return Zl||(Zl=Nu.createContext(null))}var Lu=Eo(),ku=()=>{};function Ei(){let o=Ln();return(0,kn.useContext)(o)||void 0}function Mi(){let o=Ei();return(0,kn.useCallback)(()=>o?.getSnapshot(),[o])}function Ai(o){let e=Ln(),t=(0,kn.useContext)(e),n=Nn(t||Lu,t?o:ku);return t?n??void 0:void 0}function Mo(){let o=Ln(),e=(0,kn.useContext)(o),n=xi(e||Lu,e?r=>r.masterRowInfo:ku);return e?n:void 0}var zn=B(require("react")),rt=require("react");function Ao(o){if(o==null)return!1;let e=o;return!0}var _o=require("react");var _i=require("react"),$t=()=>{let[o,e]=(0,_i.useState)(0);return[o,(0,_i.useCallback)(()=>{e(t=>t+1)},[e])]};var zu=o=>{let e=(0,_o.useCallback)(o,[]),t=(0,_o.useRef)(!1),n=(0,_o.useRef)(!1),r=(0,_o.useRef)(void 0),[i,a]=$t();t.current&&(n.current=!0),(0,_o.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var Oi=require("react");function Ne(o){let e=(0,Oi.useRef)(o);return e.current=o,(0,Oi.useCallback)(()=>e.current,[])}var Fi=require("react"),Oo=(o,e)=>{let t=(0,Fi.useRef)(e===void 0?o:e);return(0,Fi.useLayoutEffect)(()=>{t.current=o}),t.current};var Mr={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Ql=class o{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,n=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Mr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Mr[n].track,label:i.label}),get label(){let i=Mr[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,n,{get:()=>{let i=Mr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function at(o){return Ql.create(o)}function Vu(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Jl=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function Ar(o){return o!==void 0}function Fo(o,e){let t=e[o];return Ar(t)}var Gu=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function Yb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Fo(r,e)?e[r]:e[`default${Jl(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Hu(o,e,t){let{fn:n,propertyReads:r}=Vu(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function Ku(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=Yb(n,e,t));let s={...t,...l};if(i){let c=Hu(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...c}}return s}function Bu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,c=e.payload.mappedState,u=e.payload.updatedPropsToState,d={...o};if(c&&Object.assign(d,c),i){let f=Hu(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:u,parentState:s}):d}function Wu(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=Gu}=o,c=t();return Object.keys(c).reduce((u,d)=>{let p=d;return Object.defineProperty(u,d,{set:m=>{let g=n(),h=t(),y=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:u,state:h})===!1&&(y=!1),y){let b=[m],C=`on${Jl(d)}Change`;if(l&&l[p]){let w=l[p](m,h);C=w.callbackName||C,b=w.callbackParams}s(g,C,b)}let S=r[p];typeof S=="function"&&(m=S(m));let T=!!i?.[p];Fo(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),u},{})}function ju(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},c=0,u={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],h=e[m];if(m!=="children"&&g!==h&&(u[m]={newValue:h,oldValue:g},d++,Fo(m,e)||Fo(m,t)))if(r.hasOwnProperty(f)){let y=h,S=r[f];typeof S=="function"&&(y=S(h)),n[m]!==y&&(a[m]=y,l++)}else i.has(f)&&(s[m]=e[m],c++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:c,rawUpdatedProps:u,rawUpdatedPropsCount:d}}var es;function Uu(){return es||(es=(0,rt.createContext)(null))}function Lt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,rt.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,rt.useRef)(new Set),l=(0,rt.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Ne(s);function u(){return Ku({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,rt.useState)(u),p=Ne(r),f=(v,D)=>Bu(v,D,{getProps:p,getParentState:()=>c?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,rt.useReducer)(f,d),h=Ne(m),{allowedControlledPropOverrides:y}=o,S=(0,rt.useMemo)(()=>Wu({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:y,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,y]),T=o.Context??Uu(),b=(0,rt.useMemo)(()=>({componentState:m,componentActions:S,getComponentState:h,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,S,h]),C=Oo(r),w=(0,rt.useRef)(!1);w.current=!1;let R=o.layoutEffect?rt.useLayoutEffect:rt.useEffect;return R(()=>{let v=r,{newMappedState:D,newMappedStateCount:I,updatedPropsToState:M,updatedPropsToStateCount:E,rawUpdatedProps:x,rawUpdatedPropsCount:P}=ju({currentProps:v,prevProps:C,state:m,propsToForward:l,propsToStateSet:a.current});if(E>0||I>0){let _=m.debugId,F=_?at(_).track.ComponentState.label.PropUpdate.start():void 0,k=o.debugName?typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`:"rerender";Nt(k)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(M??{})),F&&F.end({label:k,details:[I>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,E>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,E>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Ao)});let H={payload:{mappedState:I?D:null,updatedPropsToState:E?M:null}};if(w.current=!0,g(H),o.onPropChange){for(var A in x)if(x.hasOwnProperty(A)){let{newValue:W,oldValue:z}=x[A];o.onPropChange({name:A,newValue:W,oldValue:z},r,S,m)}}o.onPropsChange&&P&&o.onPropsChange(x,r,S,m)}}),R(()=>{s!=null&&!w.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),zu(()=>()=>{o.cleanup?.(h())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:zn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return zn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function kt(o){return o=o??Uu(),zn.useContext(o)}var id=B(require("react"));var gt="Infinite",ze={rootClassName:gt};var Ni=()=>ze;var $u="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Yu={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Gt="_16lm1iw3b _16lm1iw3c _16lm1iw35",qu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Vn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Li={1:"_16lm1iw1c",none:"_16lm1iw1d"},_r={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Xu={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Zu={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Qu={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Ju={none:"_16lm1iwd"},ed={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var ki={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var td={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var od={none:"_16lm1iw1x"};var nd={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var rd={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function ad(o){let{rootClassName:e}=Ni();return id.createElement("div",{...o,className:J(`${e}Footer`,ki.relative,Vn.flex,_r.row,o.className)})}var Me=B(require("react")),yo=require("react"),Jm=require("react-dom");function zi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function te(o){return o.slice(4,-1)}var cd=B(require("react"));var Gn={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},ld="_1jm33zvf";var sd={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var lt="InfiniteIcon";var Ve=o=>{let{icon:e,...t}=o,n=o.size??"var(--infinite-icon-size)",r={flex:"none",width:n,height:n,fill:"currentColor",...o.style};return cd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?J(o.className,Gn[e],lt,`${lt}-${sd[e]}`):o.className,style:r},o.children)};var ts=B(require("react"));var Ge={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var ud=o=>ts.createElement(Ve,{...o,icon:"filterOperatorContains"},Ge.includesOperator.map(e=>ts.createElement("path",{key:e,d:e})));var os=B(require("react"));var dd=o=>os.createElement(Ve,{...o,icon:"filterOperatorEndsWith"},os.createElement("path",{d:Ge.endsWithOperator[0]}));var ns=B(require("react"));var pd=o=>ns.createElement(Ve,{...o,icon:"filterOperatorEq"},ns.createElement("path",{d:Ge.eqOperator[0]}));var rs=B(require("react"));var fd=o=>rs.createElement(Ve,{...o,icon:"filterOperatorGte"},rs.createElement("path",{d:Ge.gteOperator[0]}));var is=B(require("react"));var md=o=>is.createElement(Ve,{...o,icon:"filterOperatorGt"},is.createElement("path",{d:Ge.gtOperator[0]}));var as=B(require("react"));var gd=o=>as.createElement(Ve,{...o,icon:"filterOperatorLte"},as.createElement("path",{d:Ge.lteOperator[0]}));var ls=B(require("react"));var hd=o=>ls.createElement(Ve,{...o,icon:"filterOperatorLt"},ls.createElement("path",{d:Ge.ltOperator[0]}));var ss=B(require("react"));var yd=o=>ss.createElement(Ve,{...o,icon:"filterOperatorNeq"},ss.createElement("path",{d:Ge.neqOperator[0]}));var cs=B(require("react"));var Sd=o=>cs.createElement(Ve,{...o,icon:"filterOperatorStartsWith"},cs.createElement("path",{d:Ge.startsWithOperator[0]}));var bs=B(require("react"));var ct=B(require("react")),Fr=require("react");var Hn=B(require("react")),on=require("react");function qb(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Xb(o){var e=qb(o,"string");return typeof e=="symbol"?e:String(e)}function Zb(o,e,t){return e=Xb(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function bd(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Td(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bd(Object(t),!0).forEach(function(n){Zb(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):bd(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Cd(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Qb=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},Se=o=>{var e=t=>{var n=o.defaultClassName,r=Td(Td({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)Qb(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Cd(o.variantClassNames,t=>Cd(t,n=>n.split(" ")[0]))}},e};var wd="_1eexc2a6";var Rd=Se({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),Id="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",vd=Se({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Pd=Se({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),Dd=Se({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),xd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Ed="_12zfob17",Md="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Ad=Se({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),us=Se({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),_d="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Od=Se({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Fd="_12zfob1b _16lm1iw2",Nd="_16lm1iw1",Ld="_12zfob16",kd=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),zd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Vd="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",Vi="_1nnkya21";var Gd={transition:"width 0.25s, opacity 0.25s"},$D=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Kn(o){let[e,t]=(0,on.useState)(!0),[n,r]=(0,on.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Gd,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,on.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,on.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Hn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:J(l,lt,Vd,`${lt}-filter`)},c?Hn.createElement("div",{"data-name":"index",style:m,className:Ed},s):null,Hn.createElement("div",{className:Vi,style:{width:p[0],...f}}),Hn.createElement("div",{className:Vi,style:{width:p[1],...f}}),Hn.createElement("div",{className:Vi,style:{width:p[2],...f}}))}var Gi=Object.freeze({}),Jb={string:Gi,number:{}};function Bn(o,e){let t=e.default||Gi;return o.type===void 0?t:o.type===null?Gi:typeof o.type=="string"?e[o.type]||Jb[o.type]||Gi:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ps=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((R,v)=>{let D=R.maxSize??r??void 0,I=R.minSize??n??void 0;s.push(I),c.push(D),R.size!=null&&(D!=null&&R.size>D&&(R.size=D),I!=null&&R.size<I&&(R.size=I));let M=R.flex==0?null:R.flex;if(R.size==null&&M==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;M!=null&&(l+=1),a+=M??0,i+=R.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((R,v)=>{if(R.flex!=null){let D=d*R.flex,I=R.maxSize??r??void 0,M=R.minSize??n??void 0,E=!1,x=0;I!=null&&D>I&&(p[v]=!0,E=!0,x=I),M!=null&&D<M&&(f[v]=!0,E=!0,x=M),E&&(m+=1,l-=1,a-=R.flex,u-=x)}}),m&&(d=u/a);let g=[],h=0,y=u,S=a,T=0,b=0,C=[];return{items:t.map((R,v)=>{let D={...R},I=R.maxSize??r??void 0,M=R.minSize??n??void 0,E=0,x=p[v],P=f[v],A=x||P,_=R.size??0;if(R.flex!=null){if(A)P&&(E=M),x&&(E=I);else{h+=1;let F=k=>(I!=null&&k>I&&(k=I),M!=null&&k<M&&(k=M),k);h===l?E=F(y):(E=F(Math.round(R.flex*d)),b+=E,y=u-b,S-=R.flex,d=y/S)}_=E,D.flexSize=E}return g.push(E),C.push(_),D.computedSize=_,T+=_,D}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-T)}};function Hi(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}function Kd(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function ds(o,e){return o.computedFlex&&!e?"flex":"width"}function Or(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var fs=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((M,E)=>(M[E]={...o.columnSizing[E]},M),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=Kd(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=ds(l,d),h=s?.computedWidth,y=s?.computedMinWidth,S=s?.computedMaxWidth,T=s?ds(s,d):"width",b=!1,C=!1,w=r>0?1:-1,{value:R,clamped:v,diff:D}=Hi(Math.round(p+r),f,m,w);if(o.shareSpaceOnResize){if(s==null)return n[c]=Or(n[c],g,R),C=v==="min",b=v==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:n,minReached:C,maxReached:b,constrained:C||b};let{value:M,clamped:E,diff:x}=Hi(Math.round(h-r),y,S,w);if(v&&E&&(Math.abs(D)>Math.abs(x)?E=!1:v=!1),!(!v&&!E)){if(v){let P=Hi(Math.round(h-r-D),y,S,w);M=P.value,E=P.clamped,x=P.diff}else if(E){let P=Hi(Math.round(p+r+x),f,m,w);R=P.value,v=P.clamped,D=P.diff}}n[c]=Or(n[c],g,R),n[u]=Or(n[u],T,M),C=v==="min"||E==="min",b=v==="max"||E==="max"}else n[c]=Or(n[c],g,R),C=v==="min",b=v==="max";let I=R-p;return{adjustedDiff:I,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-I),columnSizing:n,minReached:C,maxReached:b,constrained:C||b}};function Hd(o,e){return o+e}function eT(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Bd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((S,T)=>(S[T]={...o.columnSizing[T]},S),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((S,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(S=>o.items[S]),l=a.map(S=>S.computedWidth),s=Kd(o.items,e,t),c=a.map(S=>ds(S,s)),u=0,{computedSizes:d}=ps({items:a.map(S=>(S.resizable===!1&&(u+=S.computedWidth),{maxSize:S.computedMaxWidth,minSize:S.computedMinWidth,flex:S.resizable?S.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Hd,0)+r-u,0)}),p=a.map((S,T)=>d[T]-S.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((S,T)=>{let b=a[T];if(!b.resizable){h.push(0);return}let C=c[T],w=l[T],R=eT(n),{maxReached:v,minReached:D,constrained:I,adjustedDiff:M}=fs({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:S,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[b.id]=Or(R[b.id],C,Math.round(w+M)),h.push(M),v||(m=!1),D||(f=!1),I||(g=!1)});let y=h.reduce(Hd,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:y,columnSizing:n,reservedWidth:Math.round(t-y)}};var Ki;function Yt(){if(Ki!=null)return Ki;let o=Ee().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Ki=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Ki}var Wd=["start",void 0,"end"],jd=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Wd.indexOf(r)-Wd.indexOf(i)}),o);function Ud(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function ms(o,...e){return Ud(t=>t!=null,o,...e)}function $d(o,e,...t){return Ud((n,r)=>!(r in o),e,...t)}var Bi=!0,tT=!0,oT=!0,Yd="string",uo="unknown";var nT=xo("getComputedVisibleColumns"),rT=(o,e,t)=>o[t]!==!1,gs=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function nn(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function iT(o,e){let t=Bn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:Yd}function aT(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[uo];let l=nn(e,a);if(!l)return[uo];let s=iT(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===uo)?uo:r.length===1?r[0]:r}function hs(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Bi}var qd=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,pinnedStartMaxWidth:u,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=No,viewportReservedWidth:y,resizableColumns:S,draggableColumns:T,columnDefaultDraggable:b,columnOrder:C,columnPinning:w,editable:R,columnDefaultEditable:v,columnDefaultFilterable:D,columnDefaultGroupable:I,columnDefaultSortable:M,columnSizing:E,columnTypes:x,columnVisibility:P,columnVisibilityAssumeVisible:A,groupBy:_})=>{let F=0,k={};_.forEach((K,ne)=>{K.field&&(k[K.field]=ne)});let O=(p||[]).reduce((K,ne)=>{let{id:ye,field:Ce}=ne;return Ce&&(K[Ce]=ne),ye&&(K[ye]=ne),K},{}),H=jd(C===!0?Object.keys(o):C,w),W=H.filter(K=>o[K]?rT(P,A,K):(nT(`Column with id "${K}" specified in columnOrder array cannot be found in the columns map.`),!1)),z=new Map,ee=W.map((K,ne)=>{let ye=o[K];return z.set(K,ne),ye}),V=(m??[]).reduce((K,ne,ye)=>(ne.id?K[ne.id]={sortInfo:ne,index:ye}:ne.field&&(K[ne.field]={sortInfo:ne,index:ye}),K),{});function $(K){let ne=o[K],ye=Bn(ne,x),Ce={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},st={width:ne?.defaultWidth,flex:ne?.defaultFlex,minWidth:ne?.minWidth,maxWidth:ne?.maxWidth},G=E[K];G?.width!=null&&G.flex==null&&delete st.flex,G?.flex!=null&&G.width==null&&delete st.width;let ke=ms(st,G);ke.width!=null&&delete Ce.flex,ke.flex!=null&&delete Ce.width,ke=ms(Ce,ke);let St=ke.flex??void 0,de=ke.minWidth??ne?.minWidth??n,Re=ke.maxWidth??ne?.maxWidth??r,Xe=St!=null?void 0:ke.width??(a?void 0:i);return!Xe&&St==null&&(a?St=a:Xe=de),{size:Xe,flex:St,minSize:de,maxSize:Re}}let ie=ps({availableSize:Math.max(t.width-(y??0)-(l??Yt()),0),maxSize:r,minSize:n,items:W.map($)}),{computedSizes:fe,flexSizes:se,minSizes:le,maxSizes:pe}=ie,ce=[],Y=[],q=[],j=[];j.length=W.length;let X=new Map,U=new Map,Q=0,ae=0,he=0,ue=null,L=[],N=0,me=0,Ae=0;ee.forEach((K,ne)=>{let ye=W[ne],Ce=fe[ne],st=L[ne]=gs(ye,w);st==="start"?N+=Ce:st==="end"?Ae+=Ce:me+=Ce});let ve=t.width-Ae,be=[],Oe=new Map;W.forEach((K,ne)=>{let ye=ee[ne];Oe.set(K,ye)});let Ke=[];Object.keys(o).forEach(K=>{let ne=o[K];Ke.push(K),Oe.has(K)||Oe.set(K,ne)});let nt=new Map;Oe.forEach((K,ne)=>{let ye=z.get(ne);ye==null&&(ye=-1);let Ce=ye!=-1,st=W[ye+1],G=Bn(K,x),ke=ye,St=V[ne]?V[ne]:K.field?V[K.field]??null:null,de=St?.sortInfo??null,Re=!!de,Xe=Re&&de.dir===1,Po=Re&&!Xe,fu=St?.index??-1,Vl=Ce?{}:$(ne),mu=Ce?fe[ye]:Vl.size||0,yb=Ce&&se[ye]||null,Sb=Ce?le[ye]||0:Vl.minSize||0,bb=Ce?pe[ye]||1e4:Vl.maxSize||1e4,Et=Ce?gs(ne,w):!1,gu=Ce?ye===W.length-1:!1,Ci=ke,Tb=Ce?Et==="start"?ae:Et==="end"?he:F-ae:0;Et=="start"?Ci=Ce?ke:-1:Et==="end"?Ci=Ce?ke-(ce.length+q.length):-1:Ci=Ce?ke-ce.length:-1;let Cb=Ce?Et==="start"||Et===!1?F:ve+he:-1,wb=Ce?Et!==ue:!1,Rb=Ce?gu||Et!==gs(st,w):!1,hu=K.cssEllipsis??G.cssEllipsis??s,Ib=K.headerCssEllipsis??G.cssEllipsis??K.cssEllipsis??G.headerCssEllipsis??c??hu,wi=Ce&&(O[ne]||K.field||K.groupByForColumn)&&(O[ne]||O[K.field||K.groupByForColumn])||null,vb=K.defaultFilterable??G.defaultFilterable??D??!0,Pb=R??K.defaultEditable??G.defaultEditable??v??!1,Gl=K.dataType||G.dataType||(Array.isArray(K.type)?K.type[0]:K.type)||Yd,Db=K.sortType||G.sortType||Gl,yu=K.filterType||G.filterType||Gl,Su=!1;if(wi!=null&&!wi.disabled){let Kl=h[yu];Kl&&(!Kl.emptyValues||!Kl.emptyValues.includes(wi.filter.value))&&(Su=!0)}let On=K.field??G.field,xb=K.valueGetter??G.valueGetter,Hl=K.defaultGroupable??G.defaultGroupable??I??!!On;On||(Hl=!1),K.groupByForColumn&&(Hl=!1);let bu=On?k[On]!==void 0:!1,Eb=bu?k[On]:void 0,Mb=hs(K,{colType:G,sortable:f,columnDefaultSortable:M}),Ab=K.resizable??G.resizable??S??tT,Ze={colType:G,align:G.align,headerAlign:G.headerAlign,computedVisible:Ce,verticalAlign:G.verticalAlign,defaultHiddenWhenGroupedBy:G.defaultHiddenWhenGroupedBy,valueGetter:xb,valueFormatter:G.valueFormatter,renderValue:G.renderValue,render:G.render,style:G.style,className:G.className,contentFocusable:G.contentFocusable,renderMenuIcon:G.renderMenuIcon,renderSortIcon:G.renderSortIcon,renderRowDetailIcon:G.renderRowDetailIcon,renderSelectionCheckBox:G.renderSelectionCheckBox,renderHeaderSelectionCheckBox:G.renderHeaderSelectionCheckBox,headerStyle:G.headerStyle,headerClassName:G.headerClassName,columnGroup:G.columnGroup,getValueToEdit:G.getValueToEdit,getValueToPersist:G.getValueToPersist,shouldAcceptEdit:G.shouldAcceptEdit,field:On,...K,components:{...G.components,...K.components},computedResizable:Ab,computedMinWidth:Sb,computedMaxWidth:bb,computedFlex:yb,computedDataType:Gl,computedEditable:Pb,computedSortType:Db,computedFilterType:yu,cssEllipsis:hu,headerCssEllipsis:Ib,computedFilterValue:wi,computedFiltered:Su,computedFilterable:vb,computedGroupable:Hl,computedGroupedBy:bu,computedGroupedByIndex:Eb,computedWidth:mu,computedAbsoluteOffset:Cb,computedPinningOffset:Tb,computedVisibleIndexInCategory:Ci,computedOffset:F,computedSortable:Mb,computedSortInfo:de,computedSortIndex:fu,computedMultiSort:g,computedSorted:Re,computedSortedAsc:Xe,computedSortedDesc:Po,computedVisibleIndex:ke,computedPinned:Et,computedDraggable:T??K.defaultDraggable??b??oT,computedFirstInCategory:wb,computedLastInCategory:Rb,computedFirst:ye===0,computedLast:gu,id:ne,header:K.header??G.header??K.name??K.field};Ce&&(F+=mu,X.set(Ze.id,Ze),j[ye]=Ze,Et==="start"&&(ce.push(Ze),ae+=Ze.computedWidth),Et==="end"&&(Y.push(Ze),he+=Ze.computedWidth),Et||(q.push(Ze),Q+=Ze.computedWidth),ue=Et),Ze.groupByForColumn&&(Ze.computedSortType=K.sortType||G.sortType||aT(Ze.groupByForColumn,e,x),be.push(Ze)),U.set(Ze.id,Ze),Ze.field&&!Ze.groupByForColumn&&!nt.has(Ze.field)&&nt.set(Ze.field,Ze)}),be.forEach(K=>{K.computedSortable=Xd(K,{fieldsToColumn:nt,userColumns:e,columnTypes:x,sortable:f,columnDefaultSortable:M})});let Je=new Map;Ke.forEach(K=>{let ne=U.get(K);ne&&Je.set(K,ne)}),U.forEach(K=>{Je.has(K.id)||Je.set(K.id,K)});let it=u!=null?Math.min(u,ae):ae,et=d!=null?Math.min(d,he):he;return{computedRemainingSpace:t.width-(N+Ae+me),computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:he,computedUnpinnedColumnsWidth:Q,computedColumnOrder:H,computedPinnedStartColumns:ce,computedPinnedEndColumns:Y,computedUnpinnedOffset:ae,computedPinnedEndOffset:ae+Q,computedUnpinnedColumns:q,computedVisibleColumns:j,computedColumnsMap:U,computedColumnsMapInInitialOrder:Je,computedVisibleColumnsMap:X,computedPinnedEndWidth:et,computedPinnedStartWidth:it,renderSelectionCheckBox:j.reduce((K,ne)=>K||!!ne.renderSelectionCheckBox,!1),fieldsToColumn:nt}};function Xd(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Bi,c=o.sortType??o.colType.sortType;return c!=null&&c!==uo&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let y=h.field||h.groupField,S;if(y){let T=n.get(y),b=T?f.getColumnApi(T.id):void 0;if(T&&b)S=b.isSortable();else{let C=nn(i,y);if(C){let w=hs(C,{colType:Bn(C,a??{}),sortable:t,columnDefaultSortable:r});S=typeof w=="boolean"?w:void 0}else S=!1}}return S===void 0&&h.valueGetter&&(S=!0),S??r??Bi},!0)}}function ht(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;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){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},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)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function rn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=ht(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var Zd=B(require("react"));var Wn=`${gt}HeaderCell__filter`,Wi=`${gt}HeaderCell__filterOperator`,wx=`${Wn}__input`;var ys=Zd.createContext(null);var Jd=require("react");var Qd=require("react"),Ss;function ji(){return Ss||(Ss=(0,Qd.createContext)(null))}function re(o){let e=ji(),t=(0,Jd.useContext)(e);return Nn(t,o)}function Be(){return re(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var lT=`${Wn}__input`,Ui=o=>o.stopPropagation();function ep(o){let{filterOperatorMenuVisibleForColumnId:e}=re(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Nr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Fr.useState)(!1),l=ct.useCallback(()=>{a(!0)},[]),s=ct.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return ct.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,onFocus:l,onBlur:s,className:`${Wn} ${us({active:c})}`,style:{height:o.columnHeaderHeight}},ct.createElement(ys.Provider,{value:o},ct.createElement(r,null),ct.createElement(n,null)))}function tp(){let{columnApi:o,disabled:e,operator:t}=jn(),n=t?.components?.Icon??Kn;return ct.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:J(Wi,Md,e?`${Wi}--disabled`:"")},ct.createElement(n,{size:20,className:`${Ad({disabled:e})}`}))}function op(){return ct.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,className:`${Wn} ${us({active:!1})} ${Xu["50%"]}`})}function jn(){let o=Be(),{column:e,columnApi:t}=Nr(),n=rn(e,o,"column-filter"),r=ct.useContext(ys),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Fr.useState)(l?.filter.value??""),d=ct.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=ct.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=ct.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Fr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${xd} ${lT}`}}function Un(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=jn();return bs.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function $i(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=jn();return bs.createElement("input",{"aria-label":o,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:n})}var qt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function np(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...qt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...qt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...qt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...qt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...qt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...qt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...qt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...qt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var No=np({StringFilterEditor:Un,NumberFilterEditor:$i,icons:{includes:ud,eq:pd,neq:yd,startsWith:Sd,endsWith:dd,gt:md,gte:fd,lt:hd,lte:gd}});function Yi(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Zn=require("react"),Bp=require("react-dom");function Lo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function rp(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var oe={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var qi="true",ge={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)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},ip="column-header-height";var ap=`.${ze.rootClassName}`;function Ts(o){return Lo(o,ap)}var lp=te(oe.scrollLeft),sT=te(oe.scrollTop),cT=te(oe.columnWidthAtIndex),Cs=te(oe.columnOffsetAtIndex),sp=te(oe.columnReorderEffectDurationAtIndex),uT=te(oe.columnOffsetAtIndexWhileReordering),dT=te(oe.columnVisibilityAtIndex),pT=te(oe.columnZIndexAtIndex);function Xt(o,e,t){let n=t?Ts(t):document.querySelector(ap);fT(o,e,n)}function fT(o,e,t){if(t){let n=o,r=oe[n]?te(oe[n]):o;t.style.setProperty(r,`${e}`)}}function $n(o,e){if(e)for(var t in o){let n=oe[t]?te(oe[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function ws(o,e,t){Xt(`${Cs}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${lp}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Rs(o,e,t){Xt(`${pT}-${o}`,`${e}`,t)}function Lr(o,e,t){Xt(`${uT}-${o}`,typeof e=="number"?`calc( var(${Cs}-${o}) + ${e}px )`:e,t)}function kr(o,e,t){Xt(`${dT}-${o}`,e,t)}function Xi(o,e,t){Xt(`${sp}-${o}`,t??"",e)}function Is(o,e){let t=`${sp}-${o}`;Xt(t,ge.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${cT}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Cs}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(o),e,t)}}};function cp(o,e){$n({[lp]:`${o.scrollLeft}px`,[sT]:`${o.scrollTop}px`},e)}var up="_16lm1iw1",dp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",pp="_1yeub2vs",fp="_1yeub2vr",mp=Se({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var vs="_1yeub2vp";var yE=Se({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Rp=require("react");var zr={bodyWidth:{name:te(ge.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:te(ge.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:te(ge.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:te(ge.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:te(ge.runtime.browserScrollbarWidth),value:""}},mT=te(oe.scrollbarWidthHorizontal),gp=te(oe.scrollbarWidthVertical),gT=te(oe.columnWidthAtIndex),hT=te(oe.columnZIndexAtIndex),hp=te(oe.scrollLeft),yT=te(oe.activeCellColWidth),yp=te(oe.activeCellColOffset),Cp=te(oe.baseZIndexForCells),ST=te(oe.pinnedStartWidth),Sp=te(oe.bodyWidth),bT=te(oe.bodyHeight),bp=te(oe.pinnedEndOffset),Tp=te(oe.pinnedEndWidth),TT=te(oe.computedVisibleColumnsCount);function Zi(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Cp}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function wp(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:c,scrollbars:u}=o,d=Yt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${hp}) )`:g.computedPinned==="end"?`calc( var(${bp}) ${p.length?"+":""} ${p.map(S=>Ie.columnWidths.get(S.computedVisibleIndex)).join(" + ")} + var(${hp}) )`:`${g.computedOffset}px`;let y=Zi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${hT}-${h}`]=`${y}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[zr.browserScrollbarWidth.name]=`${Yt()}px`),f[zr.bodyWidth.name]=`calc(${oe.bodyWidth} - ${oe.scrollbarWidthVertical})`,f[zr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[zr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${gT}-${g})`).join(" + ")})`,f[zr.visibleColumnsCount.name]=e.length,s!=null){f[yT]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(c.isHorizontalLayoutBrain){let g=c.getPageIndexForRow(s[0]);f[yp]=g?`calc( ${ge.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[yp]=m}return f[TT]=e.length,f[mT]=u.horizontal?`${d}px`:"0px",f[gp]=u.vertical?`${d}px`:"0px",f[ST]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Tp]="calc( "+n.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Cp]=e.length*10,f[bp]=`calc( var(${Sp}) - var(${Tp}) - var(${gp}) )`,f[Sp]=`${l.width}px`,f[bT]=`${l.height}px`,f}var Ps=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Ip(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:c,onSelfBlur:u,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:b,focusedClassName:C,focusedWithinClassName:w,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:D,focusedWithinStyle:I,brain:M}=re(O=>{let{state:H,computed:W}=O;return{brain:H.brain,actions:O.actions,getState:O.getState,focused:H.focused,focusedWithin:H.focusedWithin,domRef:H.domRef,scrollerDOMRef:H.scrollerDOMRef,onBlurWithin:H.onBlurWithin,onFocusWithin:H.onFocusWithin,onSelfFocus:H.onSelfFocus,onSelfBlur:H.onSelfBlur,bodySize:H.bodySize,activeCellIndex:H.activeCellIndex,wrapRowsHorizontally:H.wrapRowsHorizontally,computedPinnedStartColumnsWidth:W.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:W.computedPinnedEndColumnsWidth,computedPinnedStartColumns:W.computedPinnedStartColumns,computedPinnedEndColumns:W.computedPinnedEndColumns,computedVisibleColumns:W.computedVisibleColumns,computedUnpinnedColumnsWidth:W.computedUnpinnedColumnsWidth,scrollbars:W.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:W.computedPinnedStartOverflow,computedPinnedEndOverflow:W.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),E=(0,Rp.useMemo)(()=>wp({computedVisibleColumns:S,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:M,scrollbars:b}),[S,h,y,m,g,T,d,p,M,b]),x=Ps(O=>{e.focused=O}),P=Ps(O=>{e.focusedWithin=O}),F={...o,onFocus:O=>{if(o?.onFocus?.(O),O.target===i.current||O.target===a.current){if(t().focused)return;x(!0),c?.(O),r&&(P(!1),l?.(O));return}r||(P(!0),s?.(O))},onBlur:O=>{if(o?.onBlur?.(O),O.target===i.current||O.target===a.current){if(!t().focused)return;x(!1),u?.(O),r&&(P(!1),l?.(O));return}i.current?.contains(O.relatedTarget)||(P(!1),l?.(O))}},k=J(Zt,dp,f?`${Zt}--horizontal-layout`:null,F?.className,m?`${Zt}--has-pinned-start ${fp}`:null,g?`${Zt}--has-pinned-end ${pp}`:null,n?`${Zt}--focused`:null,r?`${Zt}--focused-within`:null,n&&C?C:null,r&&w?w:null,R?`${Zt}--has-pinned-start-overflow`:null,v?`${Zt}--has-pinned-end-overflow`:null,mp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return F.className=k,F.style={...o?.style,...E},n&&D&&Object.assign(F.style,D),r&&I&&Object.assign(F.style,I),F}var Fp=B(an());function Qi(o){return o.map(e=>e instanceof ko?e:new ko(null,[e]))}var ko=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>CT(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function CT(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var wT=(...o)=>new ko("+",Qi(o)),Pp=(...o)=>new ko("-",Qi(o)),RT=(...o)=>new ko("*",Qi(o)),IT=(...o)=>new ko("/",Qi(o)),Vr={add:wT,subtract:Pp,minus:Pp,multiply:RT,divide:IT};var ln=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var He=Ee().requestAnimationFrame||(o=>setTimeout(o,16)),Ht=Ee().cancelAnimationFrame||(o=>clearTimeout(o));var Dp=o=>{let e=null,t=null;return{stop(){e!==null&&Ht(e),t!=null&&Ht(t)},scroll(n){e!==null&&Ht(e),t!=null&&Ht(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=He(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=He(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var je=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(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,n=e.left-this.left;return{top:t,left:n}}};function xp(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Ep(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function vT(o,e,t){let n=xp(o,t),r=xp(e,t);return n===r?Ep(t,e)-Ep(t,o):n-r}function Mp(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>vT(n,r,t)),e}function PT(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function DT(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=Mp(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function Ap(o,e){if(PT(o))return DT(o,e);o=Mp(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(xT([t,i,a],e))return!0}return!1}function xT(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Yn=class{containsPoint(e){return Ap(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var qn=class o extends Yn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function ET(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Pe({top:n,left:t,width:a-t,height:c-n})}var Pe=class o extends Yn{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 o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=ET(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new qn(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}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Ds;function MT(){if(typeof document>"u"||!document.body)return 1/0;let o=document.createElement("div");o.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(o);let e=n=>(o.style.height=`${n}px`,Math.abs(o.getBoundingClientRect().height-n)<1),t=1e6;if(!e(t))return o.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return o.remove(),t}function Ji(){return Ds===void 0&&(Ds=MT()),Ds}function ea(o){return o<=4e6?!1:o>Ji()}function xs(o,e){if(!ea(o))return 1;let t=Ji()-e,n=o-e;return t>0&&n>0?n/t:1}function _p(o){let e=null;return{get value(){let t=o.getScrollPosition(),n=o.getScrollRatio();return n>1&&e!==null&&Math.abs(e-t)<=n?e:(e=null,t)},set value(t){e=t,o.setScrollPosition(t)}}}function Es(o,e,t=Math.floor){return Math.abs(o-e)<=1e6?e:t(o)}var Op=10,AT=te(oe.pinnedStartWidth);function Np(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:y,pageWidth:S}=o;function T(j){let X=j==="start"?k:O;return A===F?X:F===j?X+x.computedWidth:A===j?X-x.computedWidth:X}function b(j){if(j.columnIndex===P||y!=null)return!0;let X=e[j.columnIndex];if(X.computedPinned)return!0;let U=l.getScrollPosition().scrollLeft,Q=X.computedOffset+(y!=null&&S!=null?S*y:0);return Q>=U+T("start")&&Q+X.computedWidth<=U+u.width-T("end")}let C=(j,X)=>{let{restrictToParentGroup:U,dragColumn:Q}=X,ae=[];if(j.forEach(ue=>{if(ue.computedVisibleIndex===P)return;let L={columnId:ue.id,columnIndex:ue.computedVisibleIndex,offsetX:ue.computedOffset+Math.round(ue.computedWidth/2)};b(L)&&ae.push(L)}),U){let L=function(me,Ae,ve){let be=j[me];be&&(be.columnGroup!==Q.columnGroup&&ve.add(be.id),L(me+Ae,Ae,ve))};var he=L;let ue=Q.computedVisibleIndex,N=new Set;L(ue-1,-1,N),L(ue+1,1,N),ae=ae.filter(me=>!N.has(me.columnId))}return ae},R=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},D={left:v.clientX-u.left-(v.clientX-s.left)+Op,top:v.clientY-u.top-(v.clientY-s.top)+Op},I=l.getScrollPosition(),M=e.map(j=>j.computedVisibleIndex),E=M,x=t.get(i),P=x.computedVisibleIndex,A=x?.computedPinned,_=P,F=A,k=l.getFixedStartColsWidth(),O=l.getFixedEndColsWidth(),H=v,W={x:0,y:0},z=1,ee=0;function V(j){let X=Math.round(j.clientX),U=Math.round(j.clientY);if(X===H.clientX&&U===H.clientY)return Pe.from(s).shift({left:W.x,top:W.y});H={clientX:X,clientY:U};let ae=l.getScrollPosition().scrollLeft-I.scrollLeft;return W.x=H.clientX-v.clientX,W.y=H.clientY-v.clientY,ee=W.x+ae,z=ee<0?-1:1,f({left:D.left+W.x,top:D.top+W.y}),Pe.from(s).shift({left:W.x,top:W.y})}function $(j){let X=0;A?A==="start"&&j.forEach((U,Q)=>{X||e[U]?.computedPinned!=="start"&&(X=Q)}):j.forEach((U,Q)=>{e[U]?.computedPinned==="start"&&(X=Q+1)}),R=X,ie("start",j,X)}function ie(j,X,U){if(j==="start"){let Q=0;for(let ae=0;ae<U;ae++){let he=X[ae],ue=e[he];Q+=ue.computedWidth}Xt(AT,`${Q}px`,a)}}function fe(j){if(j==null||j===_)return;if(_===-1&&j!==-1&&(kr(P,"",a),m(!1)),_=j,j===-1){se(P);return}let X=ln(M,P,_>P?_-1:_);R=0;let Q=new Set;return X.forEach((ae,he)=>{let ue=E[he];ae!==ue&&Q.add(ae),$(X)}),E=X,le(Q),{newColumnIndexes:X,indexesWithTransition:Q,pinnedStartCount:R}}function se(j){E=E.filter(U=>U!==j),e.forEach(U=>{let Q=U.computedVisibleIndex,ae=Q>j;Is(Q,a);let he="";ae&&(he=Vr.minus(Ie.columnOffsets.get(Q),Ie.columnWidths.get(j)).done()),Lr(Q,he,a)}),kr(j,"hidden",a),m(!0)}function le(j){e.forEach(X=>{let U=X.computedVisibleIndex;j.has(U)?Is(U,a):Xi(U,a);let Q=U===P,ae=z===-1?U<_||U>P:U<P||U>=_,he="";z===-1?he=Q?Ie.columnOffsets.get(_):ae?Ie.columnOffsets.get(U):Vr.add(Ie.columnOffsets.get(U),Ie.columnWidths.get(P)).done():he=ae?Ie.columnOffsets.get(U):Q?Vr.add(Ie.columnOffsets.get(_-1),Ie.columnWidths.get(_-1)).minus(Ie.columnWidths.get(P)).done():Vr.minus(Ie.columnOffsets.get(U),Ie.columnWidths.get(P)).done(),Lr(U,he,a)})}let pe=u.left+T("start"),ce=u.right-T("end"),Y=Dp({scrollOffsetStart:pe,scrollOffsetEnd:ce}),q=_p({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:j=>{h.scrollLeft=j},getScrollRatio:()=>l.getScrollRatio("horizontal")});return V(v),{speedScroller:Y,stop(){Y.stop()},onMove(j){let X=V(j);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(X.getCenter()))return p&&fe(-1),null;Y.scroll({mousePosition:H,get scrollLeft(){return q.value},set scrollLeft(L){q.value=L}});let U=C(e,{dragColumn:x,restrictToParentGroup:c==="group"}),Q=z===-1?x.computedOffset+ee:x.computedOffset+x.computedWidth+ee,ae=(0,Fp.default)(U,Q,({offsetX:L},N)=>L<N?-1:L>N?1:0);ae<0&&(ae=~ae),U.length?ae=U[ae]?U[ae].columnIndex:U[U.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ae=0),ae===P+1&&(ae=P),fe(ae);let he={};n.forEach(L=>{he[L.id]="end"});for(let L=0;L<R;L++){let N=E[L],me=e[N];he[me.id]="start"}let ue=E.map(L=>e[L].id);return{columnPinning:he,columnOrder:ue}}}}function Ms(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;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 n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}return e}var wt=B(require("react"));var sn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Lp=B(an());var kp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=je.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,y=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),S=(0,Lp.default)(h,y,(R,v)=>R-v);S<0&&(S=~S),m===1&&S===u+1&&p&&S--;let T=Math.min(u,S),b=Math.max(u,S),C=p?i.map((R,v)=>{if(v===u&&p)return t;if(v<T||v>=b)return{left:0,top:0};let D=S<=v?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((R,v)=>{let D=S<=v?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),w={offset:t,dropIndex:S,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(w)?{event:w,error:null,success:!0}:(w.status="rejected",{event:w,error:"rejected by interaction target",success:!1})},zp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=je.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((y,S)=>y.id===c.id?t:f?{left:0,top:0}:S>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(y=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var De=class De{static startDrag(e,t){let n=e instanceof Xn?e:new Xn(e),r=new As({activeDragSource:n,startPoint:t});return De.currentDragOperation=r,r.on("start",De.onDragStart),r.on("move",De.onDragMove),r.on("drop",De.onDragDrop),r.start(),r}static retriggerMove(){let e=De.currentDragOperation;e&&e.phase==="move"&&De.onDragMove(e)}static emit(e,...t){De.emitter.emit(e,...t)}static on(e,t){return De.emitter.on(e,t)}static registerDragInteractionTarget(e){if(De.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return De.dragInteractionTargetsMap.set(e.listId,e),De.emit("register",e),()=>{De.unregisterDragInteractionTarget(e)}}static unregisterAll(){De.dragInteractionTargetsMap.forEach(e=>{De.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!De.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}De.dragInteractionTargetsMap.delete(e.listId),e.unregister(),De.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=De.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;De.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),De.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=De.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(De.dragInteractionTargetsMap.get(r))),De.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=kp(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=zp(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];De.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;De.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];De.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;De.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),De.currentDragOperation=null,De.unregisterAll()}};De.dragInteractionTargetsMap=new Map,De.currentDragOperation=null,De.emitter=new sn;var Ct=De,Xn=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){Tt(this.data,e)||(this.data=e,this.dragRectangle=new Pe(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Pe.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},As=class extends sn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Xn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Xn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Ct;var Vp=require("react"),Gp=wt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),po=()=>wt.useContext(Gp),ta=o=>{let[e,t]=wt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=wt.useRef(e);n.current=e;let r=wt.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=wt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Vp.useEffect)(()=>{let a=Ct.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=Ct.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=Ct.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[Ct,t]),wt.createElement(Gp.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var _s=`${gt}Body`,Hp=o=>o.querySelector(`.${_s}`);var cn=`${gt}HeaderCell`,Os=`${gt}HeaderWrapper`,Kp=o=>Array.from(o.querySelectorAll(`.${Os}`));function Gr(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var _T=te(oe.baseZIndexForCells),OT=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:Tt(o,e)},Wp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Zn.useState)(null),[a,l]=(0,Zn.useState)(!1),{getCurrentDragSourceAndTarget:s}=po(),{getComputed:c,getState:u,api:d,computedDraggable:p,rootRef:f,actions:m}=re(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),g=(0,Zn.useCallback)(y=>{let S=c().computedVisibleColumnsMap.get(o);if(!S||!S.computedSortable)return;let{multiSortBehavior:T}=u();d.toggleSortingForColumn(o,{multiSortBehavior:T==="replace"&&(y.ctrlKey||y.metaKey)?"append":T})},[]),h=(0,Zn.useCallback)(y=>{if(Gr(y.target))return;let{brain:S,draggableColumnsRestrictTo:T}=u(),{computedVisibleColumns:b,computedVisibleColumnsMap:C,computedPinnedStartColumns:w,computedUnpinnedColumns:R,computedPinnedEndColumns:v}=c(),D=C.get(o);if(!D.computedDraggable){g(y);return}let I=e.current,M=I.getBoundingClientRect(),E=f.current.getBoundingClientRect(),x=S.getAvailableSize(),P=D.computedVisibleIndex,A=S.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),_=S.isHorizontalLayoutBrain?S.getPageWidth():null,F=I.style.cursor??"auto",k=!1,O=f.current,H=Pe.from(Hp(O).getBoundingClientRect()),W=Kp(O).map(pe=>Pe.from(pe.getBoundingClientRect())),z=H.getMinimumBoundingRectangle(...W),ee=Np({brain:S,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:_,draggableColumnsRestrictTo:T,computedPinnedEndColumns:v,computedPinnedStartColumns:w,computedUnpinnedColumns:R,computedVisibleColumns:b,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:E,acceptDropToReorderRect:z,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),V=null,$,ie;function fe(pe){let{columnPinning:ce,columnOrder:Y}=pe;OT(u().columnPinning,ce)||(m.columnPinning=ce);let q=c().computedColumnOrder;JSON.stringify(Y,q)&&(m.columnOrder=Ms({newColumnOrder:Y,visibleColumnOrder:c().computedVisibleColumns.map(j=>j.id),existingColumnOrder:q,dragColumnId:o}))}let se=pe=>{let{headerBrain:ce,brain:Y}=u();if(!k){k=!0;let q=Y.keepColumnRendered(A),j=ce.keepColumnRendered(A);if(Y.isHorizontalLayoutBrain){let U=Y.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),Q=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{U(),Q()}}$=()=>{q(),j()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),Rs(P,`calc( var(${_T}) + 10000 )`,f.current),f.current?.classList.add(vs),I.style.cursor="grabbing"}V=ee.onMove(pe)},le=pe=>{let ce=pe.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:Y}=u(),q=f.current;q?.classList.remove(vs),ee.stop(),S.update({...x}),$?.(),ie?.(),I.style.cursor=F,I.hasPointerCapture?.(ce)&&I.releasePointerCapture(ce),I.removeEventListener("pointermove",se),I.removeEventListener("pointerup",le),i(null);let j=d.getColumnApi(D.id)?.isSortable()??!1;!k&&j&&d.toggleSortingForColumn(D.id,{multiSortBehavior:Y==="replace"&&(pe.ctrlKey||pe.metaKey)?"append":Y}),(0,Bp.flushSync)(()=>{V?fe(V):k&&n&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),b.forEach(X=>{Xi(X.computedVisibleIndex,q),kr(X.computedVisibleIndex,"",q),Lr(X.computedVisibleIndex,"",q)}),Rs(P,Zi(D,{pinnedStartColsCount:w.length,visibleColsCount:b.length}),q)})};I.addEventListener("pointermove",se),I.addEventListener("pointerup",le),I.setPointerCapture(y.pointerId)},[o,t]);return{onPointerDown:p?h:g,dragColumnOutside:a,proxyPosition:r}};var nr=B(require("react"));var we=B(require("react")),Le=require("react");var Up=Symbol("REPAINT_CELLS_KEY_NO_ROW");function $p(o){return typeof o=="function"}function jp(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return Up;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function Yp(o,e,t){let n=jp(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=jp(o,e);r!==Up&&(Object.is(r,n)||(n=r,t()))})}var qp="_1eexc2a7 _1eexc2a6",Xp=Se({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Zp=Se({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Qp="_1eexc2a5",oa=Se({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Qn="_1eexc2a8";var na=B(require("react")),ra=require("react");var Jp="qz8ht90 _16lm1iwk";function FT(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:NT}=Lt({forwardProps:FT,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function LT(){let{componentState:o,componentActions:e}=kt(),{checked:t,domProps:n,disabled:r}=o,i=(0,ra.useRef)(null);return(0,ra.useEffect)(()=>{i.current.indeterminate=t==null},[t]),na.createElement("input",{...n,className:J("InfiniteCheckBox",Jp,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function zo(o){return na.createElement(NT,{...o},na.createElement(LT,null))}var kT="*",Ue=class{constructor(e){this.wildcard=kT;this.cache=new Z;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.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 c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.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(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.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 u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){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(n){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,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){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(n){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,n=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)}),n&&n.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 n=this.selectedRowsToColumns.get(e);if(n){if(n.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=>n.has(r)):!1}return!1}error(e){xo(`${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 n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=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)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Vo(o,e){return e().dataArray[o]}function ia(o){return o().dataArray}var ut=class{constructor(e){this.collapsedPathsMap=new Z;this.expandedPathsMap=new Z;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:n,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)?n.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)?n.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,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Fs=o=>Array.isArray(o)?new Z(o.map(e=>[e,!0])):o,zT=(o,e)=>o.length-e.length,Qe=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new Z;this.cache=new Z;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new Z})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Fs(e):this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Fs(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?Fs(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:n,treePaths:r}=this.config;return t!=="visible"||!n||n===r?!1:n.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:n,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{n.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}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 n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)!==!1){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.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(zT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!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,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),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:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function er(o,e){return new Qe(o,Jn(e))}function Jn(o){return()=>{let e=typeof o=="function"?o():o,{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}:{treePaths:n??t,multiRowSelectionTarget:r}}}var aa=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.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 Qe))throw"Invalid tree selection";let a=new Qe(r,Jn(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ut({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ut({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 n=this.getState(),r=new ut(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ut(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ut(n.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?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Vo(n,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 Qe))throw"Invalid node selection";let n=new Qe(e,Jn(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Qe))throw"Invalid node selection";let n=new Qe(e,Jn(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Qe))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)}};function Ns(o){return o.map(Qt)}function Qt(o){if(Ee().structuredClone)return Ee().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ns(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ns(Array.from(o)));if(o instanceof Map)return new Map(Ns(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Qt(o[t]));return e}function Hr(o){return o}var la="____not_loaded_yet____";function Ls(o){return typeof o=="string"&&o.startsWith(la)}var un=Object.seal({data:null,field:null});var Rt="____root____";function Go(){return!1}function ks(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function sa(o,e,t,n,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=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function tf(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=o;t&&t.start();let u=new Z;function d(y,S,T,b=0,C=[]){let w=!T.length||b===T.length-1,R=S[c?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let D=v;C.push(D),p.set(C,!0),y.set(C,{reducerResults:R[v][c?.totals||"totals"]||{},items:[]}),w||d(y,R[v],T,b+1,C),C.pop()}}let p=r?new Z:void 0,f=[],m=ks(n),g=Qt(m);e.visitDepthFirst((y,S,T,b)=>{let[C,...w]=S,R=y.children,v=u.get(w);if(v&&(v.cache=y.cache,v.childrenLoading=y.childrenLoading,v.childrenAvailable=y.childrenAvailable,v.error=y.error),w.length==i.length&&i.length){if(v){v.items=R;for(let I=0,M=w.length;I<M;I++){let E=w.slice(0,I),x=u.get(E);x&&(x.items=x.items||[],x.items=x.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let D=0,I=R.length;D<I;D++){if(!R[D]){let P={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...w,`${la}${D}`],P);continue}let M=R[D].data,E=R[D].keys||[];if(E.length){let P=E[E.length-1];w.push(P)}let x={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:R[D].totalChildrenCount,totalChildrenCountUnfiltered:R[D].totalChildrenCountUnfiltered,reducerResults:R[D].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(w,x),r){let P=x.pivotDeepMap=new Z,A=R[D].pivot;d(P,A,r,0,f)}E.length&&w.pop()}b?.()});let h={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(y=>y.field).join(", ")}]}),h}function ef(o,e,t,n,r,i,a,l,s,c=Hr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&sa(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:y}=i[f],S=g?n[g]:null;h&&(un.data=n,un.field=g,S=h(un));let T=(y||c)(S,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Qt(s),items:[]}));let{reducerResults:b,items:C}=p.get(t);C.push(n),a&&sa(n,r,a,b,e)}t.length=0}}function of(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let y=0,S=n.length;y<=S;y++){let T=n.slice(0,y),b=e.get(T),{reducerResults:C,items:w}=b;w.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&sa(r,i,a,C,T)}return}let m=Qt(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let y=0,S=h.length;y<S;y++){let T=h[y];of(o,e,t,p,T,y,a,l)}a&&Kr(a,m,g)}}function zs(o,e){let{reducers:t,marker:n}=o;if(n){let c=Object.keys(t??{});n.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=ks(t),i=Qt(r),a=new Z,l=new Z;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)of(o,a,l,[],e[c],c,t,r);t&&Kr(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function ua(o,e){let{marker:t,groupBy:n,defaultToKey:r=Hr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new Z:void 0,c=new Z,u=[],d=[],p=ks(a),f=Qt(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Qt(p)};i&&(g.pivotDeepMap=new Z),c.set(u,g)}for(let g=0,h=e.length;g<h;g++){let y=e[g],S={};for(let T=0;T<l;T++){let{field:b,groupField:C,valueGetter:w,toKey:R}=n[T],v=b?y[b]:null;w&&(un.data=y,un.field=b,v=w(un));let D=(R||r)(v,y);if(S[b||C]=D,u.push(D),!c.has(u)){let I={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...S},childrenLoading:!1,childrenAvailable:!1,reducerResults:Qt(p)};i&&(I.pivotDeepMap=new Z),c.set(u,I)}ef(c,u,d,y,g,i,a,s,p,r)}l||ef(c,u,d,y,g,i,a,s,p,r),a&&sa(y,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,h,y,S)=>{Kr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:b},C,w,R)=>{Kr(a,b,T),R?.()}),S?.()}),Kr(a,f,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function nf(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function VT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let S in i)if(i.hasOwnProperty(S)){let b=i[S].field;b&&(f[b]=c[S]),b&&p[b]==null&&(p[b]=c[S])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let S=t[n.length-1];S&&S.field&&(h=p[S.field]),S&&S.toKey&&(h=S.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(la)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function ca(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Kr(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function rf(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:y}=r,{deepMap:S}=u,T=o.length,b=t[t.length-1],C=b?b.nodeExpanded:!0;for(let w=0;w<T;w++){let R=o[w],v=c(R,w),D=[...e,v];if(l(R)){let _={id:v,nodePath:D,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,w],indexInParent:w,indexInAll:C?i.length:-1};p&&(_.rowSelected=p(_)),d&&(_.rowDisabled=d(_)),f&&f(_);let F=h&&y!=null&&y>0&&_.indexInAll%y===0?_.indexInAll/y:null;for(let k=0,O=t.length;k<O;k++){let H=t[k];if(C||(H.collapsedLeafNodesCount+=1),H.deepRowInfoArray.push(_),F!=null&&C){if(typeof h=="function"&&h(H)!==!0)continue;let W=ca(H,_.indexInAll,F);i[W.indexInAll]=W,_.indexInAll++}}C&&(i[_.indexInAll]=_);continue}let E=S.get(D)?.totalLeafNodesCount??0,x={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:v,data:R,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...n,w],totalLeafNodesCount:E,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(x.rowSelected=p(x),g)){let _=g.getSelectionCountFor(x.nodePath);x.selectedLeafNodesCount=_.selectedCount,x.deselectedLeafNodesCount=_.deselectedCount}d&&(x.rowDisabled=d(x)),f&&f(x);let P=!0;if(m&&(x.selfExpanded=P=m(x)),C||(P=!1),x.nodeExpanded=P,C&&h&&y!=null&&y>0){let _=x.indexInAll,F=x.parentNodes;if(F.length>0&&_%y===0){let k=_/y,O=0;F.forEach(H=>{typeof h=="function"&&h(H)!==!0||(i.push(ca(H,_+O,k)),O++,x.indexInAll++)})}}C&&(i[x.indexInAll]=x);let A=s(R);Array.isArray(A)&&rf(A,D,[...t,x],x.indexInParentNodes,r,i)}return i}function af(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return rf(e,[],[],[],o,n),t&&t.end(),{data:n}}function lf(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:y}=m;e&&e.start({details:[{name:"Group by fields",value:y.map(w=>w.field).join(", ")}]});let S=[],T=[],b=[],C=[];return g.visitDepthFirst((w,R,v,D)=>{let I=w.items,M=R.length,E=s?.isGroupRowCollapsed(R)??!1;C.push(v);let x=VT({lazyLoad:t,groupBy:y,parents:Array.from(b),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:S.length,groupKeys:R,error:w.error,totalChildrenCount:w.totalChildrenCount,childrenLoading:(w.childrenLoading||!E&&!w.childrenAvailable)&&t,childrenAvailable:w.childrenAvailable,directChildrenCount:R.length===y.length?w.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},w);if(u&&(x.rowSelected=u(x),d)){let k=d.getSelectionCountFor(x.groupKeys);x.selectedChildredCount=k.selectedCount,x.deselectedChildredCount=k.deselectedCount}c&&(x.rowDisabled=c(x));let P=b[b.length-1],A=P?.collapsed??!1;A&&(E=!0),x.collapsed=E;let _=p||E;if(A&&(_=!1),_){if(i&&r!=null&&r>0){let k=x.indexInAll,O=x.parents;if(O.length>0&&k%r===0){let H=k/r,W=0;O.forEach(z=>{typeof i=="function"&&i(z)!==!0||(S.push(ca(z,k+W,H)),W++,x.indexInAll++)})}}S.push(x),T.push(S.length-1)}x.collapsedChildrenCount=0,b.forEach(k=>{k.deepRowInfoArray.push(x),k.collapsedGroupsCount+=E?1:0}),P&&x.selfLoaded&&t&&(P.directChildrenLoadedCount+=1),a&&a(x),b.push(x);let F=!0;if(F){if(D)D();else if(!h){let k=S.length;E||(S.length+=I.length);let O=0;for(let H=0,W=I.length;H<W;H++){let z=I[H];if(!E&&i&&r!=null&&r>0){let ie=k+H+O;if(ie%r===0){let fe=ie/r;b.forEach(se=>{if(typeof i=="function"&&i(se)!==!0)return;let le=k+H+O;S[le]=ca(se,le,fe),O++,S.length++})}}let ee=k+H+O,$={id:z?l(z,ee):`${R}-${H}`,data:z,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!z,rowSelected:!1,rowDisabled:!1,rootGroupBy:y,collapsed:E,groupKeys:R,parents:Array.from(b),indexInParentGroups:[...C,H],indexInGroup:H,indexInAll:ee,groupBy:y,groupNesting:M+1,groupCount:x.groupCount};u&&($.rowSelected=u($)),c&&($.rowDisabled=c($)),a&&a($),b.forEach((ie,fe)=>{fe===b.length-1&&z&&(ie.directChildrenLoadedCount+=1),E&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push($)}),E||(S[k+H+O]=$)}}}b.pop(),C.pop()}),e&&e.end(),{data:S,groupRowsIndexes:T}}function Ho(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Hr)(l,o);return t.push(s),t},[])}var GT=new Z,sf=new WeakMap;function da(o){let{originalDataArray:e,groupBy:t,toPrimaryKey:n}=o;if(!e||!t.length)return GT;let r=sf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new Z,a=t.length,l=[];return e.forEach(s=>{let c=Ho(s,t);l.length=0;for(let u=0;u<c.length;u++){l.push(c[u]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(n(s))}}),sf.set(e,{groupBy:t,groups:i}),i}function HT(o,e){let t=[];return o.getLeafNodesStartingWith(e,n=>{let r=n.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var _e=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new Z;this.deselectedMap=new Z;this.onlyUsePrimaryKeys=!1;this.selectionCache=new Z;this.selectionCountCache=new Z;this.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Ho(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:n}=this.getConfig();return e.length?n?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?da(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:n,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Ho(l,n),c=r(l),u=[...s,c];a.delete(u),this.isRowSelected(c,s)!==t&&i.set(u,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(n?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new Z;this.selectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new Z;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let n=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,n??null),n}computeLazyRowCount(e){let t=this.getConfig(),n=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!n)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===n)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,c)=>s+(Ls(c[c.length-1])?1:this.getLazyRowCount(c)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new Z;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let n=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,n),n}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),n=e.length?t?.get(e):void 0;return e.length&&!n?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Ls(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new Z;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:n,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?n?.get(e):void 0,s=l?l.items:r??[],c=l?l.totalChildrenCount:a,u=new Set,d=c==null||s.length>=c;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:u.add(i(f))}t={primaryKeys:u,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),n=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>n?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let c=this.getLazyRowCount(e),u=c===void 0?1:Math.max(c-l-s,0);t?l+=u:s+=u;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return da(this.getConfig()).get(e)?.count??0;let n=this.getGroupDeepMap()?.get(e);return n?this.getLazyUnfilteredCount(e)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?da(t).getKeysStartingWith(e,n):t.groupDeepMap?.getKeysStartingWith(e,n)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:n,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?HT(da(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=n?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}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(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!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(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!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}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!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)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!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)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),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 n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),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 n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:c}=this.getConfig(),u=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(c(f),e)?u++:d++});let p={selectedCount:u,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 c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function tr(o,e){return new _e(o,dt(e))}function dt(o){return()=>{let e=typeof o=="function"?o():o,{originalDataArray:t,postFilterDataArray:n}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([Rt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!n&&n.length<t.length,originalDataArray:t,postFilterDataArray:n}}}function cf(o){let{getDataSourceState:e,dataSourceActions:t}=o;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 _e))throw"Invalid row selection";let a=new _e(r,dt(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 _e))throw"Invalid row selection";let a=new _e(r,dt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=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 _e))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Ho(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=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 _e))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new _e(a,dt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=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 _e))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new _e(l,dt(e));u.deselectRow(r,i),t.rowSelection=u}},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 _e))throw"Invalid row selection";let s=new _e(a,dt(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 _e))throw"Invalid row selection";let s=new _e(a,dt(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 _e))throw"Invalid row selection";let s=new _e(a,dt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new _e(i,dt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof _e))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new _e(r,dt(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 c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}function uf(o,e){pa(o,e),BT(o,e),e.detail===2&&KT(o,e),o.getState().onCellClick?.(o,e)}function KT(o,e){if(Gr(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function BT(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,y=new Ue(u);y.debugId=m??"",d.cellSelectionState=y;let S={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(S);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(S,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:T})}else d.resetClick(S);l.cellSelection=y}function WT(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function jT(o){return o?Gr(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${Qn}, [data-name="expand-collapse-icon"]`):!1}function pa(o,e,t=e.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:c,cloneTreeSelection:u}=o,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&jT(e.target))return!1;let h=m[n];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:y}=p;if(y&&!y(h))return!1}if(f==="multi-row"){let y=WT(o);if(t==="click"&&y==="checkbox")return!1;let S=t==="checkbox"||t==="keyboard"&&y==="checkbox",T=()=>{e.shiftKey?d.multiSelectClick(n):S||e.metaKey||e.ctrlKey?d.singleAddClick(n):d.resetClick(n)};if(g){let{treeSelectionState:C}=p;if(!(C instanceof Qe))return!1;let w=u(C);d.treeSelectionState=w,T(),d.treeSelectionState=void 0;let R=!e.shiftKey&&(S||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=R?{nodePath:h.nodePath,selected:!!w.isNodeSelected(h.nodePath)}:null),a.treeSelection=w,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=c(b),d.rowSelectionState=b,T(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let y=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:T}=l;return y?T.toggleNodeSelection(h.nodePath):T.selectNode(h.nodePath),!0}let S=h.id;return y?s.rowSelectionApi.toggleRowSelection(S):s.rowSelectionApi.selectRow(S),!0}return!1}function df(o,e){let{getComputed:t,dataSourceActions:n,dataSourceApi:r}=o,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=o.getDataSourceState;return pa({rowIndex:e,api:o,getComputed:t,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:r,cloneRowSelection:s=>tr(s,l),cloneTreeSelection:s=>er(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Br=B(require("react")),gf=require("react");var pf="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",ff=Se({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var mf="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",i1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var fa=`${lt}-expand-collapse`;function dn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,gf.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Fo("expanded",o)||i(!r)};Br.useEffect(()=>{Fo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Br.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:J(o.className,pf,Gn.expandCollapse,ff({direction:t||"start",expanded:r,disabled:n}),`${lt}`,`${fa}`,`${fa}--${l}`,`${fa}--${t==="end"?"end":"start"}`,n?`${fa}--disabled`:"")},Br.createElement("path",{d:mf}))}function hf(o){return typeof o.field=="string"}function yf(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function Jt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",y=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:S,formattedValueContext:{rawValue:T}}=or({column:p,rowInfo:c,rowDetailState:y,columnsMap:e().computedColumnsMap,context:o}),b=ht(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:S,rawValue:T}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:S,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:y,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:S,rawValue:T}}function Sf(o){return Tf(o.column,o.rowInfo)}function bf(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=yf({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=or(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.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:u,stylingParam:d,formattedValueContext:c,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:UT({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function UT(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,y=p(),{selectionMode:S,cellSelection:T}=y,b=yf({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,w=T?.isCellSelected(n.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:S,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.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:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:C,toggleCurrentGroupRow:()=>{n.isGroupRow&&C(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function $T(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function Tf(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:hf(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&hf(o)&&(a=$T(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function YT(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,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:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function or(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Tf(e,t),a=YT(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Cf=Se({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),wf="_7pupv00",Rf=Se({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:If}=ze,fo=`${If}Cell`,Wr=`${If}Cell_content`;var{rootClassName:qT}=ze,eo=`${qT}ColumnCell`;var XT=te(oe.columnZIndexAtIndex),ZT=te(oe.columnVisibilityAtIndex);function vf({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[te(ge.components.Row.groupNesting)]:t}}function Pf({rowInfo:o}){return{[te(ge.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Vs(o,e){return o?typeof o=="function"?o(e):o:void 0}function Gs(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Df(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:c,formattedValueContext:u,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:y,rowDisabled:S,rowSelected:T,cellSelected:b,cellSelection:C,getData:w,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:D,columnReorderInPageIndex:I}=o,M=v??R.map(se=>se.id),E=D,x,P={...u,visibleColumnIds:M,allColumnIds:E,rowIndex:n,get rowHasSelectedCells(){return x===void 0&&(x=t.hasSelectedCells(M)),x}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),_=typeof f=="function"?f(P):f,F;d?.className&&(F=Vs(d.className,c)),g&&(F=J(F,Vs(g,c))),e.className&&(F=J(F,Vs(e.className,c))),A&&(F=J(F,Rf({align:l})));let k;t.dataSourceHasGrouping&&e.groupByForColumn&&(k=vf({rowInfo:t,column:e})),A&&(k=Pf({rowInfo:t})),p&&(k=typeof p=="function"?{...k,...p(P)}:{...k,...p}),m&&(k=Gs(k,m,c)),d?.style&&(k=Gs(k,d.style,c)),e.style&&(k=Gs(k,e.style,c)),k=k||{},k.height=r,k.zIndex=`var(${XT}-${e.computedVisibleIndex})`,k.visibility=`var(${ZT}-${e.computedVisibleIndex}, visible)`;let O=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,H=h?O?"odd":"even":!1,W=!1,z=!1,ee=!1,V=!1;if(C&&b){let se=w(),le=se[t.indexInAll-1],pe=se[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],Y=R[e.computedVisibleIndex-1];W=le?!C.isCellSelected(le.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?z=!0:z=Y?!C.isCellSelected(t.id,Y.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?ee=!0:ee=ce?!C.isCellSelected(t.id,ce.id):!0,V=pe?!C.isCellSelected(pe.id,e.id):!0}let $=C&&b?{top:W,left:z,right:ee,bottom:V}:null,ie=I!=null?a!==I:!1,fe=J($?Zp($):"",Yi(e,[eo,fo],Xp,{dragging:!1,insideDisabledDraggingPage:ie,zebra:H,align:l,verticalAlign:s,rowDisabled:S,rowActive:y,cellSelected:b,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),F,_);return{style:k,className:fe,cellSelectionBorders:$,zebra:H,columnIsTree:A}}var mo=B(require("react"));var QT=te(oe.columnWidthAtIndex),JT=te(oe.columnReorderEffectDurationAtIndex);function eC(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,y=typeof m=="function"?m():m,S={width:`var(${QT}-${i.computedVisibleIndex})`,transition:`transform var(${JT}-${i.computedVisibleIndex}, 0s)`,...h.style},T={...h,style:S,"data-column-id":i.id,"data-z-index":S.zIndex,className:J(h.className,fo,qp),children:mo.createElement(mo.Fragment,null,d,mo.createElement("div",{className:J(Wr,e?Gt:ed.hidden,s),style:r},y),u)};c!=null&&(T["data-row-id"]=`${c}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?mo.createElement(b,{...T,ref:a}):mo.createElement("div",{...T,ref:a})}var ma=mo.memo(eC);var fn=B(require("react")),pn=require("react");function xf(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=ga(),i=(0,pn.useRef)(null),a=(0,pn.useRef)(!1),l=fn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,pn.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):u.stopPropagation()},[]),c=(0,pn.useCallback)(()=>{a.current||t()},[]);return fn.createElement(fn.Fragment,null,fn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:J($u,Ju.none),type:"text",defaultValue:o,onChange:(0,pn.useCallback)(u=>{e(u.target.value)},[])}))}function Ef(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var jr=we.createContext(null),tC=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return we.createElement(dn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},oC={display:"inline-block",visibility:"visible"},Hs=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return we.createElement(dn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:oC,expanded:n,onChange:t})},nC=o=>{let{rowInfo:e,rowIndex:t,column:n,api:r}=o;e.isGroupRow&&n.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||zo;return we.createElement(l,{domProps:{className:Qn},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{df(r,t)},checked:e.rowSelected})};function rC(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=(0,Le.useReducer)(s=>s+1,0),l=$p(e)?e:void 0;(0,Le.useEffect)(()=>{if(l)return Yp(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function iC(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:c,cellStyle:u,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:y,onRowMouseEnter:S,onRowMouseLeave:T,rowIndex:b,rowHeight:C,columnsMap:w,fieldsToColumn:R,domRef:v,hidden:D,showZebraRows:I,getDataSourceState:M,dataSourceApi:E,dataSourceActions:x,getState:P,imperativeApi:A,componentActions:_,getComputed:F,getDataSourceMasterContext:k}=o,O=(0,Le.useSyncExternalStore)((0,Le.useCallback)(de=>t.subscribeToRowIndex(b,de),[t,b]),(0,Le.useCallback)(()=>t.getRowInfoAtIndex(b),[t,b]));rC({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:M});let H=!O,W=!g,z=we.useRef(null),ee=(0,Le.useCallback)(de=>{z.current=de,v&&v(de)},[v]),V=O??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:$}=V,ie=F(),{activeRowIndex:fe,keyboardNavigation:se,columnReorderInPageIndex:le}=P(),pe=b===fe&&se==="row",ce={getState:P,getDataSourceState:M,getDataSourceMasterContext:k,actions:_,dataSourceActions:x,api:A,dataSourceApi:E},Y=V.rowDisabled,q=bf({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:V,rowDetailState:f,columnsMap:w,visibleColumnIds:s,fieldsToColumn:R,context:ce}),{stylingParam:j,renderParams:X,formattedValueContext:U,renderFunctions:Q,groupByColumnReference:ae,inEdit:he}=q,{align:ue,verticalAlign:L}=X,N=X,me=we.useRef(N),Ae=S&&y?de=>{let Xe={...U,rowIndex:b};S(Xe,de),y(de)}:y,ve=T&&h?de=>{let Re={...U,rowIndex:b,rowInfo:V};T(Re,de),h(de)}:h,be=(0,Le.useCallback)(de=>{let Re=g.computedVisibleIndex;P().cellClick({rowIndex:b,colIndex:Re,event:de})},[b,g.computedVisibleIndex,se]),Oe=(0,Le.useCallback)(de=>{let Re=g.computedVisibleIndex;if(P().cellMouseDown({rowIndex:b,colIndex:Re,event:de}),se==="row"){Y||(_.activeRowIndex=b);return}se==="cell"&&(_.activeCellIndex=[b,Re])},[b,Y,g.computedVisibleIndex,se]),{selectionMode:Ke,cellSelection:nt,isNodeReadOnly:Je}=e,it=N.cellSelected;N.domRef=ee,N.htmlElementRef=z,N.toggleCurrentTreeNode=(0,Le.useCallback)(N.toggleCurrentTreeNode,[V]),N.selectCell=(0,Le.useCallback)(N.selectCell,[V]),N.deselectCell=(0,Le.useCallback)(N.deselectCell,[V]),N.selectCurrentRow=(0,Le.useCallback)(N.selectCurrentRow,[V]),N.deselectCurrentRow=(0,Le.useCallback)(N.deselectCurrentRow,[V]),N.toggleCurrentGroupRow=(0,Le.useCallback)(N.toggleCurrentGroupRow,[V]),N.toggleCurrentRowSelection=(0,Le.useCallback)(N.toggleCurrentRowSelection,[V]),N.toggleCurrentGroupRowSelection=(0,Le.useCallback)(N.toggleCurrentGroupRowSelection,[V]),N.toggleCurrentTreeNodeSelection=(0,Le.useCallback)(N.toggleCurrentTreeNodeSelection,[V]);let et=g.components?.Editor??xf,qe=he?we.createElement(Af,{contextValue:N},we.createElement(et,null)):null,K=(0,Le.useCallback)(mt(()=>{if(D||he)return null;if(me.current=N,Q.renderGroupIcon&&(N.renderBag.groupIcon=we.createElement(It,{render:Q.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),Q.renderSelectionCheckBox&&Ke=="multi-row"&&(N.renderBag.selectionCheckBox=we.createElement(It,{render:nC,renderParam:N}),Q.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=we.createElement(It,{render:Q.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),V.isTreeNode){let{isParentNode:Xe}=V,Po;Po=(Xe?Q.renderTreeIconForParentNode:Q.renderTreeIconForLeafNode)||typeof Q.renderTreeIcon=="function"?Q.renderTreeIcon:Xe&&Q.renderTreeIcon===!0?Hs:void 0,Po===!0?Po=Hs:Po&&(N.renderBag.treeIcon=we.createElement(It,{render:Hs,renderParam:N})),Po&&(N.renderBag.treeIcon=we.createElement(It,{render:Po,renderParam:{...N,renderBag:{...N.renderBag}}}))}Q.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=we.createElement(It,{render:tC,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof Q.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=we.createElement(It,{render:Q.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),Q.renderValue&&(N.renderBag.value=we.createElement(It,{render:Q.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),V.isGroupRow&&Q.renderGroupValue&&(N.renderBag.value=we.createElement(It,{render:Q.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!V.isGroupRow&&Q.renderLeafValue&&(N.renderBag.value=we.createElement(It,{render:Q.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),me.current=N;let de=N.renderBag.value;de instanceof Date&&(de=de.toLocaleDateString());let Re=we.createElement(we.Fragment,null,ue!=="end"?N.renderBag.treeIcon:null,ue!=="end"?N.renderBag.groupIcon:null,ue!=="end"?N.renderBag.rowDetailsIcon:null,ue!=="end"?N.renderBag.selectionCheckBox:null,de,ue==="end"?N.renderBag.selectionCheckBox:null,ue==="end"?N.renderBag.rowDetailsIcon:null,ue==="end"?N.renderBag.groupIcon:null,ue==="end"?N.renderBag.treeIcon:null);return g.render?we.createElement(It,{render:g.render,renderParam:{...N,renderBag:{...N.renderBag,all:Re}}}):Re}),[g,D,he,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Je:!1,...Ef(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})]),{style:ne,className:ye}=Df({column:g,rowInfo:V,rowIndex:b,rowHeight:C,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ue,verticalAlign:L,stylingParam:j,formattedValueContext:U,groupByColumnReference:ae,rowStyle:n,rowClassName:r,cellStyle:u,cellClassName:d,showZebraRows:I,rowActive:pe,rowDisabled:Y,rowSelected:$,cellSelected:it,cellSelection:nt,getData:l,visibleColumnIds:s,computedVisibleColumns:ie.computedVisibleColumns,computedColumnOrder:c,columnReorderInPageIndex:le}),Ce=(0,Le.useMemo)(()=>ne,[ne?JSON.stringify(ne):null]),st=qe,G=K(),ke={domRef:ee,cellType:"body",column:g,width:m,rowId:V.id,horizontalLayoutPageIndex:a,style:Ce,onMouseLeave:ve,onMouseEnter:Ae,onClick:be,afterChildren:st,onMouseDown:Oe,cssEllipsis:g.cssEllipsis??!0,className:ye,renderChildren:(0,Le.useCallback)(()=>G,[K])},St=jr.Provider;return W||H?we.createElement("div",{ref:ee,style:{display:"none"}}):we.createElement(St,{value:me.current},we.createElement(ma,{...ke}))}var Mf=we.memo(iC);function Ur(){return(0,Le.useContext)(jr)}function ga(){let{api:o,editingValueRef:e,editingCell:t}=re(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Ur(),[i]=we.useState(()=>t?.value),[a,l]=we.useState(i),s=t?!t.active&&!!t.waiting:!1,c=we.useCallback(f=>{e.current=f,l(f)},[]);we.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function $r(o){return o.render(o.renderParam)??null}function It(o){let e=jr.Provider;return nr.createElement(e,{value:o.renderParam},nr.createElement($r,{render:o.render,renderParam:o.renderParam}))}function Af(o){let e=jr.Provider;return nr.createElement(e,{value:o.contextValue},o.children)}function Ko(o){let e=ha.Provider;return nr.createElement(e,{value:o.renderParam},nr.createElement($r,{render:o.render,renderParam:o.renderParam}))}var Bo=B(require("react"));var _f="yhvuzb1",Of="yhvuzb0";var Yr=zi({"data-name":""}),qr={[Yr["data-name"]]:"menu-icon"},b_=`[${Yr["data-name"]}="${qr["data-name"]}"]`;var aC={width:"100%",pointerEvents:"none"},Ks=J(`${lt}-menu`,_f);function Xr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...aC,borderTop:`${ge.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Bo.createElement("div",{...n,style:e,...qr,onPointerDown:s=>s.stopPropagation(),className:J(t,Od({menuVisible:i,reserveSpaceWhenHidden:r}),lt,`${lt}-menu`,a==null?Of:"")},a??Bo.createElement(Bo.Fragment,null,Bo.createElement("div",{className:Ks,style:l}),Bo.createElement("div",{className:Ks,style:l}),Bo.createElement("div",{className:Ks,style:l})))}var rr=B(require("react")),Zr=require("react");var Ff="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32",Nf={asc:"_1b8djff1",desc:"_1b8djff2",none:"_1b8djff3"},ya="_1b8djff4";var Lf={transition:"width 0.25s, opacity 0.25s"},O_=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Sa(o){let[e,t]=(0,Zr.useState)(!0),[n,r]=(0,Zr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.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={...Lf,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Zr.useEffect)(()=>{let S=i!=0?1:0;if(!e&&S&&t(!0),S!==n){let T=requestAnimationFrame(()=>{r(S)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",y={};return i===-1&&(y.top="100%"),rr.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,lt,Ff,Nf[h],`${lt}-sort`,`${lt}-sort--${h}`)},u?rr.createElement("div",{"data-name":"index",style:y,className:Ld},c):null,rr.createElement("div",{className:ya,style:{width:f[0],...m},onTransitionEnd:g}),rr.createElement("div",{className:ya,style:{width:f[1],...m}}),rr.createElement("div",{className:ya,style:{width:f[2],...m}}))}var Hf=B(require("react")),Ws=require("react");function Bs(o){return Math.max(o.width-Yt(),0)}function kf(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,c=e.getComputed().computedVisibleColumns,u=!1,d=c.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},u=!0),f),{}),p=u?{...a,...d}:a;return fs({shareSpaceOnResize:r,availableSize:Bs(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:c.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Qr=require("react"),Jr=B(require("react"));function zf(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ie.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?ws(l,i,n.current):Ie.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){ws(c,i,n.current);continue}c.computedPinned!=="end"&&Ie.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Ie.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Vf(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Ie.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Ie.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Ie.columnOffsets.set(u,d.computedOffset+s,c)}}}}var ba="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ta=Se({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),Ca=Se({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:lC}=ze,sC=`${lC}HeaderCell_ResizeHandle`;function cC(o){let{brain:e,headerBrain:t}=re(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,Qr.useRef)(null),[r,i]=(0,Qr.useState)(!1),a=(0,Qr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,y=g.pointerId,S=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),D()}}T.setPointerCapture(y);let b=zf(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),C=(v,{done:D}={})=>{s&&(v=v/(s+1),D&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:I,constrained:M}=o.computeResize({diff:v,shareSpaceOnResize:h});return a.current!==M&&i(M),b.resize(I),I},w=v=>{C(Math.round(v.clientX-S))},R=v=>{T.releasePointerCapture(y),T.removeEventListener("pointermove",w),T.removeEventListener("pointerup",R);let D=Math.round(v.clientX-S),I=C(D,{done:!0});p(),b.resize(0),o.onResize({diff:I,shareSpaceOnResize:h})};T.addEventListener("pointermove",w),T.addEventListener("pointerup",R)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Jr.createElement("div",{ref:n,className:`${sC} ${ba} ${Ca({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Jr.createElement("div",{style:m,className:Ta({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Gf=Jr.memo(cC);function Kf(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=re(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,Ws.useCallback)(({diff:c,shareSpaceOnResize:u})=>kf({context:{getState:n,getComputed:r},column:o,diff:c,shareSpaceOnResize:u}),[o,n,r]),l=(0,Ws.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?Hf.createElement(Gf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=B(require("react"));var to=require("react");var Bf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Wf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function jf(o,e){return Tt(o,e)}var ir=class extends sn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return jf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return jf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=ln(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var uC={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function dC(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function pC(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(dC(t,e))return t;t=t.parentElement}return null}function fC(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Yf=1;function Uf(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Yf;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function mC(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Yf;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function $f(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=fC(n,r),s=o-e,c=t-o,u=c<s,d;return u?d=Uf(c,l,r):d=-Uf(s,l,r),d===0?0:a?(d>0?1:-1)*mC(Math.abs(d),i,r):d}var mn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...uC,...e.config}}start(e){this.scrollContainer=pC(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=$f(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=$f(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Zf=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),gn=()=>Ye.useContext(Zf),gC=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},hC=o=>`${o.getAttribute(vt)}`;function js(o,e){let t=o.current?.querySelectorAll(Jf)??[];return Array.from(t).filter(r=>r.getAttribute(ei)===`${e}`)}function yC(o,e){let t=js(o,e);return!t||t.length,Array.from(t).map(r=>{let i=hC(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function SC(o){let{domRef:e,orientation:t,dragListId:n}=o,r=yC(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>c&&(c=f.right)}let u=Pe.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:u,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function Qf(o){return new ir(SC(o))}function bC(o,e){let t=Ne(e),[n,r]=Ye.useState(null),i=(0,to.useCallback)(l=>{if(l)Ct.registerDragInteractionTarget(l);else{let s=a();s&&Ct.unregisterDragInteractionTarget(s)}r(l)},[]),a=Ne(n);return(0,to.useEffect)(()=>Ct.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=Qf({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function Us(o,e){let t=o.cloneNode(!0);return t.removeAttribute(vt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function $s({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function qf(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var Wo=o=>{let e=Ye.useRef(null),t=Ye.useRef(null),[n,r]=(0,to.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(I=>{a.current=I},[]),{dropTargetListId:s,dragSourceListId:c}=po(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:p}=po(),f=Ne(o.onDrop),m=Ne(o.onAcceptDrop),g=Ne(o.onRemove),h=Ne(o.updatePosition??gC),{interactionTarget:y,setInteractionTarget:S}=bC(e,o);(0,to.useEffect)(()=>{let I=document.querySelector(`[${Xf}="${o.dragListId}"]`);I?e.current=I:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),(0,to.useEffect)(()=>{if(y){let I=o.dragListId,M=y.on("start",({dragItem:k,dragSourceListId:O,dropTargetListId:H})=>{u({dragSourceListId:O,dropTargetListId:H,dragItemId:k.id,status:"accepted"})}),E=y.on("move",({offsetsForItems:k,items:O,status:H,dragItem:W})=>{if(H==="rejected")return;let z=b(),ee=h(),V=t.current;O.forEach(($,ie)=>{let fe=k[ie],se=z[ie];if(se&&!(V&&$.id===V.dragItemId)){if(!V&&$.id===W.id){let le=i.current;fe={left:fe.left+le.left,top:fe.top+le.top}}ee({id:$.id,node:se,offset:fe})}})}),x=y.on("drop",k=>{let{sortedIndexes:O,dragIndex:H,dropIndex:W,dragItem:z,items:ee,dragSourceListId:V,dropTargetListId:$,outside:ie,status:fe}=k,se=b();T.current=[];let le=m(),pe=g(),ce=f(),Y=h();ee.forEach((X,U)=>{let Q=se[U];Q&&Y({id:X.id,node:Q,offset:null})}),qf(t),r(X=>X&&(requestAnimationFrame(()=>r(null)),{...X,dragItemId:null})),I===$&&V!==I&&le&&fe==="accepted"&&le({dragItemId:z.id,dragSourceListId:V,dropTargetListId:$,dragIndex:H,dropIndex:W,dropItemId:ee[W]?.id});let j=null;W===-1&&V===I&&$===I&&ie&&(j=pe),W!==-1&&$===I&&V===I&&(j=ce),j&&j?.(O,{dragIndex:H,dropIndex:W,dragItemId:ee[H].id,dropItemId:ee[W]?.id})}),P=null,A=null,_=null,F=null;if(!y.getData().initial&&e.current){if(P=new mn({orientation:o.orientation,onScroll:()=>{}}),P.start(e.current),A=P.getScrollContainer(),A){let k=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;_=()=>{let O=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,H=O-k;k=O,H!==0&&(y.adjustForScroll(H),Ct.retriggerMove())},A.addEventListener("scroll",_)}F=k=>{P.updatePointer({left:k.clientX,top:k.clientY})},Ee().addEventListener("pointermove",F)}return()=>{M(),E(),x(),P&&P.stop(),A&&_&&A.removeEventListener("scroll",_),F&&Ee().removeEventListener("pointermove",F)}}},[y,o.dragListId]);let T=Ye.useRef([]),b=(0,to.useCallback)(()=>{let I=T.current;return(!I||I.length===0)&&(I=js(e,o.dragListId),T.current=I),I},[o.dragListId]),C=(0,to.useCallback)(I=>{let M=I.currentTarget,E=M.getAttribute(vt);if(E==null){let q=Lo(M,Jf);q&&(E=q.getAttribute(vt))}if(E==null){console.warn("Could not find drag item id for element",M,`Make sure you have a parent element with a ${vt} attribute`);return}E=`${E}`;let x=null,P=js(e,o.dragListId);T.current=P;let A=Qf({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),_=A.getData().draggableItems,F=_.findIndex(q=>q.id===E);if(F===-1)return;let k=_[F],O=P[F]?.getAttribute(vt)===`${E}`?P[F]:P.find(q=>q.getAttribute(vt)===`${E}`);S(A);let H={left:I.clientX,top:I.clientY},W={left:I.clientX,top:I.clientY};i.current={top:0,left:0};let z=new mn({orientation:o.orientation,onScroll:()=>{}});e.current&&z.start(e.current);let ee=z.getScrollContainer(),V=ee?o.orientation==="vertical"?ee.scrollTop:ee.scrollLeft:0;function $(){x&&x.move({left:W.left,top:W.top})}let ie=()=>{if(!ee)return;let q=o.orientation==="vertical"?ee.scrollTop:ee.scrollLeft,j=q-V;V=q,j!==0&&(A.adjustForScroll(j),o.orientation==="vertical"?i.current.top+=j:i.current.left+=j),$()};ee?.addEventListener("scroll",ie);let fe=o.dragStrategy??"proxy",se=fe==="proxy"&&!o.renderDragProxy,le=fe==="proxy"&&!!o.renderDragProxy,pe=o.onDragProxyMove??$s,ce=q=>{if(W={left:q.clientX,top:q.clientY},!x){if(x=Ct.startDrag({listId:o.dragListId,dragItem:k,dragIndex:F},H),O&&se){let U=O.getBoundingClientRect(),Q=null,ae={dragItemNode:O,dragItemId:`${E}`,initialRect:U,initialCoords:H,get proxyElement(){return Q||(Q=Us(O,U)),Q}},he=o.onDragProxySetup?.(ae),ue=he?.proxyElement??ae.proxyElement;O.style.visibility="hidden",t.current={proxyElement:ue,originalNode:O,dragItemId:`${E}`,initialRect:U,cleanup:he?.cleanup}}if(O&&le){let U=O.getBoundingClientRect();O.style.visibility="hidden",t.current={proxyElement:O,originalNode:O,dragItemId:`${E}`,initialRect:U,cleanup:()=>{}},r({dragItemId:`${E}`,initialRect:U,dx:0,dy:0})}}let j=q.clientX-H.left,X=q.clientY-H.top;if(le)r(U=>U&&{...U,dx:j,dy:X});else{let U=t.current;U&&pe({proxyElement:U.proxyElement,dx:j,dy:X})}z.updatePointer({left:q.clientX,top:q.clientY}),$()},Y=()=>{if(z.stop(),ee?.removeEventListener("scroll",ie),Ee().removeEventListener("pointermove",ce),le&&(r(q=>q&&{...q,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!x){qf(t),S(null);return}x.drop(),x=null};Ee().addEventListener("pointermove",ce),Ee().addEventListener("pointerup",Y,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),w=!!d,R=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:c,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:w}),[d,C,w,c,s,o.dragListId]),v={className:J("DragList",w?"DragList--dragging":"",Bf({dragging:w})),[Xf]:o.dragListId},D=typeof o.children=="function"?o.children(v,R):o.children;return Ye.createElement(Zf.Provider,{value:R},D,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},Xf="data-drag-list-id",vt="data-drag-item-id",ei="data-drag-item-list-id",Jf=`[${vt}]`,TC=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),CC=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=gn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,c=Ye.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),u={[vt]:`${o.id}`,[ei]:l,onPointerDown:e,className:J("DraggableItem",s?"DraggableItem--active":"",Wf({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(u,c):o.children;return Ye.createElement(TC.Provider,{value:c},d)};Wo.DraggableItem=CC;var Ys=B(require("react"));var em=o=>Ys.createElement(Ve,{...o,icon:"hidden",viewBox:"0 -960 960 960"},Ys.createElement("path",{d:Ge.hidden[0]}));var si=B(require("react"));function tm(){return{}}var om=o=>({allowColumnHideWhileDragging:e=>e??!0});var nm=require("react"),wC=(0,nm.createContext)(null);function qs(){return wC}var Kt=B(require("react"));var Cn=B(require("react")),Pt=require("react");var wa=B(require("react"));function RC(o){let{height:e,width:t,count:n}=o;return wa.createElement("div",{"data-count":n,"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 rm=wa.memo(RC);var im="mlx2t3";var Ra=B(require("react")),fm=require("react");var am=require("react"),lm=(o,e)=>{(0,am.useEffect)(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var sm={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},cm={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},um={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Xs="_1ueijco1",dm="_1ueijco0 _16lm1iw0";var pm=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=sm[`${o}`]:e=J(cm[`${o.horizontal}`],um[`${o.vertical}`]),e};var IC="InfiniteVirtualScrollContainer";var mm=Ra.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,fm.useRef)(null);return lm(u,i),Ra.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:J(a,IC,dm,pm(r))},n)});var Fa=B(require("react")),Sn=require("react");var gm=B(require("react")),ar=require("react");function vC(o){let[e,t]=(0,ar.useState)(o.updater.get),n=(0,ar.useRef)(null);return(0,ar.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var jo=gm.memo(vC);var hm=B(an());var Zs=(o,e)=>o-e,go={horizontal:!0,vertical:!0};function Ia(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var Qs="DebugID=";function Uo(o,e){return e&&e.startsWith(Qs)?e:e?`${Qs}${o}:${e}`:`${Qs}${o}`}var va={start:0,end:0},Js=o=>{o()},ec=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},ym=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},ti=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function PC(o){return o.horizontalChange||o.verticalChange}var hn=class extends bt{constructor(t){let n=Uo(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=va;this.verticalExtendRangeBy=va;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;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.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{ti(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Js:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Js:ti;n.forEach(a=>{i(()=>{this.destroyed||n.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 n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=go)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(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:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,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:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=go)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=go)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=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 n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,hm.default)(a,t,Zs);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="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],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let y=f;for(;h>1;)y+=1,d[y]=f,p[y]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n: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,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ec;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(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==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(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=go){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,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,y=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let S=a!=null,T=l!=null,b=S&&a!==this.rowHeight,C=T&&l!==this.colWidth;S&&(this.rowHeight=a),T&&(this.colWidth=l);let w=t.rowspan!=null,R=t.colspan!=null,v=w&&t.rowspan!=this.rowspan,D=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let I=y||C||p||D,M=h||b||f||v;(n||PC)({horizontalChange:I,verticalChange:M,colsChanged:y,colWidthChanged:C,widthChanged:p,colspanChanged:D,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:I,vertical:M})}extendRenderRange(t){let{direction:n}=t,r=n==="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:n})}}updateRenderCount(t=go){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,n){return Math.floor(n)}updateLargeContent(){let t=this.getVirtualizedContentSize(),n=this.supportsLargeContent("vertical")&&ea(t.height),r=this.supportsLargeContent("horizontal")&&ea(t.width);this.largeContent={vertical:n,horizontal:r},this.scrollRatio={vertical:n?xs(t.height,this.availableHeight):1,horizontal:r?xs(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:n}=this;if(!n.vertical&&!n.horizontal)return t;let r=Ji();return{width:n.horizontal?r:t.width,height:n.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop*n,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop/n,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let n=this.getScrollOrigin();return!n.scrollTop&&!n.scrollLeft?t:{scrollTop:t.scrollTop-n.scrollTop,scrollLeft:t.scrollLeft-n.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:n,scrollOrigin:r}=this,i=c=>this.alignScrollOrigin("vertical",c),a=c=>this.alignScrollOrigin("horizontal",c),l=n.vertical?Es(t.scrollTop,i(r.scrollTop),i):0,s=n.horizontal?Es(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(n=>n(t))}doUpdateRenderCount(t=go){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Js:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,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,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Ia(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{ti(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="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 n=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*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=va,this.verticalExtendRangeBy=va,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var tc=B(an());function Sm(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function bm(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function oi(o,e){for(let t of o)if(e(t))return t}var Pa=(o,e)=>o-e,Da=class extends bt{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new Z;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,y=f>=s;(m||g||h||y)&&c.add(u)}),c};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,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,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);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,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=oi(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=oi(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Pa)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Pa)}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((n,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(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,tc.default)(n,t,Pa);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,tc.default)(n,t,Pa);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return oi(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return oi(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Tm=B(an());var xa=class extends bt{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}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,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Tm.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.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 n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}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 Cm=!0,yn=te(oe.y),wm=te(oe.scrollTop),BF=te(oe.columnOffsetAtIndex),oc=te(oe.columnOffsetAtIndexWhileReordering),lr=class extends bt{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(yn,i?`calc( ${r}px + var(${wm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${yn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Ie.columnOffsets.get(r),d=`${oc}-${r}`,p=s?`calc( ${a}px + var(${wm}) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(yn,p));let f=`translate3d(var(${d}, ${u}), var(${yn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let y=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),S=this.getScrollPositionForScrollColumnIntoView(y,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});S&&(a=S.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{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,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=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 c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=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,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.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(n=>{let r=n.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 n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};He(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,c=this.brain.getCellOffset(l,s);if(c==null)return;let{x:u,y:d}=c;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Cm){this.setTransform(i,l,s,{x:u,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let g=(n?n.hidden:!!this.isCellCovered(l,s))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==g&&(i.__zIndex=g,i.style.zIndex=g)}else i.style.display="",i.style.left=`${u}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=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;n&&(n.dataset.detailRowIndex=r,Cm&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(P=>{let A=i.getRowIndex(P);if(A!=null){let _=this.brain.getItemOffsetFor(A,"vertical");if(_==null)return;let F=P.getElement();if(!F)return;this.setDetailTransform(F,A,{y:_,scrollLeft:n.getDOMScrollPosition(t).scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&cp(n.getDOMScrollPosition(t),this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[y,S]=g,[T,b]=h;function C(P,A,_){let F=r.getCellAt([P,A]);if(F==null)return;let k=n.getCellOffset(P,A),O=F.getElement();O&&k&&_(P,A,O,k)}let w=(P,A,_,{x:F,y:k})=>{this.setTransform(_,P,A,{x:F,y:k,scrollLeft:!0},s-A)},R=(P,A,_,F)=>{this.setTransform(_,P,A,{x:F.x,y:F.y,scrollTop:!0},u-P)},v=(P,A,_,{y:F})=>{let k=f[A];this.setTransform(_,P,A,{x:k,y:F,scrollLeft:!0},a-A)},D=(P,A,_,F)=>{this.setTransform(_,P,A,{x:F.x,y:m[P],scrollTop:!0},l-P)},I=(P,A,_,{x:F,y:k})=>{this.setTransform(_,P,A,{x:F,scrollLeft:!0,y:k,scrollTop:!0},1e5)},M=(P,A,_,{x:F})=>{this.setTransform(_,P,A,{x:F,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},E=(P,A,_,F)=>{this.setTransform(_,P,A,{x:f[A],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},x=(P,A,_)=>{this.setTransform(_,P,A,{x:f[A],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let P=y;P<T;P++){for(let A=0;A<s;A++)C(P,A,w);if(c){let A=a-c;for(let _=A;_<a;_++)C(P,_,v)}}if(u||d)for(let P=S;P<b;P++){for(let A=0;A<u;A++)C(A,P,R);if(d){let A=l-d;for(let _=A;_<l;_++)C(_,P,D)}}if(s&&u)for(let P=0;P<u;P++)for(let A=0;A<s;A++)C(P,A,I);if(s&&d){let P=l-d;for(let A=P;A<l;A++)for(let _=0;_<s;_++)C(A,_,M)}if(c&&u){let P=a-c;for(let A=0;A<u;A++)for(let _=P;_<a;_++)C(A,_,E)}if(c&&d){let P=l-d,A=a-c;for(let _=P;_<l;_++)for(let F=A;F<a;F++)C(_,F,x)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Da(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,d)=>{d?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new xa(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,d)=>{d?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),He(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop),c=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{c(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=Ts(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let I=t.start[1],M=t.end[1];m.forEach(E=>{I<=E&&E<M||f.push({start:[t.start[0],E],end:[t.end[0],E+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([I,M])=>{g.set(`${I}:${M}`,!0)});let y=f.reduce((I,M)=>I+ec(M),0),S=r?f.reduce((I,M)=>I+ym(M),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let C=Math.min(T*b,y);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>S&&(u.poolSize=S));let w=Sm(...f.map(I=>d.getCellsOutsideRenderRange(I)));w=bm(w,I=>{let M=d.getCellPosition(I);return!(M&&g.has(`${M[0]}:${M[1]}`))}),d.detachCells(w),d.poolSize=C;let R=new Map,v=new Map;f.forEach(I=>{let{start:M,end:E}=I,[x,P]=M,[A,_]=E;for(let F=x;F<A;F++){for(let O=P;O<_;O++){let H=`${F}:${O}`;if(R.has(H))continue;R.set(H,!0);let{rendered:W,mapped:z}=this.isCellRenderedAndMappedCorrectly(F,O);if(F===x||O===P){let V=this.isCellCovered(F,O);if(V&&g.has(`${V[0]}:${V[1]}`)){let $=d.getCellAt([F,O]);$!=null&&d.detachCell($);continue}}if(W&&!i&&z)continue;let ee;W?ee=d.getCellAt([F,O]):ee=d.getCellFor([F,O],c?"row":"column"),ee==null&&(ee=d.getDetachedCell()),this.renderCellAt(F,O,ee,n)}!r||v.has(F)||(v.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([I,M])=>{let{rendered:E,mapped:x}=this.isCellRenderedAndMappedCorrectly(I,M);if(E){if(i||!x){let A=[I,M],_=d.getCellAt(A);this.renderCellAt(I,M,_,n)}return}let P=d.getCellFor([I,M],c?"row":"column");P!=null&&this.renderCellAt(I,M,P,n)});let D=d.getAllCells().map(I=>I.getNode());return r&&u.getAllRows().forEach(I=>{D.push(I.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}renderDetailRowAtElement(t,n,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,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:y}=this.getCellRealCoordinates(t,n),S=i({rowIndex:h,colIndex:y,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let w=C.getElement();w&&(w.style.position="absolute",w.style.left="0px",w.style.top="0px"),this.updateElementPosition(C)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:y}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!S){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(S,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Ea=class extends lr{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),u=ge.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${oc}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(yn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${yn})`,y=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),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,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var Im=B(require("react"));var sr=class sr extends bt{constructor(t){super(t);this.cellRemoveSubscription=Te();this.cellAttachmentChangeSubscription=Te();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=this.createCellInstance();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,n=t.values().next().value;return n||(this.poolSize+=sr.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/sr.POOL_SIZE_INCREMENT)*sr.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-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--}};sr.POOL_SIZE_INCREMENT=1;var Ma=sr;var Rm=new Map,DC=()=>{},nc=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Te();let n=Rm.get(e)??0,r=`${e}:GridCellReact:${n}`;Rm.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Te(),this.node=Im.createElement(jo,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=DC,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}},Aa=class extends Ma{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new nc(this.cellDebugId)}};var Pm=B(require("react"));var cr=class cr extends bt{constructor(t){super(t);this.rowRemoveSubscription=Te();this.rowAttachmentChangeSubscription=Te();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=this.createRowInstance();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,n=t.values().next().value;return n||(this.poolSize+=cr.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/cr.POOL_SIZE_INCREMENT)*cr.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-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--}};cr.POOL_SIZE_INCREMENT=1;var _a=cr;var vm=new Map,xC=()=>{},rc=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Te();let t=vm.get(e)??0,n=`${e}:ListRowReact:${t}`;vm.set(e,t+1),this.debugId=n,this.updater=Te(),this.node=Pm.createElement(jo,{key:`detail-row-${n}`,name:`detail-row-${n}`,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(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=xC,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Oa=class extends _a{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new rc(this.rowDebugId)}};function Dm(o){return{cellPool:new Aa(o),rowPool:new Oa(o)}}function ni(o){let e=o.isHorizontalLayoutBrain?new Ea(o,`${o.name}:HorizontalLayoutTableRenderer`,Dm(`${o.name}:HorizontalLayoutTableRenderer`)):new lr(o,`${o.name}:ReactHeadlessTableRenderer`,Dm(`${o.name}:ReactHeadlessTableRenderer`)),t=Te();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function EC(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,Sn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:ni(e),[e,o.onRenderUpdater,o.renderer]);return(0,Sn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,Sn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,Sn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,Sn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),Fa.createElement(jo,{updater:a})}var Na=Fa.memo(EC);var ri=B(require("react")),bn=require("react");var xm=Se({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),La="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Em=Se({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function Mm(o,e){let t=e-o.getScrollOriginPageIndex();return t?`calc(${ge.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function Am(o,e){let t="0px",n=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(t=Mm(o,o.getPageIndexForRow(n))??"0px",n=n%o.rowsPerPage);let r=o.getRowHeight(n),i=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function _m(o,e){let{scrollTop:t,scrollLeft:n}=o.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.isHorizontalLayoutBrain?`${-n}px`:"0px"}}function Om(o,e,t){let[n]=e,r=e[1],i;if(o.isHorizontalLayoutBrain&&o.rowsPerPage){let c=Ie.columnOffsets.get(r),u=Mm(o,o.getPageIndexForRow(n));i=u?`calc( ${u} + ${c})`:c,n=n%o.rowsPerPage}let a=typeof t=="function"?t(n):t??o.getRowHeight(n),l=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:MC}=ze,AC=`${MC}-ActiveRowIndicator`,_C=`calc(${oe.activeCellRowOffsetX} + var(${te(oe.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,OC={[te(oe.activeCellOffsetY)]:oe.activeCellRowOffset,transform:`translate3d(${_C}, calc( ${oe.activeCellOffsetY} + var(${te(oe.scrollTopForActiveRow)}, 0px)), 0px)`,height:oe.activeCellRowHeight,maxWidth:ge.runtime.totalVisibleColumnsWidthVar},FC=o=>{let{brain:e}=o,t=(0,bn.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=$t(),a=(0,bn.useRef)(o.activeRowIndex);a.current=o.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||$n(Am(e,s),t.current)};return(0,bn.useLayoutEffect)(l,[o.activeRowIndex,e]),(0,bn.useEffect)(()=>{let s=p=>{$n(_m(e,p),t.current)};s(e.getScrollPosition());let c=e.onScroll(s),u=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),u(),c()}},[e]),ri.createElement("div",{className:La,"data-name":"active-row"},ri.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${AC} ${Em({active:n})}`,style:n?OC:void 0}))},Fm=ri.memo(FC);var ii=B(require("react")),Tn=require("react");var{rootClassName:NC}=ze,LC=`${NC}-ActiveCellIndicator`,kC=te(oe.columnZIndexAtIndex),Nm=(o,e,t,n)=>{e!=null&&$n(Om(o,e,t),n.current)},zC=o=>{let{brain:e}=o,[t,n]=$t(),r=(0,Tn.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];(0,Tn.useLayoutEffect)(()=>{Nm(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]);let a=(0,Tn.useRef)(o);return a.current=o,(0,Tn.useEffect)(()=>{let l=e.onRenderCountChange(()=>{n()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:c,rowHeight:u}=a.current;Nm(e,c,u,r)});return()=>{l(),s()}},[e]),ii.createElement("div",{className:La,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${kC}-${o.activeCellIndex[1]})`}:void 0},ii.createElement("div",{"data-name":"active-cell-indicator",className:`${LC} ${xm({visible:i})}`}))},Lm=ii.memo(zC);var ka=[Qp,`${gt}DetachedCell`];function za(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.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 VC=J(im,Xs);function km(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,y=(0,Pt.useRef)(null),[S,T]=(0,Pt.useState)({width:0,height:0});(0,Pt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Pt.useEffect)(()=>{let R=y.current?.parentNode;return R?(h&&document.activeElement!==R&&R.focus(),Fn(R,()=>{let I={height:R.clientHeight,width:R.clientWidth};e.update(I)},{debounce:50})):void 0},[p,e]);let b=(0,Pt.useCallback)(R=>{let v=e.getDOMScrollPosition(R);requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[e]),C=(0,Pt.useCallback)(R=>{e.setScrollPosition(e.toContentScrollPosition(R),b)},[e,b]);(0,Pt.useEffect)(()=>{let R=e.onRenderCountChange(()=>{T(e.getNativeScrollSize())});return T(e.getNativeScrollSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),R},[e]);let w=(0,Pt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Pt.useLayoutEffect)(()=>{let R=w.current,v=e.getScrollRatio("vertical"),D=e.getScrollRatio("horizontal");w.current={brain:e,vertical:v,horizontal:D};let I=y.current?.parentElement;if(!I||R.brain!==e||R.vertical===v&&R.horizontal===D)return;let M=e.toNativeScrollPosition(e.getScrollPosition());R.vertical!==v&&(I.scrollTop=M.scrollTop),R.horizontal!==D&&(I.scrollLeft=M.scrollLeft)},[S,e]),Cn.createElement(mm,{onContainerScroll:C,...g,ref:t},Cn.createElement("div",{ref:y,className:VC,"data-name":"scroll-transform-target"},Cn.createElement(Na,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ka}),u!=null?Cn.createElement(Lm,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?Cn.createElement(Fm,{brain:e,activeRowIndex:c}):null,Cn.createElement(rm,{width:S.width,height:S.height}))}function zm(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let y={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],y);let S=u.columnGroup,T,b=y;for(;S;){let C=e[S];if(C){g.add(S);let w=[p,...g];T=h.has(S)?i.get(S):void 0,T||(T={id:S,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[S],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(S)??0},r.set(w,T),i.set(S,T)),T.columnItems.push(y),T.uniqueGroupId.push(y.id),b&&!h.has(b.id)&&T.children.push(b),b=T,S=C.columnGroup}else break}});let l=[],s=new Z,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Vm(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Vm(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Vm(t.children),e+=n})}var $o=B(require("react")),ho=require("react");var ac=B(require("react"));var Hm=B(require("react")),ic=require("react");var ai=require("react"),li=B(require("react"));var{rootClassName:GC}=ze,HC=`${GC}HeaderCell_ResizeHandle`;function KC(o){let e=(0,ai.useRef)(null),[t,n]=(0,ai.useState)(!1),r=(0,ai.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Vf(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),y=b=>{a==="end"&&(b*=-1);let{constrained:C,adjustedDiffs:w,adjustedDiff:R}=o.computeResize(b);return r.current!==C&&n(C),h.resize(w),R},S=b=>{if(g){let C=o.groupColumns.reduce((v,D)=>v+D.computedWidth-D.computedMinWidth,0),w=o.brain.getAvailableSize(),R={width:w.width+C,height:w.height};o.brain.update(R),g=!1}y(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",S),m.removeEventListener("pointerup",T);let C=Math.round(b.clientX-f),w=y(C);h.resize(o.groupColumns.map(()=>0)),o.onResize(w)};m.addEventListener("pointermove",S),m.addEventListener("pointerup",T)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ge.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return li.createElement("div",{ref:e,className:`${HC} ${ba} ${Ca({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},li.createElement("div",{style:{...u,...o.style},className:Ta({constrained:t})}))}var Gm=li.memo(KC);function Km(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=re(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=o[o.length-1],d=(0,ic.useCallback)(g=>{let h=l(),{columnSizing:y,viewportReservedWidth:S,bodySize:T}=h,b=s().computedVisibleColumns,C=!1,w=b.reduce((D,I)=>(I.computedFlex&&(D[I.id]={...y[I.id],flex:I.computedWidth},C=!0),D),{}),R=C?{...y,...w}:y;return Bd({availableSize:Bs(T),reservedWidth:S||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:R,columnGroupSize:o.length,items:b.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[u]),p=(0,ic.useCallback)(g=>{let{columnSizing:h,reservedWidth:y}=d(g);c.viewportReservedWidth=y,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?Hm.createElement(Gm,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Bm=`${gt}HeaderGroup`,Wm=te(oe.columnWidthAtIndex),BC=te(oe.columnZIndexAtIndex);function jm(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=Km(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${Wm}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Wm}-${c.computedVisibleIndex})`,d=`calc(var(${BC}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,ac.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:J(_d,Bm),style:p,"data-z-index":d},ac.createElement("div",{className:J(`${Bm}__header-content`,Gt)},a),s)}var Um=require("react");var cc=B(require("react")),lc;function uc(){return lc||(lc=cc.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var sc;function Va(){return sc||(sc=cc.createContext(null))}function Fe(o){let e=Va(),t=(0,Um.useContext)(e);return Nn(t,o)}function oo(){return Fe(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:WC}=ze,jC=[],$m=`${WC}Header`,UC=Dd({overflow:!1}),Ym=()=>{};function $C(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=re(E=>({computedColumnsMap:E.computed.computedColumnsMap,getState:E.getState,headerOptions:E.state.headerOptions,headerRenderer:E.state.headerRenderer,headerOnRenderUpdater:E.state.headerOnRenderUpdater,showColumnFilters:E.state.showColumnFilters})),g=(0,ho.useRef)(null),h=(0,ho.useCallback)(E=>{if(g.current){let{scrollLeft:x}=t.getDOMScrollPosition(E);g.current.style.transform=`translate3d(${-x}px, 0px, 0px)`}},[t]);(0,ho.useEffect)(()=>{let E=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),E},[t]);let y={ref:g,className:J($m,`${$m}--virtualized`,i,UC),style:{...r,height:a}},{getDataSourceState:S,dataSourceApi:T,dataSourceActions:b}=oo(),{allRowsSelected:C,someRowsSelected:w,selectionMode:R,filterTypes:v,filterDelay:D}=Fe(E=>({allRowsSelected:E.dataSourceState.allRowsSelected,someRowsSelected:E.dataSourceState.someRowsSelected,selectionMode:E.dataSourceState.selectionMode,filterTypes:E.dataSourceState.filterTypes,filterDelay:E.dataSourceState.filterDelay})),I=(0,ho.useMemo)(()=>({allRowsSelected:C,someRowsSelected:w,selectionMode:R}),[C,w,R]),M=(0,ho.useCallback)(E=>{let{rowIndex:x,colIndex:P,domRef:A,height:_,widthWithColspan:F,heightWithRowspan:k,hidden:O}=E,H=n[P];if(!H||O)return null;let W=t.isHorizontalLayoutBrain?t.getPageIndexForRow(x):null,z=l?l.pathsToCells.get([x,P]):null;if(z&&z.type==="group"){let ee=z.columnItems.map(ie=>ie.ref),V={...z.ref,id:z.id,uniqueGroupId:z.uniqueGroupId,depth:z.depth,columns:ee.map(ie=>ie.id),computedWidth:z.computedWidth,groupOffset:z.groupOffset};return c().columnGroupVisibility[z.id]!==!1?$o.createElement(jm,{horizontalLayoutPageIndex:W,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:ee,width:F,height:_,columnGroup:V}):null}return $o.createElement(Xm,{domRef:A,column:H,horizontalLayoutPageIndex:W,headerOptions:u,dataSourceStatePartialForHeaderCell:I,filterTypes:v,filterDelay:D,getDataSourceState:S,dataSourceApi:T,dataSourceActions:b,width:F,height:k,columnsMap:m})},[u,n,a,l,s,f,t,S,T,b,v,D,I]);return $o.createElement(Wo,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Ym,updatePosition:Ym},E=>$o.createElement("div",{...E,...y,className:J(E.className,y.className)},$o.createElement(Na,{name:"header",renderCell:M,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:jC,cellDetachedClassNames:ka})))}var qm=$o.memo($C);function Zm(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=re(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:p}=re(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:u+2,m=f*s+(p?s:0),g=Kt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return zm(a,d,c,u)},[a,d,c]),h=Kt.useCallback(({rowIndex:w,colIndex:R})=>{let v=a[R],D=1,I=1;if(!v||!g)return{rowspan:D,colspan:I};let M=g.pathsToCells.get([w,R]);if(!M)return{rowspan:D,colspan:I};if(M.type==="column")return{colspan:I,rowspan:f-M.depth};let E=M.columnItems.findIndex(x=>x.id===v.id);return{rowspan:D,colspan:E===0?M.columnItems.length:1}},[d,u,a,g,f,c]),y=Kt.useCallback(({rowIndex:w,colIndex:R})=>h({rowIndex:w,colIndex:R}).rowspan,[h]),S=Kt.useCallback(({rowIndex:w,colIndex:R})=>h({rowIndex:w,colIndex:R}).colspan,[h]),T=Kt.useCallback(w=>p?w<f-1?s:2*s:s,[f,p,s]);za(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:y,colspan:S},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Kt.createElement(qm,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=n.vertical&&Yt()?Kt.createElement("div",{className:Fd,style:{zIndex:1e3,width:Yt()}}):null;return Kt.createElement("div",{className:`${Os} ${zd}`,style:{height:m}},b,C)}var{ManagedComponentContextProvider:YC}=Lt({initSetupState:tm,forwardProps:om,Context:qs()});function dc(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=re(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?si.createElement(YC,{...o},si.createElement(Zm,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function Qm(){return si.useContext(qs()).componentState}var qC=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||zo;return Me.createElement(s,{domProps:{className:Qn},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},ha=Me.createContext(null);var XC=te(oe.columnZIndexAtIndex),ZC=te(oe.columnVisibilityAtIndex),pc=Me.createElement("div",{className:Li[1]}),eg=zi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[vt]:"",[ei]:""});function QC(o){let e=o.column,{allowColumnHideWhileDragging:t}=Qm(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=o,{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=gn(),{api:m,getComputed:g,getState:h,actions:y,getDataSourceMasterContext:S,showColumnFilters:T,components:b,portalDOMRef:C,columnHeaderHeight:w,columnReorderDragColumnId:R,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:D}=re(G=>({api:G.api,getComputed:G.getComputed,getState:G.getState,actions:G.actions,getDataSourceMasterContext:G.getDataSourceMasterContext,showColumnFilters:G.state.showColumnFilters,components:G.state.components,portalDOMRef:G.state.portalDOMRef,columnHeaderHeight:G.state.columnHeaderHeight,columnReorderDragColumnId:G.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:G.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:G.state.columnReorderInPageIndex})),I=R===e.id,M=D!=null?r!==D:!1,{onResize:E,height:x,width:P,headerOptions:A,columnsMap:_}=o,F=e.computedSortInfo,k=e.header,O=(0,yo.useCallback)(G=>{q.current=G,o.domRef?.(G)},[o.domRef]),H=A.alwaysReserveSpaceForSortIcon,W=e.headerAlign??e.align,z=(typeof W=="function"?W({isHeader:!0,column:e}):W)??"start",ee=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",V=ht(e,{actions:y,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:S,getState:h}),$=V.isSortable(),ie=$&&(e.computedSorted||H)?Me.createElement(Sa,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ge.spacing[2],marginInlineEnd:ge.spacing[2]},className:`${cn}__sort-icon ${Nd} ${kd({align:z})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,se=e.computedFilterable&&e.computedFiltered?Me.createElement(Kn,null):null,le=e.headerCssEllipsis??e.cssEllipsis??!0,pe={reserveSpaceWhenHidden:z==="center",menuVisible:v===e.id,style:z==="end"?{marginInlineStart:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ge.spacing[2]}:{marginInlineEnd:`calc(${ge.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ge.spacing[2]},domProps:{onMouseDown:G=>{G.stopPropagation(),V.toggleContextMenu(G.target)}}},ce=e.components?.MenuIcon||b?.MenuIcon||Xr,Y=Me.createElement(ce,{...pe}),q=(0,yo.useRef)(null),j={horizontalLayoutPageIndex:r,dragging:I,domRef:O,htmlElementRef:q,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:F,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:p,api:m,dataSourceApi:a,columnApi:V,renderBag:{sortIcon:ie,filterIcon:se,menuIcon:Y,menuIconProps:pe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},X=j,U=X.renderBag.header,Q=()=>{let G={...j,renderBag:{...j.renderBag}};if(e.renderSortIcon&&(G.renderBag.sortIcon=Me.createElement(Ko,{render:e.renderSortIcon,renderParam:{...G,renderBag:{...G.renderBag}}})),e.renderFilterIcon&&(G.renderBag.filterIcon=Me.createElement(Ko,{render:e.renderFilterIcon,renderParam:{...G,renderBag:{...G.renderBag}}})),typeof e.renderMenuIcon=="function"&&(G.renderBag.menuIcon=Me.createElement(Ko,{render:Re=>{if(typeof e.renderMenuIcon!="function")return null;let Xe=e.renderMenuIcon(Re);return Xe?Xe.type===ce||Xe.type===Xr?Xe:Me.createElement(ce,{...pe},Xe):null},renderParam:{...G,renderBag:{...G.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){G.renderBag.selectionCheckBox=Me.createElement(Ko,{render:qC,renderParam:{...G,renderBag:{...G.renderBag}}});let Re=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Re&&Re!==!0&&(G.renderBag.selectionCheckBox=Me.createElement(Ko,{render:Re,renderParam:{...G,renderBag:{...G.renderBag}}}))}k instanceof Function&&(G.renderBag.header=U=Me.createElement(Ko,{render:k,renderParam:{...G,renderBag:{...G.renderBag}}}));let ke=e.renderMenuIcon===!1?null:G.renderBag.menuIcon,St=le?Me.createElement("div",{className:Gt},G.renderBag.header):G.renderBag.header,de=Me.createElement(Me.Fragment,null,z==="center"?pc:null,G.renderBag.selectionCheckBox,St,G.renderBag.sortIcon,G.renderBag.filterIcon,z==="center"?pc:null,z!=="center"?pc:null,ke);return e.renderHeader?Me.createElement(Ko,{render:e.renderHeader,renderParam:{...G,renderBag:{...G.renderBag,all:de}}}):de};(0,yo.useEffect)(()=>{let G=null,ke=q.current;return E&&ke&&(G=Fn(ke,E)),()=>{G?.()}},[q.current,o.onResize]);let ae={height:x};e.headerStyle&&(ae=typeof e.headerStyle=="function"?{...ae,...e.headerStyle(X)||{}}:{...ae,...e.headerStyle});let he=typeof e.headerClassName=="function"?e.headerClassName(X):e.headerClassName,{onPointerDown:ue,proxyPosition:L,dragColumnOutside:N}=Wp({columnId:e.id,domRef:q,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),me=null,Ae=ha.Provider,ve={filtered:e.computedFiltered,verticalAlign:ee,align:z},be=Me.useMemo(()=>{let G=ke=>{m.setColumnFilter(e.id,ke)};return c>0?Ft(G,{wait:c}):G},[c,e.id]),Oe=e.computedFilterType,Ke=s[Oe],nt=e.computedFilterable?e.computedFilterValue?.filter.operator??Ke?.defaultOperator:void 0,Je=e.computedFilterable&&Ke?Ke.operators.find(G=>G.name===nt):void 0,it=Je?.components?.FilterEditor||Ke?.components?.FilterEditor||e.components?.FilterEditor||Un,et=Ke?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,qe=Kf(e,{horizontalLayoutPageIndex:r}),K=`var(${XC}-${e.computedVisibleIndex})`;ae.zIndex=K,ae.visibility=`var(${ZC}-${e.computedVisibleIndex}, visible)`;let ne={"data-field":`${e.field||""}`,"data-column-id":e.id,[vt]:e.id,[ei]:"header","data-header-align":z,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?Me.createElement(ep,{horizontalLayoutPageIndex:r,filterEditor:it,filterOperatorSwitch:et??tp,operator:Je,filterTypes:s,onChange:be,columnFilterType:Oe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:w}):Me.createElement(op,null);X.renderBag.filterEditor=ye;let Ce=(0,yo.useCallback)(G=>{ue(G),f(G)},[ue,f]),st=Q();return I&&L&&(me=Me.createElement("div",{key:e.id,className:`${cn}Proxy ${Id}`,style:{height:x,width:P,left:L.left??0,top:L.top??0}},Me.createElement("div",{className:vd({visible:N})},Me.createElement(em,{size:16})),U),me=(0,Jm.createPortal)(me,C.current)),Me.createElement(Ae,{value:X},Me.createElement(ma,{domRef:O,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...ne,"data-z-index":K,style:ae,width:P,onPointerDown:Ce,contentClassName:J(Rd(ve),Zu[z]),contentStyle:T?{height:x/2}:void 0,className:J(cn,od.none,$?qu.pointer:"",he,Yi(e,[cn,fo],Pd,{dragging:I,insideDisabledDraggingPage:M,align:z,verticalAlign:ee,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),wd),cssEllipsis:le,afterChildren:Me.createElement(Me.Fragment,null,T?ye:null,qe),renderChildren:st}),me)}var Xm=Me.memo(QC);function Nr(){return(0,yo.useContext)(ha)}var So=B(require("react")),rg=require("react");function tg(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var og={padding:ge.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},JC={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},ng=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(tg(t),n,"important")},ig=So.forwardRef(function(e,t){let{rootClassName:n}=Ni(),r=So.useRef(null),i=So.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,rg.useEffect)(()=>{let a=()=>{setTimeout(()=>{ng(r.current,og),ng(r.current?.firstElementChild,JC)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),So.createElement("div",{ref:i,...e,className:J(`${n}-Footer`,up,e.className),style:og},"Powered by"," ",So.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});var Ga=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new Z(n.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 Z(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 Dt=class extends Ga{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 zt(){let o=Ee().performance?.now();return`${Date.now()}:${o}`}function Ha(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var ag=new WeakMap;function Ka(o,e){if(!o||!o.length)return[];let t=ag.get(o);t||(t=new WeakMap,ag.set(o,t));let n=t.get(e);if(n)return n;let r=[],i=Ha(o,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],c=e[s.filter.type];if(s.disabled||!c)continue;let u;for(let d=0;d<c.operators.length;d++){let p=c.operators[d];p.name===s.filter.operator&&(u=p.fn)}u&&r.push({field:s.field,valueGetter:s.valueGetter||c.valueGetter,fn:u,value:s.filter.value,emptyValues:c.emptyValues})}return t.set(e,r),r}function fc(o,e){if(!o.length)return!0;let{data:t}=e,n={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=o.length;r<i;r++){let a=o[r];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?t[a.field]:t,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var ew=0;function mc(o){return ew++,fc(Ka(o.filterValue,o.filterTypes),o)}function Ba(o){return Ka(o.filterValue,o.filterTypes).length?o.isLeafNode?mc(o):o.filterTreeNode(o.data):!0}var tw="group-by",lg="group-by-";function sg(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Wa(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===tw){let i=sg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(lg)){let i=r.id.slice(lg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=sg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}var cg=!0,ow={originalDataArray:!0,changes:!0},nw={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Bt(o,e,t){let n=Wa(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],o.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=o.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=gc(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!ow[s]){let c=s,u=nw[c],d=i[c],p=l[c];(u?u(d,p):d===p)||(a[c]=!0)}return i.changes=a,i}function bo(o,e,t,n,r){let i=Bt(e,n,r),a=i.append;if(e.lazyLoad){let u=e.originalLazyGroupData,d=[Rt,...i.groupKeys||[]],p=u.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:cg,totalCount:0}),t.originalLazyGroupDataChangeDetect=zt()}if(typeof o=="function")try{o=o(i)}catch(u){o=Promise.reject(u)}let s=typeof o=="object"&&typeof o.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let c=u=>{if(console.error('The DataSource "data" function failed:',u),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([Rt,...d]),f=u instanceof Error?u.message:String(u);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=zt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(o).then(u=>{let d=[],p=!1;if(Array.isArray(u.data)){let m=u;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(y,S,T){let b=[Rt,...y],C=S.data,w={cache:S.cache??cg,childrenLoading:!1,childrenAvailable:!0,totalCount:S.totalCount??C.length,totalCountUnfiltered:S.totalCountUnfiltered,totalChildrenCount:S.totalChildrenCount,totalChildrenCountUnfiltered:S.totalChildrenCountUnfiltered,children:C,error:S.error},R=[];if(i.lazyLoadBatchSize&&!T){let D=g.get(b),I=!D,M=$d({children:!0},D||{},w);I&&(M.chidren=[]),M.children.length=M.totalCount;let E=i.lazyLoadStartIndex??0,x=Math.min(S.totalCount??C.length,E+i.lazyLoadBatchSize);for(let P=E;P<x;P++){let A=w.children[P-E];if(!A)throw`lazily loaded item not found at index ${P-E}`;M.children[P]=A,A.dataset&&R.push({keys:A.keys,dataset:A.dataset})}I&&g.set(b,M)}else w.children.forEach(D=>{D&&D.dataset&&R.push({keys:D.keys,dataset:D.dataset})}),w.children.length=w.totalCount,g.set(b,w);let v=!1;if(!y||!y.length){let D=g.get([Rt]);t.originalDataArray=[...D.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=zt()),R.length){let D=y;R.forEach(({keys:I,dataset:M})=>{h(I,M,D)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=u;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(c)}function gc(o,{filterTypes:e,filterMode:t}){return t==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(ug):(Ha(o,e)||[]).map(ug)}function ug(o){if(!o.valueGetter)return o;let e={...o};return delete e.valueGetter,e}function dg(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=gc(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var rw=()=>new Promise(o=>{He(o)});function hc(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function pg(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;if(!e||!t||t<=0)return!1;for(let r of n.keys())if(r.length===1)return!0;return!1}function fg(o){for(let[e,t]of o.entries())t==="failed"&&o.delete(e)}function mg(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new Z,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let y=c(g),S=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&S.pop();let T=S.length?S:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},w=h.groupKeys,R=d.get(w);if(!R?.[h.id]){let v=!R;R=R||{},R[h.id]||(R[h.id]=C),v&&d.set(w,R)}}if(!y&&r!=null){let C=d.get(T),w=Math.floor(b/r)*r,R=b-w,v=s[h.indexInAll-R].indexInAll,D=c(v),I=s[v].id;if(D||C?.[I])continue;let M=!C;C=C||{};let E={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:S,append:u};C[I]||(C[I]=E),M&&d.set(T,C)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let y=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(y))return g;e?.set(y,!0);let S=[i.data,i,a,h];return g.then(()=>rw()).then(()=>bo(...S))},f)}function yc(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function ci(o,e){let t=yc(o,e);return t===-1?null:Jt({...o,rowIndex:t,columnId:e.columnId})}function ui(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function Sc(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function ja(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function bc(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function gg(o,e,t){if(bc(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),y=[];for(let S=d;S<=p;S++)for(let T=g;T<=h;T++){let b=S*n+T;if(S===d)for(let C=s;C<r;C++)y.push({rowIndex:b,colIndex:C});else if(S===p)for(let C=0;C<=u;C++)y.push({rowIndex:b,colIndex:C});else for(let C=0;C<r;C++)y.push({rowIndex:b,colIndex:C})}return y}function iw(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Tc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Vo(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Vo(l,this.getDataSourceState),h=Vo(c,this.getDataSourceState);if(!g||!h)return;let y=g.indexInAll,S=h.indexInAll,[T,b]=ja({rowIndex:y,colIndex:f},{rowIndex:S,colIndex:m});for(let C=T.rowIndex;C<=b.rowIndex;C++)for(let w=T.colIndex;w<=b.colIndex;w++){let R={rowIndex:C,colIndex:w},[v,D]=this.getCellSelectionPosition(R);n?a.selectCell(v,D):a.deselectCell(v,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=ia(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.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 c=iw(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};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 n=new Ue(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new Ue(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function hg(o){return new Tc(o)}var ur=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)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 Mt=class extends ur{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}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,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function yg(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Mt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Mt({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 Mt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.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 Mt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Yo(o,e,t){return Math.min(Math.max(o,e),t)}function Ua(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Yo(a,r,i)}function aw(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,y=0,S=c-1,T={ArrowDown:()=>{p=Ua(n,p,1)},ArrowUp:()=>{p=Ua(n,p,-1)},ArrowLeft:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;p-w>=y?p=p-w:T.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;p+w<=S?p=p+w:T.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[p];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,y)},End:()=>{p=S},Home:()=>{p=y}},b=T[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Cc(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[y,S]}=p.getRenderRange(),T=y-g-1,b=S-h-1,C=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,R=0,v=0;f=Yo(f,0,C),m=Yo(m,0,w);let D={ArrowDown:()=>{f=Yo(f+1,R,C)},ArrowUp:()=>{f=Yo(f-1,R,C)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=w),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f-M>=R?f=f-M:D.ArrowUp()}else D.ArrowUp();else m=Yo(m-1,v,w)},ArrowRight:()=>{if(m===w)if(f!==C&&(m=v),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f+M<=C?f=f+M:D.ArrowDown()}else D.ArrowDown();else m=Yo(m+1,v,w)},Enter:()=>{let M=c[f];return M&&M.isGroupRow?t.toggleGroupRow(M.groupKeys):M&&M.isTreeNode&&M.isParentNode?a.treeApi.toggleNode(M.nodePath):M&&t.rowDetailApi.isRowDetailEnabledForRow(M.id)?t.rowDetailApi.toggleRowDetail(M.id):!1},PageDown:()=>{s?m=Math.min(m+b,w):f=Math.min(f+T,C)},PageUp:()=>{s?m=Math.max(m-b,v):f=Math.max(f-T,R)},End:()=>{s?m=w:f=C},Home:()=>{s?m=v:f=R}},I=D[l];return I?(I(),[f,m]):!1}function lw(o,e){let t=Cc(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var sw={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Sg(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!sw[t]?!1:i!=null&&l==="row"?aw(o,e):a!=null&&l==="cell"?lw(o,e):!1}var wc=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:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ua(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,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Cc(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function bg(o){return new wc(o)}function Tg(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Rc=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();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(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));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=yc({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...Jt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let c=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),u;try{u=await c(l)}catch(p){u=p}let d=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...Jt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.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={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,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:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{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 c=l.computedEditable(Jt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=ht(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||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(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=or({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.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 n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new Dt(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(),n=new Dt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Rt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||bo(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=Z.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=zt())}};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,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:c.scrollLeft}),c.scrollTop!==u.scrollTop&&!m&&this.setNativeScroll({scrollTop:c.scrollTop}),!0)};this.context=e,this.rowSelectionApi=cf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=bg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=yg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=hg({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},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Sc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Sc(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Sf({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(Jt({...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,n){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,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,c=l?void 0:i.field,u=s?Array.isArray(s)?s:[s]:[],d=u.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Ao);d.length&&(c=d);let p=i.computedSortType;if(u.length&&p===uo){let m=this.getState().initialColumns;p=u.flatMap(h=>{let y=h.field??h.groupField,S=y?r.get(y):null;if(S)return S.computedSortType;let T=y?nn(m,y):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[uo]})}u.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:c,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,n)}setSortInfoForColumn(e,t,n){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=>!Tg(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Tg(d,l)?(c=!0,t):d),c||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 n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.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 n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Ao),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),n=t.scrollerDOMRef.current;if(!n)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(n.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(n.scrollLeft=r.scrollLeft)}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){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),u&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Cg(o){return new Rc(o)}var wn=require("react");var cw=10;function wg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${fo} > .${Wr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${cn}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Gt.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=Ee().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+cw}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c&&h.nodeType===1){let y=h,S=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(S)&&(S=0),g+=S,S>0){let T=Ee().getComputedStyle(y);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Rg(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=kt(),[a,l]=(0,wn.useState)(0),s=typeof r=="object"?r.key:r,c=Ne(s),u=(0,wn.useRef)(null);(0,wn.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,wn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),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),u.current=s;let g=wg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let y=o().columnSizing,S={...y},T=!1;h.forEach(b=>{S[b]={width:g[b]},T=T||S[b].width!==y[b]?.width}),T&&(e.columnSizing=S)},[s,n,a])}var Qo=require("react");var $a=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);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 n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}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,n,r){if(r.horizontalLayout&&!bc(e,t,r)){gg(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=ja(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function uw(o,e){return o<e?[o,e]:[e,o]}var Ya=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let n=this.getRowAt(e);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){n.nodePath&&this.isNodeSelectable(n)&&r.setNodeSelection(n.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(n.id,a):i.deselectRow(n.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let n=this.getGroupKeys(t);return t.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(t.id,n)}setRangeSelected(e,t,n){let[r,i]=uw(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let n=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!n||!r||r.length<n.length?!1:n.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let n=e-1;n>=0&&this.isSelectedAt(n);n--)t=n;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};var fh=require("react");var ph=B(require("react"));var dw=()=>{};function Ig(o,e){let t=new Z,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function vg(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=mt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let y=m[g];vg(o,e,d,y)}});p?(c?.(n),s?.(n,dw)):(l?.(n,f,i(n)),s?.(n,f))}function Pg(o,e,t){for(let n=0,r=t.length;n<r;n++)vg(o,e,[],t[n])}var pw=function(o,e){return o-e},fw=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),qa;function mw(){try{let o=new Intl.Collator;return fw.has(o.resolvedOptions().locale)?null:o}catch{return null}}var gw=function(o,e){return o=`${o}`,e=`${e}`,qa===void 0&&(qa=mw()),qa?qa.compare(o,e):o.localeCompare(e)},hw=function(o,e){return o-e},yw={number:pw,string:gw,date:hw},qo=yw;function Dg(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var no=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(xg(Dg(o),n)),r&&r.end(),e},Xa=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=xg(Dg(o),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return Pg({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};no.knownTypes=qo;var Sw=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=no.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(no.knownTypes).join(", ")}`)}return r||(r=qo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},bw=o=>o.map(Sw).filter(e=>e instanceof Function),xg=(o,e)=>{let t=bw(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var Tw=B(require("react"));function Za(o){return Fe(e=>o(e.dataSourceState))}var Cw=$e("IT:InfiniteTable"),ww="#dc3545",Rw="#eb9316";var Mg="Warn",Ag="Error",Iw="Info",vw="Success",Pw="Logs",Qa=Cw.extend(Pw),Az=Qa.extend(Iw),Dw=Qa.extend(Mg),xw=Qa.extend(Ag),_z=Qa.extend(vw);var Ew=Rw,Mw=ww;var Aw=(o,e)=>{e=e?e.extend?e.extend(Mg):e:Dw,e(typeof e.color=="function"?e.color(Ew,o):o)},_w=(o,e)=>{e=e?e.extend?e.extend(Ag):e:xw,e(typeof e.color=="function"?e.color(Mw,o):o)};var Eg=new Z,_g=(o,...e)=>{Eg.has(e)||(Eg.set(e,!0),o())};var Og=(o,e=o,t)=>{_g(()=>Aw(o,t),e,"warn")},Fg=(o,e=o,t)=>{_g(()=>_w(o,t),e,"error")};var Ic=new WeakMap,Ow=o=>o;function Ng(o,e=50,t){Ic.set(o,{lastCallTime:0,lastCallArg:null});let n=t??Ow;return r=>{let{lastCallTime:i,lastCallArg:a}=Ic.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=Tt(n(a),n(r));s<e&&c||(Ic.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Ja=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new Z;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[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,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};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:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[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)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),y=s?[...p,h]:void 0,S=s&&!!y,T=S?n?.getMutationsForNodePath(y):n?.getMutationsForPrimaryKey(h);if(T&&T.length){for(let b=0,C=T.length;b<C;b++){let w=T[b];if(w.type==="delete"&&!g&&(S?this.removeNodePath(y,t):this.remove(h),g=!0,d.splice(f,1),f--),w.type==="update"&&!g&&(m={...m,...w.data},d[f]=m),w.type==="update-children"&&!g){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))}S?n?.removeNodePathInfo(y):n?.removeInfo(h)}if(!g)if(S){this.addNodePath(y,m);let b=a(m),C=b?null:i(m);!b&&Array.isArray(C)&&(p.push(h),c&&(m[l]=C=C.concat()),u(C,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};var Fw=Object.freeze([]),Lg=(o,e)=>{let t=o??Fw,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var xt=class extends ur{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}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,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function el(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!el(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!el(o[r],e[r]))return!1;return!0}return!1}function Nw(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var tl={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},kg={...tl,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},Lw={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},kw={...tl,...Lw,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},zg={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},zw={...tl,...zg,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},Vw={...tl,...zg,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},Gw=Object.entries(kg).map(([o,e])=>e?o:void 0).filter(Boolean),Hw=Object.entries(kg).map(([o,e])=>e?o:void 0),Kw=Object.entries(kw).map(([o,e])=>e?o:void 0),Bw=Object.entries(zw).map(([o,e])=>e?o:void 0),Ww=Object.entries(Vw).map(([o,e])=>e?o:void 0);function jw(o,e){if(o===e)return!0;if(!o||!e||!Nw(o,e)||o.id!==e.id||o.data!==e.data&&!el(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?Kw:Hw:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?Ww:Bw:t=Gw;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!el(r,i))return!1}return!0}function Vg(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,y=p!==m&&t.size>0;y&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let S=[],T=l();for(let b of T){let C=m[b],w=p[b];if(w===void 0){S.push(b);continue}jw(C,w)||S.push(b)}o=p,(S.length>0||y)&&queueMicrotask(()=>{for(let b=0,C=S.length;b<C;b++){let w=S[b],R=e.get(w);if(R)for(let v of R)v()}if(y)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:S.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var To=new Map,Co=new Map,Xo=new Map,wo=new Map,ro=new Map;var Uw=Symbol("cursorId"),Gg=o=>o.totalLeafNodesCount===0,$w=o=>o.isParentNode?!Gg(o):!0;function Hg(o){let e=Date.now(),t=[],n=[],r=new Z;return{logger:Nt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Vg(),indexer:new Ja,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 Z,waitForNodePathPromises:new Z,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new Z,dataParams:void 0,onCleanup:Te(),notifyScrollbarsChange:Te(),notifyScrollStop:Te(),notifyRenderRangeChange:Te(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:Uw,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt: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 Yw(o){let e={...o};return delete e.originalDataArray,e}var qw=[],Kg=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},Bg=(o,e)=>({onDataParamsChange:t=>t?Ng(t,100,Yw):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Gg,isNodeSelectable:t=>t??$w,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,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...No,...t}),sortTypes:t=>({...qo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.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 xt)return t;let n=o.propsCache.get("rowDisabledState"),r=n.get(t);return r||(r=new xt(t),n.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=>Lg(t,o.propsCache.get("sortInfo")),groupBy:t=>t??qw});function Xw(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}function Zw(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var Qw={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Wg(o,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.
|
|
1
|
+
"use strict";var Yb=Object.create;var Ii=Object.defineProperty;var qb=Object.getOwnPropertyDescriptor;var Xb=Object.getOwnPropertyNames;var Zb=Object.getPrototypeOf,Qb=Object.prototype.hasOwnProperty;var Jb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),eT=(o,e)=>{for(var t in e)Ii(o,t,{get:e[t],enumerable:!0})},Du=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xb(e))!Qb.call(o,r)&&r!==t&&Ii(o,r,{get:()=>e[r],enumerable:!(n=qb(e,r))||n.enumerable});return o};var H=(o,e,t)=>(t=o!=null?Yb(Zb(o)):{},Du(e||!o||!o.__esModule?Ii(t,"default",{value:o,enumerable:!0}):t,o)),tT=o=>Du(Ii({},"__esModule",{value:!0}),o);var an=Jb((qE,_p)=>{"use strict";_p.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});var pv={};eT(pv,{AutoScroller:()=>gn,CellSelectionState:()=>Ue,DRAG_ITEM_ATTRIBUTE:()=>Tt,DataClient:()=>Su,DataSource:()=>kI,DataSourceActionType:()=>Eh,DeepMap:()=>q,DragDropProvider:()=>ta,DragInteractionTarget:()=>ar,DragList:()=>Wo,FixedSizeSet:()=>Vl,FlashingColumnCell:()=>Eb,GroupRowsState:()=>xt,INTERNAL_MatrixDebugger:()=>Ab,InfiniteTable:()=>co,InfiniteTableClassName:()=>Jt,InfiniteTableComponent:()=>Sb,Menu:()=>Yt,RowDetailCache:()=>mr,RowDetailState:()=>At,RowDisabledState:()=>Et,RowSelectionState:()=>Oe,TreeDataSource:()=>iv,TreeExpandState:()=>ft,TreeGrid:()=>Cb,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>Hl,alignNode:()=>Cl,components:()=>dv,createDefaultProxy:()=>wa,createFlashingColumnCellComponent:()=>bu,debounce:()=>Nt,debug:()=>Ye,defaultDragProxyMove:()=>va,defaultFilterFunction:()=>Tc,defaultFilterTypes:()=>No,defaultTreeFilterFunction:()=>$a,eventMatchesKeyboardShortcut:()=>Sl,filterDataArray:()=>kc,filterTypes:()=>No,flatten:()=>pf,getComponentStateRoot:()=>kt,group:()=>pa,interceptMap:()=>Ib,keyboardShortcuts:()=>Rb,multisort:()=>ro,multisortNested:()=>el,queryKeyToCacheKey:()=>_n,toTreeDataArray:()=>Kg,useComponentState:()=>zt,useDataSourceApi:()=>xh,useDataSourceInternal:()=>fr,useDataSourceSelector:()=>Ne,useDataSourceState:()=>tl,useDragDropProvider:()=>fo,useDragListContext:()=>hn,useEffectWhen:()=>Bl,useEffectWhenSameDeps:()=>wb,useEffectWithChanges:()=>vn,useEffectWithObject:()=>EI,useGridScroll:()=>Al,useInfiniteColumnApi:()=>yb,useInfiniteColumnCell:()=>$r,useInfiniteColumnEditor:()=>ya,useInfiniteColumnFilterEditor:()=>Un,useInfiniteHeaderCell:()=>Lr,useInfinitePortalContainer:()=>BS,useInfiniteTableApi:()=>hb,useLayoutEffectWithChanges:()=>xI,useManagedDataSource:()=>Vc,useMasterRowInfo:()=>Mo,useOverlay:()=>lo,useOverlayPortal:()=>jy,usePrevious:()=>Oo,useRowInfoReducers:()=>zI,useVisibleColumnSizes:()=>NS,withSelectedLeafNodesOnly:()=>yu});module.exports=tT(pv);function Nt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var Ee=H(require("react"));var X=(...o)=>o.filter(e=>!!`${e}`).join(" ");var tn=H(require("react")),ts=require("react");var oT=H(require("react")),Do=require("react");var Nn=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Nt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}};var wi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,Do.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=Nn(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,Do.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,Do.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Ce(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;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 yt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var xu=(o,e)=>o-e;var vi=(o,e)=>xu(o.revision,e.revision),q=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.mutations=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],S=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,S,f);if(n&&y===!0)return!0;l++}else S?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}get version(){return this.mutations}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(vi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(vi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(vi).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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 n=this.map;this.mutations++,e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0,this.mutations++}delete(e){let t=this.map;this.mutations++,e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===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,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=yt(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,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 n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}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(vi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=q;function Fe(){return globalThis}var Di=["#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"],Eu=Symbol("color"),Pi=new WeakMap,Yl=Ce();function ql(o=Di){Pi.set(o,o.map(e=>0))}ql();var nT=(o=Di)=>{let e=[];Pi.has(o)?e=Pi.get(o):(e=o.map(n=>0),Pi.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??Di[0]},Dr=":",Xl="*",Mu="-",rT=",",iT="debug",aT="diffdebug",_u=!1,Pr=new q,xr=new Map;function Zl(o,e){let t=o.split(Dr),n=new q;n.set(t,!0);let r=e.split(Dr),i=new Set(r).has(Xl),a=r.indexOf(Xl),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(Dr)):!0}}function Ou(o,e){let t=`channel=${o}_permissions=${e}`;if(xr.has(t))return xr.get(t);let n=e.split(rT);function r(l){return xr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(Xl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Mu);if(c&&(s=s.substring(Mu.length)),Zl(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),Zl(o,s))return r(!c)}return r(!1)}var Ql=()=>Ye.enable??(Fe()&&Fe().localStorage?.getItem(iT))??"",lT=()=>Ye.diffenable??(Fe()&&Fe().localStorage?.getItem(aT))??`${_u}`,Jl="",Fu=_u;function es(o){Fu=`${lT()}`=="true",Jl!==o&&(Jl=o,xr.clear())}function Nu(o){es(Ql()),typeof Fe()<"u"&&Fe().addEventListener&&Fe().addEventListener("storage",function(){es(Ql())});function e(t,n){let r=n?`${n}${Dr}${t}`:t,i=r.split(Dr),a=Pr.get(i);if(a)return a;let l=Pr.get(i.slice(0,-1)),s=(l?l.logFn:Ye.logFn)??Lu,c=s,u,d=0,p=()=>u??Ou(r,Jl),f=nT(Ye.colors),m=Object.defineProperties((...g)=>{let h=Yl.getListenersCount(),S;if(h>0&&(S=S??Date.now(),Yl({color:f,channel:r,args:g,timestamp:S})),p()){if(S=S??Date.now(),d&&Fu){let b=S-d;c(`%c[${r}]`,`color: ${f}`,`+${b}ms:`)}d=S;let y=[],T;if(g.forEach(b=>{if(b[Eu])T===void 0&&(T=!0),y.push(...b);else{if(typeof b!="string"&&typeof b!="number"){T=!1;return}y.push(`${b}%s`)}}),T){let b=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];c(...b)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let S=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return S.toString=()=>h.join(" "),S[Eu]=!0,S}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Pr.delete(i)}}});return Pr.set(i,m),m}return e(o)}var Lu=console.log.bind(console),Au;Object.defineProperty(Nu,"enable",{get:()=>Au,set:o=>{Au=o,es(Ql())}});var Ye=Nu;Ye.colors=Di;Ye.logFn=Lu;var sT=(o,e)=>Yl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;Zl(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ye.onLogIntent=sT;Ye.isChannelEnabled=Ou;Ye.destroyAll=()=>{ql(),ql(Ye.colors),Pr.clear(),xr.clear()};var Lt=o=>{let e=Ye(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},xo=o=>{let e=Ye(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Er=()=>Er;Er.extend=()=>Er;var It=class{constructor(e){this.debug=Er,this.error=Er}};var ku=xo("CSSVariableWatch"),zu=Lt("CSSVariableWatch"),Vu={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};function Gu(o){return o.startsWith("var(")||o.startsWith("calc(")?o:`var(${o})`}var cT=o=>{let e=(0,ts.useRef)(0),t=tn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);wi(o.ref,t,{earlyAttach:!0}),tn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,zu(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);ku(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Mr=o=>{let e=(0,ts.useRef)(null);cT({...o,ref:e});let t=Gu(o.varName),{allowInts:n=!1}=o;return tn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:Vu},tn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var zn=require("react");function Eo(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var uo=require("react");function wt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(o[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Hu(o,e,t){let n=(0,uo.useRef)(e);n.current=e;let r=(0,uo.useRef)(t);r.current=t;let i=(0,uo.useRef)(void 0),a=(0,uo.useRef)(!1),l=(0,uo.useCallback)(()=>{let s=o.getSnapshot(),c=n.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[o]);return(0,uo.useSyncExternalStore)(o.subscribe,l,l)}function xi(o,e){return Hu(o,e,Object.is)}function Ln(o,e){return Hu(o,e,wt)}var Ku=H(require("react")),os;function kn(){return os||(os=Ku.createContext(null))}var Bu=Eo(),Wu=()=>{};function Ei(){let o=kn();return(0,zn.useContext)(o)||void 0}function Mi(){let o=Ei();return(0,zn.useCallback)(()=>o?.getSnapshot(),[o])}function Ai(o){let e=kn(),t=(0,zn.useContext)(e),n=Ln(t||Bu,t?o:Wu);return t?n??void 0:void 0}function Mo(){let o=kn(),e=(0,zn.useContext)(o),n=xi(e||Bu,e?r=>r.masterRowInfo:Wu);return e?n:void 0}var Vn=H(require("react")),lt=require("react");function Ao(o){if(o==null)return!1;let e=o;return!0}var _o=require("react");var _i=require("react"),qt=()=>{let[o,e]=(0,_i.useState)(0);return[o,(0,_i.useCallback)(()=>{e(t=>t+1)},[e])]};var ju=o=>{let e=(0,_o.useCallback)(o,[]),t=(0,_o.useRef)(!1),n=(0,_o.useRef)(!1),r=(0,_o.useRef)(void 0),[i,a]=qt();t.current&&(n.current=!0),(0,_o.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var Oi=require("react");function Le(o){let e=(0,Oi.useRef)(o);return e.current=o,(0,Oi.useCallback)(()=>e.current,[])}var Fi=require("react"),Oo=(o,e)=>{let t=(0,Fi.useRef)(e===void 0?o:e);return(0,Fi.useLayoutEffect)(()=>{t.current=o}),t.current};var Ar={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var uT="\u200B",ns=class o{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,n=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown",u=uT+s;return performance.measure(u,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(d=>[d.name,d.value]):void 0,tooltipText:l}}}),performance.clearMeasures(u),this};this.debugId=e}static create(e){return new o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(Ar).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Ar[n].track,label:i.label}),get label(){let i=Ar[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,n,{get:()=>{let i=Ar[n];return e.markerDetails.track=i.track,r}}),t},{})}};function st(o){return ns.create(o)}function Uu(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var rs=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function _r(o){return o!==void 0}function Fo(o,e){let t=e[o];return _r(t)}var $u=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function dT(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Fo(r,e)?e[r]:e[`default${rs(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Yu(o,e,t){let{fn:n,propertyReads:r}=Uu(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function qu(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=dT(n,e,t));let s={...t,...l};if(i){let c=Yu(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...c}}return s}function Xu(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,c=e.payload.mappedState,u=e.payload.updatedPropsToState,d={...o};if(c&&Object.assign(d,c),i){let f=Yu(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:u,parentState:s}):d}function Zu(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=$u}=o,c=t();return Object.keys(c).reduce((u,d)=>{let p=d;return Object.defineProperty(u,d,{set:m=>{let g=n(),h=t(),S=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:u,state:h})===!1&&(S=!1),S){let b=[m],R=`on${rs(d)}Change`;if(l&&l[p]){let C=l[p](m,h);R=C.callbackName||R,b=C.callbackParams}s(g,R,b)}let y=r[p];typeof y=="function"&&(m=y(m));let T=!!i?.[p];Fo(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),u},{})}function Qu(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},c=0,u={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],h=e[m];if(m!=="children"&&g!==h&&(u[m]={newValue:h,oldValue:g},d++,Fo(m,e)||Fo(m,t)))if(r.hasOwnProperty(f)){let S=h,y=r[f];typeof y=="function"&&(S=y(h)),n[m]!==S&&(a[m]=S,l++)}else i.has(f)&&(s[m]=e[m],c++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:c,rawUpdatedProps:u,rawUpdatedPropsCount:d}}var is;function Ju(){return is||(is=(0,lt.createContext)(null))}function kt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,lt.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,lt.useRef)(new Set),l=(0,lt.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Le(s);function u(){return qu({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,lt.useState)(u),p=Le(r),f=(w,v)=>Xu(w,v,{getProps:p,getParentState:()=>c?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,lt.useReducer)(f,d),h=Le(m),{allowedControlledPropOverrides:S}=o,y=(0,lt.useMemo)(()=>Zu({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:S,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,S]),T=o.Context??Ju(),b=(0,lt.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:w=>{g({type:"REPLACE_STATE",payload:w})},assignState:w=>{g({type:"ASSIGN_STATE",payload:w})}}),[m,y,h]),R=Oo(r),C=(0,lt.useRef)(!1);C.current=!1;let I=o.layoutEffect?lt.useLayoutEffect:lt.useEffect;return I(()=>{let w=r,{newMappedState:v,newMappedStateCount:P,updatedPropsToState:E,updatedPropsToStateCount:M,rawUpdatedProps:D,rawUpdatedPropsCount:x}=Qu({currentProps:w,prevProps:R,state:m,propsToForward:l,propsToStateSet:a.current});if(M>0||P>0){let O=m.debugId,F=O?st(O).track.ComponentState.label.PropUpdate.start():void 0,z=o.debugName?typeof o.debugName=="function"?`${o.debugName(w)}:rerender`:`${o.debugName}:rerender`:"rerender";Lt(z)("Triggered by new values for the following props",...Object.keys(v??{}),...Object.keys(E??{})),F&&F.end({label:z,details:[P>0?{name:"Updated properties",value:Object.keys(v).join(", ")}:void 0,M>0?{name:"Updated props",value:Object.keys(E).join(", ")}:void 0,M>0||E?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Ao)});let B={payload:{mappedState:P?v:null,updatedPropsToState:M?E:null}};if(C.current=!0,g(B),o.onPropChange){for(var A in D)if(D.hasOwnProperty(A)){let{newValue:Y,oldValue:V}=D[A];o.onPropChange({name:A,newValue:Y,oldValue:V},r,y,m)}}o.onPropsChange&&x&&o.onPropsChange(D,r,y,m)}}),I(()=>{s!=null&&!C.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),ju(()=>()=>{o.cleanup?.(h())}),{contextValue:b,ContextComponent:T}}return{ManagedComponentContextProvider:Vn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Vn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function zt(o){return o=o??Ju(),Vn.useContext(o)}var pd=H(require("react"));var St="Infinite",ze={rootClassName:St};var Ni=()=>ze;var ed="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",td={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ht="_16lm1iw3b _16lm1iw3c _16lm1iw35",od={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Gn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Li={1:"_16lm1iw1c",none:"_16lm1iw1d"},Or={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var nd={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},rd={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},id={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var ad={none:"_16lm1iwd"},ld={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var ki={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var sd={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var cd={none:"_16lm1iw1x"};var ud={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var dd={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function fd(o){let{rootClassName:e}=Ni();return pd.createElement("div",{...o,className:X(`${e}Footer`,ki.relative,Gn.flex,Or.row,o.className)})}var _e=H(require("react")),So=require("react"),fg=require("react-dom");function zi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function Q(o){return o.slice(4,-1)}var hd=H(require("react"));var Hn={expandCollapse:"_1jm33zv0",loading:"_1jm33zv1",done:"_1jm33zv2",clear:"_1jm33zv3",hidden:"_1jm33zv4",filterOperatorContains:"_1jm33zv5",filterOperatorStartsWith:"_1jm33zv6",filterOperatorEndsWith:"_1jm33zv7",filterOperatorEq:"_1jm33zv8",filterOperatorNeq:"_1jm33zv9",filterOperatorGt:"_1jm33zva",filterOperatorGte:"_1jm33zvb",filterOperatorLt:"_1jm33zvc",filterOperatorLte:"_1jm33zvd"},md="_1jm33zvf";var gd={expandCollapse:"expand-collapse",loading:"loading",done:"done",clear:"clear",hidden:"hidden",filterOperatorContains:"filter-operator-contains",filterOperatorStartsWith:"filter-operator-starts-with",filterOperatorEndsWith:"filter-operator-ends-with",filterOperatorEq:"filter-operator-eq",filterOperatorNeq:"filter-operator-neq",filterOperatorGt:"filter-operator-gt",filterOperatorGte:"filter-operator-gte",filterOperatorLt:"filter-operator-lt",filterOperatorLte:"filter-operator-lte"};var ct="InfiniteIcon";var Ve=o=>{let{icon:e,...t}=o,n=o.size??"var(--infinite-icon-size)",r={flex:"none",width:n,height:n,fill:"currentColor",...o.style};return hd.createElement("svg",{viewBox:"0 0 24 24",...t,className:e?X(o.className,Hn[e],ct,`${ct}-${gd[e]}`):o.className,style:r},o.children)};var as=H(require("react"));var Ge={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"],clear:["M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"]};var yd=o=>as.createElement(Ve,{...o,icon:"filterOperatorContains"},Ge.includesOperator.map(e=>as.createElement("path",{key:e,d:e})));var ls=H(require("react"));var Sd=o=>ls.createElement(Ve,{...o,icon:"filterOperatorEndsWith"},ls.createElement("path",{d:Ge.endsWithOperator[0]}));var ss=H(require("react"));var bd=o=>ss.createElement(Ve,{...o,icon:"filterOperatorEq"},ss.createElement("path",{d:Ge.eqOperator[0]}));var cs=H(require("react"));var Td=o=>cs.createElement(Ve,{...o,icon:"filterOperatorGte"},cs.createElement("path",{d:Ge.gteOperator[0]}));var us=H(require("react"));var Cd=o=>us.createElement(Ve,{...o,icon:"filterOperatorGt"},us.createElement("path",{d:Ge.gtOperator[0]}));var ds=H(require("react"));var Rd=o=>ds.createElement(Ve,{...o,icon:"filterOperatorLte"},ds.createElement("path",{d:Ge.lteOperator[0]}));var ps=H(require("react"));var Id=o=>ps.createElement(Ve,{...o,icon:"filterOperatorLt"},ps.createElement("path",{d:Ge.ltOperator[0]}));var fs=H(require("react"));var wd=o=>fs.createElement(Ve,{...o,icon:"filterOperatorNeq"},fs.createElement("path",{d:Ge.neqOperator[0]}));var ms=H(require("react"));var vd=o=>ms.createElement(Ve,{...o,icon:"filterOperatorStartsWith"},ms.createElement("path",{d:Ge.startsWithOperator[0]}));var ws=H(require("react"));var dt=H(require("react")),Nr=require("react");var Kn=H(require("react")),on=require("react");function pT(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function fT(o){var e=pT(o,"string");return typeof e=="symbol"?e:String(e)}function mT(o,e,t){return e=fT(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Pd(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Dd(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pd(Object(t),!0).forEach(function(n){mT(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Pd(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function xd(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var gT=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},Se=o=>{var e=t=>{var n=o.defaultClassName,r=Dd(Dd({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)gT(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return xd(o.variantClassNames,t=>xd(t,n=>n.split(" ")[0]))}},e};var Ed="_1eexc2a6";var Md=Se({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),Ad="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",_d=Se({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Od=Se({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),Fd=Se({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),Nd="_12zfob12u _16lm1iw22 _16lm1iw1z";var Ld="_12zfob17",kd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",zd=Se({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),gs=Se({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Vd="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Gd=Se({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Hd="_12zfob1b _16lm1iw2",Kd="_16lm1iw1",Bd="_12zfob16",Wd=Se({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),jd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Ud="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j",Vi="_1nnkya21";var $d={transition:"width 0.25s, opacity 0.25s"},lx=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function Bn(o){let[e,t]=(0,on.useState)(!0),[n,r]=(0,on.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...$d,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,on.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,on.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return Kn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:X(l,ct,Ud,`${ct}-filter`)},c?Kn.createElement("div",{"data-name":"index",style:m,className:Ld},s):null,Kn.createElement("div",{className:Vi,style:{width:p[0],...f}}),Kn.createElement("div",{className:Vi,style:{width:p[1],...f}}),Kn.createElement("div",{className:Vi,style:{width:p[2],...f}}))}var Gi=Object.freeze({}),hT={string:Gi,number:{}};function Wn(o,e){let t=e.default||Gi;return o.type===void 0?t:o.type===null?Gi:typeof o.type=="string"?e[o.type]||hT[o.type]||Gi:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ys=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((I,w)=>{let v=I.maxSize??r??void 0,P=I.minSize??n??void 0;s.push(P),c.push(v),I.size!=null&&(v!=null&&I.size>v&&(I.size=v),P!=null&&I.size<P&&(I.size=P));let E=I.flex==0?null:I.flex;if(I.size==null&&E==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;E!=null&&(l+=1),a+=E??0,i+=I.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((I,w)=>{if(I.flex!=null){let v=d*I.flex,P=I.maxSize??r??void 0,E=I.minSize??n??void 0,M=!1,D=0;P!=null&&v>P&&(p[w]=!0,M=!0,D=P),E!=null&&v<E&&(f[w]=!0,M=!0,D=E),M&&(m+=1,l-=1,a-=I.flex,u-=D)}}),m&&(d=u/a);let g=[],h=0,S=u,y=a,T=0,b=0,R=[];return{items:t.map((I,w)=>{let v={...I},P=I.maxSize??r??void 0,E=I.minSize??n??void 0,M=0,D=p[w],x=f[w],A=D||x,O=I.size??0;if(I.flex!=null){if(A)x&&(M=E),D&&(M=P);else{h+=1;let F=z=>(P!=null&&z>P&&(z=P),E!=null&&z<E&&(z=E),z);h===l?M=F(S):(M=F(Math.round(I.flex*d)),b+=M,S=u-b,y-=I.flex,d=S/y)}O=M,v.flexSize=M}return g.push(M),R.push(O),v.computedSize=O,T+=O,v}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:R,remainingSize:Math.round(e-T)}};function Hi(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}function qd(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function hs(o,e){return o.computedFlex&&!e?"flex":"width"}function Fr(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var Ss=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((E,M)=>(E[M]={...o.columnSizing[M]},E),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=qd(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=hs(l,d),h=s?.computedWidth,S=s?.computedMinWidth,y=s?.computedMaxWidth,T=s?hs(s,d):"width",b=!1,R=!1,C=r>0?1:-1,{value:I,clamped:w,diff:v}=Hi(Math.round(p+r),f,m,C);if(o.shareSpaceOnResize){if(s==null)return n[c]=Fr(n[c],g,I),R=w==="min",b=w==="max",{adjustedDiff:I-p,reservedWidth:t,columnSizing:n,minReached:R,maxReached:b,constrained:R||b};let{value:E,clamped:M,diff:D}=Hi(Math.round(h-r),S,y,C);if(w&&M&&(Math.abs(v)>Math.abs(D)?M=!1:w=!1),!(!w&&!M)){if(w){let x=Hi(Math.round(h-r-v),S,y,C);E=x.value,M=x.clamped,D=x.diff}else if(M){let x=Hi(Math.round(p+r+D),f,m,C);I=x.value,w=x.clamped,v=x.diff}}n[c]=Fr(n[c],g,I),n[u]=Fr(n[u],T,E),R=w==="min"||M==="min",b=w==="max"||M==="max"}else n[c]=Fr(n[c],g,I),R=w==="min",b=w==="max";let P=I-p;return{adjustedDiff:P,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-P),columnSizing:n,minReached:R,maxReached:b,constrained:R||b}};function Yd(o,e){return o+e}function yT(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Xd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((y,T)=>(y[T]={...o.columnSizing[T]},y),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((y,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(y=>o.items[y]),l=a.map(y=>y.computedWidth),s=qd(o.items,e,t),c=a.map(y=>hs(y,s)),u=0,{computedSizes:d}=ys({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(Yd,0)+r-u,0)}),p=a.map((y,T)=>d[T]-y.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((y,T)=>{let b=a[T];if(!b.resizable){h.push(0);return}let R=c[T],C=l[T],I=yT(n),{maxReached:w,minReached:v,constrained:P,adjustedDiff:E}=Ss({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:y,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[b.id]=Fr(I[b.id],R,Math.round(C+E)),h.push(E),w||(m=!1),v||(f=!1),P||(g=!1)});let S=h.reduce(Yd,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:S,columnSizing:n,reservedWidth:Math.round(t-S)}};var Ki;function Xt(){if(Ki!=null)return Ki;let o=Fe().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),Ki=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Ki}var Zd=["start",void 0,"end"],Qd=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Zd.indexOf(r)-Zd.indexOf(i)}),o);function Jd(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function bs(o,...e){return Jd(t=>t!=null,o,...e)}function ep(o,e,...t){return Jd((n,r)=>!(r in o),e,...t)}var Bi=!0,ST=!0,bT=!0,tp="string",po="unknown";var TT=xo("getComputedVisibleColumns"),CT=(o,e,t)=>o[t]!==!1,Ts=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function nn(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function RT(o,e){let t=Wn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:tp}function IT(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[po];let l=nn(e,a);if(!l)return[po];let s=RT(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===po)?po:r.length===1?r[0]:r}function Cs(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Bi}var op=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,pinnedStartMaxWidth:u,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=No,viewportReservedWidth:S,resizableColumns:y,draggableColumns:T,columnDefaultDraggable:b,columnOrder:R,columnPinning:C,editable:I,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:P,columnDefaultSortable:E,columnSizing:M,columnTypes:D,columnVisibility:x,columnVisibilityAssumeVisible:A,groupBy:O})=>{let F=0,z={};O.forEach((G,te)=>{G.field&&(z[G.field]=te)});let L=(p||[]).reduce((G,te)=>{let{id:ye,field:Ie}=te;return Ie&&(G[Ie]=te),ye&&(G[ye]=te),G},{}),B=Qd(R===!0?Object.keys(o):R,C),Y=B.filter(G=>o[G]?CT(x,A,G):(TT(`Column with id "${G}" specified in columnOrder array cannot be found in the columns map.`),!1)),V=new Map,W=Y.map((G,te)=>{let ye=o[G];return V.set(G,te),ye}),N=(m??[]).reduce((G,te,ye)=>(te.id?G[te.id]={sortInfo:te,index:ye}:te.field&&(G[te.field]={sortInfo:te,index:ye}),G),{});function K(G){let te=o[G],ye=Wn(te,D),Ie={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},ut={width:te?.defaultWidth,flex:te?.defaultFlex,minWidth:te?.minWidth,maxWidth:te?.maxWidth},le=M[G];le?.width!=null&&le.flex==null&&delete ut.flex,le?.flex!=null&&le.width==null&&delete ut.width;let $=bs(ut,le);$.width!=null&&delete Ie.flex,$.flex!=null&&delete Ie.width,$=bs(Ie,$);let tt=$.flex??void 0,ce=$.minWidth??te?.minWidth??n,Ae=$.maxWidth??te?.maxWidth??r,Ze=tt!=null?void 0:$.width??(a?void 0:i);return!Ze&&tt==null&&(a?tt=a:Ze=ce),{size:Ze,flex:tt,minSize:ce,maxSize:Ae}}let ae=ys({availableSize:Math.max(t.width-(S??0)-(l??Xt()),0),maxSize:r,minSize:n,items:Y.map(K)}),{computedSizes:re,flexSizes:ue,minSizes:fe,maxSizes:be}=ae,de=[],U=[],ie=[],ge=[];ge.length=Y.length;let Z=new Map,ee=new Map,j=0,se=0,ne=0,pe=null,k=[],_=0,me=0,Te=0;W.forEach((G,te)=>{let ye=Y[te],Ie=re[te],ut=k[te]=Ts(ye,C);ut==="start"?_+=Ie:ut==="end"?Te+=Ie:me+=Ie});let Pe=t.width-Te,Re=[],Me=new Map;Y.forEach((G,te)=>{let ye=W[te];Me.set(G,ye)});let qe=[];Object.keys(o).forEach(G=>{let te=o[G];qe.push(G),Me.has(G)||Me.set(G,te)});let We=new Map;Me.forEach((G,te)=>{let ye=V.get(te);ye==null&&(ye=-1);let Ie=ye!=-1,ut=Y[ye+1],le=Wn(G,D),$=ye,tt=N[te]?N[te]:G.field?N[G.field]??null:null,ce=tt?.sortInfo??null,Ae=!!ce,Ze=Ae&&ce.dir===1,Rt=Ae&&!Ze,Tu=tt?.index??-1,Wl=Ie?{}:K(te),Cu=Ie?re[ye]:Wl.size||0,Ob=Ie&&ue[ye]||null,Fb=Ie?fe[ye]||0:Wl.minSize||0,Nb=Ie?be[ye]||1e4:Wl.maxSize||1e4,Mt=Ie?Ts(te,C):!1,Ru=Ie?ye===Y.length-1:!1,Ci=$,Lb=Ie?Mt==="start"?se:Mt==="end"?ne:F-se:0;Mt=="start"?Ci=Ie?$:-1:Mt==="end"?Ci=Ie?$-(de.length+ie.length):-1:Ci=Ie?$-de.length:-1;let kb=Ie?Mt==="start"||Mt===!1?F:Pe+ne:-1,zb=Ie?Mt!==pe:!1,Vb=Ie?Ru||Mt!==Ts(ut,C):!1,Iu=G.cssEllipsis??le.cssEllipsis??s,Gb=G.headerCssEllipsis??le.cssEllipsis??G.cssEllipsis??le.headerCssEllipsis??c??Iu,Ri=Ie&&(L[te]||G.field||G.groupByForColumn)&&(L[te]||L[G.field||G.groupByForColumn])||null,Hb=G.defaultFilterable??le.defaultFilterable??v??!0,Kb=I??G.defaultEditable??le.defaultEditable??w??!1,jl=G.dataType||le.dataType||(Array.isArray(G.type)?G.type[0]:G.type)||tp,Bb=G.sortType||le.sortType||jl,wu=G.filterType||le.filterType||jl,vu=!1;if(Ri!=null&&!Ri.disabled){let $l=h[wu];$l&&(!$l.emptyValues||!$l.emptyValues.includes(Ri.filter.value))&&(vu=!0)}let Fn=G.field??le.field,Wb=G.valueGetter??le.valueGetter,Ul=G.defaultGroupable??le.defaultGroupable??P??!!Fn;Fn||(Ul=!1),G.groupByForColumn&&(Ul=!1);let Pu=Fn?z[Fn]!==void 0:!1,jb=Pu?z[Fn]:void 0,Ub=Cs(G,{colType:le,sortable:f,columnDefaultSortable:E}),$b=G.resizable??le.resizable??y??ST,Qe={colType:le,align:le.align,headerAlign:le.headerAlign,computedVisible:Ie,verticalAlign:le.verticalAlign,defaultHiddenWhenGroupedBy:le.defaultHiddenWhenGroupedBy,valueGetter:Wb,valueFormatter:le.valueFormatter,renderValue:le.renderValue,render:le.render,style:le.style,className:le.className,contentFocusable:le.contentFocusable,renderMenuIcon:le.renderMenuIcon,renderSortIcon:le.renderSortIcon,renderRowDetailIcon:le.renderRowDetailIcon,renderSelectionCheckBox:le.renderSelectionCheckBox,renderHeaderSelectionCheckBox:le.renderHeaderSelectionCheckBox,headerStyle:le.headerStyle,headerClassName:le.headerClassName,columnGroup:le.columnGroup,getValueToEdit:le.getValueToEdit,getValueToPersist:le.getValueToPersist,shouldAcceptEdit:le.shouldAcceptEdit,field:Fn,...G,components:{...le.components,...G.components},computedResizable:$b,computedMinWidth:Fb,computedMaxWidth:Nb,computedFlex:Ob,computedDataType:jl,computedEditable:Kb,computedSortType:Bb,computedFilterType:wu,cssEllipsis:Iu,headerCssEllipsis:Gb,computedFilterValue:Ri,computedFiltered:vu,computedFilterable:Hb,computedGroupable:Ul,computedGroupedBy:Pu,computedGroupedByIndex:jb,computedWidth:Cu,computedAbsoluteOffset:kb,computedPinningOffset:Lb,computedVisibleIndexInCategory:Ci,computedOffset:F,computedSortable:Ub,computedSortInfo:ce,computedSortIndex:Tu,computedMultiSort:g,computedSorted:Ae,computedSortedAsc:Ze,computedSortedDesc:Rt,computedVisibleIndex:$,computedPinned:Mt,computedDraggable:T??G.defaultDraggable??b??bT,computedFirstInCategory:zb,computedLastInCategory:Vb,computedFirst:ye===0,computedLast:Ru,id:te,header:G.header??le.header??G.name??G.field};Ie&&(F+=Cu,Z.set(Qe.id,Qe),ge[ye]=Qe,Mt==="start"&&(de.push(Qe),se+=Qe.computedWidth),Mt==="end"&&(U.push(Qe),ne+=Qe.computedWidth),Mt||(ie.push(Qe),j+=Qe.computedWidth),pe=Mt),Qe.groupByForColumn&&(Qe.computedSortType=G.sortType||le.sortType||IT(Qe.groupByForColumn,e,D),Re.push(Qe)),ee.set(Qe.id,Qe),Qe.field&&!Qe.groupByForColumn&&!We.has(Qe.field)&&We.set(Qe.field,Qe)}),Re.forEach(G=>{G.computedSortable=np(G,{fieldsToColumn:We,userColumns:e,columnTypes:D,sortable:f,columnDefaultSortable:E})});let it=new Map;qe.forEach(G=>{let te=ee.get(G);te&&it.set(G,te)}),ee.forEach(G=>{it.has(G.id)||it.set(G.id,G)});let at=u!=null?Math.min(u,se):se,et=d!=null?Math.min(d,ne):ne;return{computedRemainingSpace:t.width-(_+Te+me),computedPinnedStartColumnsWidth:se,computedPinnedEndColumnsWidth:ne,computedUnpinnedColumnsWidth:j,computedColumnOrder:B,computedPinnedStartColumns:de,computedPinnedEndColumns:U,computedUnpinnedOffset:se,computedPinnedEndOffset:se+j,computedUnpinnedColumns:ie,computedVisibleColumns:ge,computedColumnsMap:ee,computedColumnsMapInInitialOrder:it,computedVisibleColumnsMap:Z,computedPinnedEndWidth:et,computedPinnedStartWidth:at,renderSelectionCheckBox:ge.reduce((G,te)=>G||!!te.renderSelectionCheckBox,!1),fieldsToColumn:We}};function np(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Bi,c=o.sortType??o.colType.sortType;return c!=null&&c!==po&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let S=h.field||h.groupField,y;if(S){let T=n.get(S),b=T?f.getColumnApi(T.id):void 0;if(T&&b)y=b.isSortable();else{let R=nn(i,S);if(R){let C=Cs(R,{colType:Wn(R,a??{}),sortable:t,columnDefaultSortable:r});y=typeof C=="boolean"?C:void 0}else y=!1}}return y===void 0&&h.valueGetter&&(y=!0),y??r??Bi},!0)}}function bt(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;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){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},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)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function rn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=bt(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var rp=H(require("react"));var jn=`${St}HeaderCell__filter`,Wi=`${St}HeaderCell__filterOperator`,Lx=`${jn}__input`;var Rs=rp.createContext(null);var ap=require("react");var ip=require("react"),Is;function ji(){return Is||(Is=(0,ip.createContext)(null))}function oe(o){let e=ji(),t=(0,ap.useContext)(e);return Ln(t,o)}function Ke(){return oe(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var wT=`${jn}__input`,Ui=o=>o.stopPropagation();function lp(o){let{filterOperatorMenuVisibleForColumnId:e}=oe(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Lr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Nr.useState)(!1),l=dt.useCallback(()=>{a(!0)},[]),s=dt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return dt.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,onFocus:l,onBlur:s,className:`${jn} ${gs({active:c})}`,style:{height:o.columnHeaderHeight}},dt.createElement(Rs.Provider,{value:o},dt.createElement(r,null),dt.createElement(n,null)))}function sp(){let{columnApi:o,disabled:e,operator:t}=Un(),n=t?.components?.Icon??Bn;return dt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:X(Wi,kd,e?`${Wi}--disabled`:"")},dt.createElement(n,{size:20,className:`${zd({disabled:e})}`}))}function cp(){return dt.createElement("div",{onPointerUp:Ui,onPointerDown:Ui,className:`${jn} ${gs({active:!1})} ${nd["50%"]}`})}function Un(){let o=Ke(),{column:e,columnApi:t}=Lr(),n=rn(e,o,"column-filter"),r=dt.useContext(Rs),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Nr.useState)(l?.filter.value??""),d=dt.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=dt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=dt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Nr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Nd} ${wT}`}}function $n(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Un();return ws.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function $i(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Un();return ws.createElement("input",{"aria-label":o,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:n})}var Zt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function up(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Zt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Zt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Zt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Zt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Zt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Zt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Zt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Zt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Zt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Zt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var No=up({StringFilterEditor:$n,NumberFilterEditor:$i,icons:{includes:yd,eq:bd,neq:wd,startsWith:vd,endsWith:Sd,gt:Cd,gte:Td,lt:Id,lte:Rd}});function Yi(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected===null?r.push(...e.map(l=>`${l}--row-partially-selected`)):n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Qn=require("react"),Zp=require("react-dom");function Lo(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function dp(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var J={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var qi="true",he={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)",baseFontSize:"var(--infinite-font-size)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",rowHeight:"var(--infinite-row-height)",densityScale:"var(--infinite-density-scale)",icons:{expandCollapse:"var(--infinite-icon-expand-collapse)",loading:"var(--infinite-icon-loading)",sortAsc:"var(--infinite-icon-sort-asc)",sortDesc:"var(--infinite-icon-sort-desc)",filter:"var(--infinite-icon-filter)",menu:"var(--infinite-icon-menu)",done:"var(--infinite-icon-done)",clear:"var(--infinite-icon-clear)",hidden:"var(--infinite-icon-hidden)",filterOperatorContains:"var(--infinite-icon-filter-operator-contains)",filterOperatorStartsWith:"var(--infinite-icon-filter-operator-starts-with)",filterOperatorEndsWith:"var(--infinite-icon-filter-operator-ends-with)",filterOperatorEq:"var(--infinite-icon-filter-operator-eq)",filterOperatorNeq:"var(--infinite-icon-filter-operator-neq)",filterOperatorGt:"var(--infinite-icon-filter-operator-gt)",filterOperatorGte:"var(--infinite-icon-filter-operator-gte)",filterOperatorLt:"var(--infinite-icon-filter-operator-lt)",filterOperatorLte:"var(--infinite-icon-filter-operator-lte)"},runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",paddingX:"var(--infinite-cell-padding-x)",paddingY:"var(--infinite-cell-padding-y)",borderWidth:"var(--infinite-cell-border-width)",borderColor:"var(--infinite-cell-border-color)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},pp="column-header-height";var fp=`.${ze.rootClassName}`;function vs(o){return Lo(o,fp)}var mp=Q(J.scrollLeft),vT=Q(J.scrollTop),PT=Q(J.columnWidthAtIndex),Ps=Q(J.columnOffsetAtIndex),gp=Q(J.columnReorderEffectDurationAtIndex),DT=Q(J.columnOffsetAtIndexWhileReordering),xT=Q(J.columnVisibilityAtIndex),ET=Q(J.columnZIndexAtIndex);function Qt(o,e,t){let n=t?vs(t):document.querySelector(fp);MT(o,e,n)}function MT(o,e,t){if(t){let n=o,r=J[n]?Q(J[n]):o;t.style.setProperty(r,`${e}`)}}function Yn(o,e){if(e)for(var t in o){let n=J[t]?Q(J[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Ds(o,e,t){Qt(`${Ps}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${mp}))`:`${o.computedAbsoluteOffset+e}px`,t)}function xs(o,e,t){Qt(`${ET}-${o}`,`${e}`,t)}function kr(o,e,t){Qt(`${DT}-${o}`,typeof e=="number"?`calc( var(${Ps}-${o}) + ${e}px )`:e,t)}function zr(o,e,t){Qt(`${xT}-${o}`,e,t)}function Xi(o,e,t){Qt(`${gp}-${o}`,t??"",e)}function Es(o,e){let t=`${gp}-${o}`;Qt(t,he.components.Cell.reorderEffectDuration,e)}var ve={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${PT}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ps}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Qt(this.varName.get(o),e,t)}}};function hp(o,e){Yn({[mp]:`${o.scrollLeft}px`,[vT]:`${o.scrollTop}px`},e)}var yp="_16lm1iw1",Sp="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",bp="_1yeub2vs",Tp="_1yeub2vr",Cp=Se({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var Ms="_1yeub2vp";var AE=Se({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Mp=require("react");var Vr={bodyWidth:{name:Q(he.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:Q(he.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:Q(he.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:Q(he.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:Q(he.runtime.browserScrollbarWidth),value:""}},AT=Q(J.scrollbarWidthHorizontal),Rp=Q(J.scrollbarWidthVertical),_T=Q(J.columnWidthAtIndex),OT=Q(J.columnZIndexAtIndex),Ip=Q(J.scrollLeft),FT=Q(J.activeCellColWidth),wp=Q(J.activeCellColOffset),xp=Q(J.baseZIndexForCells),NT=Q(J.pinnedStartWidth),vp=Q(J.bodyWidth),LT=Q(J.bodyHeight),Pp=Q(J.pinnedEndOffset),Dp=Q(J.pinnedEndWidth),kT=Q(J.computedVisibleColumnsCount);function Zi(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${xp}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Ep(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:c,scrollbars:u}=o,d=Xt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[ve.columnWidths.varName.get(h)]=g.computedWidth+"px",m[ve.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Ip}) )`:g.computedPinned==="end"?`calc( var(${Pp}) ${p.length?"+":""} ${p.map(y=>ve.columnWidths.get(y.computedVisibleIndex)).join(" + ")} + var(${Ip}) )`:`${g.computedOffset}px`;let S=Zi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${OT}-${h}`]=`${S}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Vr.browserScrollbarWidth.name]=`${Xt()}px`),f[Vr.bodyWidth.name]=`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,f[Vr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Vr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${_T}-${g})`).join(" + ")})`,f[Vr.visibleColumnsCount.name]=e.length,s!=null){f[FT]=ve.columnWidths.get(s[1]);let m=ve.columnOffsets.get(s[1]);if(c.isHorizontalLayoutBrain){let g=c.getPageIndexForRow(s[0]);f[wp]=g?`calc( ${he.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[wp]=m}return f[kT]=e.length,f[AT]=u.horizontal?`${d}px`:"0px",f[Rp]=u.vertical?`${d}px`:"0px",f[NT]="calc( "+t.map(m=>ve.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Dp]="calc( "+n.map(m=>ve.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[xp]=e.length*10,f[Pp]=`calc( var(${vp}) - var(${Dp}) - var(${Rp}) )`,f[vp]=`${l.width}px`,f[LT]=`${l.height}px`,f}var As=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Ap(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:c,onSelfBlur:u,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedVisibleColumns:y,computedUnpinnedColumnsWidth:T,scrollbars:b,focusedClassName:R,focusedWithinClassName:C,computedPinnedStartOverflow:I,computedPinnedEndOverflow:w,focusedStyle:v,focusedWithinStyle:P,brain:E}=oe(L=>{let{state:B,computed:Y}=L;return{brain:B.brain,actions:L.actions,getState:L.getState,focused:B.focused,focusedWithin:B.focusedWithin,domRef:B.domRef,scrollerDOMRef:B.scrollerDOMRef,onBlurWithin:B.onBlurWithin,onFocusWithin:B.onFocusWithin,onSelfFocus:B.onSelfFocus,onSelfBlur:B.onSelfBlur,bodySize:B.bodySize,activeCellIndex:B.activeCellIndex,wrapRowsHorizontally:B.wrapRowsHorizontally,computedPinnedStartColumnsWidth:Y.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:Y.computedPinnedEndColumnsWidth,computedPinnedStartColumns:Y.computedPinnedStartColumns,computedPinnedEndColumns:Y.computedPinnedEndColumns,computedVisibleColumns:Y.computedVisibleColumns,computedUnpinnedColumnsWidth:Y.computedUnpinnedColumnsWidth,scrollbars:Y.scrollbars,focusedClassName:L.state.focusedClassName,focusedWithinClassName:L.state.focusedWithinClassName,computedPinnedStartOverflow:Y.computedPinnedStartOverflow,computedPinnedEndOverflow:Y.computedPinnedEndOverflow,focusedStyle:L.state.focusedStyle,focusedWithinStyle:L.state.focusedWithinStyle}}),M=(0,Mp.useMemo)(()=>Ep({computedVisibleColumns:y,computedPinnedStartColumns:h,computedPinnedEndColumns:S,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:E,scrollbars:b}),[y,h,S,m,g,T,d,p,E,b]),D=As(L=>{e.focused=L}),x=As(L=>{e.focusedWithin=L}),F={...o,onFocus:L=>{if(o?.onFocus?.(L),L.target===i.current||L.target===a.current){if(t().focused)return;D(!0),c?.(L),r&&(x(!1),l?.(L));return}r||(x(!0),s?.(L))},onBlur:L=>{if(o?.onBlur?.(L),L.target===i.current||L.target===a.current){if(!t().focused)return;D(!1),u?.(L),r&&(x(!1),l?.(L));return}i.current?.contains(L.relatedTarget)||(x(!1),l?.(L))}},z=X(Jt,Sp,f?`${Jt}--horizontal-layout`:null,F?.className,m?`${Jt}--has-pinned-start ${Tp}`:null,g?`${Jt}--has-pinned-end ${bp}`:null,n?`${Jt}--focused`:null,r?`${Jt}--focused-within`:null,n&&R?R:null,r&&C?C:null,I?`${Jt}--has-pinned-start-overflow`:null,w?`${Jt}--has-pinned-end-overflow`:null,Cp({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return F.className=z,F.style={...o?.style,...M},n&&v&&Object.assign(F.style,v),r&&P&&Object.assign(F.style,P),F}var Hp=H(an());function Qi(o){return o.map(e=>e instanceof ko?e:new ko(null,[e]))}var ko=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>zT(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function zT(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var VT=(...o)=>new ko("+",Qi(o)),Op=(...o)=>new ko("-",Qi(o)),GT=(...o)=>new ko("*",Qi(o)),HT=(...o)=>new ko("/",Qi(o)),Gr={add:VT,subtract:Op,minus:Op,multiply:GT,divide:HT};var ln=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var He=Fe().requestAnimationFrame||(o=>setTimeout(o,16)),Kt=Fe().cancelAnimationFrame||(o=>clearTimeout(o));var Fp=o=>{let e=null,t=null;return{stop(){e!==null&&Kt(e),t!=null&&Kt(t)},scroll(n){e!==null&&Kt(e),t!=null&&Kt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=He(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=He(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var je=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(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,n=e.left-this.left;return{top:t,left:n}}};function Np(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Lp(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function KT(o,e,t){let n=Np(o,t),r=Np(e,t);return n===r?Lp(t,e)-Lp(t,o):n-r}function kp(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>KT(n,r,t)),e}function BT(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function WT(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=kp(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function zp(o,e){if(BT(o))return WT(o,e);o=kp(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(jT([t,i,a],e))return!0}return!1}function jT(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var qn=class{containsPoint(e){return zp(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Xn=class o extends qn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function UT(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new De({top:n,left:t,width:a-t,height:c-n})}var De=class o extends qn{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 o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=UT(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Xn(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}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var _s;function $T(){if(typeof document>"u"||!document.body)return 1/0;let o=document.createElement("div");o.style.cssText="position:absolute;top:0;left:0;width:1px;visibility:hidden;pointer-events:none",document.body.appendChild(o);let e=n=>(o.style.height=`${n}px`,Math.abs(o.getBoundingClientRect().height-n)<1),t=1e6;if(!e(t))return o.remove(),1/0;for(;t<64e6&&e(t*2);)t*=2;return o.remove(),t}function Ji(){return _s===void 0&&(_s=$T()),_s}function ea(o){return o<=4e6?!1:o>Ji()}function Os(o,e){if(!ea(o))return 1;let t=Ji()-e,n=o-e;return t>0&&n>0?n/t:1}function Vp(o){let e=null;return{get value(){let t=o.getScrollPosition(),n=o.getScrollRatio();return n>1&&e!==null&&Math.abs(e-t)<=n?e:(e=null,t)},set value(t){e=t,o.setScrollPosition(t)}}}function Fs(o,e,t=Math.floor){return Math.abs(o-e)<=1e6?e:t(o)}var Gp=10,YT=Q(J.pinnedStartWidth);function Kp(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,groupingToolbarDragListId:h,api:S,horizontalLayoutPageIndex:y,pageWidth:T}=o;function b(Z){let ee=Z==="start"?L:B;return O===z?ee:z===Z?ee+x.computedWidth:O===Z?ee-x.computedWidth:ee}function R(Z){if(Z.columnIndex===A||y!=null)return!0;let ee=e[Z.columnIndex];if(ee.computedPinned)return!0;let j=l.getScrollPosition().scrollLeft,se=ee.computedOffset+(y!=null&&T!=null?T*y:0);return se>=j+b("start")&&se+ee.computedWidth<=j+u.width-b("end")}let C=(Z,ee)=>{let{restrictToParentGroup:j,dragColumn:se}=ee,ne=[];if(Z.forEach(k=>{if(k.computedVisibleIndex===A)return;let _={columnId:k.id,columnIndex:k.computedVisibleIndex,offsetX:k.computedOffset+Math.round(k.computedWidth/2)};R(_)&&ne.push(_)}),j){let _=function(Te,Pe,Re){let Me=Z[Te];Me&&(Me.columnGroup!==se.columnGroup&&Re.add(Me.id),_(Te+Pe,Pe,Re))};var pe=_;let k=se.computedVisibleIndex,me=new Set;_(k-1,-1,me),_(k+1,1,me),ne=ne.filter(Te=>!me.has(Te.columnId))}return ne},w=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},P={left:v.clientX-u.left-(v.clientX-s.left)+Gp,top:v.clientY-u.top-(v.clientY-s.top)+Gp},E=l.getScrollPosition(),M=e.map(Z=>Z.computedVisibleIndex),D=M,x=t.get(i),A=x.computedVisibleIndex,O=x?.computedPinned,F=A,z=O,L=l.getFixedStartColsWidth(),B=l.getFixedEndColsWidth(),Y=v,V={x:0,y:0},W=1,N=0;function K(Z){let ee=Math.round(Z.clientX),j=Math.round(Z.clientY);if(ee===Y.clientX&&j===Y.clientY)return De.from(s).shift({left:V.x,top:V.y});Y={clientX:ee,clientY:j};let ne=l.getScrollPosition().scrollLeft-E.scrollLeft;return V.x=Y.clientX-v.clientX,V.y=Y.clientY-v.clientY,N=V.x+ne,W=N<0?-1:1,f({left:P.left+V.x,top:P.top+V.y}),De.from(s).shift({left:V.x,top:V.y})}function ae(Z){let ee=0;O?O==="start"&&Z.forEach((j,se)=>{ee||e[j]?.computedPinned!=="start"&&(ee=se)}):Z.forEach((j,se)=>{e[j]?.computedPinned==="start"&&(ee=se+1)}),w=ee,re("start",Z,ee)}function re(Z,ee,j){if(Z==="start"){let se=0;for(let ne=0;ne<j;ne++){let pe=ee[ne],k=e[pe];se+=k.computedWidth}Qt(YT,`${se}px`,a)}}function ue(Z){if(Z==null||Z===F)return;if(F===-1&&Z!==-1&&(zr(A,"",a),m(!1)),F=Z,Z===-1){fe(A);return}let ee=ln(M,A,F>A?F-1:F);w=0;let se=new Set;return ee.forEach((ne,pe)=>{let k=D[pe];ne!==k&&se.add(ne),ae(ee)}),D=ee,be(se),{newColumnIndexes:ee,indexesWithTransition:se,pinnedStartCount:w}}function fe(Z){D=D.filter(j=>j!==Z),e.forEach(j=>{let se=j.computedVisibleIndex,ne=se>Z;Es(se,a);let pe="";ne&&(pe=Gr.minus(ve.columnOffsets.get(se),ve.columnWidths.get(Z)).done()),kr(se,pe,a)}),zr(Z,"hidden",a),m(!0)}function be(Z){e.forEach(ee=>{let j=ee.computedVisibleIndex;Z.has(j)?Es(j,a):Xi(j,a);let se=j===A,ne=W===-1?j<F||j>A:j<A||j>=F,pe="";W===-1?pe=se?ve.columnOffsets.get(F):ne?ve.columnOffsets.get(j):Gr.add(ve.columnOffsets.get(j),ve.columnWidths.get(A)).done():pe=ne?ve.columnOffsets.get(j):se?Gr.add(ve.columnOffsets.get(F-1),ve.columnWidths.get(F-1)).minus(ve.columnWidths.get(A)).done():Gr.minus(ve.columnOffsets.get(j),ve.columnWidths.get(A)).done(),kr(j,pe,a)})}let de=u.left+b("start"),U=u.right-b("end"),ie=Fp({scrollOffsetStart:de,scrollOffsetEnd:U}),ge=Vp({getScrollPosition:()=>l.getScrollPosition().scrollLeft,setScrollPosition:Z=>{S.scrollLeft=Z},getScrollRatio:()=>l.getScrollRatio("horizontal")});return K(v),{speedScroller:ie,stop(){ie.stop()},onMove(Z){let ee=K(Z);if(g().dropTargetListId===h||p&&!d.containsPoint(ee.getCenter()))return p&&ue(-1),null;ie.scroll({mousePosition:Y,get scrollLeft(){return ge.value},set scrollLeft(_){ge.value=_}});let j=C(e,{dragColumn:x,restrictToParentGroup:c==="group"}),se=W===-1?x.computedOffset+N:x.computedOffset+x.computedWidth+N,ne=(0,Hp.default)(j,se,({offsetX:_},me)=>_<me?-1:_>me?1:0);ne<0&&(ne=~ne),j.length?ne=j[ne]?j[ne].columnIndex:j[j.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===A+1&&(ne=A),ue(ne);let pe={};n.forEach(_=>{pe[_.id]="end"});for(let _=0;_<w;_++){let me=D[_],Te=e[me];pe[Te.id]="start"}let k=D.map(_=>e[_].id);return{columnPinning:pe,columnOrder:k}}}}function Ns(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;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 n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return ln(n,u,c)}return e}var ot=H(require("react"));var sn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var Bp=H(an());var Wp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=je.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,S=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,Bp.default)(h,S,(I,w)=>I-w);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let T=Math.min(u,y),b=Math.max(u,y),R=p?i.map((I,w)=>{if(w===u&&p)return t;if(w<T||w>=b)return{left:0,top:0};let v=y<=w?1:-1;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}):i.map((I,w)=>{let v=y<=w?1:0;return r==="horizontal"?{left:Math.round(v*g.width),top:0}:{left:0,top:Math.round(v*g.height)}}),C={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:R,dragRect:g,status:"accepted"};return e.acceptsDrop(C)?{event:C,error:null,success:!0}:(C.status="rejected",{event:C,error:"rejected by interaction target",success:!1})},jp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=je.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((S,y)=>S.id===c.id?t:f?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(S=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var xe=class xe{static startDrag(e,t){let n=e instanceof Zn?e:new Zn(e),r=new Ls({activeDragSource:n,startPoint:t});return xe.currentDragOperation=r,r.on("start",xe.onDragStart),r.on("move",xe.onDragMove),r.on("drop",xe.onDragDrop),r.start(),r}static retriggerMove(){let e=xe.currentDragOperation;e&&e.phase==="move"&&xe.onDragMove(e)}static emit(e,...t){xe.emitter.emit(e,...t)}static on(e,t){return xe.emitter.on(e,t)}static registerDragInteractionTarget(e){let{listId:t}=e,n=xe.dragInteractionTargetsMap.get(t);if(n&&n!==e){console.warn(`DragInteractionTarget with listId ${t} already registered`);return}return n||(xe.dragInteractionTargetsMap.set(t,e),xe.emit("register",e)),()=>{xe.unregisterDragInteractionTarget(e)}}static unregisterAll(){xe.dragInteractionTargetsMap.forEach(e=>{xe.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(!e)return;let{listId:t}=e;xe.dragInteractionTargetsMap.get(t)===e&&(xe.dragInteractionTargetsMap.delete(t),e.unregister(),xe.emit("unregister",e))}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=xe.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;xe.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),xe.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=xe.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(xe.dragInteractionTargetsMap.get(r))),xe.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=Wp(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=jp(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;xe.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];xe.withDragMove(e,(s,{event:c})=>{e.cancelled&&(c={...c,dropTargetListId:null,dropIndex:-1,outside:!1}),s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;xe.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),xe.currentDragOperation=null,xe.unregisterAll()}};xe.dragInteractionTargetsMap=new Map,xe.currentDragOperation=null,xe.emitter=new sn;var pt=xe,Zn=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){wt(this.data,e)||(this.data=e,this.dragRectangle=new De(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=De.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},Ls=class extends sn{constructor(t){super(t.listeners);this.phase="start";this.cancelled=!1;this.currentOffset={top:0,left:0};this.initialDragSource=Zn.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}cancel(){this.cancelled=!0,this.drop()}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Zn.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=pt;var Up=require("react"),$p=ot.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),fo=()=>ot.useContext($p),Yp=ot.createContext(""),cn=o=>{let e=ot.useContext(Yp);return e?`${o}-${e}`:o},ta=o=>{let[e,t]=ot.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=ot.useId(),r=ot.useRef(e);r.current=e;let i=ot.useCallback(()=>{let l=r.current;return{dragSourceListId:l.dragSourceListId,dropTargetListId:l.dropTargetListId,dragItemId:l.dragItemId,status:l.status}},[]),a=ot.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:i}),[e,t]);return(0,Up.useEffect)(()=>{let l=pt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),s=pt.on("drag-move",u=>{let d=r.current,p={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(d)!==JSON.stringify(p)&&t(p)}),c=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{l(),s(),c()}},[pt,t]),ot.createElement(Yp.Provider,{value:n},ot.createElement($p.Provider,{value:a},typeof o.children=="function"?o.children(a):o.children))};var oa="header",na="grouping-toolbar";var ks=`${St}Body`,qp=o=>o.querySelector(`.${ks}`);var un=`${St}HeaderCell`,zs=`${St}HeaderWrapper`,Xp=o=>Array.from(o.querySelectorAll(`.${zs}`));function Hr(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var qT=Q(J.baseZIndexForCells),XT=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:wt(o,e)},Qp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Qn.useState)(null),[a,l]=(0,Qn.useState)(!1),{getCurrentDragSourceAndTarget:s}=fo(),c=cn(na),{getComputed:u,getState:d,api:p,computedDraggable:f,rootRef:m,actions:g}=oe(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),h=(0,Qn.useCallback)(y=>{let T=u().computedVisibleColumnsMap.get(o);if(!T||!T.computedSortable)return;let{multiSortBehavior:b}=d();p.toggleSortingForColumn(o,{multiSortBehavior:b==="replace"&&(y.ctrlKey||y.metaKey)?"append":b})},[]),S=(0,Qn.useCallback)(y=>{if(Hr(y.target))return;let{brain:T,draggableColumnsRestrictTo:b}=d(),{computedVisibleColumns:R,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=u(),P=C.get(o);if(!P.computedDraggable){h(y);return}let E=e.current,M=E.getBoundingClientRect(),D=m.current.getBoundingClientRect(),x=T.getAvailableSize(),A=P.computedVisibleIndex,O=T.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),F=T.isHorizontalLayoutBrain?T.getPageWidth():null,z=E.style.cursor??"auto",L=!1,B=m.current,Y=De.from(qp(B).getBoundingClientRect()),V=Xp(B).map(de=>De.from(de.getBoundingClientRect())),W=Y.getMinimumBoundingRectangle(...V),N=Kp({brain:T,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:F,draggableColumnsRestrictTo:b,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedVisibleColumns:R,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,groupingToolbarDragListId:c,api:p,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:D,acceptDropToReorderRect:W,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),K=null,ae,re;function ue(de){let{columnPinning:U,columnOrder:ie}=de;XT(d().columnPinning,U)||(g.columnPinning=U);let ge=u().computedColumnOrder;JSON.stringify(ie,ge)&&(g.columnOrder=Ns({newColumnOrder:ie,visibleColumnOrder:u().computedVisibleColumns.map(Z=>Z.id),existingColumnOrder:ge,dragColumnId:o}))}let fe=de=>{let{headerBrain:U,brain:ie}=d();if(!L){L=!0;let ge=ie.keepColumnRendered(O),Z=U.keepColumnRendered(O);if(ie.isHorizontalLayoutBrain){let j=ie.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),se=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{j(),se()}}ae=()=>{ge(),Z()},g.columnReorderDragColumnId=P.id,t!=null&&(g.columnReorderInPageIndex=t),xs(A,`calc( var(${qT}) + 10000 )`,m.current),m.current?.classList.add(Ms),E.style.cursor="grabbing"}K=N.onMove(de)},be=de=>{let U=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:ie}=d(),ge=m.current;ge?.classList.remove(Ms),N.stop(),T.update({...x}),ae?.(),re?.(),E.style.cursor=z,E.hasPointerCapture?.(U)&&E.releasePointerCapture(U),E.removeEventListener("pointermove",fe),E.removeEventListener("pointerup",be),i(null);let Z=p.getColumnApi(P.id)?.isSortable()??!1;!L&&Z&&p.toggleSortingForColumn(P.id,{multiSortBehavior:ie==="replace"&&(de.ctrlKey||de.metaKey)?"append":ie}),(0,Zp.flushSync)(()=>{K?ue(K):L&&n&&p.setVisibilityForColumn(P.id,!1),g.columnReorderDragColumnId=!1,t!=null&&(g.columnReorderInPageIndex=null)}),R.forEach(ee=>{Xi(ee.computedVisibleIndex,ge),zr(ee.computedVisibleIndex,"",ge),kr(ee.computedVisibleIndex,"",ge)}),xs(A,Zi(P,{pinnedStartColsCount:I.length,visibleColsCount:R.length}),ge)})};E.addEventListener("pointermove",fe),E.addEventListener("pointerup",be),E.setPointerCapture(y.pointerId)},[o,t,c]);return{onPointerDown:f?S:h,dragColumnOutside:a,proxyPosition:r}};var rr=H(require("react"));var we=H(require("react")),ke=require("react");var ef=Symbol("REPAINT_CELLS_KEY_NO_ROW");function tf(o){return typeof o=="function"}function Jp(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return ef;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function of(o,e,t){let n=Jp(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=Jp(o,e);r!==ef&&(Object.is(r,n)||(n=r,t()))})}var nf="_1eexc2a7 _1eexc2a6",rf=Se({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),af=Se({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var lf="_1eexc2a5",ra=Se({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Jn="_1eexc2a8";var ia=H(require("react")),aa=require("react");var sf="qz8ht90 _16lm1iwk";function ZT(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:QT}=kt({forwardProps:ZT,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function JT(){let{componentState:o,componentActions:e}=zt(),{checked:t,domProps:n,disabled:r}=o,i=(0,aa.useRef)(null);return(0,aa.useEffect)(()=>{i.current.indeterminate=t==null},[t]),ia.createElement("input",{...n,className:X("InfiniteCheckBox",sf,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function zo(o){return ia.createElement(QT,{...o},ia.createElement(JT,null))}var eC="*",Ue=class{constructor(e){this.wildcard=eC;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,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.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 c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.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(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.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 u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){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(n){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,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){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(n){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,n=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)}),n&&n.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 n=this.selectedRowsToColumns.get(e);if(n){if(n.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=>n.has(r)):!1}return!1}error(e){xo(`${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 n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=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)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};function Vo(o,e){return e().dataArray[o]}function la(o){return o().dataArray}var ft=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:n,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)?n.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)?n.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,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var Vs=o=>Array.isArray(o)?new q(o.map(e=>[e,!0])):o,tC=(o,e)=>o.length-e.length,Je=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new q;this.cache=new q;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new q})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Vs(e):this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Vs(t.treePaths),strictCheckPaths:t.strictCheckPaths??!0,multiRowSelectionTarget:t.multiRowSelectionTarget,unfilteredTreePaths:t.unfilteredTreePaths?Vs(t.unfilteredTreePaths):void 0},this.xcache()}hasFilteredOutLeavesInside(e){let{multiRowSelectionTarget:t,unfilteredTreePaths:n,treePaths:r}=this.config;return t!=="visible"||!n||n===r?!1:n.getAllChildrenSizeFor(e)>r.getAllChildrenSizeFor(e)}setVisibleLeafNodesSelection(e,t){let{unfilteredTreePaths:n,treePaths:r}=this.config;this.xcache(),r.getKeysForLeafNodesStartingWith(e).forEach(i=>{n.getAllChildrenSizeFor(i)>0||(this.selectionMap.delete(i),this.isNodeSelected(i)!==t&&this.setSelectionForPath(i,t))}),this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!1);return}this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){if(this.hasFilteredOutLeavesInside([])){this.setVisibleLeafNodesSelection([],!0);return}this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}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 n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)!==!1){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.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(tC);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!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,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.hasFilteredOutLeavesInside(e)){this.setVisibleLeafNodesSelection(e,t);return}if(this.xcache(),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:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function tr(o,e){return new Je(o,er(e))}function er(o){return()=>{let e=typeof o=="function"?o():o,{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}=e;return r==="visible"?{treePaths:t,unfilteredTreePaths:n,multiRowSelectionTarget:r}:{treePaths:n??t,multiRowSelectionTarget:r}}}var sa=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.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 Je))throw"Invalid tree selection";let a=new Je(r,er(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ft({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ft({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 n=this.getState(),r=new ft(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ft(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ft(n.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?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?Vo(n,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 Je))throw"Invalid node selection";let n=new Je(e,er(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let n=new Je(e,er(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))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)}};function Gs(o){return o.map(eo)}function eo(o){if(Fe().structuredClone)return Fe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Gs(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Gs(Array.from(o)));if(o instanceof Map)return new Map(Gs(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=eo(o[t]));return e}function Kr(o){return o}var ca="____not_loaded_yet____";function Hs(o){return typeof o=="string"&&o.startsWith(ca)}var dn=Object.seal({data:null,field:null});var vt="____root____";function Go(){return!1}function Ks(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function ua(o,e,t,n,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=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function uf(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=o;t&&t.start();let u=new q;function d(S,y,T,b=0,R=[]){let C=!T.length||b===T.length-1,I=y[c?.values||"values"]||{};for(let w in I)if(I.hasOwnProperty(w)){let v=w;R.push(v),p.set(R,!0),S.set(R,{reducerResults:I[w][c?.totals||"totals"]||{},items:[]}),C||d(S,I[w],T,b+1,R),R.pop()}}let p=r?new q:void 0,f=[],m=Ks(n),g=eo(m);e.visitDepthFirst((S,y,T,b)=>{let[R,...C]=y,I=S.children,w=u.get(C);if(w&&(w.cache=S.cache,w.childrenLoading=S.childrenLoading,w.childrenAvailable=S.childrenAvailable,w.error=S.error),C.length==i.length&&i.length){if(w){w.items=I;for(let P=0,E=C.length;P<E;P++){let M=C.slice(0,P),D=u.get(M);D&&(D.items=D.items||[],D.items=D.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return b?.()}for(let v=0,P=I.length;v<P;v++){if(!I[v]){let x={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...C,`${ca}${v}`],x);continue}let E=I[v].data,M=I[v].keys||[];if(M.length){let x=M[M.length-1];C.push(x)}let D={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:E,totalChildrenCount:I[v].totalChildrenCount,totalChildrenCountUnfiltered:I[v].totalChildrenCountUnfiltered,reducerResults:I[v].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(C,D),r){let x=D.pivotDeepMap=new q,A=I[v].pivot;d(x,A,r,0,f)}M.length&&C.pop()}b?.()});let h={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(S=>S.field).join(", ")}]}),h}function cf(o,e,t,n,r,i,a,l,s,c=Kr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&ua(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:S}=i[f],y=g?n[g]:null;h&&(dn.data=n,dn.field=g,y=h(dn));let T=(S||c)(y,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:eo(s),items:[]}));let{reducerResults:b,items:R}=p.get(t);R.push(n),a&&ua(n,r,a,b,e)}t.length=0}}function df(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let S=0,y=n.length;S<=y;S++){let T=n.slice(0,S),b=e.get(T),{reducerResults:R,items:C}=b;C.push(r),b.leavesAvailableCount++,b.totalLeafNodesCount++,a&&ua(r,i,a,R,T)}return}let m=eo(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let S=0,y=h.length;S<y;S++){let T=h[S];df(o,e,t,p,T,S,a,l)}a&&Br(a,m,g)}}function Bs(o,e){let{reducers:t,marker:n}=o;if(n){let c=Object.keys(t??{});n.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Ks(t),i=eo(r),a=new q,l=new q;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)df(o,a,l,[],e[c],c,t,r);t&&Br(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function pa(o,e){let{marker:t,groupBy:n,defaultToKey:r=Kr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new q:void 0,c=new q,u=[],d=[],p=Ks(a),f=eo(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:eo(p)};i&&(g.pivotDeepMap=new q),c.set(u,g)}for(let g=0,h=e.length;g<h;g++){let S=e[g],y={};for(let T=0;T<l;T++){let{field:b,groupField:R,valueGetter:C,toKey:I}=n[T],w=b?S[b]:null;C&&(dn.data=S,dn.field=b,w=C(dn));let v=(I||r)(w,S);if(y[b||R]=v,u.push(v),!c.has(u)){let P={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:eo(p)};i&&(P.pivotDeepMap=new q),c.set(u,P)}cf(c,u,d,S,g,i,a,s,p,r)}l||cf(c,u,d,S,g,i,a,s,p,r),a&&ua(S,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,h,S,y)=>{Br(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:b},R,C,I)=>{Br(a,b,T),I?.()}),y?.()}),Br(a,f,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function pf(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function oC(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let b=i[y].field;b&&(f[b]=c[y]),b&&p[b]==null&&(p[b]=c[y])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let y=t[n.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(ca)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function da(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Br(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function ff(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:S}=r,{deepMap:y}=u,T=o.length,b=t[t.length-1],R=b?b.nodeExpanded:!0;for(let C=0;C<T;C++){let I=o[C],w=c(I,C),v=[...e,w];if(l(I)){let O={id:w,nodePath:v,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,C],indexInParent:C,indexInAll:R?i.length:-1};p&&(O.rowSelected=p(O)),d&&(O.rowDisabled=d(O)),f&&f(O);let F=h&&S!=null&&S>0&&O.indexInAll%S===0?O.indexInAll/S:null;for(let z=0,L=t.length;z<L;z++){let B=t[z];if(R||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(O),F!=null&&R){if(typeof h=="function"&&h(B)!==!0)continue;let Y=da(B,O.indexInAll,F);i[Y.indexInAll]=Y,O.indexInAll++}}R&&(i[O.indexInAll]=O);continue}let M=y.get(v)?.totalLeafNodesCount??0,D={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:v,id:w,data:I,indexInAll:i.length,indexInParent:C,indexInParentNodes:[...n,C],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Go,hasSelectedCells:Go,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(D.rowSelected=p(D),g)){let O=g.getSelectionCountFor(D.nodePath);D.selectedLeafNodesCount=O.selectedCount,D.deselectedLeafNodesCount=O.deselectedCount}d&&(D.rowDisabled=d(D)),f&&f(D);let x=!0;if(m&&(D.selfExpanded=x=m(D)),R||(x=!1),D.nodeExpanded=x,R&&h&&S!=null&&S>0){let O=D.indexInAll,F=D.parentNodes;if(F.length>0&&O%S===0){let z=O/S,L=0;F.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(da(B,O+L,z)),L++,D.indexInAll++)})}}R&&(i[D.indexInAll]=D);let A=s(I);Array.isArray(A)&&ff(A,v,[...t,D],D.indexInParentNodes,r,i)}return i}function mf(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return ff(e,[],[],[],o,n),t&&t.end(),{data:n}}function gf(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:S}=m;e&&e.start({details:[{name:"Group by fields",value:S.map(C=>C.field).join(", ")}]});let y=[],T=[],b=[],R=[];return g.visitDepthFirst((C,I,w,v)=>{let P=C.items,E=I.length,M=s?.isGroupRowCollapsed(I)??!1;R.push(w);let D=oC({lazyLoad:t,groupBy:S,parents:Array.from(b),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(R),indexInAll:y.length,groupKeys:I,error:C.error,totalChildrenCount:C.totalChildrenCount,childrenLoading:(C.childrenLoading||!M&&!C.childrenAvailable)&&t,childrenAvailable:C.childrenAvailable,directChildrenCount:I.length===S.length?C.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},C);if(u&&(D.rowSelected=u(D),d)){let z=d.getSelectionCountFor(D.groupKeys);D.selectedChildredCount=z.selectedCount,D.deselectedChildredCount=z.deselectedCount}c&&(D.rowDisabled=c(D));let x=b[b.length-1],A=x?.collapsed??!1;A&&(M=!0),D.collapsed=M;let O=p||M;if(A&&(O=!1),O){if(i&&r!=null&&r>0){let z=D.indexInAll,L=D.parents;if(L.length>0&&z%r===0){let B=z/r,Y=0;L.forEach(V=>{typeof i=="function"&&i(V)!==!0||(y.push(da(V,z+Y,B)),Y++,D.indexInAll++)})}}y.push(D),T.push(y.length-1)}D.collapsedChildrenCount=0,b.forEach(z=>{z.deepRowInfoArray.push(D),z.collapsedGroupsCount+=M?1:0}),x&&D.selfLoaded&&t&&(x.directChildrenLoadedCount+=1),a&&a(D),b.push(D);let F=!0;if(F){if(v)v();else if(!h){let z=y.length;M||(y.length+=P.length);let L=0;for(let B=0,Y=P.length;B<Y;B++){let V=P[B];if(!M&&i&&r!=null&&r>0){let ae=z+B+L;if(ae%r===0){let re=ae/r;b.forEach(ue=>{if(typeof i=="function"&&i(ue)!==!0)return;let fe=z+B+L;y[fe]=da(ue,fe,re),L++,y.length++})}}let W=z+B+L,K={id:V?l(V,W):`${I}-${B}`,data:V,isCellSelected:Go,hasSelectedCells:Go,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!V,rowSelected:!1,rowDisabled:!1,rootGroupBy:S,collapsed:M,groupKeys:I,parents:Array.from(b),indexInParentGroups:[...R,B],indexInGroup:B,indexInAll:W,groupBy:S,groupNesting:E+1,groupCount:D.groupCount};u&&(K.rowSelected=u(K)),c&&(K.rowDisabled=c(K)),a&&a(K),b.forEach((ae,re)=>{re===b.length-1&&V&&(ae.directChildrenLoadedCount+=1),M&&(ae.collapsedChildrenCount+=1),ae.deepRowInfoArray.push(K)}),M||(y[z+B+L]=K)}}}b.pop(),R.pop()}),e&&e.end(),{data:y,groupRowsIndexes:T}}function Ho(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Kr)(l,o);return t.push(s),t},[])}var nC=new q,hf=new WeakMap;function fa(o){let{originalDataArray:e,groupBy:t,toPrimaryKey:n}=o;if(!e||!t.length)return nC;let r=hf.get(e);if(r&&r.groupBy===t)return r.groups;let i=new q,a=t.length,l=[];return e.forEach(s=>{let c=Ho(s,t);l.length=0;for(let u=0;u<c.length;u++){l.push(c[u]);let d=i.get(l);d||(d={count:0},l.length===a&&(d.primaryKeys=[]),i.set(l,d)),d.count++,d.primaryKeys?.push(n(s))}}),hf.set(e,{groupBy:t,groups:i}),i}function rC(o,e){let t=[];return o.getLeafNodesStartingWith(e,n=>{let r=n.value?.primaryKeys;if(r)for(let i=0;i<r.length;i++)t.push(r[i])}),t}var Oe=class o{constructor(e,t,n){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.lazyEntries=null;this.lazyLoadedRows=null;this.lazyChildrenLoaded=null;this.lazyRowCounts=null;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,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Ho(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}targetsVisibleRowsOnly(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e==="visible"&&!!t}targetsFilteredOutRows(){let{multiRowSelectionTarget:e,someRowsFilteredOut:t}=this.getConfig();return e!=="visible"&&!!t}getVisibleDataInsideGroup(e){let{postFilterDataArray:t,groupDeepMap:n}=this.getConfig();return e.length?n?.get(e)?.items??[]:t??[]}hasFilteredOutRowsInsideGroup(e){let t=this.getConfig();return t.someRowsFilteredOut?(e.length?fa(t).get(e)?.count??0:t.originalDataArray?.length??0)>this.getVisibleDataInsideGroup(e).length:!1}setVisibleRowsSelection(e,t){let{groupBy:n,toPrimaryKey:r}=this.getConfig(),i=t?this.selectedMap:this.deselectedMap,a=t?this.deselectedMap:this.selectedMap;this.xcache(),this.getVisibleDataInsideGroup(e).forEach(l=>{let s=Ho(l,n),c=r(l),u=[...s,c];a.delete(u),this.isRowSelected(c,s)!==t&&i.set(u,!0)}),this.xcache()}getLazyUnfilteredCount(e){let t=this.getConfig();if(!(!t.lazyLoad||t.multiRowSelectionTarget==="visible"))return e.length?t.groupDeepMap?.get(e)?.totalChildrenCountUnfiltered:t.lazyUnfilteredCount}getLazyHiddenRowsCount(e){let t=e.length<this.getGroupByLength()?this.getLazyUnfilteredCount(e):void 0;if(t===void 0)return 0;let{groupDeepMap:n}=this.getConfig(),r=0;return this.getGroupKeysDirectlyInsideGroup(e).forEach(i=>{r+=this.getLazyUnfilteredCount(i)??(n?.get(i)?.totalChildrenCount||0)}),Math.max(t-r,0)}getLazyEntries(){let e=`${this.selectedMap.version}:${this.deselectedMap.version}`;if(this.lazyEntries?.version!==e){let t=new q;this.selectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!0)),this.deselectedMap.getKeysStartingWith([]).forEach(n=>t.set(n,!1)),this.lazyEntries={version:e,entries:t}}return this.lazyEntries.entries}getLazyRowCount(e){this.lazyRowCounts=this.lazyRowCounts??new q;let t=this.lazyRowCounts.get(e);if(t!==void 0)return t??void 0;let n=this.computeLazyRowCount(e);return this.lazyRowCounts.set(e,n??null),n}computeLazyRowCount(e){let t=this.getConfig(),n=this.getGroupByLength(),r=this.getLazyUnfilteredCount(e);if(r!==void 0)return r;if(!e.length&&!n)return t.totalCount;let i=e.length?t.groupDeepMap?.get(e):void 0,a=e.length?i?.totalChildrenCount:t.lazyGroupedRowCount;if(a!=null)return a;if(e.length===n)return i?.childrenAvailable?i.items.length:void 0;let l=t.groupDeepMap?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[];if(l.length)return l.reduce((s,c)=>s+(Hs(c[c.length-1])?1:this.getLazyRowCount(c)??1),0)}areLazyChildrenLoaded(e){this.lazyChildrenLoaded=this.lazyChildrenLoaded??new q;let t=this.lazyChildrenLoaded.get(e);if(t!==void 0)return t;let n=this.computeLazyChildrenLoaded(e);return this.lazyChildrenLoaded.set(e,n),n}computeLazyChildrenLoaded(e){let{groupDeepMap:t}=this.getConfig(),n=e.length?t?.get(e):void 0;return e.length&&!n?.childrenAvailable?!1:e.length===this.getGroupByLength()?this.getLazyLoadedRows(e).complete:(t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})??[]).every(r=>!Hs(r[r.length-1]))}getLazyLoadedRows(e){this.lazyLoadedRows=this.lazyLoadedRows??new q;let t=this.lazyLoadedRows.get(e);if(!t){let{groupDeepMap:n,originalDataArray:r,toPrimaryKey:i,totalCount:a}=this.getConfig(),l=e.length?n?.get(e):void 0,s=l?l.items:r??[],c=l?l.totalChildrenCount:a,u=new Set,d=c==null||s.length>=c;for(let p=0;p<s.length;p++){let f=s[p];f==null?d=!1:u.add(i(f))}t={primaryKeys:u,complete:d},this.lazyLoadedRows.set(e,t)}return t}isLazyEntryFilteredOut(e){let{groupDeepMap:t}=this.getConfig(),n=this.getGroupByLength();for(let r=1;r<=e.length;r++){let i=e.slice(0,r-1);if(!(r>n?this.getLazyLoadedRows(i).primaryKeys.has(e[r-1]):!!t?.get(e.slice(0,r))))return this.areLazyChildrenLoaded(i)}return!1}getLazySelectionCountFor(e,t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getLazyEntries(),i=this.getGroupByLength()+1,a=this.getLazyUnfilteredCount([])!==void 0,l=0,s=0;r.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0,respectOrder:!1}).forEach(p=>{if(!a&&this.isLazyEntryFilteredOut(p))return;let f=r.get(p);if(p.length>=i){f?l++:s++;return}let m=this.getLazySelectionCountFor(p,f);l+=m.selectedCount,s+=m.deselectedCount});let c=this.getLazyRowCount(e),u=c===void 0?1:Math.max(c-l-s,0);t?l+=u:s+=u;let d={selectedCount:l,deselectedCount:s};return this.selectionCountCache.set(e,d),d}getGroupCount(e){if(e.length==0)return this.getLazyUnfilteredCount([])??this.getConfig().totalCount;if(this.targetsFilteredOutRows())return fa(this.getConfig()).get(e)?.count??0;let n=this.getGroupDeepMap()?.get(e);return n?this.getLazyUnfilteredCount(e)??n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let t=this.getConfig(),n={excludeSelf:!0,depthLimit:1};return this.targetsFilteredOutRows()?fa(t).getKeysStartingWith(e,n):t.groupDeepMap?.getKeysStartingWith(e,n)||[]}getAllPrimaryKeysInsideGroup(e){let t=this.getConfig(),{groupDeepMap:n,toPrimaryKey:r}=t;if(this.targetsFilteredOutRows())return e.length?rC(fa(t),e):(t.originalDataArray??[]).map(r);if(!t.groupBy.length)return this.getVisibleDataInsideGroup([]).map(r);if(!e.length)return(n?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(l=>this.getAllPrimaryKeysInsideGroup(l)).flat();let i=n?.get(e);return i?i.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}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(),this.lazyLoadedRows=null,this.lazyChildrenLoaded=null,this.lazyRowCounts=null}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys||i===0&&a.length===1?a[0]:a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.deselectGroupRow([]):this.setVisibleRowsSelection([],!1);return}this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){if(this.targetsVisibleRowsOnly()){this.onlyUsePrimaryKeys?this.selectGroupRow([]):this.setVisibleRowsSelection([],!0);return}this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!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(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!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}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!0);return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!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)}),this.xcache()}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}if(this.targetsVisibleRowsOnly()&&this.hasFilteredOutRowsInsideGroup(e)){this.setVisibleRowsSelection(e,!1);return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!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)}),this.xcache()}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),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 n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),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 n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(this.getConfig().lazyLoad&&(!this.onlyUsePrimaryKeys||!r))return this.getLazySelectionCountFor(e,t??this.getGroupRowBooleanSelectionStateFromParent(e));if(this.onlyUsePrimaryKeys&&(r||this.targetsVisibleRowsOnly())){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}if(e.length===r&&this.targetsVisibleRowsOnly()){let{toPrimaryKey:c}=this.getConfig(),u=0,d=0;this.getVisibleDataInsideGroup(e).forEach(f=>{this.isRowSelected(c(f),e)?u++:d++});let p={selectedCount:u,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 c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function or(o,e){return new Oe(o,mt(e))}function mt(o){return()=>{let e=typeof o=="function"?o():o,{originalDataArray:t,postFilterDataArray:n}=e,r=!!e.lazyLoad,i=r?e.originalLazyGroupData.get([vt]):void 0;return{lazyLoad:r,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:r?t?.length??0:e.unfilteredCount,lazyGroupedRowCount:e.groupBy.length?i?.totalChildrenCount:void 0,lazyUnfilteredCount:e.groupBy.length?i?.totalChildrenCountUnfiltered:i?.totalCountUnfiltered,multiRowSelectionTarget:e.multiRowSelectionTarget,someRowsFilteredOut:!e.lazyLoad&&!!t&&!!n&&n.length<t.length,originalDataArray:t,postFilterDataArray:n}}}function yf(o){let{getDataSourceState:e,dataSourceActions:t}=o;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 Oe))throw"Invalid row selection";let a=new Oe(r,mt(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 Oe))throw"Invalid row selection";let a=new Oe(r,mt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=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 Oe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Ho(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=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 Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new Oe(a,mt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=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 Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Ho(d,c):[]}let u=new Oe(l,mt(e));u.deselectRow(r,i),t.rowSelection=u}},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 Oe))throw"Invalid row selection";let s=new Oe(a,mt(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 Oe))throw"Invalid row selection";let s=new Oe(a,mt(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 Oe))throw"Invalid row selection";let s=new Oe(a,mt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Oe(i,mt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Oe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,mt(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 c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}function Sf(o,e){ma(o,e),aC(o,e),e.detail===2&&iC(o,e),o.getState().onCellClick?.(o,e)}function iC(o,e){if(Hr(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function aC(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,S=new Ue(u);S.debugId=m??"",d.cellSelectionState=S;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(y,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:T})}else d.resetClick(y);l.cellSelection=S}function lC(o){return o.getState().multiRowSelectionWith!=="click"&&o.getComputed().renderSelectionCheckBox?"checkbox":"click"}function sC(o){return o?Hr(o)?!0:typeof o.closest!="function"?!1:!!o.closest(`.${Jn}, [data-name="expand-collapse-icon"]`):!1}function ma(o,e,t=e.key?"keyboard":"click"){let{rowIndex:n,getDataSourceState:r,getComputed:i,dataSourceActions:a,dataSourceApi:l,api:s,cloneRowSelection:c,cloneTreeSelection:u}=o,{multiRowSelector:d}=i(),p=r(),{selectionMode:f,dataArray:m,isTree:g}=p;if(t==="click"&&sC(e.target))return!1;let h=m[n];if(!h||h.rowDisabled)return!1;if(g){if(!h.isTreeNode||!h.nodePath)return!1;let{isNodeSelectable:S}=p;if(S&&!S(h))return!1}if(f==="multi-row"){let S=lC(o);if(t==="click"&&S==="checkbox")return!1;let y=t==="checkbox"||t==="keyboard"&&S==="checkbox",T=()=>{e.shiftKey?d.multiSelectClick(n):y||e.metaKey||e.ctrlKey?d.singleAddClick(n):d.resetClick(n)};if(g){let{treeSelectionState:R}=p;if(!(R instanceof Je))return!1;let C=u(R);d.treeSelectionState=C,T(),d.treeSelectionState=void 0;let I=!e.shiftKey&&(y||e.metaKey||e.ctrlKey);return p.lastSelectionUpdatedNodePathRef&&(p.lastSelectionUpdatedNodePathRef.current=I?{nodePath:h.nodePath,selected:!!C.isNodeSelected(h.nodePath)}:null),a.treeSelection=C,!0}let{rowSelection:b}=p;return!b||typeof b!="object"?!1:(b=c(b),d.rowSelectionState=b,T(),a.rowSelection=b,!0)}else if(f==="single-row"){if(h.isGroupRow)return!1;let S=e.metaKey||e.ctrlKey||t!=="click";if(g){let{treeApi:T}=l;return S?T.toggleNodeSelection(h.nodePath):T.selectNode(h.nodePath),!0}let y=h.id;return S?s.rowSelectionApi.toggleRowSelection(y):s.rowSelectionApi.selectRow(y),!0}return!1}function bf(o,e){let{getComputed:t,dataSourceActions:n,dataSourceApi:r}=o,i=t().multiRowSelector,a=i.lastPointerDown;i.lastPointerDown=void 0;let l=o.getDataSourceState;return ma({rowIndex:e,api:o,getComputed:t,getState:o.getState,getDataSourceState:l,dataSourceActions:n,dataSourceApi:r,cloneRowSelection:s=>or(s,l),cloneTreeSelection:s=>tr(s,l)},{key:"",metaKey:!1,ctrlKey:!1,shiftKey:a?.rowIndex===e&&a.shiftKey,preventDefault:()=>{}},"checkbox")}var Wr=H(require("react")),If=require("react");var Tf="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",Cf=Se({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Rf="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",C1=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var ga=`${ct}-expand-collapse`;function pn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,If.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Fo("expanded",o)||i(!r)};Wr.useEffect(()=>{Fo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Wr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:X(o.className,Tf,Hn.expandCollapse,Cf({direction:t||"start",expanded:r,disabled:n}),`${ct}`,`${ga}`,`${ga}--${l}`,`${ga}--${t==="end"?"end":"start"}`,n?`${ga}--disabled`:"")},Wr.createElement("path",{d:Rf}))}function wf(o){return typeof o.field=="string"}function vf(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function to(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",S=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:T}}=nr({column:p,rowInfo:c,rowDetailState:S,columnsMap:e().computedColumnsMap,context:o}),b=bt(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:b,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}:{api:a,dataSourceApi:l,columnApi:b,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:S,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:T}}function Pf(o){return xf(o.column,o.rowInfo)}function Df(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=vf({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=nr(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.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:u,stylingParam:d,formattedValueContext:c,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:cC({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function cC(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,S=p(),{selectionMode:y,cellSelection:T}=S,b=vf({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),R=d.toggleGroupRow,C=T?.isCellSelected(n.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:C,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:b,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.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:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:R,toggleCurrentGroupRow:()=>{n.isGroupRow&&R(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:S.groupBy,pivotBy:S.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),I}function uC(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function xf(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:wf(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&wf(o)&&(a=uC(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function dC(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,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:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function nr(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=xf(e,t),a=dC(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Ef=Se({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Mf="_7pupv00",Af=Se({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:_f}=ze,mo=`${_f}Cell`,jr=`${_f}Cell_content`;var{rootClassName:pC}=ze,oo=`${pC}ColumnCell`;var fC=Q(J.columnZIndexAtIndex),mC=Q(J.columnVisibilityAtIndex);function Of({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[Q(he.components.Row.groupNesting)]:t}}function Ff({rowInfo:o}){return{[Q(he.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function Ws(o,e){return o?typeof o=="function"?o(e):o:void 0}function js(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Nf(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:c,formattedValueContext:u,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:S,rowDisabled:y,rowSelected:T,cellSelected:b,cellSelection:R,getData:C,computedVisibleColumns:I,visibleColumnIds:w,computedColumnOrder:v,columnReorderInPageIndex:P}=o,E=w??I.map(ue=>ue.id),M=v,D,x={...u,visibleColumnIds:E,allColumnIds:M,rowIndex:n,get rowHasSelectedCells(){return D===void 0&&(D=t.hasSelectedCells(E)),D}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),O=typeof f=="function"?f(x):f,F;d?.className&&(F=Ws(d.className,c)),g&&(F=X(F,Ws(g,c))),e.className&&(F=X(F,Ws(e.className,c))),A&&(F=X(F,Af({align:l})));let z;t.dataSourceHasGrouping&&e.groupByForColumn&&(z=Of({rowInfo:t,column:e})),A&&(z=Ff({rowInfo:t})),p&&(z=typeof p=="function"?{...z,...p(x)}:{...z,...p}),m&&(z=js(z,m,c)),d?.style&&(z=js(z,d.style,c)),e.style&&(z=js(z,e.style,c)),z=z||{},z.height=r,z.zIndex=`var(${fC}-${e.computedVisibleIndex})`,z.visibility=`var(${mC}-${e.computedVisibleIndex}, visible)`;let L=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,B=h?L?"odd":"even":!1,Y=!1,V=!1,W=!1,N=!1;if(R&&b){let ue=C(),fe=ue[t.indexInAll-1],be=ue[t.indexInAll+1],de=I[e.computedVisibleIndex+1],U=I[e.computedVisibleIndex-1];Y=fe?!R.isCellSelected(fe.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?V=!0:V=U?!R.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?W=!0:W=de?!R.isCellSelected(t.id,de.id):!0,N=be?!R.isCellSelected(be.id,e.id):!0}let K=R&&b?{top:Y,left:V,right:W,bottom:N}:null,ae=P!=null?a!==P:!1,re=X(K?af(K):"",Yi(e,[oo,mo],rf,{dragging:!1,insideDisabledDraggingPage:ae,zebra:B,align:l,verticalAlign:s,rowDisabled:y,rowActive:S,cellSelected:b,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),F,O);return{style:z,className:re,cellSelectionBorders:K,zebra:B,columnIsTree:A}}var go=H(require("react"));var gC=Q(J.columnWidthAtIndex),hC=Q(J.columnReorderEffectDurationAtIndex);function yC(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,S=typeof m=="function"?m():m,y={width:`var(${gC}-${i.computedVisibleIndex})`,transition:`transform var(${hC}-${i.computedVisibleIndex}, 0s)`,...h.style},T={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:X(h.className,mo,nf),children:go.createElement(go.Fragment,null,d,go.createElement("div",{className:X(jr,e?Ht:ld.hidden,s),style:r},S),u)};c!=null&&(T["data-row-id"]=`${c}`);let b=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return b?go.createElement(b,{...T,ref:a}):go.createElement("div",{...T,ref:a})}var ha=go.memo(yC);var mn=H(require("react")),fn=require("react");function Lf(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=ya(),i=(0,fn.useRef)(null),a=(0,fn.useRef)(!1),l=mn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,fn.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):u.stopPropagation()},[]),c=(0,fn.useCallback)(()=>{a.current||t()},[]);return mn.createElement(mn.Fragment,null,mn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:X(ed,ad.none),type:"text",defaultValue:o,onChange:(0,fn.useCallback)(u=>{e(u.target.value)},[])}))}function kf(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Ur=we.createContext(null),SC=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return we.createElement(pn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},bC={display:"inline-block",visibility:"visible"},Us=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return we.createElement(pn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:bC,expanded:n,onChange:t})},TC=o=>{let{rowInfo:e,rowIndex:t,column:n,api:r}=o;e.isGroupRow&&n.groupByForColumn;let{components:i}=r.getState(),a=r.getDataSourceState().isNodeSelectable,l=i?.CheckBox||zo;return we.createElement(l,{domProps:{className:Jn},disabled:e.isTreeNode?!a(e):!1,onChange:()=>{bf(r,t)},checked:e.rowSelected})};function CC(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=(0,ke.useReducer)(s=>s+1,0),l=tf(e)?e:void 0;(0,ke.useEffect)(()=>{if(l)return of(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function RC(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:c,cellStyle:u,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:S,onRowMouseEnter:y,onRowMouseLeave:T,rowIndex:b,rowHeight:R,columnsMap:C,fieldsToColumn:I,domRef:w,hidden:v,showZebraRows:P,getDataSourceState:E,dataSourceApi:M,dataSourceActions:D,getState:x,imperativeApi:A,componentActions:O,getComputed:F,getDataSourceMasterContext:z}=o,L=(0,ke.useSyncExternalStore)((0,ke.useCallback)(ce=>t.subscribeToRowIndex(b,ce),[t,b]),(0,ke.useCallback)(()=>t.getRowInfoAtIndex(b),[t,b]));CC({repaintCellsKey:p,column:g,rowIndex:b,rowInfoStore:t,getDataSourceState:E});let B=!L,Y=!g,V=we.useRef(null),W=(0,ke.useCallback)(ce=>{V.current=ce,w&&w(ce)},[w]),N=L??{id:"",indexInAll:b,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:K}=N,ae=F(),{activeRowIndex:re,keyboardNavigation:ue,columnReorderInPageIndex:fe}=x(),be=b===re&&ue==="row",de={getState:x,getDataSourceState:E,getDataSourceMasterContext:z,actions:O,dataSourceActions:D,api:A,dataSourceApi:M},U=N.rowDisabled,ie=Df({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:N,rowDetailState:f,columnsMap:C,visibleColumnIds:s,fieldsToColumn:I,context:de}),{stylingParam:ge,renderParams:Z,formattedValueContext:ee,renderFunctions:j,groupByColumnReference:se,inEdit:ne}=ie,{align:pe,verticalAlign:k}=Z,_=Z,me=we.useRef(_),Te=y&&S?ce=>{let Ze={...ee,rowIndex:b};y(Ze,ce),S(ce)}:S,Pe=T&&h?ce=>{let Ae={...ee,rowIndex:b,rowInfo:N};T(Ae,ce),h(ce)}:h,Re=(0,ke.useCallback)(ce=>{let Ae=g.computedVisibleIndex;x().cellClick({rowIndex:b,colIndex:Ae,event:ce})},[b,g.computedVisibleIndex,ue]),Me=(0,ke.useCallback)(ce=>{let Ae=g.computedVisibleIndex;if(x().cellMouseDown({rowIndex:b,colIndex:Ae,event:ce}),ue==="row"){U||(O.activeRowIndex=b);return}ue==="cell"&&(O.activeCellIndex=[b,Ae])},[b,U,g.computedVisibleIndex,ue]),{selectionMode:qe,cellSelection:We,isNodeReadOnly:it}=e,at=_.cellSelected;_.domRef=W,_.htmlElementRef=V,_.toggleCurrentTreeNode=(0,ke.useCallback)(_.toggleCurrentTreeNode,[N]),_.selectCell=(0,ke.useCallback)(_.selectCell,[N]),_.deselectCell=(0,ke.useCallback)(_.deselectCell,[N]),_.selectCurrentRow=(0,ke.useCallback)(_.selectCurrentRow,[N]),_.deselectCurrentRow=(0,ke.useCallback)(_.deselectCurrentRow,[N]),_.toggleCurrentGroupRow=(0,ke.useCallback)(_.toggleCurrentGroupRow,[N]),_.toggleCurrentRowSelection=(0,ke.useCallback)(_.toggleCurrentRowSelection,[N]),_.toggleCurrentGroupRowSelection=(0,ke.useCallback)(_.toggleCurrentGroupRowSelection,[N]),_.toggleCurrentTreeNodeSelection=(0,ke.useCallback)(_.toggleCurrentTreeNodeSelection,[N]);let et=g.components?.Editor??Lf,Xe=ne?we.createElement(Vf,{contextValue:_},we.createElement(et,null)):null,G=(0,ke.useCallback)(yt(()=>{if(v||ne)return null;if(me.current=_,j.renderGroupIcon&&(_.renderBag.groupIcon=we.createElement(Pt,{render:j.renderGroupIcon,renderParam:{..._,renderBag:{..._.renderBag}}})),j.renderSelectionCheckBox&&qe=="multi-row"&&(_.renderBag.selectionCheckBox=we.createElement(Pt,{render:TC,renderParam:_}),j.renderSelectionCheckBox!==!0&&(_.renderBag.selectionCheckBox=we.createElement(Pt,{render:j.renderSelectionCheckBox,renderParam:{..._,renderBag:{..._.renderBag}}}))),N.isTreeNode){let{isParentNode:Ze}=N,Rt;Rt=(Ze?j.renderTreeIconForParentNode:j.renderTreeIconForLeafNode)||typeof j.renderTreeIcon=="function"?j.renderTreeIcon:Ze&&j.renderTreeIcon===!0?Us:void 0,Rt===!0?Rt=Us:Rt&&(_.renderBag.treeIcon=we.createElement(Pt,{render:Us,renderParam:_})),Rt&&(_.renderBag.treeIcon=we.createElement(Pt,{render:Rt,renderParam:{..._,renderBag:{..._.renderBag}}}))}j.renderRowDetailIcon&&(_.renderBag.rowDetailsIcon=we.createElement(Pt,{render:SC,renderParam:{..._,renderBag:{..._.renderBag}}}),typeof j.renderRowDetailIcon=="function"&&(_.renderBag.rowDetailsIcon=we.createElement(Pt,{render:j.renderRowDetailIcon,renderParam:{..._,renderBag:{..._.renderBag}}}))),j.renderValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderValue,renderParam:{..._,renderBag:{..._.renderBag}}})),N.isGroupRow&&j.renderGroupValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderGroupValue,renderParam:{..._,renderBag:{..._.renderBag}}})),!N.isGroupRow&&j.renderLeafValue&&(_.renderBag.value=we.createElement(Pt,{render:j.renderLeafValue,renderParam:{..._,renderBag:{..._.renderBag}}})),me.current=_;let ce=_.renderBag.value;ce instanceof Date&&(ce=ce.toLocaleDateString());let Ae=we.createElement(we.Fragment,null,pe!=="end"?_.renderBag.treeIcon:null,pe!=="end"?_.renderBag.groupIcon:null,pe!=="end"?_.renderBag.rowDetailsIcon:null,pe!=="end"?_.renderBag.selectionCheckBox:null,ce,pe==="end"?_.renderBag.selectionCheckBox:null,pe==="end"?_.renderBag.rowDetailsIcon:null,pe==="end"?_.renderBag.groupIcon:null,pe==="end"?_.renderBag.treeIcon:null);return g.render?we.createElement(Pt,{render:g.render,renderParam:{..._,renderBag:{..._.renderBag,all:Ae}}}):Ae}),[g,v,ne,f,g.renderTreeIcon||g.renderTreeIconForParentNode?it:!1,...kf(_,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:te,className:ye}=Nf({column:g,rowInfo:N,rowIndex:b,rowHeight:R,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:pe,verticalAlign:k,stylingParam:ge,formattedValueContext:ee,groupByColumnReference:se,rowStyle:n,rowClassName:r,cellStyle:u,cellClassName:d,showZebraRows:P,rowActive:be,rowDisabled:U,rowSelected:K,cellSelected:at,cellSelection:We,getData:l,visibleColumnIds:s,computedVisibleColumns:ae.computedVisibleColumns,computedColumnOrder:c,columnReorderInPageIndex:fe}),Ie=(0,ke.useMemo)(()=>te,[te?JSON.stringify(te):null]),ut=Xe,le=G(),$={domRef:W,cellType:"body",column:g,width:m,rowId:N.id,horizontalLayoutPageIndex:a,style:Ie,onMouseLeave:Pe,onMouseEnter:Te,onClick:Re,afterChildren:ut,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:ye,renderChildren:(0,ke.useCallback)(()=>le,[G])},tt=Ur.Provider;return Y||B?we.createElement("div",{ref:W,style:{display:"none"}}):we.createElement(tt,{value:me.current},we.createElement(ha,{...$}))}var zf=we.memo(RC);function $r(){return(0,ke.useContext)(Ur)}function ya(){let{api:o,editingValueRef:e,editingCell:t}=oe(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=$r(),[i]=we.useState(()=>t?.value),[a,l]=we.useState(i),s=t?!t.active&&!!t.waiting:!1,c=we.useCallback(f=>{e.current=f,l(f)},[]);we.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function Yr(o){return o.render(o.renderParam)??null}function Pt(o){let e=Ur.Provider;return rr.createElement(e,{value:o.renderParam},rr.createElement(Yr,{render:o.render,renderParam:o.renderParam}))}function Vf(o){let e=Ur.Provider;return rr.createElement(e,{value:o.contextValue},o.children)}function Ko(o){let e=Sa.Provider;return rr.createElement(e,{value:o.renderParam},rr.createElement(Yr,{render:o.render,renderParam:o.renderParam}))}var Bo=H(require("react"));var Gf="yhvuzb1",Hf="yhvuzb0";var qr=zi({"data-name":""}),Xr={[qr["data-name"]]:"menu-icon"},N_=`[${qr["data-name"]}="${Xr["data-name"]}"]`;var IC={width:"100%",pointerEvents:"none"},$s=X(`${ct}-menu`,Gf);function Zr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...IC,borderTop:`${he.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Bo.createElement("div",{...n,style:e,...Xr,onPointerDown:s=>s.stopPropagation(),className:X(t,Gd({menuVisible:i,reserveSpaceWhenHidden:r}),ct,`${ct}-menu`,a==null?Hf:"")},a??Bo.createElement(Bo.Fragment,null,Bo.createElement("div",{className:$s,style:l}),Bo.createElement("div",{className:$s,style:l}),Bo.createElement("div",{className:$s,style:l})))}var ir=H(require("react")),Qr=require("react");var Kf="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32",Bf={asc:"_1b8djff1",desc:"_1b8djff2",none:"_1b8djff3"},ba="_1b8djff4";var Wf={transition:"width 0.25s, opacity 0.25s"},q_=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ta(o){let[e,t]=(0,Qr.useState)(!0),[n,r]=(0,Qr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.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={...Wf,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Qr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let T=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h=i===1?"asc":i===-1?"desc":"none",S={};return i===-1&&(S.top="100%"),ir.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:X(s,ct,Kf,Bf[h],`${ct}-sort`,`${ct}-sort--${h}`)},u?ir.createElement("div",{"data-name":"index",style:S,className:Bd},c):null,ir.createElement("div",{className:ba,style:{width:f[0],...m},onTransitionEnd:g}),ir.createElement("div",{className:ba,style:{width:f[1],...m}}),ir.createElement("div",{className:ba,style:{width:f[2],...m}}))}var qf=H(require("react")),qs=require("react");function Ys(o){return Math.max(o.width-Xt(),0)}function jf(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,c=e.getComputed().computedVisibleColumns,u=!1,d=c.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},u=!0),f),{}),p=u?{...a,...d}:a;return Ss({shareSpaceOnResize:r,availableSize:Ys(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:c.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var Jr=require("react"),ei=H(require("react"));function Uf(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){ve.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;ve.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Ds(l,i,n.current):ve.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Ds(c,i,n.current);continue}c.computedPinned!=="end"&&ve.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||ve.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function $f(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;ve.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&ve.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&ve.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Ca="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ra=Se({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),Ia=Se({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:wC}=ze,vC=`${wC}HeaderCell_ResizeHandle`;function PC(o){let{brain:e,headerBrain:t}=oe(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,Jr.useRef)(null),[r,i]=(0,Jr.useState)(!1),a=(0,Jr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,S=g.pointerId,y=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),v=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),v()}}T.setPointerCapture(S);let b=Uf(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),R=(w,{done:v}={})=>{s&&(w=w/(s+1),v&&(w=Math.round(w))),c==="end"&&(w*=-1);let{adjustedDiff:P,constrained:E}=o.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==E&&i(E),b.resize(P),P},C=w=>{R(Math.round(w.clientX-y))},I=w=>{T.releasePointerCapture(S),T.removeEventListener("pointermove",C),T.removeEventListener("pointerup",I);let v=Math.round(w.clientX-y),P=R(v,{done:!0});p(),b.resize(0),o.onResize({diff:P,shareSpaceOnResize:h})};T.addEventListener("pointermove",C),T.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return ei.createElement("div",{ref:n,className:`${vC} ${Ca} ${Ia({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},ei.createElement("div",{style:m,className:Ra({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Yf=ei.memo(PC);function Xf(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=oe(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,qs.useCallback)(({diff:c,shareSpaceOnResize:u})=>jf({context:{getState:n,getComputed:r},column:o,diff:c,shareSpaceOnResize:u}),[o,n,r]),l=(0,qs.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?qf.createElement(Yf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var $e=H(require("react")),Bt=require("react");var Zf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Qf=Se({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Jf(o,e){return wt(o,e)}var ar=class extends sn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return Jf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Jf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=ln(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var DC={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function xC(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function EC(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(xC(t,e))return t;t=t.parentElement}return null}function MC(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var Xs=1;function em(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return Xs;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function AC(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return Xs;let a=(i-n)/(r-n);return Math.max(Xs,Math.ceil(o*t.ease(a)))}function tm(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=MC(n,r),s=o-e,c=t-o,u=c<s,d;return u?d=em(c,l,r):d=-em(s,l,r),d===0?0:a?(d>0?1:-1)*AC(Math.abs(d),i,r):d}var gn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...DC,...e.config}}start(e){this.scrollContainer=EC(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=tm(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=tm(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Zs="data-drag-list-id",Tt="data-drag-item-id",lr="data-drag-item-list-id",om=`[${Tt}]`,nm=()=>null,rm=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},_C=o=>`${o.getAttribute(Tt)}`;function Qs(o,e){let t=o.current?.querySelectorAll(om)??[];return Array.from(t).filter(r=>r.getAttribute(lr)===`${e}`)}function OC(o,e){let t=Qs(o,e);return Array.from(t).map(r=>{let i=_C(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function FC(o){let{domRef:e,orientation:t,dragListId:n}=o,r=OC(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>c&&(c=f.right)}let u=De.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:u,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function im(o){return new ar(FC(o))}function am(o,e){let t=document.querySelector(`[${Zs}="${e}"]`);t?o.current=t:console.warn(`DragList with id "${e}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)}function lm(o,e){let t=o.current;t&&t!==e&&pt.unregisterDragInteractionTarget(t),o.current=e,e&&pt.registerDragInteractionTarget(e)}function sm(o){let{getProps:e,domRef:t,setInteractionTarget:n}=o;return pt.on("register",r=>{let{dragListId:i,acceptDropsFrom:a,orientation:l,shouldAcceptDrop:s}=e(),c=r.getData();if(c.initial&&c.listId!==i&&a?.includes(c.listId)){let u=im({domRef:t,orientation:l,dragListId:i,initial:!1,acceptDropsFrom:a,shouldAcceptDrop:s});r.once("unregister",()=>{n(null)}),n(u)}})}function wa(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Tt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function va({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function cm(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}function um(o,e,t){let n=o.current;return(!n||n.length===0)&&(n=Qs(e,t),o.current=n),n}function dm(o,e){let{dragListId:t,orientation:n,domRef:r,proxyStateRef:i,sourceScrollOffsetRef:a,dragItemsRef:l,getDragItems:s,getOnDrop:c,getOnAcceptDrop:u,getOnRemove:d,getUpdatePosition:p,updateDragOperationSourceAndTarget:f,updateDragProxyRenderState:m}=e,g=o.on("start",({dragItem:C,dragSourceListId:I,dropTargetListId:w})=>{f({dragSourceListId:I,dropTargetListId:w,dragItemId:C.id,status:"accepted"})}),h=o.on("move",({offsetsForItems:C,items:I,status:w,dragItem:v})=>{if(w==="rejected")return;let P=s(),E=p(),M=i.current;I.forEach((D,x)=>{let A=C[x],O=P[x];if(O&&!(M&&D.id===M.dragItemId)){if(!M&&D.id===v.id){let F=a.current;A={left:A.left+F.left,top:A.top+F.top}}E({id:D.id,node:O,offset:A})}})}),S=o.on("drop",C=>{let{sortedIndexes:I,dragIndex:w,dropIndex:v,dragItem:P,items:E,dragSourceListId:M,dropTargetListId:D,outside:x,status:A}=C,O=s();l.current=[];let F=u(),z=d(),L=c(),B=p();E.forEach((W,N)=>{let K=O[N];K&&B({id:W.id,node:K,offset:null})}),cm(i),m(W=>W&&(requestAnimationFrame(()=>m(nm)),{...W,dragItemId:null})),t===D&&M!==t&&F&&A==="accepted"&&F({dragItemId:P.id,dragSourceListId:M,dropTargetListId:D,dragIndex:w,dropIndex:v,dropItemId:E[v]?.id});let V=null;v===-1&&M===t&&D===t&&x&&(V=z),v!==-1&&D===t&&M===t&&(V=L),V&&V?.(I,{dragIndex:w,dropIndex:v,dragItemId:E[w].id,dropItemId:E[v]?.id})}),y=null,T=null,b=null,R=null;if(!o.getData().initial&&r.current){if(y=new gn({orientation:n,onScroll:()=>{}}),y.start(r.current),T=y.getScrollContainer(),T){let C=n==="vertical"?T.scrollTop:T.scrollLeft;b=()=>{let I=n==="vertical"?T.scrollTop:T.scrollLeft,w=I-C;C=I,w!==0&&(o.adjustForScroll(w),pt.retriggerMove())},T.addEventListener("scroll",b)}R=C=>{y.updatePointer({left:C.clientX,top:C.clientY})},Fe().addEventListener("pointermove",R)}return()=>{g(),h(),S(),y&&y.stop(),T&&b&&T.removeEventListener("scroll",b),R&&Fe().removeEventListener("pointermove",R)}}function pm(o,e,t){let{dragListId:n,orientation:r,acceptDropsFrom:i,preserveDragSpace:a,onDragProxySetup:l}=e,{domRef:s,proxyStateRef:c,sourceScrollOffsetRef:u,dragItemsRef:d,setInteractionTarget:p,updateDragProxyRenderState:f}=t,m=e.dragStrategy??"proxy",g=m==="proxy"&&!e.renderDragProxy,h=m==="proxy"&&!!e.renderDragProxy,S=e.onDragProxyMove??va,y=o.currentTarget,T=y.getAttribute(Tt);if(T==null){let N=Lo(y,om);N&&(T=N.getAttribute(Tt))}if(T==null){console.warn("Could not find drag item id for element",y,`Make sure you have a parent element with a ${Tt} attribute`);return}T=`${T}`;let b=null,R=Qs(s,n);d.current=R;let C=im({domRef:s,orientation:r,dragListId:n,acceptDropsFrom:i,initial:!0,preserveDragSpace:a}),I=C.getData().draggableItems,w=I.findIndex(N=>N.id===T);if(w===-1)return;let v=I[w],P=R[w]?.getAttribute(Tt)===`${T}`?R[w]:R.find(N=>N.getAttribute(Tt)===`${T}`);p(C);let E={left:o.clientX,top:o.clientY},M={left:o.clientX,top:o.clientY};u.current={top:0,left:0};let D=new gn({orientation:r,onScroll:()=>{}});s.current&&D.start(s.current);let x=D.getScrollContainer(),A=x?r==="vertical"?x.scrollTop:x.scrollLeft:0;function O(){b&&b.move({left:M.left,top:M.top})}let F=()=>{if(!x)return;let N=r==="vertical"?x.scrollTop:x.scrollLeft,K=N-A;A=N,K!==0&&(C.adjustForScroll(K),r==="vertical"?u.current.top+=K:u.current.left+=K),O()};x?.addEventListener("scroll",F);let z=N=>{if(M={left:N.clientX,top:N.clientY},!b){if(b=pt.startDrag({listId:n,dragItem:v,dragIndex:w},E),P&&g){let re=P.getBoundingClientRect(),ue=null,fe={dragItemNode:P,dragItemId:`${T}`,initialRect:re,initialCoords:E,get proxyElement(){return ue||(ue=wa(P,re)),ue}},be=l?.(fe),de=be?.proxyElement??fe.proxyElement;P.style.visibility="hidden",c.current={proxyElement:de,originalNode:P,dragItemId:`${T}`,initialRect:re,cleanup:be?.cleanup}}if(P&&h){let re=P.getBoundingClientRect();P.style.visibility="hidden",c.current={proxyElement:P,originalNode:P,dragItemId:`${T}`,initialRect:re,cleanup:()=>{}};let ue={dragItemId:`${T}`,initialRect:re,dx:0,dy:0};f(()=>ue)}}let K=N.clientX-E.left,ae=N.clientY-E.top;if(h)f(re=>re&&{...re,dx:K,dy:ae});else{let re=c.current;re&&S({proxyElement:re.proxyElement,dx:K,dy:ae})}D.updatePointer({left:N.clientX,top:N.clientY}),O()},L=N=>{N.preventDefault()},B=N=>{if(D.stop(),x?.removeEventListener("scroll",F),W.removeEventListener("pointermove",z),W.removeEventListener("pointerup",Y),W.removeEventListener("pointercancel",V),W.removeEventListener("dragstart",L,!0),h&&(f(K=>K&&{...K,dragItemId:null}),requestAnimationFrame(()=>{f(nm)})),!b){cm(c),p(null);return}N?b.cancel():b.drop(),b=null},Y=()=>B(!1),V=()=>B(!0),W=Fe();W.addEventListener("pointermove",z),W.addEventListener("pointerup",Y),W.addEventListener("pointercancel",V),W.addEventListener("dragstart",L,!0)}var fm=$e.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),hn=()=>$e.useContext(fm);function NC(o,e){let t=Le(e),[n,r]=$e.useState(null),i=$e.useRef(null),a=(0,Bt.useCallback)(s=>{lm(i,s),r(s)},[]),l=Le(n);return(0,Bt.useEffect)(()=>()=>{pt.unregisterDragInteractionTarget(i.current),i.current=null},[]),(0,Bt.useEffect)(()=>sm({getProps:t,domRef:o,setInteractionTarget:a}),[t]),{interactionTarget:n,setInteractionTarget:a,getInteractionTarget:l}}var Wo=o=>{let e=$e.useRef(null),t=$e.useRef(null),[n,r]=(0,Bt.useState)(null),i=$e.useRef({top:0,left:0}),a=$e.useRef(null),l=$e.useCallback(P=>{a.current=P},[]),{dropTargetListId:s,dragSourceListId:c}=fo(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:p}=fo(),f=Le(o.onDrop),m=Le(o.onAcceptDrop),g=Le(o.onRemove),h=Le(o.updatePosition??rm),{interactionTarget:S,setInteractionTarget:y}=NC(e,o);(0,Bt.useEffect)(()=>{am(e,o.dragListId)},[o.dragListId]),(0,Bt.useEffect)(()=>{if(S)return dm(S,{dragListId:o.dragListId,orientation:o.orientation,domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:T,getDragItems:b,getOnDrop:f,getOnAcceptDrop:m,getOnRemove:g,getUpdatePosition:h,updateDragOperationSourceAndTarget:u,updateDragProxyRenderState:r})},[S,o.dragListId]);let T=$e.useRef([]),b=(0,Bt.useCallback)(()=>um(T,e,o.dragListId),[o.dragListId]),R=(0,Bt.useCallback)(P=>{pm(P,o,{domRef:e,proxyStateRef:t,sourceScrollOffsetRef:i,dragItemsRef:T,setInteractionTarget:y,updateDragProxyRenderState:r})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),C=!!d,I=$e.useMemo(()=>({dragItemId:d,onDragItemPointerDown:R,dragSourceListId:c,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:C}),[d,R,C,c,s,o.dragListId]),w={className:X("DragList",C?"DragList--dragging":"",Zf({dragging:C})),[Zs]:o.dragListId},v=typeof o.children=="function"?o.children(w,I):o.children;return $e.createElement(fm.Provider,{value:I},v,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},LC=$e.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),kC=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=hn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,c=$e.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),u={[Tt]:`${o.id}`,[lr]:l,onPointerDown:e,className:X("DraggableItem",s?"DraggableItem--active":"",Qf({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(u,c):o.children;return $e.createElement(LC.Provider,{value:c},d)};Wo.DraggableItem=kC;var Js=H(require("react"));var mm=o=>Js.createElement(Ve,{...o,icon:"hidden",viewBox:"0 -960 960 960"},Js.createElement("path",{d:Ge.hidden[0]}));var si=H(require("react"));function gm(){return{}}var hm=o=>({allowColumnHideWhileDragging:e=>e??!0});var ym=require("react"),zC=(0,ym.createContext)(null);function ec(){return zC}var Wt=H(require("react"));var Rn=H(require("react")),Dt=require("react");var Pa=H(require("react"));function VC(o){let{height:e,width:t,count:n}=o;return Pa.createElement("div",{"data-count":n,"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 Sm=Pa.memo(VC);var bm="mlx2t3";var Da=H(require("react")),Dm=require("react");var Tm=require("react"),Cm=(o,e)=>{(0,Tm.useEffect)(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var Rm={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Im={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},wm={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},tc="_1ueijco1",vm="_1ueijco0 _16lm1iw0";var Pm=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Rm[`${o}`]:e=X(Im[`${o.horizontal}`],wm[`${o.vertical}`]),e};var GC="InfiniteVirtualScrollContainer";var xm=Da.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Dm.useRef)(null);return Cm(u,i),Da.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:X(a,GC,vm,Pm(r))},n)});var za=H(require("react")),bn=require("react");var Em=H(require("react")),sr=require("react");function HC(o){let[e,t]=(0,sr.useState)(o.updater.get),n=(0,sr.useRef)(null);return(0,sr.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var jo=Em.memo(HC);var Mm=H(an());var oc=(o,e)=>o-e,ho={horizontal:!0,vertical:!0};function xa(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var nc="DebugID=";function Uo(o,e){return e&&e.startsWith(nc)?e:e?`${nc}${o}:${e}`:`${nc}${o}`}var Ea={start:0,end:0},rc=o=>{o()},ic=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Am=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},ti=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function KC(o){return o.horizontalChange||o.verticalChange}var yn=class extends It{constructor(t){let n=Uo(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Ea;this.verticalExtendRangeBy=Ea;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.largeContent={vertical:!1,horizontal:!1};this.scrollRatio={vertical:1,horizontal:1};this.scrollOrigin={scrollLeft:0,scrollTop:0};this.onScrollOriginChangeFns=new Set;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.onScrollOriginChange=t=>this.onScrollOriginChangeForBrain(t);this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{ti(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.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 n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=ho)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(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:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,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:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=ho)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=ho)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=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 n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,Mm.default)(a,t,oc);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="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],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let S=f;for(;h>1;)S+=1,d[S]=f,p[S]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n: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,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ic;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(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==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(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=ho){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,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,S=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,T=l!=null,b=y&&a!==this.rowHeight,R=T&&l!==this.colWidth;y&&(this.rowHeight=a),T&&(this.colWidth=l);let C=t.rowspan!=null,I=t.colspan!=null,w=C&&t.rowspan!=this.rowspan,v=I&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),v&&(this.colspan=t.colspan);let P=S||R||p||v,E=h||b||f||w;(n||KC)({horizontalChange:P,verticalChange:E,colsChanged:S,colWidthChanged:R,widthChanged:p,colspanChanged:v,rowsChanged:h,rowHeightChanged:b,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:P,vertical:E})}extendRenderRange(t){let{direction:n}=t,r=n==="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:n})}}updateRenderCount(t=ho){this.reset(t),this.doUpdateRenderCount(t),this.updateLargeContent()}supportsLargeContent(t){return t==="vertical"}alignScrollOrigin(t,n){return Math.floor(n)}updateLargeContent(){let t=this.getVirtualizedContentSize(),n=this.supportsLargeContent("vertical")&&ea(t.height),r=this.supportsLargeContent("horizontal")&&ea(t.width);this.largeContent={vertical:n,horizontal:r},this.scrollRatio={vertical:n?Os(t.height,this.availableHeight):1,horizontal:r?Os(t.width,this.availableWidth):1},this.updateScrollOrigin()}isLargeContent(t){return this.largeContent[t]}getScrollRatio(t){return this.scrollRatio[t]}getNativeScrollSize(){let t=this.getVirtualizedContentSize(),{largeContent:n}=this;if(!n.vertical&&!n.horizontal)return t;let r=Ji();return{width:n.horizontal?r:t.width,height:n.vertical?r:t.height}}toContentScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop*n,scrollLeft:t.scrollLeft*r}}toNativeScrollPosition(t){let{vertical:n,horizontal:r}=this.scrollRatio;return n===1&&r===1?t:{scrollTop:t.scrollTop/n,scrollLeft:t.scrollLeft/r}}getScrollOrigin(){return this.scrollOrigin}getDOMScrollPosition(t=this.getScrollPosition()){let n=this.getScrollOrigin();return!n.scrollTop&&!n.scrollLeft?t:{scrollTop:t.scrollTop-n.scrollTop,scrollLeft:t.scrollLeft-n.scrollLeft}}onScrollOriginChangeForBrain(t){return this.onScrollOriginChangeFns.add(t),()=>{this.onScrollOriginChangeFns.delete(t)}}updateScrollOrigin(){let{scrollPosition:t,largeContent:n,scrollOrigin:r}=this,i=c=>this.alignScrollOrigin("vertical",c),a=c=>this.alignScrollOrigin("horizontal",c),l=n.vertical?Fs(t.scrollTop,i(r.scrollTop),i):0,s=n.horizontal?Fs(t.scrollLeft,a(r.scrollLeft),a):0;l===r.scrollTop&&s===r.scrollLeft||(this.scrollOrigin={scrollTop:l,scrollLeft:s},this.notifyScrollOriginChange())}notifyScrollOriginChange(){if(this.destroyed)return;let t=this.getScrollOrigin();this.onScrollOriginChangeFns.forEach(n=>n(t))}doUpdateRenderCount(t=ho){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(this.updateScrollOrigin(),n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?rc:ti;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,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,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=xa(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,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:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{ti(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="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 n=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*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Ea,this.verticalExtendRangeBy=Ea,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onScrollOriginChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ac=H(an());function _m(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function Om(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function oi(o,e){for(let t of o)if(e(t))return t}var Ma=(o,e)=>o-e,Aa=class extends It{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,S=f>=s;(m||g||h||S)&&c.add(u)}),c};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,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,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);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,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=oi(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=oi(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Ma)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Ma)}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((n,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(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,ac.default)(n,t,Ma);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,ac.default)(n,t,Ma);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return oi(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return oi(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Fm=H(an());var _a=class extends It{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}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,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Fm.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.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 n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}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 Nm=!0,Sn=Q(J.y),Lm=Q(J.scrollTop),lN=Q(J.columnOffsetAtIndex),lc=Q(J.columnOffsetAtIndexWhileReordering),cr=class extends It{constructor(t,n,r){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{i||(r-=this.brain.getScrollOrigin().scrollTop),t.style.setProperty(Sn,i?`calc( ${r}px + var(${Lm}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Sn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=ve.columnOffsets.get(r),d=`${lc}-${r}`,p=s?`calc( ${a}px + var(${Lm}) )`:`${a-this.brain.getScrollOrigin().scrollTop}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Sn,p));let f=`translate3d(var(${d}, ${u}), var(${Sn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.onScrollOriginChange=()=>{this.destroyed||(this.cellManager.getAllCells().forEach(t=>{this.updateElementPosition(t,void 0,{immediate:!0})}),this.rowManager.forEachAttachedRow(t=>{this.updateDetailElementPosition(t)}),this.adjustFixedElementsOnScroll())};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let S=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(S,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{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,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=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 c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=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,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.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(n=>{let r=n.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 n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};He(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n,r)=>{if(this.destroyed)return;let i=t.getElement(),a=this.cellManager.getCellPosition(t);if(!a)return;let[l,s]=a,c=this.brain.getCellOffset(l,s);if(c==null)return;let{x:u,y:d}=c;if(i){let p=()=>{this.updateHoverClassNamesForRow(l);let f=this.getCellRealCoordinates(l,s);if(i.dataset.rowIndex=f.rowIndex,i.dataset.colIndex=f.colIndex,Nm){this.setTransform(i,l,s,{x:u,y:d},null),i.style.willChange="transform",i.style.backfaceVisibility="hidden";let g=(n?n.hidden:!!this.isCellCovered(l,s))?"-1":i.dataset.zIndex||"auto";i.__zIndex!==g&&(i.__zIndex=g,i.style.zIndex=g)}else i.style.display="",i.style.left=`${u}px`,i.style.top=`${d}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain&&!r?.immediate?t.setPendingAfterCommitWork(p):p()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=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;n&&(n.dataset.detailRowIndex=r,Nm&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getDOMScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.flushPendingAfterCommitWork(),this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(x=>{let A=i.getRowIndex(x);if(A!=null){let O=this.brain.getItemOffsetFor(A,"vertical");if(O==null)return;let F=x.getElement();if(!F)return;this.setDetailTransform(F,A,{y:O,scrollLeft:n.getDOMScrollPosition(t).scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&hp(n.getDOMScrollPosition(t),this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[S,y]=g,[T,b]=h;function R(x,A,O){let F=r.getCellAt([x,A]);if(F==null)return;let z=n.getCellOffset(x,A),L=F.getElement();L&&z&&O(x,A,L,z)}let C=(x,A,O,{x:F,y:z})=>{this.setTransform(O,x,A,{x:F,y:z,scrollLeft:!0},s-A)},I=(x,A,O,F)=>{this.setTransform(O,x,A,{x:F.x,y:F.y,scrollTop:!0},u-x)},w=(x,A,O,{y:F})=>{let z=f[A];this.setTransform(O,x,A,{x:z,y:F,scrollLeft:!0},a-A)},v=(x,A,O,F)=>{this.setTransform(O,x,A,{x:F.x,y:m[x],scrollTop:!0},l-x)},P=(x,A,O,{x:F,y:z})=>{this.setTransform(O,x,A,{x:F,scrollLeft:!0,y:z,scrollTop:!0},1e5)},E=(x,A,O,{x:F})=>{this.setTransform(O,x,A,{x:F,scrollLeft:!0,y:m[x],scrollTop:!0},2e5)},M=(x,A,O,F)=>{this.setTransform(O,x,A,{x:f[A],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},D=(x,A,O)=>{this.setTransform(O,x,A,{x:f[A],y:m[x],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let x=S;x<T;x++){for(let A=0;A<s;A++)R(x,A,C);if(c){let A=a-c;for(let O=A;O<a;O++)R(x,O,w)}}if(u||d)for(let x=y;x<b;x++){for(let A=0;A<u;A++)R(A,x,I);if(d){let A=l-d;for(let O=A;O<l;O++)R(O,x,v)}}if(s&&u)for(let x=0;x<u;x++)for(let A=0;A<s;A++)R(x,A,P);if(s&&d){let x=l-d;for(let A=x;A<l;A++)for(let O=0;O<s;O++)R(A,O,E)}if(c&&u){let x=a-c;for(let A=0;A<u;A++)for(let O=x;O<a;O++)R(A,O,M)}if(c&&d){let x=l-d,A=a-c;for(let O=x;O<l;O++)for(let F=A;F<a;F++)R(O,F,D)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Aa(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,d)=>{d?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new _a(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,d)=>{d?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),He(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop),c=t.onScrollOriginChange(this.onScrollOriginChange);this.onDestroy=()=>{c(),i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=vs(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let P=t.start[1],E=t.end[1];m.forEach(M=>{P<=M&&M<E||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([P,E])=>{g.set(`${P}:${E}`,!0)});let S=f.reduce((P,E)=>P+ic(E),0),y=r?f.reduce((P,E)=>P+Am(E),0):0,T=this.brain.getRowCount(),b=this.brain.getColCount();d.detachCellsStartingAt([T,b]);let R=Math.min(T*b,S);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let C=_m(...f.map(P=>d.getCellsOutsideRenderRange(P)));C=Om(C,P=>{let E=d.getCellPosition(P);return!(E&&g.has(`${E[0]}:${E[1]}`))}),d.detachCells(C),d.poolSize=R;let I=new Map,w=new Map;f.forEach(P=>{let{start:E,end:M}=P,[D,x]=E,[A,O]=M;for(let F=D;F<A;F++){for(let L=x;L<O;L++){let B=`${F}:${L}`;if(I.has(B))continue;I.set(B,!0);let{rendered:Y,mapped:V}=this.isCellRenderedAndMappedCorrectly(F,L);if(F===D||L===x){let N=this.isCellCovered(F,L);if(N&&g.has(`${N[0]}:${N[1]}`)){let K=d.getCellAt([F,L]);K!=null&&d.detachCell(K);continue}}if(Y&&!i&&V)continue;let W;Y?W=d.getCellAt([F,L]):W=d.getCellFor([F,L],c?"row":"column"),W==null&&(W=d.getDetachedCell()),this.renderCellAt(F,L,W,n)}!r||w.has(F)||(w.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([P,E])=>{let{rendered:M,mapped:D}=this.isCellRenderedAndMappedCorrectly(P,E);if(M){if(i||!D){let A=[P,E],O=d.getCellAt(A);this.renderCellAt(P,E,O,n)}return}let x=d.getCellFor([P,E],c?"row":"column");x!=null&&this.renderCellAt(P,E,x,n)});let v=d.getAllCells().map(P=>P.getNode());return r&&u.getAllRows().forEach(P=>{v.push(P.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(v),v}renderDetailRowAtElement(t,n,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,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):n}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:S}=this.getCellRealCoordinates(t,n),y=i({rowIndex:h,colIndex:S,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(R=>{let C=R.getElement();C&&(C.style.position="absolute",C.style.left="0px",C.style.top="0px"),this.updateElementPosition(R)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:S}:void 0,b=this.brain.isHorizontalLayoutBrain;if(!y){b?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Oa=class extends cr{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage)-this.brain.getScrollOriginPageIndex(),u=he.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=ve.columnOffsets.get(l.colIndex),f=`${lc}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Sn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Sn})`,S=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==S&&(t.__transformValue=S,t.style.transform=S)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),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,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};var zm=H(require("react"));var ur=class ur extends It{constructor(t){super(t);this.cellRemoveSubscription=Ce();this.cellAttachmentChangeSubscription=Ce();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=this.createCellInstance();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,n=t.values().next().value;return n||(this.poolSize+=ur.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/ur.POOL_SIZE_INCREMENT)*ur.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-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--}};ur.POOL_SIZE_INCREMENT=1;var Fa=ur;var km=new Map,BC=()=>{},sc=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Ce();let n=km.get(e)??0,r=`${e}:GridCellReact:${n}`;km.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Ce(),this.node=zm.createElement(jo,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=BC,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}},Na=class extends Fa{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new sc(this.cellDebugId)}};var Gm=H(require("react"));var dr=class dr extends It{constructor(t){super(t);this.rowRemoveSubscription=Ce();this.rowAttachmentChangeSubscription=Ce();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=this.createRowInstance();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,n=t.values().next().value;return n||(this.poolSize+=dr.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/dr.POOL_SIZE_INCREMENT)*dr.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-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--}};dr.POOL_SIZE_INCREMENT=1;var La=dr;var Vm=new Map,WC=()=>{},cc=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Ce();let t=Vm.get(e)??0,n=`${e}:ListRowReact:${t}`;Vm.set(e,t+1),this.debugId=n,this.updater=Ce(),this.node=Gm.createElement(jo,{key:`detail-row-${n}`,name:`detail-row-${n}`,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(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=WC,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ka=class extends La{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new cc(this.rowDebugId)}};function Hm(o){return{cellPool:new Na(o),rowPool:new ka(o)}}function ni(o){let e=o.isHorizontalLayoutBrain?new Oa(o,`${o.name}:HorizontalLayoutTableRenderer`,Hm(`${o.name}:HorizontalLayoutTableRenderer`)):new cr(o,`${o.name}:ReactHeadlessTableRenderer`,Hm(`${o.name}:ReactHeadlessTableRenderer`)),t=Ce();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function jC(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,bn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:ni(e),[e,o.onRenderUpdater,o.renderer]);return(0,bn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,bn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,bn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,bn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),za.createElement(jo,{updater:a})}var Va=za.memo(jC);var ri=H(require("react")),Tn=require("react");var Km=Se({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Ga="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Bm=Se({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});function Wm(o,e){let t=e-o.getScrollOriginPageIndex();return t?`calc(${he.runtime.totalVisibleColumnsWidthVar} * ${t})`:null}function jm(o,e){let t="0px",n=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(t=Wm(o,o.getPageIndexForRow(n))??"0px",n=n%o.rowsPerPage);let r=o.getRowHeight(n),i=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop;return{activeCellRowHeight:`${r}px`,activeCellRowOffset:`${i}px`,activeCellRowOffsetX:t}}function Um(o,e){let{scrollTop:t,scrollLeft:n}=o.getDOMScrollPosition(e);return{scrollTopForActiveRow:`${-t}px`,scrollLeftForActiveRowWhenHorizontalLayout:o.isHorizontalLayoutBrain?`${-n}px`:"0px"}}function $m(o,e,t){let[n]=e,r=e[1],i;if(o.isHorizontalLayoutBrain&&o.rowsPerPage){let c=ve.columnOffsets.get(r),u=Wm(o,o.getPageIndexForRow(n));i=u?`calc( ${u} + ${c})`:c,n=n%o.rowsPerPage}let a=typeof t=="function"?t(n):t??o.getRowHeight(n),l=o.getItemOffsetFor(n,"vertical")-o.getScrollOrigin().scrollTop,s={activeCellRowHeight:`${a}px`,activeCellRowOffset:`${l}px`};return i!==void 0&&(s.activeCellColOffset=i),s}var{rootClassName:UC}=ze,$C=`${UC}-ActiveRowIndicator`,YC=`calc(${J.activeCellRowOffsetX} + var(${Q(J.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,qC={[Q(J.activeCellOffsetY)]:J.activeCellRowOffset,transform:`translate3d(${YC}, calc( ${J.activeCellOffsetY} + var(${Q(J.scrollTopForActiveRow)}, 0px)), 0px)`,height:J.activeCellRowHeight,maxWidth:he.runtime.totalVisibleColumnsWidthVar},XC=o=>{let{brain:e}=o,t=(0,Tn.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=qt(),a=(0,Tn.useRef)(o.activeRowIndex);a.current=o.activeRowIndex;let l=()=>{let s=a.current;s==null||!t.current||Yn(jm(e,s),t.current)};return(0,Tn.useLayoutEffect)(l,[o.activeRowIndex,e]),(0,Tn.useEffect)(()=>{let s=p=>{Yn(Um(e,p),t.current)};s(e.getScrollPosition());let c=e.onScroll(s),u=e.onRenderCountChange(i),d=e.onScrollOriginChange(l);return()=>{d(),u(),c()}},[e]),ri.createElement("div",{className:Ga,"data-name":"active-row"},ri.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${$C} ${Bm({active:n})}`,style:n?qC:void 0}))},Ym=ri.memo(XC);var ii=H(require("react")),Cn=require("react");var{rootClassName:ZC}=ze,QC=`${ZC}-ActiveCellIndicator`,JC=Q(J.columnZIndexAtIndex),qm=(o,e,t,n)=>{e!=null&&Yn($m(o,e,t),n.current)},eR=o=>{let{brain:e}=o,[t,n]=qt(),r=(0,Cn.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];(0,Cn.useLayoutEffect)(()=>{qm(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]);let a=(0,Cn.useRef)(o);return a.current=o,(0,Cn.useEffect)(()=>{let l=e.onRenderCountChange(()=>{n()}),s=e.onScrollOriginChange(()=>{let{activeCellIndex:c,rowHeight:u}=a.current;qm(e,c,u,r)});return()=>{l(),s()}},[e]),ii.createElement("div",{className:Ga,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${JC}-${o.activeCellIndex[1]})`}:void 0},ii.createElement("div",{"data-name":"active-cell-indicator",className:`${QC} ${Km({visible:i})}`}))},Xm=ii.memo(eR);var Ha=[lf,`${St}DetachedCell`];function Ka(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.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 tR=X(bm,tc);function Zm(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,S=(0,Dt.useRef)(null),[y,T]=(0,Dt.useState)({width:0,height:0});(0,Dt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Dt.useEffect)(()=>{let I=S.current?.parentNode;return I?(h&&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,Dt.useCallback)(I=>{let w=e.getDOMScrollPosition(I);requestAnimationFrame(()=>{S.current&&S.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[e]),R=(0,Dt.useCallback)(I=>{e.setScrollPosition(e.toContentScrollPosition(I),b)},[e,b]);(0,Dt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{T(e.getNativeScrollSize())});return T(e.getNativeScrollSize()),b(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]);let C=(0,Dt.useRef)({brain:e,vertical:1,horizontal:1});return(0,Dt.useLayoutEffect)(()=>{let I=C.current,w=e.getScrollRatio("vertical"),v=e.getScrollRatio("horizontal");C.current={brain:e,vertical:w,horizontal:v};let P=S.current?.parentElement;if(!P||I.brain!==e||I.vertical===w&&I.horizontal===v)return;let E=e.toNativeScrollPosition(e.getScrollPosition());I.vertical!==w&&(P.scrollTop=E.scrollTop),I.horizontal!==v&&(P.scrollLeft=E.scrollLeft)},[y,e]),Rn.createElement(xm,{onContainerScroll:R,...g,ref:t},Rn.createElement("div",{ref:S,className:tR,"data-name":"scroll-transform-target"},Rn.createElement(Va,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:Ha}),u!=null?Rn.createElement(Xm,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?Rn.createElement(Ym,{brain:e,activeRowIndex:c}):null,Rn.createElement(Sm,{width:y.width,height:y.height}))}function Qm(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let S={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],S);let y=u.columnGroup,T,b=S;for(;y;){let R=e[y];if(R){g.add(y);let C=[p,...g];T=h.has(y)?i.get(y):void 0,T||(T={id:y,type:"group",ref:R,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:S.computedPinned,depth:t.get(y)??0},r.set(C,T),i.set(y,T)),T.columnItems.push(S),T.uniqueGroupId.push(S.id),b&&!h.has(b.id)&&T.children.push(b),b=T,y=R.columnGroup}else break}});let l=[],s=new q,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Jm(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Jm(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Jm(t.children),e+=n})}var $o=H(require("react")),yo=require("react");var dc=H(require("react"));var tg=H(require("react")),uc=require("react");var ai=require("react"),li=H(require("react"));var{rootClassName:oR}=ze,nR=`${oR}HeaderCell_ResizeHandle`;function rR(o){let e=(0,ai.useRef)(null),[t,n]=(0,ai.useState)(!1),r=(0,ai.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=$f(o.groupColumns.map(b=>b.computedVisibleIndex),{columns:o.columns,domRef:e}),S=b=>{a==="end"&&(b*=-1);let{constrained:R,adjustedDiffs:C,adjustedDiff:I}=o.computeResize(b);return r.current!==R&&n(R),h.resize(C),I},y=b=>{if(g){let R=o.groupColumns.reduce((w,v)=>w+v.computedWidth-v.computedMinWidth,0),C=o.brain.getAvailableSize(),I={width:C.width+R,height:C.height};o.brain.update(I),g=!1}S(Math.round(b.clientX-f))},T=b=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",T);let R=Math.round(b.clientX-f),C=S(R);h.resize(o.groupColumns.map(()=>0)),o.onResize(C)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",T)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:he.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return li.createElement("div",{ref:e,className:`${nR} ${Ca} ${Ia({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},li.createElement("div",{style:{...u,...o.style},className:Ra({constrained:t})}))}var eg=li.memo(rR);function og(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=oe(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=o[o.length-1],d=(0,uc.useCallback)(g=>{let h=l(),{columnSizing:S,viewportReservedWidth:y,bodySize:T}=h,b=s().computedVisibleColumns,R=!1,C=b.reduce((v,P)=>(P.computedFlex&&(v[P.id]={...S[P.id],flex:P.computedWidth},R=!0),v),{}),I=R?{...S,...C}:S;return Xd({availableSize:Ys(T),reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:o.length,items:b.map(v=>({id:v.id,resizable:v.computedResizable,computedFlex:v.computedFlex,computedWidth:v.computedWidth,computedMinWidth:v.computedMinWidth,computedMaxWidth:v.computedMaxWidth}))})},[u]),p=(0,uc.useCallback)(g=>{let{columnSizing:h,reservedWidth:S}=d(g);c.viewportReservedWidth=S,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?tg.createElement(eg,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var ng=`${St}HeaderGroup`,rg=Q(J.columnWidthAtIndex),iR=Q(J.columnZIndexAtIndex);function ig(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=og(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${rg}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${rg}-${c.computedVisibleIndex})`,d=`calc(var(${iR}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,dc.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:X(Vd,ng),style:p,"data-z-index":d},dc.createElement("div",{className:X(`${ng}__header-content`,Ht)},a),s)}var ag=require("react");var mc=H(require("react")),pc;function gc(){return pc||(pc=mc.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var fc;function Ba(){return fc||(fc=mc.createContext(null))}function Ne(o){let e=Ba(),t=(0,ag.useContext)(e);return Ln(t,o)}function no(){return Ne(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:aR}=ze,lR=[],lg=`${aR}Header`,sR=Fd({overflow:!1}),sg=()=>{};function cR(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=oe(D=>({computedColumnsMap:D.computed.computedColumnsMap,getState:D.getState,headerOptions:D.state.headerOptions,headerRenderer:D.state.headerRenderer,headerOnRenderUpdater:D.state.headerOnRenderUpdater,showColumnFilters:D.state.showColumnFilters})),g=(0,yo.useRef)(null),h=(0,yo.useCallback)(D=>{if(g.current){let{scrollLeft:x}=t.getDOMScrollPosition(D);g.current.style.transform=`translate3d(${-x}px, 0px, 0px)`}},[t]);(0,yo.useEffect)(()=>{let D=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),D},[t]);let S={ref:g,className:X(lg,`${lg}--virtualized`,i,sR),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:T,dataSourceActions:b}=no(),{allRowsSelected:R,someRowsSelected:C,selectionMode:I,filterTypes:w,filterDelay:v}=Ne(D=>({allRowsSelected:D.dataSourceState.allRowsSelected,someRowsSelected:D.dataSourceState.someRowsSelected,selectionMode:D.dataSourceState.selectionMode,filterTypes:D.dataSourceState.filterTypes,filterDelay:D.dataSourceState.filterDelay})),P=(0,yo.useMemo)(()=>({allRowsSelected:R,someRowsSelected:C,selectionMode:I}),[R,C,I]),E=(0,yo.useCallback)(D=>{let{rowIndex:x,colIndex:A,domRef:O,height:F,widthWithColspan:z,heightWithRowspan:L,hidden:B}=D,Y=n[A];if(!Y||B)return null;let V=t.isHorizontalLayoutBrain?t.getPageIndexForRow(x):null,W=l?l.pathsToCells.get([x,A]):null;if(W&&W.type==="group"){let N=W.columnItems.map(re=>re.ref),K={...W.ref,id:W.id,uniqueGroupId:W.uniqueGroupId,depth:W.depth,columns:N.map(re=>re.id),computedWidth:W.computedWidth,groupOffset:W.groupOffset};return c().columnGroupVisibility[W.id]!==!1?$o.createElement(ig,{horizontalLayoutPageIndex:V,bodyBrain:e,columnGroupsMaxDepth:s,domRef:O,columns:N,width:z,height:F,columnGroup:K}):null}return $o.createElement(ug,{domRef:O,column:Y,horizontalLayoutPageIndex:V,headerOptions:u,dataSourceStatePartialForHeaderCell:P,filterTypes:w,filterDelay:v,getDataSourceState:y,dataSourceApi:T,dataSourceActions:b,width:z,height:L,columnsMap:m})},[u,n,a,l,s,f,t,y,T,b,w,v,P]),M=cn(oa);return $o.createElement(Wo,{orientation:"horizontal",dragListId:M,dragStrategy:"inline",onDrop:sg,updatePosition:sg},D=>$o.createElement("div",{...D,...S,className:X(D.className,S.className)},$o.createElement(Va,{name:"header",renderCell:E,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:lR,cellDetachedClassNames:Ha})))}var cg=$o.memo(cR);function dg(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=oe(C=>({computedPinnedStartColumns:C.computed.computedPinnedStartColumns,computedPinnedEndColumns:C.computed.computedPinnedEndColumns,computedVisibleColumns:C.computed.computedVisibleColumns,columnSize:C.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:p}=oe(C=>({columnHeaderHeight:C.state.columnHeaderHeight,columnGroupsDepthsMap:C.state.columnGroupsDepthsMap,columnGroupsMaxDepth:C.state.columnGroupsMaxDepth,computedColumnGroups:C.state.computedColumnGroups,showColumnFilters:C.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:u+2,m=f*s+(p?s:0),g=Wt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Qm(a,d,c,u)},[a,d,c]),h=Wt.useCallback(({rowIndex:C,colIndex:I})=>{let w=a[I],v=1,P=1;if(!w||!g)return{rowspan:v,colspan:P};let E=g.pathsToCells.get([C,I]);if(!E)return{rowspan:v,colspan:P};if(E.type==="column")return{colspan:P,rowspan:f-E.depth};let M=E.columnItems.findIndex(D=>D.id===w.id);return{rowspan:v,colspan:M===0?E.columnItems.length:1}},[d,u,a,g,f,c]),S=Wt.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).rowspan,[h]),y=Wt.useCallback(({rowIndex:C,colIndex:I})=>h({rowIndex:C,colIndex:I}).colspan,[h]),T=Wt.useCallback(C=>p?C<f-1?s:2*s:s,[f,p,s]);Ka(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:S,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let b=Wt.createElement(cg,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),R=n.vertical&&Xt()?Wt.createElement("div",{className:Hd,style:{zIndex:1e3,width:Xt()}}):null;return Wt.createElement("div",{className:`${zs} ${jd}`,style:{height:m}},b,R)}var{ManagedComponentContextProvider:uR}=kt({initSetupState:gm,forwardProps:hm,Context:ec()});function hc(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=oe(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?si.createElement(uR,{...o},si.createElement(dg,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function pg(){return si.useContext(ec()).componentState}var dR=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||zo;return _e.createElement(s,{domProps:{className:Jn},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Sa=_e.createContext(null);var pR=Q(J.columnZIndexAtIndex),fR=Q(J.columnVisibilityAtIndex),yc=_e.createElement("div",{className:Li[1]}),mg=zi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Tt]:"",[lr]:""});function mR(o){let e=o.column,{allowColumnHideWhileDragging:t}=pg(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=o,{allRowsSelected:u,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f,dragListId:m}=hn(),{api:g,getComputed:h,getState:S,actions:y,getDataSourceMasterContext:T,showColumnFilters:b,components:R,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=oe($=>({api:$.api,getComputed:$.getComputed,getState:$.getState,actions:$.actions,getDataSourceMasterContext:$.getDataSourceMasterContext,showColumnFilters:$.state.showColumnFilters,components:$.state.components,portalDOMRef:$.state.portalDOMRef,columnHeaderHeight:$.state.columnHeaderHeight,columnReorderDragColumnId:$.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:$.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:$.state.columnReorderInPageIndex})),E=w===e.id,M=P!=null?r!==P:!1,{onResize:D,height:x,width:A,headerOptions:O,columnsMap:F}=o,z=e.computedSortInfo,L=e.header,B=(0,So.useCallback)($=>{ge.current=$,o.domRef?.($)},[o.domRef]),Y=O.alwaysReserveSpaceForSortIcon,V=e.headerAlign??e.align,W=(typeof V=="function"?V({isHeader:!0,column:e}):V)??"start",N=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",K=bt(e,{actions:y,api:g,dataSourceActions:l,dataSourceApi:a,getComputed:h,getDataSourceState:i,getDataSourceMasterContext:T,getState:S}),ae=K.isSortable(),re=ae&&(e.computedSorted||Y)?_e.createElement(Ta,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:he.spacing[2],marginInlineEnd:he.spacing[2]},className:`${un}__sort-icon ${Kd} ${Wd({align:W})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,fe=e.computedFilterable&&e.computedFiltered?_e.createElement(Bn,null):null,be=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:W==="center",menuVisible:v===e.id,style:W==="end"?{marginInlineStart:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:he.spacing[2]}:{marginInlineEnd:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:he.spacing[2]},domProps:{onMouseDown:$=>{$.stopPropagation(),K.toggleContextMenu($.target)}}},U=e.components?.MenuIcon||R?.MenuIcon||Zr,ie=_e.createElement(U,{...de}),ge=(0,So.useRef)(null),Z={horizontalLayoutPageIndex:r,dragging:E,domRef:B,htmlElementRef:ge,renderLocation:"column-header",column:e,columnsMap:F,columnSortInfo:z,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:p,api:g,dataSourceApi:a,columnApi:K,renderBag:{sortIcon:re,filterIcon:fe,menuIcon:ie,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},ee=Z,j=ee.renderBag.header,se=()=>{let $={...Z,renderBag:{...Z.renderBag}};if(e.renderSortIcon&&($.renderBag.sortIcon=_e.createElement(Ko,{render:e.renderSortIcon,renderParam:{...$,renderBag:{...$.renderBag}}})),e.renderFilterIcon&&($.renderBag.filterIcon=_e.createElement(Ko,{render:e.renderFilterIcon,renderParam:{...$,renderBag:{...$.renderBag}}})),typeof e.renderMenuIcon=="function"&&($.renderBag.menuIcon=_e.createElement(Ko,{render:Ze=>{if(typeof e.renderMenuIcon!="function")return null;let Rt=e.renderMenuIcon(Ze);return Rt?Rt.type===U||Rt.type===Zr?Rt:_e.createElement(U,{...de},Rt):null},renderParam:{...$,renderBag:{...$.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){$.renderBag.selectionCheckBox=_e.createElement(Ko,{render:dR,renderParam:{...$,renderBag:{...$.renderBag}}});let Ze=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ze&&Ze!==!0&&($.renderBag.selectionCheckBox=_e.createElement(Ko,{render:Ze,renderParam:{...$,renderBag:{...$.renderBag}}}))}L instanceof Function&&($.renderBag.header=j=_e.createElement(Ko,{render:L,renderParam:{...$,renderBag:{...$.renderBag}}}));let tt=e.renderMenuIcon===!1?null:$.renderBag.menuIcon,ce=be?_e.createElement("div",{className:Ht},$.renderBag.header):$.renderBag.header,Ae=_e.createElement(_e.Fragment,null,W==="center"?yc:null,$.renderBag.selectionCheckBox,ce,$.renderBag.sortIcon,$.renderBag.filterIcon,W==="center"?yc:null,W!=="center"?yc:null,tt);return e.renderHeader?_e.createElement(Ko,{render:e.renderHeader,renderParam:{...$,renderBag:{...$.renderBag,all:Ae}}}):Ae};(0,So.useEffect)(()=>{let $=null,tt=ge.current;return D&&tt&&($=Nn(tt,D)),()=>{$?.()}},[ge.current,o.onResize]);let ne={height:x};e.headerStyle&&(ne=typeof e.headerStyle=="function"?{...ne,...e.headerStyle(ee)||{}}:{...ne,...e.headerStyle});let pe=typeof e.headerClassName=="function"?e.headerClassName(ee):e.headerClassName,{onPointerDown:k,proxyPosition:_,dragColumnOutside:me}=Qp({columnId:e.id,domRef:ge,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),Te=null,Pe=Sa.Provider,Re={filtered:e.computedFiltered,verticalAlign:N,align:W},Me=_e.useMemo(()=>{let $=tt=>{g.setColumnFilter(e.id,tt)};return c>0?Nt($,{wait:c}):$},[c,e.id]),qe=e.computedFilterType,We=s[qe],it=e.computedFilterable?e.computedFilterValue?.filter.operator??We?.defaultOperator:void 0,at=e.computedFilterable&&We?We.operators.find($=>$.name===it):void 0,et=at?.components?.FilterEditor||We?.components?.FilterEditor||e.components?.FilterEditor||$n,Xe=We?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,G=Xf(e,{horizontalLayoutPageIndex:r}),te=`var(${pR}-${e.computedVisibleIndex})`;ne.zIndex=te,ne.visibility=`var(${fR}-${e.computedVisibleIndex}, visible)`;let ye={"data-field":`${e.field||""}`,"data-column-id":e.id,[Tt]:e.id,[lr]:m,"data-header-align":W,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Ie=e.computedFilterable?_e.createElement(lp,{horizontalLayoutPageIndex:r,filterEditor:et,filterOperatorSwitch:Xe??sp,operator:at,filterTypes:s,onChange:Me,columnFilterType:qe,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):_e.createElement(cp,null);ee.renderBag.filterEditor=Ie;let ut=(0,So.useCallback)($=>{k($),f($)},[k,f]),le=se();return E&&_&&(Te=_e.createElement("div",{key:e.id,className:`${un}Proxy ${Ad}`,style:{height:x,width:A,left:_.left??0,top:_.top??0}},_e.createElement("div",{className:_d({visible:me})},_e.createElement(mm,{size:16})),j),Te=(0,fg.createPortal)(Te,C.current)),_e.createElement(Pe,{value:ee},_e.createElement(ha,{domRef:B,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...ye,"data-z-index":te,style:ne,width:A,onPointerDown:ut,contentClassName:X(Md(Re),rd[W]),contentStyle:b?{height:x/2}:void 0,className:X(un,cd.none,ae?od.pointer:"",pe,Yi(e,[un,mo],Od,{dragging:E,insideDisabledDraggingPage:M,align:W,verticalAlign:N,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Ed),cssEllipsis:be,afterChildren:_e.createElement(_e.Fragment,null,b?Ie:null,G),renderChildren:le}),Te)}var ug=_e.memo(mR);function Lr(){return(0,So.useContext)(Sa)}var bo=H(require("react")),Rg=require("react");function gg(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var yg="https://infinite-table.com",Sg="Invalid Infinite Table license. See console for details.",bg={padding:he.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem"},gR={...bg,background:"white",color:"black"},hR={...bg,background:"#fee2e2",color:"#991b1b"},Tg={opacity:"1",visibility:"visible",display:"inline-block",pointerEvents:"all",textDecoration:"underline"},yR={...Tg,color:"black"},SR={...Tg,color:"#991b1b"};function Sc(o){return o?{footer:hR,anchor:SR}:{footer:gR,anchor:yR}}var hg=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(gg(t),n,"important")};function Cg(o,e){let t=Sc(e),n=()=>{setTimeout(()=>{let i=o();hg(i,t.footer),hg(i?.querySelector("a")??null,t.anchor)})};n();let r=setInterval(n,1e3);return()=>{clearInterval(r)}}var Ig=bo.forwardRef(function(e,t){let{invalid:n=!1,...r}=e,{rootClassName:i}=Ni(),a=bo.useRef(null),l=bo.useCallback(c=>{a.current=c,t&&(typeof t=="function"?t(c):t.current=c)},[]);(0,Rg.useEffect)(()=>Cg(()=>a.current,n),[n]);let s=Sc(n);return bo.createElement("div",{ref:l,...r,className:X(`${i}-Footer`,n?`${i}-Footer--invalid`:null,yp,r.className),style:s.footer},n?`${Sg} `:null,"Powered by"," ",bo.createElement("a",{href:yg,rel:"noopener noreferrer",role:"link",target:"_blank",style:s.anchor},"Infinite Table"))});var Wa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new q(n.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 xt=class extends Wa{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 Vt(){let o=Fe().performance?.now();return`${Date.now()}:${o}`}function ja(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var wg=new WeakMap;function Ua(o,e){if(!o||!o.length)return[];let t=wg.get(o);t||(t=new WeakMap,wg.set(o,t));let n=t.get(e);if(n)return n;let r=[],i=ja(o,e)||[];for(let a=0,l=i.length;a<l;a++){let s=i[a],c=e[s.filter.type];if(s.disabled||!c)continue;let u;for(let d=0;d<c.operators.length;d++){let p=c.operators[d];p.name===s.filter.operator&&(u=p.fn)}u&&r.push({field:s.field,valueGetter:s.valueGetter||c.valueGetter,fn:u,value:s.filter.value,emptyValues:c.emptyValues})}return t.set(e,r),r}function bc(o,e){if(!o.length)return!0;let{data:t}=e,n={data:t,index:e.index,dataArray:e.dataArray,primaryKey:e.primaryKey,field:void 0,filterValue:void 0,currentValue:void 0,emptyValues:[]};for(let r=0,i=o.length;r<i;r++){let a=o[r];if(n.field=a.field,n.filterValue=a.value,n.currentValue=a.valueGetter?a.valueGetter(n):a.field?t[a.field]:t,n.emptyValues=a.emptyValues,!a.fn(n))return!1}return!0}var bR=0;function Tc(o){return bR++,bc(Ua(o.filterValue,o.filterTypes),o)}function $a(o){return Ua(o.filterValue,o.filterTypes).length?o.isLeafNode?Tc(o):o.filterTreeNode(o.data):!0}var TR="group-by",vg="group-by-";function Pg(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function Ya(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===TR){let i=Pg(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(vg)){let i=r.id.slice(vg.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Pg([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}var Dg=!0,CR={originalDataArray:!0,changes:!0},RR={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function jt(o,e,t){let n=Ya(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[],o.selectionMode==="multi-row"&&(i.multiRowSelectionTarget=o.multiRowSelectionTarget)),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=Cc(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!CR[s]){let c=s,u=RR[c],d=i[c],p=l[c];(u?u(d,p):d===p)||(a[c]=!0)}return i.changes=a,i}function To(o,e,t,n,r){let i=jt(e,n,r),a=i.append;if(e.lazyLoad){let u=e.originalLazyGroupData,d=[vt,...i.groupKeys||[]],p=u.get(d);if(!p){let f=[...i.groupKeys||[],i.lazyLoadStartIndex??0];e.lazyLoadCacheOfLoadedBatches.set(f,!0)}if(p&&p.cache&&d.length>1){let f=p.children,m=f.length,g=!0;for(let h=0;h<m;h++)if(f[h]==null){g=!1;break}if(g)return Promise.resolve(!0)}p?p.childrenLoading||(p.childrenLoading=!0):u.set(d,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Dg,totalCount:0}),t.originalLazyGroupDataChangeDetect=Vt()}if(typeof o=="function")try{o=o(i)}catch(u){o=Promise.reject(u)}let s=typeof o=="object"&&typeof o.then=="function"&&(!e.lazyLoad||!a&&!i.groupKeys?.length);s&&(t.loading=!0);let c=u=>{if(console.error('The DataSource "data" function failed:',u),e.lazyLoad){let d=i.groupKeys||[],p=e.originalLazyGroupData.get([vt,...d]),f=u instanceof Error?u.message:String(u);if(d.length&&p&&!p.childrenAvailable)p.childrenLoading=!1,p.cache=!1,p.error=f,t.originalLazyGroupDataChangeDetect=Vt();else{let m=e.lazyLoadCacheOfLoadedBatches,g=[...d,i.lazyLoadStartIndex??0];m.has(g)&&m.set(g,"failed"),p&&(p.childrenLoading=!1,p.error=f)}}s&&(t.loading=!1)};return Promise.resolve(o).then(u=>{let d=[],p=!1;if(Array.isArray(u.data)){let m=u;if(d=m.data,m.livePaginationCursor!==void 0&&(t.livePaginationCursor=m.livePaginationCursor),m.mappings&&(t.pivotMappings=m.mappings),e.lazyLoad||(t.unfilteredCount=m.totalCountUnfiltered??d.length),e.lazyLoad){let h=function(S,y,T){let b=[vt,...S],R=y.data,C={cache:y.cache??Dg,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??R.length,totalCountUnfiltered:y.totalCountUnfiltered,totalChildrenCount:y.totalChildrenCount,totalChildrenCountUnfiltered:y.totalChildrenCountUnfiltered,children:R,error:y.error},I=[];if(i.lazyLoadBatchSize&&!T){let v=g.get(b),P=!v,E=ep({children:!0},v||{},C);P&&(E.chidren=[]),E.children.length=E.totalCount;let M=i.lazyLoadStartIndex??0,D=Math.min(y.totalCount??R.length,M+i.lazyLoadBatchSize);for(let x=M;x<D;x++){let A=C.children[x-M];if(!A)throw`lazily loaded item not found at index ${x-M}`;E.children[x]=A,A.dataset&&I.push({keys:A.keys,dataset:A.dataset})}P&&g.set(b,E)}else C.children.forEach(v=>{v&&v.dataset&&I.push({keys:v.keys,dataset:v.dataset})}),C.children.length=C.totalCount,g.set(b,C);let w=!1;if(!S||!S.length){let v=g.get([vt]);t.originalDataArray=[...v.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Vt()),I.length){let v=S;I.forEach(({keys:P,dataset:E})=>{h(P,E,v)})}};var f=h;let g=e.originalLazyGroupData;p=!0,h(i.groupKeys||[],m)}}else d=u;p||(t.originalDataArray=a?e.originalDataArray.concat(d):d),s&&(t.loading=!1)}).catch(c)}function Cc(o,{filterTypes:e,filterMode:t}){return t==="local"?!o||!o.some(n=>n.valueGetter)?o:o.map(xg):(ja(o,e)||[]).map(xg)}function xg(o){if(!o.valueGetter)return o;let e={...o};return delete e.valueGetter,e}function Eg(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=Cc(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var IR=()=>new Promise(o=>{He(o)});function Rc(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Mg(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;if(!e||!t||t<=0)return!1;for(let r of n.keys())if(r.length===1)return!0;return!1}function Ag(o){for(let[e,t]of o.entries())t==="failed"&&o.delete(e)}function _g(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new q,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let S=c(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let T=y.length?y:p,b=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let R={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},C=h.groupKeys,I=d.get(C);if(!I?.[h.id]){let w=!I;I=I||{},I[h.id]||(I[h.id]=R),w&&d.set(C,I)}}if(!S&&r!=null){let R=d.get(T),C=Math.floor(b/r)*r,I=b-C,w=s[h.indexInAll-I].indexInAll,v=c(w),P=s[w].id;if(v||R?.[P])continue;let E=!R;R=R||{};let M={lazyLoadStartIndex:C,lazyLoadBatchSize:r,groupKeys:y,append:u};R[P]||(R[P]=M),E&&d.set(T,R)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let S=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(S))return g;e?.set(S,!0);let y=[i.data,i,a,h];return g.then(()=>IR()).then(()=>To(...y))},f)}function Ic(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function ci(o,e){let t=Ic(o,e);return t===-1?null:to({...o,rowIndex:t,columnId:e.columnId})}function ui(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function wc(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function qa(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function vc(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Og(o,e,t){if(vc(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),S=[];for(let y=d;y<=p;y++)for(let T=g;T<=h;T++){let b=y*n+T;if(y===d)for(let R=s;R<r;R++)S.push({rowIndex:b,colIndex:R});else if(y===p)for(let R=0;R<=u;R++)S.push({rowIndex:b,colIndex:R});else for(let R=0;R<r;R++)S.push({rowIndex:b,colIndex:R})}return S}function wR(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Pc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??Vo(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new Ue(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=Vo(l,this.getDataSourceState),h=Vo(c,this.getDataSourceState);if(!g||!h)return;let S=g.indexInAll,y=h.indexInAll,[T,b]=qa({rowIndex:S,colIndex:f},{rowIndex:y,colIndex:m});for(let R=T.rowIndex;R<=b.rowIndex;R++)for(let C=T.colIndex;C<=b.colIndex;C++){let I={rowIndex:R,colIndex:C},[w,v]=this.getCellSelectionPosition(I);n?a.selectCell(w,v):a.deselectCell(w,v)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=la(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.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 c=wR(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};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 n=new Ue(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new Ue(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new Ue:new Ue(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new Ue(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new Ue(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new Ue(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Fg(o){return new Pc(o)}var pr=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)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 At=class extends pr{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}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,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};function Ng(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new At({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new At({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 At(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.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 At(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Yo(o,e,t){return Math.min(Math.max(o,e),t)}function Xa(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Yo(a,r,i)}function vR(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,S=0,y=c-1,T={ArrowDown:()=>{p=Xa(n,p,1)},ArrowUp:()=>{p=Xa(n,p,-1)},ArrowLeft:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p-C>=S?p=p-C:T.ArrowUp();return}return R&&R.isGroupRow?i.collapseGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.collapseRowDetail(R.id):!1},ArrowRight:()=>{let R=s[p];if(d.isHorizontalLayoutBrain){let C=d.rowsPerPage;p+C<=y?p=p+C:T.ArrowDown();return}return R&&R.isGroupRow?i.expandGroupRow(R.groupKeys):R&&i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.expandRowDetail(R.id):!1},Enter:()=>{let R=s[p];return R&&R.isGroupRow?i.toggleGroupRow(R.groupKeys):R&&R.isTreeNode&&R.isParentNode?a.treeApi.toggleNode(R.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(R.id)?i.rowDetailApi.toggleRowDetail(R.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,S)},End:()=>{p=y},Home:()=>{p=S}},b=T[l];return b?(b(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Dc(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[S,y]}=p.getRenderRange(),T=S-g-1,b=y-h-1,R=i().dataArray.length-1,C=r().computedVisibleColumns.length-1,I=0,w=0;f=Yo(f,0,R),m=Yo(m,0,C);let v={ArrowDown:()=>{f=Yo(f+1,I,R)},ArrowUp:()=>{f=Yo(f-1,I,R)},ArrowLeft:()=>{if(m===w)if(f!==I&&(m=C),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f-E>=I?f=f-E:v.ArrowUp()}else v.ArrowUp();else m=Yo(m-1,w,C)},ArrowRight:()=>{if(m===C)if(f!==R&&(m=w),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f+E<=R?f=f+E:v.ArrowDown()}else v.ArrowDown();else m=Yo(m+1,w,C)},Enter:()=>{let E=c[f];return E&&E.isGroupRow?t.toggleGroupRow(E.groupKeys):E&&E.isTreeNode&&E.isParentNode?a.treeApi.toggleNode(E.nodePath):E&&t.rowDetailApi.isRowDetailEnabledForRow(E.id)?t.rowDetailApi.toggleRowDetail(E.id):!1},PageDown:()=>{s?m=Math.min(m+b,C):f=Math.min(f+T,R)},PageUp:()=>{s?m=Math.max(m-b,w):f=Math.max(f-T,I)},End:()=>{s?m=C:f=R},Home:()=>{s?m=w:f=I}},P=v[l];return P?(P(),[f,m]):!1}function PR(o,e){let t=Dc(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var DR={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Lg(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!DR[t]?!1:i!=null&&l==="row"?vR(o,e):a!=null&&l==="cell"?PR(o,e):!1}var xc=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:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Xa(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,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Dc(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function kg(o){return new xc(o)}function zg(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Ec=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();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(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(p=>requestAnimationFrame(p));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=Ic({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...to({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let c=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),u;try{u=await c(l)}catch(p){u=p}let d=u instanceof Error?u:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};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:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...to({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.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={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,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:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{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 c=l.computedEditable(to({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=bt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||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(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=nr({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.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 n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new xt(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(),n=new xt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[vt,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||To(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=Vt())}};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,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&this.setNativeScroll({scrollLeft:c.scrollLeft}),c.scrollTop!==u.scrollTop&&!m&&this.setNativeScroll({scrollTop:c.scrollTop}),!0)};this.context=e,this.rowSelectionApi=yf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=kg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Ng({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Fg({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},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(wc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(wc(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Pf({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(to({...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,n){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,n);return}let l=!!i.pivotColumn,s=i.groupByForColumn,c=l?void 0:i.field,u=s?Array.isArray(s)?s:[s]:[],d=u.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Ao);d.length&&(c=d);let p=i.computedSortType;if(u.length&&p===po){let m=this.getState().initialColumns;p=u.flatMap(h=>{let S=h.field??h.groupField,y=S?r.get(S):null;if(y)return y.computedSortType;let T=S?nn(m,S):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[po]})}u.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:c,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,n)}setSortInfoForColumn(e,t,n){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=>!zg(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:zg(d,l)?(c=!0,t):d),c||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 n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.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 n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Ao),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}setNativeScroll(e){let t=this.getState(),n=t.scrollerDOMRef.current;if(!n)return;let r=t.brain.toNativeScrollPosition({scrollTop:e.scrollTop??0,scrollLeft:e.scrollLeft??0});e.scrollTop!==void 0&&(n.scrollTop=r.scrollTop),e.scrollLeft!==void 0&&(n.scrollLeft=r.scrollLeft)}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){this.setNativeScroll({scrollLeft:Math.max(e,0)})}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){this.setNativeScroll({scrollTop:Math.max(e,0)})}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&this.setNativeScroll({scrollTop:s.scrollTop}),u&&this.setNativeScroll({scrollLeft:s.scrollLeft}),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&this.setNativeScroll({scrollLeft:l.scrollLeft}),!0)}};function Vg(o){return new Ec(o)}var In=require("react");var xR=10;function Gg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${mo} > .${jr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${un}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ht.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=Fe().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+xR}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c&&h.nodeType===1){let S=h,y=Math.max(S.offsetWidth,parseInt(S.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let T=Fe().getComputedStyle(S);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function Hg(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=zt(),[a,l]=(0,In.useState)(0),s=typeof r=="object"?r.key:r,c=Le(s),u=(0,In.useRef)(null);(0,In.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,In.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),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),u.current=s;let g=Gg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let S=o().columnSizing,y={...S},T=!1;h.forEach(b=>{y[b]={width:g[b]},T=T||y[b].width!==S[b]?.width}),T&&(e.columnSizing=y)},[s,n,a])}var Qo=require("react");var Za=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);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 n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}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,n,r){if(r.horizontalLayout&&!vc(e,t,r)){Og(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=qa(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function ER(o,e){return o<e?[o,e]:[e,o]}var Qa=class{constructor(e){this.multiSelectStartIndex=0;this.getRowAt=e.getRowAt,this.isNodeSelectable=e.isNodeSelectable??(()=>!0)}set rowSelectionState(e){this._rowSelectionState=e,this._treeSelectionState=void 0}get rowSelectionState(){return this._rowSelectionState}set treeSelectionState(e){this._treeSelectionState=e}get treeSelectionState(){return this._treeSelectionState}deselectAll(){(this._treeSelectionState??this._rowSelectionState).deselectAll()}isContainerRow(e){return e.isGroupRow||!!e.isParentNode}isExpanded(e){return e.isGroupRow?!e.collapsed:!!e.nodeExpanded}getPath(e){if(e)return this._treeSelectionState?e.nodePath:this.getGroupKeys(e)}getGroupKeys(e){return e.groupKeys&&e.groupKeys.length?e.groupKeys:void 0}setSelectedAt(e,t){let n=this.getRowAt(e);if(!n||n.rowDisabled||n.selfLoaded===!1)return;let r=this._treeSelectionState;if(r){n.nodePath&&this.isNodeSelectable(n)&&r.setNodeSelection(n.nodePath,t);return}let i=this.rowSelectionState,a=this.getGroupKeys(n);if(n.isGroupRow){if(!a)return;t?i.selectGroupRow(a):i.deselectGroupRow(a);return}t?i.selectRow(n.id,a):i.deselectRow(n.id,a)}isSelectedAt(e){let t=this.getRowAt(e);if(!t)return!1;if(this._treeSelectionState)return t.nodePath?this._treeSelectionState.isNodeSelected(t.nodePath):!1;let n=this.getGroupKeys(t);return t.isGroupRow?n?this.rowSelectionState.isGroupRowSelected(n):!1:this.rowSelectionState.isRowSelected(t.id,n)}setRangeSelected(e,t,n){let[r,i]=ER(e,t);for(let a=r;a<=i;a++){let l=this.getRowAt(a);l&&(a!==e&&this.isFollowedByItsChildren(a,l)||this.setSelectedAt(a,n))}}isFollowedByItsChildren(e,t){if(!this.isContainerRow(t)||!this.isExpanded(t))return!1;let n=this.getPath(t),r=this.getPath(this.getRowAt(e+1));return!n||!r||r.length<n.length?!1:n.every((i,a)=>i===r[a])}resetClick(e){this.deselectAll(),this.setSelectedAt(e,!0),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){if(this.isSelectedAt(e))this.setSelectedAt(e,!1),this.isSelectedAt(e+1)&&(this.multiSelectStartIndex=e+1);else{this.setSelectedAt(e,!0),this.multiSelectStartIndex=e;let t;for(let n=e-1;n>=0&&this.isSelectedAt(n);n--)t=n;this.multiSelectEndIndex=t}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.setRangeSelected(this.multiSelectStartIndex,this.multiSelectEndIndex,!1),this.setRangeSelected(this.multiSelectStartIndex,e,!0),this.multiSelectEndIndex=e}};var Ah=require("react");var Mh=H(require("react"));var MR=()=>{};function Kg(o,e){let t=new q,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Bg(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=yt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let S=m[g];Bg(o,e,d,S)}});p?(c?.(n),s?.(n,MR)):(l?.(n,f,i(n)),s?.(n,f))}function Wg(o,e,t){for(let n=0,r=t.length;n<r;n++)Bg(o,e,[],t[n])}var AR=function(o,e){return o-e},_R=new Set(["ca","de","de-AT","en","en-DE","en-GB","en-US","fi","fr","id","id-ID","it","ms","nl","pl","pt","ro","sl","sv","sw","vi"]),Ja;function OR(){try{let o=new Intl.Collator;return _R.has(o.resolvedOptions().locale)?null:o}catch{return null}}var FR=function(o,e){return o=`${o}`,e=`${e}`,Ja===void 0&&(Ja=OR()),Ja?Ja.compare(o,e):o.localeCompare(e)},NR=function(o,e){return o-e},LR={number:AR,string:FR,date:NR},qo=LR;function jg(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var ro=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Ug(jg(o),n)),r&&r.end(),e},el=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Ug(jg(o),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return Wg({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};ro.knownTypes=qo;var kR=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=ro.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(ro.knownTypes).join(", ")}`)}return r||(r=qo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},zR=o=>o.map(kR).filter(e=>e instanceof Function),Ug=(o,e)=>{let t=zR(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var VR=H(require("react"));function tl(o){return Ne(e=>o(e.dataSourceState))}var GR=Ye("IT:InfiniteTable"),HR="#dc3545",KR="#eb9316";var Yg="Warn",qg="Error",BR="Info",WR="Success",jR="Logs",ol=GR.extend(jR),Jz=ol.extend(BR),UR=ol.extend(Yg),$R=ol.extend(qg),eV=ol.extend(WR);var YR=KR,qR=HR;var XR=(o,e)=>{e=e?e.extend?e.extend(Yg):e:UR,e(typeof e.color=="function"?e.color(YR,o):o)},ZR=(o,e)=>{e=e?e.extend?e.extend(qg):e:$R,e(typeof e.color=="function"?e.color(qR,o):o)};var $g=new q,Xg=(o,...e)=>{$g.has(e)||($g.set(e,!0),o())};var Zg=(o,e=o,t)=>{Xg(()=>XR(o,t),e,"warn")},Qg=(o,e=o,t)=>{Xg(()=>ZR(o,t),e,"error")};var Mc=new WeakMap,QR=o=>o;function Jg(o,e=50,t){Mc.set(o,{lastCallTime:0,lastCallArg:null});let n=t??QR;return r=>{let{lastCallTime:i,lastCallArg:a}=Mc.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=wt(n(a),n(r));s<e&&c||(Mc.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var nl=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 n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[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,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};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:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[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)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),S=s?[...p,h]:void 0,y=s&&!!S,T=y?n?.getMutationsForNodePath(S):n?.getMutationsForPrimaryKey(h);if(T&&T.length){for(let b=0,R=T.length;b<R;b++){let C=T[b];if(C.type==="delete"&&!g&&(y?this.removeNodePath(S,t):this.remove(h),g=!0,d.splice(f,1),f--),C.type==="update"&&!g&&(m={...m,...C.data},d[f]=m),C.type==="update-children"&&!g){let I=C.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[f]=m}C.type==="insert"&&(C.position==="before"?(d.splice(f,0,C.data),f--):d.splice(f+1,0,C.data))}y?n?.removeNodePathInfo(S):n?.removeInfo(h)}if(!g)if(y){this.addNodePath(S,m);let b=a(m),R=b?null:i(m);!b&&Array.isArray(R)&&(p.push(h),c&&(m[l]=R=R.concat()),u(R,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};var JR=Object.freeze([]),eh=(o,e)=>{let t=o??JR,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var Et=class extends pr{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}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,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};function rl(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!rl(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!rl(o[r],e[r]))return!1;return!0}return!1}function eI(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var il={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},th={...il,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},tI={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},oI={...il,...tI,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},oh={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},nI={...il,...oh,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},rI={...il,...oh,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},iI=Object.entries(th).map(([o,e])=>e?o:void 0).filter(Boolean),aI=Object.entries(th).map(([o,e])=>e?o:void 0),lI=Object.entries(oI).map(([o,e])=>e?o:void 0),sI=Object.entries(nI).map(([o,e])=>e?o:void 0),cI=Object.entries(rI).map(([o,e])=>e?o:void 0);function uI(o,e){if(o===e)return!0;if(!o||!e||!eI(o,e)||o.id!==e.id||o.data!==e.data&&!rl(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?lI:aI:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?cI:sI:t=iI;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!rl(r,i))return!1}return!0}function nh(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,S=p!==m&&t.size>0;S&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let y=[],T=l();for(let b of T){let R=m[b],C=p[b];if(C===void 0){y.push(b);continue}uI(R,C)||y.push(b)}o=p,(y.length>0||S)&&queueMicrotask(()=>{for(let b=0,R=y.length;b<R;b++){let C=y[b],I=e.get(C);if(I)for(let w of I)w()}if(S)for(let b of Array.from(t))b()}),g&&g.end({details:[{name:"updated row infos",value:y.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Co=new Map,Ro=new Map,Xo=new Map,Io=new Map,io=new Map;var dI=Symbol("cursorId"),rh=o=>o.totalLeafNodesCount===0,pI=o=>o.isParentNode?!rh(o):!0;function ih(o){let e=Date.now(),t=[],n=[],r=new q;return{logger:Lt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:nh(),indexer:new nl,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:Ce(),notifyScrollbarsChange:Ce(),notifyScrollStop:Ce(),notifyRenderRangeChange:Ce(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:dI,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap],["isRowDisabled",new WeakMap],["cellSelection",new WeakMap],["treeSelection",new WeakMap],["treeExpandState",new WeakMap],["groupRowsState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.length,updatedAt: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 fI(o){let e={...o};return delete e.originalDataArray,e}var mI=[],ah=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear(),o.rowInfoStore.clear()},lh=(o,e)=>({onDataParamsChange:t=>t?Jg(t,100,fI):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??rh,isNodeSelectable:t=>t??pI,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,multiRowSelectionTarget:t=>t??"all",filterDelay:t=>t??200,filterTypes:t=>({...No,...t}),sortTypes:t=>({...qo,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.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 Et)return t;let n=o.propsCache.get("rowDisabledState"),r=n.get(t);return r||(r=new Et(t),n.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=>eh(t,o.propsCache.get("sortInfo")),groupBy:t=>t??mI});function gI(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}function hI(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var yI={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function sh(o,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.
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
`);let n=Jn(t);if(o instanceof Qe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??Qw,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(n),a=a??new Qe(r,n),i.set(r,a),a}function jg(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=Ar(e.sortInfo),a=Ar(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((x,P)=>{let A=l[P].operators;x[P]=x[P]||{};let _=x[P];return A.forEach(F=>{_[F.name]=F}),x},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let x=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(x!==void 0&&(x&&typeof x=="object"?u="multi-row":u="single-row"),!u){let P=c.treeSelection??c.defaultTreeSelection;P!==void 0&&(u=typeof P=="object"?"multi-row":"single-row")}u=u??!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&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new _e({selectedRows:[],deselectedRows:[],defaultSelection:!1},dt(t)):u==="single-row"||f instanceof _e?d=f:d=new _e(f,dt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let x=t.propsCache.get("cellSelection"),P=x.get(m)??new Ue(m);x.set(m,P),p=P}let g=t.primaryKey,h=typeof g=="function"?x=>g(x):x=>x[g],y=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(y&&!(y instanceof ut)){let x=t.propsCache.get("treeExpandState"),P=x.get(y)??new ut(y);x.set(y,P),y=P}y=y||new ut({defaultExpanded:!0,collapsedPaths:[]});let S=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(S&&!(S instanceof Dt)){let x=t.propsCache.get("groupRowsState"),P=x.get(S)??new Dt(S);x.set(S,P),S=P}S=S||new Dt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=Zw(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,C=!!e.livePagination,w={sortInfo:T.sortInfo??(b||C),filterValue:T.filterValue??(b||C),groupBy:T.groupBy??b,pivotBy:T.pivotBy??b},R=e.sortFunction?"local":w.sortInfo?"remote":"local",D=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":w.filterValue||e.lazyLoad?"remote":"local",I=t.rowDisabledState,M=e.isRowDisabled;if(!M&&I){let x=t.propsCache.get("isRowDisabled"),P=x.get(I);P?M=P:(M=A=>I.isRowDisabled(A.id),x.set(I,M))}let E={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:S,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:w,isRowDisabled:M,rowSelection:d,cellSelection:p,sortMode:R,filterMode:D,toPrimaryKey:h,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 x=!n||n.originalDataArray!==t.originalDataArray,P=typeof e.livePaginationCursor=="function"?x?Xw(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;E.livePaginationCursor=P}if(t.devToolsDetected&&t.debugId){let x=Co.get(t.debugId);x&&(E={...E,...x})}return E}var Jw=Nt("DataSource:fullLazyLoad");function Ug(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&Jw('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new Dt({collapsedRows:!0,expandedRows:[]})))}function $g(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof Ue?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Yg(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>Tt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Nt(Uo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function qg(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function vc(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Pc(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Dc(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Xg({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=mt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Pc({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let y=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let b=T;T=m.join("/");let C=m[m.length-1];c[T]=Dc({header:`${C}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((b,C)=>{let w=d?`${m[m.length-1]}`:b.name||b.id,R=Pc({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,columnGroup:T,header:w,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),v=`${b.id}:${m.join("/")}`;s[v]=R})}else{let y=m.join("/"),S=m.slice(0,-1);if(c[y]=Dc({columnGroup:S.length?S.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=S.length?S.join("/"):void 0;if(!d){let C=b;b=`total:${m.join("/")}`,c[b]=Dc({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((C,w)=>{let R=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=Pc({columnGroup:b,header:R,pivotAggregator:C,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Zg=Symbol("CLEAR"),Rn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new Z;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,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:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,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:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Zg,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Zg);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=()=>Z.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 n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:Z.clone(e.nodePathToData),n}};var xc=1e3;function Qg(o){return new Ec(o)}var Ec=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=()=>ia(this.getState);this.getRowInfoByIndex=e=>Vo(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(),n=t.getDataForNodePath(e);return n||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 n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?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,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?xc:r;return isNaN(a)||(a=xc),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,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.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 n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,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 n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};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 n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&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 c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,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=n?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,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});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.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new xt(n):new xt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new xt({enabledRows:!0,disabledRows:[]});return}let t=new xt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new xt({disabledRows:!0,enabledRows:[]});return}let t=new xt(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 aa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});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:n,nodesKey:r}=this.getState(),i=t?Rn.clone(t,{light:!0}):new Rn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??xc,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.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 Jg(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,y)=>h||typeof y!="function"?l.has(y):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){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 g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function ol(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function nl(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function rl(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function eh(o){return"groupNesting"in o?o.groupNesting??0:0}function th(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function eR(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||qo.string)(o,e);return a===0?0:t.dir*a}function tR(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function oR(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=eh(n);for(;t.length&&eh(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function nR(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function oh(o,e,t,n){let r=tR(e,t);if(!r.length||!o.length)return o;let i={...qo,...n},a=oR(o),l=(c,u)=>{for(let d of r){let p=eR(th(c.row,d),th(u.row,d),d,i);if(p!==0)return p}return 0},s=c=>{c.sort(l);for(let u of c)s(u.children)};return s(a),nR(a)}var io=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function rR(o){let e=o.get([Rt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let n=0;n<e.children.length;n++){let r=e.children[n]?.totalChildrenCount;if(r==null)return;t+=r}return t}function iR(o,e){let t=o.get([Rt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function Mc(){return!1}function aR(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Mc,hasSelectedCells:Mc};return n&&(a.rowSelected=n(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 lR=mt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
4
|
+
`);let n=er(t);if(o instanceof Je)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??yI,i=t.propsCache.get("treeSelection"),a=i.get(r);return a&&a.setConfig(n),a=a??new Je(r,n),i.set(r,a),a}function ch(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=_r(e.sortInfo),a=_r(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,x)=>{let A=l[x].operators;D[x]=D[x]||{};let O=D[x];return A.forEach(F=>{O[F.name]=F}),D},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="object"?u="multi-row":u="single-row"),!u){let x=c.treeSelection??c.defaultTreeSelection;x!==void 0&&(u=typeof x=="object"?"multi-row":"single-row")}u=u??!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&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},mt(t)):u==="single-row"||f instanceof Oe?d=f:d=new Oe(f,mt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new Ue;else if(m instanceof Ue)p=m;else{let D=t.propsCache.get("cellSelection"),x=D.get(m)??new Ue(m);D.set(m,x),p=x}let g=t.primaryKey,h=typeof g=="function"?D=>g(D):D=>D[g],S=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(S&&!(S instanceof ft)){let D=t.propsCache.get("treeExpandState"),x=D.get(S)??new ft(S);D.set(S,x),S=x}S=S||new ft({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof xt)){let D=t.propsCache.get("groupRowsState"),x=D.get(y)??new xt(y);D.set(y,x),y=x}y=y||new xt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let T=hI(e.shouldReloadData||{}),b=typeof e.data=="function"&&!!e.lazyLoad,R=!!e.livePagination,C={sortInfo:T.sortInfo??(b||R),filterValue:T.filterValue??(b||R),groupBy:T.groupBy??b,pivotBy:T.pivotBy??b},I=e.sortFunction?"local":C.sortInfo?"remote":"local",v=(typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function")&&!e.lazyLoad?"local":C.filterValue||e.lazyLoad?"remote":"local",P=t.rowDisabledState,E=e.isRowDisabled;if(!E&&P){let D=t.propsCache.get("isRowDisabled"),x=D.get(P);x?E=x:(E=A=>P.isRowDisabled(A.id),D.set(P,E))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:S,treeExpandMode:S.mode,shouldReloadData:C,isRowDisabled:E,rowSelection:d,cellSelection:p,sortMode:I,filterMode:v,toPrimaryKey:h,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 D=!n||n.originalDataArray!==t.originalDataArray,x=typeof e.livePaginationCursor=="function"?D?gI(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=x}if(t.devToolsDetected&&t.debugId){let D=Ro.get(t.debugId);D&&(M={...M,...D})}return M}var SI=Lt("DataSource:fullLazyLoad");function uh(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&SI('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new xt({collapsedRows:!0,expandedRows:[]})))}function dh(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof Ue?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function ph(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=jt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>wt(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Lt(Uo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function fh(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}function Ac(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function _c(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Oc(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function mh({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=yt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=_c({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let S=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let b=T;T=m.join("/");let R=m[m.length-1];c[T]=Oc({header:`${R}`,columnGroup:b,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:S,pivotIndex:m.length-1,pivotGroupKey:R})}l.forEach((b,R)=>{let C=d?`${m[m.length-1]}`:b.name||b.id,I=_c({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:b,pivotAggregatorIndex:R,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:S,columnGroup:T,header:C,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[b.id]:null}),w=`${b.id}:${m.join("/")}`;s[w]=I})}else{let S=m.join("/"),y=m.slice(0,-1);if(c[S]=Oc({columnGroup:y.length?y.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=y.length?y.join("/"):void 0;if(!d){let R=b;b=`total:${m.join("/")}`,c[b]=Oc({header:`${m[m.length-1]} total`,columnGroup:R,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((R,C)=>{let I=d?`${m[m.length-1]} total `:`${R.name||R.id} total`,w=_c({columnGroup:b,header:I,pivotAggregator:R,pivotAggregatorIndex:C,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:v})=>v.isGroupRow?v.pivotValuesMap?.get(m)?.reducerResults[R.id]:null});s[`total:${R.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var gh=Symbol("CLEAR"),wn=class o{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,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,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:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,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:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=gh,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(gh);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 n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:q.clone(e.nodePathToData),n}};var Fc=1e3;function hh(o){return new Nc(o)}var Nc=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=()=>la(this.getState);this.getRowInfoByIndex=e=>Vo(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(),n=t.getDataForNodePath(e);return n||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 n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?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,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Fc:r;return isNaN(a)||(a=Fc),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,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.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 n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,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 n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};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 n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&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 c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,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=n?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,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});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.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new Et(n):new Et({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Et({enabledRows:!0,disabledRows:[]});return}let t=new Et(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Et({disabledRows:!0,enabledRows:[]});return}let t=new Et(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 sa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});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:n,nodesKey:r}=this.getState(),i=t?wn.clone(t,{light:!0}):new wn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Fc,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.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 yh(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,S)=>h||typeof S!="function"?l.has(S):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){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 g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function al(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ll(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function sl(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function Sh(o){return"groupNesting"in o?o.groupNesting??0:0}function bh(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function bI(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||qo.string)(o,e);return a===0?0:t.dir*a}function TI(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function CI(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=Sh(n);for(;t.length&&Sh(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function RI(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function Th(o,e,t,n){let r=TI(e,t);if(!r.length||!o.length)return o;let i={...qo,...n},a=CI(o),l=(c,u)=>{for(let d of r){let p=bI(bh(c.row,d),bh(u.row,d),d,i);if(p!==0)return p}return 0},s=c=>{c.sort(l);for(let u of c)s(u.children)};return s(a),RI(a)}var ao=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function II(o){let e=o.get([vt]);if(!e)return;if(e.totalChildrenCount!=null)return e.totalChildrenCount;let t=0;for(let n=0;n<e.children.length;n++){let r=e.children[n]?.totalChildrenCount;if(r==null)return;t+=r}return t}function wI(o,e){let t=o.get([vt]);if(t)return e?t.totalChildrenCountUnfiltered:t.totalCountUnfiltered}function Lc(){return!1}function vI(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Lc,hasSelectedCells:Lc};return n&&(a.rowSelected=n(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 PI=yt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
5
5
|
|
|
6
6
|
Your filtering function probably looks like this:
|
|
7
7
|
|
|
@@ -13,18 +13,18 @@ function treeFilterFunction({ data }) {
|
|
|
13
13
|
|
|
14
14
|
Make sure you avoid mutations.
|
|
15
15
|
|
|
16
|
-
`)});function nh(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=o,c=[],u=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(u(p))return p;let f=nh({...o,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:n(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:u(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&lR(),c.push(h))}return c}var sR=[];function Ac(o){let{filterTypes:e,marker:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,c=o.filterValue||sR,{dataArray:u}=o;t?.start({details:[{name:"Count before",value:u.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=n;u=nh({dataArray:u,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):Ba),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:c,filterTypes:e})}else if(n)u=u.filter((f,m,g)=>n({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:c,filterTypes:e}));else{let f=Ka(c,e);f.length&&(u=u.filter((m,g,h)=>fc(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function rh(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=at(r).track.DataSource.label.PrepareData.start());let a=Jg(t),l=Wa(t.sortInfo,t.groupBy),s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=io(n,t,["refetchKey"]),d=io(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new Z,d=!0);let f=t.cache?Rn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,y=g?L=>L[g]:void 0,S=g?L=>L[g]===void 0:void 0,T,b;d&&(t.indexer.clear(),t.lazyLoad||(T=f?.getMutations(),b=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:y,isLeafNode:S,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:L},N)=>{L&&t.indexer.getDataForNodePath(N)!==void 0&&L.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:w,treeFilterFunction:R,filterValue:v,filterTypes:D}=t,I=!!w||!!R||Array.isArray(v)&&v.length,M=t.filterMode==="local"&&!t.lazyLoad,E=I&&M,x=io(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=d||x,A=io(n,t,["sortInfo"]),_=d||x||A,F=M&&(P||!t.lastFilterDataArray),k=c&&(_||!t.lastSortDataArray||a.sortInfo),O=t.groupBy,H=t.pivotBy,W=!h&&(O.length>0||!!H),z=h,ee=io(n,t,["rowDisabledState","isRowDisabled"]),V=io(n,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),$=io(n,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ie=d||_||io(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),fe=d||_||io(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),se=io(n,t,["rowInfoReducers"]),le=W&&(ie||!t.lastGroupDataArray||a.groupBy)||V||ee||se,pe=z&&(fe||a.tree||!t.lastTreeDataArray)||$||ee||se,ce=Date.now(),Y=t.originalDataArray;if(z&&pe){let L={marker:r?at(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:S,getNodeChildren:y,toKey:m};t.unfilteredTreePaths=zs(L,Y).treePaths}if(I||(t.unfilteredCount=Y.length),E){t.unfilteredCount=Y.length;let L=ce;F?(t.devToolsDetected&&(L=Date.now()),Y=Ac({marker:r?at(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:y,isLeafNode:S,nodesKey:g,treeFilterFunction:R,dataArray:Y,toPrimaryKey:m,filterTypes:D,filterFunction:w,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-L)):Y=t.lastFilterDataArray,t.lastFilterDataArray=Y,t.filteredAt=ce}if(t.filteredCount=(t.lazyLoad&&O.length?rR(t.originalLazyGroupData):void 0)??Y.length,t.lazyLoad&&(t.unfilteredCount=iR(t.originalLazyGroupData,O.length>0)??t.filteredCount),t.postFilterDataArray=Y,c){let L=no.knownTypes;if(no.knownTypes={...L,...t.sortTypes},k){let N=ce;if(t.devToolsDetected&&(N=Date.now()),r&&(e=at(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:Y.length}]})),t.sortFunction?(Y=t.sortFunction(l,[...Y]),e&&(e.end(),e=void 0)):h?Y=Xa(l,Y,{marker:e,inplace:!1,isLeafNode:S,getNodeChildren:y,toKey:m,nodesKey:g}):Y=no(l,[...Y],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let me=Date.now()-N;t.debugTimings.set("sort",me)}}else Y=t.lastSortDataArray;no.knownTypes=L,t.lastSortDataArray=Y,t.sortedAt=ce}t.postSortDataArray=Y;let q=t.dataArray,j=t.rowSelection instanceof _e?t.rowSelection:void 0,X=t.treeExpandState instanceof ut?t.treeExpandState:void 0,U=t.cellSelection instanceof Ue?t.cellSelection:void 0;j&&(j.getConfig=dt(t)),j?.xcache();let Q=t.selectionMode==="single-row"?L=>L.id===t.rowSelection:t.selectionMode==="multi-row"?L=>{let N=j;return L.isGroupRow?N.getGroupRowSelectionState(L.groupKeys):N.isRowSelected(L.id,L.dataSourceHasGrouping?L.groupKeys:void 0)}:void 0,ae=t.isRowDisabled||Mc;t.isRowSelected&&t.selectionMode==="multi-row"&&(Q=L=>t.isRowSelected(L,j,t.selectionMode));let he;t.isNodeExpanded&&(he=L=>t.isNodeExpanded(L,X)),t.isNodeCollapsed&&(he=L=>!t.isNodeExpanded(L,X)),he||(he=N=>X.isNodeExpanded(N.nodePath));let ue=t.rowInfoReducers;if(W){if(le){let L=ce;t.devToolsDetected&&(L=Date.now());let N=t.aggregationReducers,me=t.lazyLoad?tf({groupBy:O,pivot:H,mappings:t.pivotMappings,reducers:N,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?at(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):ua({groupBy:O,pivot:H,reducers:N,marker:r?at(r).track.DataSource.label.Group.start():void 0},Y);t.groupDeepMap=me.deepMap,j&&(j.getConfig=dt(t));let Ae=Object.keys(ue||{}),ve=ol(ue),be={reducers:ue,results:ve,reducerKeys:Ae,rowInfo:{}},Oe=ve?qe=>{be.rowInfo=qe,nl(be)}:void 0,Ke=U?qe=>{qe.isCellSelected=K=>U.isCellSelected(qe.id,K)}:void 0,nt=Oe||Ke?vc(Oe,Ke):void 0,Je=lf({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:me,lazyLoad:!!t.lazyLoad,reducers:N,toPrimaryKey:m,isRowSelected:Q,rowSelectionState:j,withRowInfo:nt,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});q=Je.data,t.rowInfoReducerResults=rl({reducers:ue,results:ve,array:q}),t.groupRowsIndexesInDataArray=Je.groupRowsIndexes,t.reducerResults=me.reducerResults;let it=H?Xg({deepMap:me.topLevelPivotColumns,pivotBy:H,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=it?.columns,t.pivotColumnGroups=it?.columnGroups;let et=oh(q,l,t.pivotColumns,t.sortTypes);et!==q&&(q=et,t.groupRowsIndexesInDataArray=q.map((qe,K)=>qe.isGroupRow?K:-1).filter(qe=>qe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-L)}else q=t.lastGroupDataArray;t.lastGroupDataArray=q,t.groupedAt=ce}else if(z){if(pe){let L=ce;t.devToolsDetected&&(L=Date.now());let N=t.aggregationReducers,me={marker:r?at(r).track.DataSource.label.Tree.start():void 0,isLeafNode:S,getNodeChildren:y,toKey:m,reducers:N},Ae=zs(me,Y);t.treeDeepMap=Ae.deepMap,t.treePaths=Ae.treePaths;let ve=t.selectionMode==="multi-row"?Wg(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=ve;let be=Object.keys(ue||{}),Oe=ol(ue),Ke={reducers:ue,results:Oe,reducerKeys:be,rowInfo:{}},nt=Oe?ne=>{Ke.rowInfo=ne,nl(Ke)}:void 0,Je=U?ne=>{ne.isCellSelected=ye=>U.isCellSelected(ne.id,ye)}:void 0,it=nt||Je?vc(nt,Je):void 0,et=t.selectionMode==="single-row"?ne=>ne.id===t.treeSelection:t.selectionMode==="multi-row"?ne=>ve.isNodeSelected(ne.nodePath):void 0,qe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;q=af({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Ae,treeParams:me,dataArray:Y,reducers:N,toPrimaryKey:m,isNodeSelected:et,isNodeExpanded:he,treeSelectionState:ve,withRowInfo:it,repeatWrappedGroupRows:qe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=rl({reducers:ue,results:Oe,array:q}),t.reducerResults=Ae.reducerResults,t.totalLeafNodesCount=Ae.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-L)}else q=t.lastTreeDataArray;t.lastTreeDataArray=q}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ie||V||ee||se){let N=Object.keys(ue||{}),me=ol(ue),Ae={reducers:ue,results:me,reducerKeys:N,rowInfo:{}};q=Y.map((ve,be)=>{let Oe=aR(ve,ve?m(ve):be,be,Q,ae,U);return me&&(Ae.rowInfo=Oe,nl(Ae)),Oe}),t.rowInfoReducerResults=rl({reducers:ue,results:me,array:q})}if(t.postGroupDataArray=q,q!==t.dataArray&&(t.updatedAt=ce),t.dataArray=q,t.reducedAt=ce,t.selectionMode==="multi-row"){let L=t.rowSelection instanceof _e&&!t.rowSelection.onlyUsePrimaryKeys;if(W&&t.lazyLoad&&!L){r&&(e=at(r).track.DataSource.label.ComputeSelectionCountLazy.start());let N=!0,me=!1;t.dataArray.forEach(ve=>{if(!ve.isTreeNode&&ve.isGroupRow&&ve.groupKeys.length===1){let{rowSelected:be}=ve;be!==!0&&(N=!1),(be===!0||be===null)&&(me=!0)}});let{rowSelection:Ae}=t;Ae instanceof _e&&Ae.getLazyHiddenRowsCount([])&&(Ae.defaultSelection?me=!0:N=!1),t.allRowsSelected=N,t.someRowsSelected=me,r&&(e?.end(),e=void 0)}else{r&&(e=at(r).track.DataSource.label.ComputeSelectionCount.start());let N=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);N?(t.allRowsSelected=N.deselectedCount===0,t.someRowsSelected=N.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ce,mutations:T?.size?T:void 0,treeMutations:b?.size?b:void 0}),t.rowInfoStore.notifyDataArray(q,{marker:r?at(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:n}),i&&i?.track.DataSource.label.PrepareData.end({details:[F||k||le||pe?{name:"Performed operations",value:[F?"filter":null,k?"sort":null,le?"group":null,pe?"tree":null].filter(Ao).join(", ")}:null,u?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Ao)}),t}var pt=B(require("react"));function ih(){return Eo()}var tt=require("react");var Vt=require("react");function In(o,e){let t=(0,Vt.useRef)({}),n=(0,Vt.useRef)({}),r=n.current,i=(0,Vt.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,Vt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function cR(o,e){let t=(0,Vt.useRef)({}),n=(0,Vt.useRef)({}),r=n.current,i=(0,Vt.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,Vt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function uR(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,Vt.useEffect)(o,t)}function dR(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
16
|
+
`)});function Ch(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a,filterValue:l,filterTypes:s}=o,c=[],u=p=>i(p)||!Array.isArray(r(p)),d=p=>{if(u(p))return p;let f=Ch({...o,dataArray:r(p)});return f.length===0?!1:(p={...p,[a]:f},p)};for(let p=0,f=e.length;p<f;p++){let m=e[p],g=r(m),h=t({data:m,index:p,dataArray:e,primaryKey:n(m,p),filterValue:l,filterTypes:s,filterTreeNode:d,isLeafNode:u(m)});h&&(h===!0?h=m:typeof h=="object"&&h===m&&g!==r(h)&&PI(),c.push(h))}return c}var DI=[];function kc(o){let{filterTypes:e,marker:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,c=o.filterValue||DI,{dataArray:u}=o;t?.start({details:[{name:"Count before",value:u.length}]});let d=!!l&&!!a&&!!s,p=0;if(d){let f=n;u=Ch({dataArray:u,treeFilterFunction:i||(f?g=>g.isLeafNode?f(g):g.filterTreeNode(g.data):$a),toPrimaryKey:r,getNodeChildren:a,nodesKey:l,isLeafNode:s,filterValue:c,filterTypes:e})}else if(n)u=u.filter((f,m,g)=>n({data:f,index:m,dataArray:g,primaryKey:r(f,m),filterValue:c,filterTypes:e}));else{let f=Ua(c,e);f.length&&(u=u.filter((m,g,h)=>bc(f,{data:m,index:g,dataArray:h,primaryKey:r(m,g)})))}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Rh(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=st(r).track.DataSource.label.PrepareData.start());let a=yh(t),l=Ya(t.sortInfo,t.groupBy),s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=ao(n,t,["refetchKey"]),d=ao(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new q,d=!0);let f=t.cache?wn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,S=g?k=>k[g]:void 0,y=g?k=>k[g]===void 0:void 0,T,b;d&&(t.indexer.clear(),t.lazyLoad||(T=f?.getMutations(),b=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:S,isLeafNode:y,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:k},_)=>{k&&t.indexer.getDataForNodePath(_)!==void 0&&k.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:C,treeFilterFunction:I,filterValue:w,filterTypes:v}=t,P=!!C||!!I||Array.isArray(w)&&w.length,E=t.filterMode==="local"&&!t.lazyLoad,M=P&&E,D=ao(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),x=d||D,A=ao(n,t,["sortInfo"]),O=d||D||A,F=E&&(x||!t.lastFilterDataArray),z=c&&(O||!t.lastSortDataArray||a.sortInfo),L=t.groupBy,B=t.pivotBy,Y=!h&&(L.length>0||!!B),V=h,W=ao(n,t,["rowDisabledState","isRowDisabled"]),N=ao(n,t,["rowSelection","cellSelection","isRowSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),K=ao(n,t,["treeSelection","cellSelection","isNodeSelected","multiRowSelectionTarget","originalLazyGroupDataChangeDetect"]),ae=d||O||ao(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),re=d||O||ao(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),ue=ao(n,t,["rowInfoReducers"]),fe=Y&&(ae||!t.lastGroupDataArray||a.groupBy)||N||W||ue,be=V&&(re||a.tree||!t.lastTreeDataArray)||K||W||ue,de=Date.now(),U=t.originalDataArray;if(V&&be){let k={marker:r?st(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m};t.unfilteredTreePaths=Bs(k,U).treePaths}if(P||(t.unfilteredCount=U.length),M){t.unfilteredCount=U.length;let k=de;F?(t.devToolsDetected&&(k=Date.now()),U=kc({marker:r?st(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:S,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:U,toPrimaryKey:m,filterTypes:v,filterFunction:C,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-k)):U=t.lastFilterDataArray,t.lastFilterDataArray=U,t.filteredAt=de}if(t.filteredCount=(t.lazyLoad&&L.length?II(t.originalLazyGroupData):void 0)??U.length,t.lazyLoad&&(t.unfilteredCount=wI(t.originalLazyGroupData,L.length>0)??t.filteredCount),t.postFilterDataArray=U,c){let k=ro.knownTypes;if(ro.knownTypes={...k,...t.sortTypes},z){let _=de;if(t.devToolsDetected&&(_=Date.now()),r&&(e=st(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:U.length}]})),t.sortFunction?(U=t.sortFunction(l,[...U]),e&&(e.end(),e=void 0)):h?U=el(l,U,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:S,toKey:m,nodesKey:g}):U=ro(l,[...U],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let me=Date.now()-_;t.debugTimings.set("sort",me)}}else U=t.lastSortDataArray;ro.knownTypes=k,t.lastSortDataArray=U,t.sortedAt=de}t.postSortDataArray=U;let ie=t.dataArray,ge=t.rowSelection instanceof Oe?t.rowSelection:void 0,Z=t.treeExpandState instanceof ft?t.treeExpandState:void 0,ee=t.cellSelection instanceof Ue?t.cellSelection:void 0;ge&&(ge.getConfig=mt(t)),ge?.xcache();let j=t.selectionMode==="single-row"?k=>k.id===t.rowSelection:t.selectionMode==="multi-row"?k=>{let _=ge;return k.isGroupRow?_.getGroupRowSelectionState(k.groupKeys):_.isRowSelected(k.id,k.dataSourceHasGrouping?k.groupKeys:void 0)}:void 0,se=t.isRowDisabled||Lc;t.isRowSelected&&t.selectionMode==="multi-row"&&(j=k=>t.isRowSelected(k,ge,t.selectionMode));let ne;t.isNodeExpanded&&(ne=k=>t.isNodeExpanded(k,Z)),t.isNodeCollapsed&&(ne=k=>!t.isNodeExpanded(k,Z)),ne||(ne=_=>Z.isNodeExpanded(_.nodePath));let pe=t.rowInfoReducers;if(Y){if(fe){let k=de;t.devToolsDetected&&(k=Date.now());let _=t.aggregationReducers,me=t.lazyLoad?uf({groupBy:L,pivot:B,mappings:t.pivotMappings,reducers:_,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?st(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):pa({groupBy:L,pivot:B,reducers:_,marker:r?st(r).track.DataSource.label.Group.start():void 0},U);t.groupDeepMap=me.deepMap,ge&&(ge.getConfig=mt(t));let Te=Object.keys(pe||{}),Pe=al(pe),Re={reducers:pe,results:Pe,reducerKeys:Te,rowInfo:{}},Me=Pe?Xe=>{Re.rowInfo=Xe,ll(Re)}:void 0,qe=ee?Xe=>{Xe.isCellSelected=G=>ee.isCellSelected(Xe.id,G)}:void 0,We=Me||qe?Ac(Me,qe):void 0,it=gf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:me,lazyLoad:!!t.lazyLoad,reducers:_,toPrimaryKey:m,isRowSelected:j,rowSelectionState:ge,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});ie=it.data,t.rowInfoReducerResults=sl({reducers:pe,results:Pe,array:ie}),t.groupRowsIndexesInDataArray=it.groupRowsIndexes,t.reducerResults=me.reducerResults;let at=B?mh({deepMap:me.topLevelPivotColumns,pivotBy:B,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=at?.columns,t.pivotColumnGroups=at?.columnGroups;let et=Th(ie,l,t.pivotColumns,t.sortTypes);et!==ie&&(ie=et,t.groupRowsIndexesInDataArray=ie.map((Xe,G)=>Xe.isGroupRow?G:-1).filter(Xe=>Xe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-k)}else ie=t.lastGroupDataArray;t.lastGroupDataArray=ie,t.groupedAt=de}else if(V){if(be){let k=de;t.devToolsDetected&&(k=Date.now());let _=t.aggregationReducers,me={marker:r?st(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:S,toKey:m,reducers:_},Te=Bs(me,U);t.treeDeepMap=Te.deepMap,t.treePaths=Te.treePaths;let Pe=t.selectionMode==="multi-row"?sh(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Pe;let Re=Object.keys(pe||{}),Me=al(pe),qe={reducers:pe,results:Me,reducerKeys:Re,rowInfo:{}},We=Me?te=>{qe.rowInfo=te,ll(qe)}:void 0,it=ee?te=>{te.isCellSelected=ye=>ee.isCellSelected(te.id,ye)}:void 0,at=We||it?Ac(We,it):void 0,et=t.selectionMode==="single-row"?te=>te.id===t.treeSelection:t.selectionMode==="multi-row"?te=>Pe.isNodeSelected(te.nodePath):void 0,Xe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;ie=mf({marker:r?st(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Te,treeParams:me,dataArray:U,reducers:_,toPrimaryKey:m,isNodeSelected:et,isNodeExpanded:ne,treeSelectionState:Pe,withRowInfo:at,repeatWrappedGroupRows:Xe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=sl({reducers:pe,results:Me,array:ie}),t.reducerResults=Te.reducerResults,t.totalLeafNodesCount=Te.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=de,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-k)}else ie=t.lastTreeDataArray;t.lastTreeDataArray=ie}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.pivotColumnGroups=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ae||N||W||ue){let _=Object.keys(pe||{}),me=al(pe),Te={reducers:pe,results:me,reducerKeys:_,rowInfo:{}};ie=U.map((Pe,Re)=>{let Me=vI(Pe,Pe?m(Pe):Re,Re,j,se,ee);return me&&(Te.rowInfo=Me,ll(Te)),Me}),t.rowInfoReducerResults=sl({reducers:pe,results:me,array:ie})}if(t.postGroupDataArray=ie,ie!==t.dataArray&&(t.updatedAt=de),t.dataArray=ie,t.reducedAt=de,t.selectionMode==="multi-row"){let k=t.rowSelection instanceof Oe&&!t.rowSelection.onlyUsePrimaryKeys;if(Y&&t.lazyLoad&&!k){r&&(e=st(r).track.DataSource.label.ComputeSelectionCountLazy.start());let _=!0,me=!1;t.dataArray.forEach(Pe=>{if(!Pe.isTreeNode&&Pe.isGroupRow&&Pe.groupKeys.length===1){let{rowSelected:Re}=Pe;Re!==!0&&(_=!1),(Re===!0||Re===null)&&(me=!0)}});let{rowSelection:Te}=t;Te instanceof Oe&&Te.getLazyHiddenRowsCount([])&&(Te.defaultSelection?me=!0:_=!1),t.allRowsSelected=_,t.someRowsSelected=me,r&&(e?.end(),e=void 0)}else{r&&(e=st(r).track.DataSource.label.ComputeSelectionCount.start());let _=t.isTree?t.treeSelectionState?.getSelectionCountFor([]):t.rowSelection.getSelectionCountFor([]);_?(t.allRowsSelected=_.deselectedCount===0,t.someRowsSelected=_.selectedCount>0):(t.allRowsSelected=t.totalLeafNodesCount===0,t.someRowsSelected=!1),r&&(e?.end(),e=void 0)}}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:de,mutations:T?.size?T:void 0,treeMutations:b?.size?b:void 0}),t.rowInfoStore.notifyDataArray(ie,{marker:r?st(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:n}),i&&i?.track.DataSource.label.PrepareData.end({details:[F||z||fe||be?{name:"Performed operations",value:[F?"filter":null,z?"sort":null,fe?"group":null,be?"tree":null].filter(Ao).join(", ")}:null,u?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Ao)}),t}var gt=H(require("react"));function Ih(){return Eo()}var nt=require("react");var Gt=require("react");function vn(o,e){let t=(0,Gt.useRef)({}),n=(0,Gt.useRef)({}),r=n.current,i=(0,Gt.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,Gt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function xI(o,e){let t=(0,Gt.useRef)({}),n=(0,Gt.useRef)({}),r=n.current,i=(0,Gt.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,Gt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function EI(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,Gt.useEffect)(o,t)}function MI(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function wh(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=MI(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function AI(o){return{message:o.join(""),type:"warning"}}function _I(o){return{message:o.join(""),type:"error"}}var OI=wh({DS001:AI`The "data" prop of your DataSource seems to be updating too frequently.
|
|
21
|
+
Make sure you don't pass a new reference on every render.`}),FI=wh({CSS001_CSS:_I`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),vh={...OI,...FI};var Ct=new Map,Ph=o=>{Ct.delete(o),Xo.delete(o),Co.delete(o),Io.delete(o),Ro.delete(o),io.delete(o)};function zc(o,e,t){let n=Ct.get(o);if(!n)return;let r=Xo.get(o);(!r||!Object.hasOwn(r,e))&&Xo.set(o,{...r||{},[e]:n.getState()[e]}),Co.set(o,{...Co.get(o)||{},[e]:t}),n.actions[e]=t}function cl(o,e,t){let n=Ct.get(o);if(!n)return;let r=Io.get(o);(!r||!Object.hasOwn(r,e))&&Io.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),Ro.set(o,{...Ro.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var NI=o=>{let e=o.type==="error"?xo(o.debugId):Lt(o.debugId),t=o.type==="error"?Qg:Zg,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},di=o=>{let{debugId:e,key:t}=o,n=lh[t];if(n&&(hR({...n,debugId:e}),e&&t)){let r=yt.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Zo(e))}};globalThis.logDevToolsWarning=di;var Zo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=yt.get(o);t&&e(o,t)};function ch(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:y}=n,[S,T]=(0,tt.useState)({vertical:!1,horizontal:!1}),b=(0,tt.useRef)(S);(0,tt.useEffect)(()=>(a.onChange(E=>{E&&(b.current=E,T(E))}),()=>a.destroy()),[a]),(0,tt.useEffect)(()=>{if(!m)return;let E=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(E)},[g]),(0,tt.useEffect)(()=>{if(!m||g!==void 0)return;let E=requestAnimationFrame(()=>{b.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(E)},[i.length,g]),(0,tt.useEffect)(()=>{let E=e(),{livePaginationCursor:x,livePagination:P,dataArray:A}=E;!S.vertical&&P&&(x?t.cursorId=x:x===void 0&&A.length&&(t.cursorId=A.length))},[S.vertical]);let w=(0,tt.useMemo)(()=>dg(),[])(p,h,f),R={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?w:null,cursorId:m?y:null},v=(0,tt.useRef)(!0),D=(0,tt.useRef)(!1);yR(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null},D);let I=Mi(),M=(0,tt.useRef)([]);In(()=>{let E=e(),x=I(),{isDetail:P,isDetailReady:A}=hc(x,e);if(P&&!A)return;let _=Date.now(),F=M.current;F.length>=10&&F.splice(0,1),F.push(_),_-F[0]<200&&F.length>=10&&di({debugId:E.debugId,key:"DS001"}),typeof E.data!="function"&&bo(E.data,E,t,void 0,x)},{data:r}),In(E=>{let x=Object.keys(E),P=!1;if(x.length===1){P=!!E.cursorId;let O=e().data;if(Array.isArray(O)&&E.refetchKey){t.originalDataArray=O;return}}let A=I(),{isDetail:_,isDetailReady:F}=hc(A,e);if(_&&!F)return;let k=e();if(typeof k.data=="function"){if(D.current&&!P&&pg(k))return;let O;k.debugId&&(O=at(k.debugId).track.DataSource.label.RemoteDataLoad.start()),bo(k.data,k,t,{append:P},A).then(()=>{O?.end()})}},{...R,data:r}),(0,tt.useEffect)(()=>{D.current=!1}),In(()=>{let E=e();if(v.current){v.current=!1;let x=Bt(E,void 0,I());t.dataParams=x}},R)}function yR(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;(0,tt.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new Z},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:c,dataArray:u,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,tt.useRef)(null),m=(h,y,S=n().lazyLoadCacheOfLoadedBatches)=>{let T=n();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:C}=h,{lazyLoadBatchSize:w,lazyLoad:R}=T;R&&((!w||w<=0)&&(!T.groupBy||T.groupBy.length===0)||mg({startIndex:b,endIndex:C,lazyLoadBatchSize:w,componentState:T,componentActions:r,dismissLoadedRows:y?.dismissLoadedRows??!1},S))},g=(0,tt.useMemo)(()=>Ft(m,{wait:p}),[p]);In(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(c.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(c.get()),c.onChange(y=>{f.current=y,fg(n().lazyLoadCacheOfLoadedBatches),m(y)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),(0,tt.useEffect)(()=>{a&&a>0&&g()},[u])}function dr(o){let e=Mo(),t=Mi(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=Oc(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Ne(s),[d]=(0,pt.useState)(()=>Qg({getState:u,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},f=Ne(i),m=Ne(p),g=uc(),h=(0,pt.useCallback)(({children:y})=>{let S=Va(),[T]=(0,pt.useState)(()=>ih());typeof y=="function"&&(y=y(u()));let b=m();return T.setSnapshot(b),(0,pt.useLayoutEffect)(()=>{T.notify()}),pt.default.createElement(a.Provider,{key:r,value:f()},pt.default.createElement(g.Provider,{value:b},pt.default.createElement(S.Provider,{value:T},y)))},[a,n,r]);return(0,pt.useLayoutEffect)(()=>{let y=t();y&&y.registerDetail(p)},[]),(0,pt.useLayoutEffect)(()=>()=>{let y=u();y.onCleanup(y)},[]),ch({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,pt.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,pt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function uh(){return Fe(o=>o.dataSourceApi)}var ll=class ll{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??ll.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.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}};ll.DEFAULT_SIZE=10;var al=ll;var Fc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},sl=class{constructor(e){this.storage=new al(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)}},Nc=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)}},pr=class{constructor(e){this.cacheStorage=e===!1?new Fc:e===!0?new Nc:typeof e=="number"?new sl(e):new sl(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 dh=(e=>(e.INIT="INIT",e))(dh||{});var{useManagedComponent:Oc}=Lt({debugName:"DataSource",initSetupState:Hg,forwardProps:Bg,concludeReducer:rh,mapPropsToState:jg,onPropChange:Ug,cleanup:Kg,interceptActions:Yg(),mappedCallbacks:$g()});function SR(o){let{DataSource:e}=dr(o);return ph.createElement(e,null,o.children??null)}function bR(){let{rowInfoReducerResults:o}=Fe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function mh(o){let{getDataSourceState:e}=Fe(n=>({getDataSourceState:n.getDataSourceState}));return(0,fh.useMemo)(()=>o.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,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var gh=require("react");var CH=Nt("useColumnSizeFn");function hh(o){return(0,gh.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Wt=require("react");var TR={scrollLeft:0,scrollTop:0},pi=class{constructor(){this.scrollPosition=TR;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 n=0,r=t.length;n<r;n++)t[n](e)}};var fi=o=>`--infinite-${o}`;var Lc=40,mi=fi(ip),yh=`var(${fi("density-scale")}, 1)`,gi=`calc(var(${fi("row-height")}, ${Lc}px) * ${yh})`,kc=`calc(var(${mi}) * ${yh})`;function Sh(o,e){if(!o)return null;if(e.rowHeightCSSVar!==gi)return o;if(!wR())return null;let t=Math.round(o);return t===e.rowHeight?null:t}var CR=fi("loaded");function wR(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(CR).trim()===qi}function bh(o,e){return o?e.columnHeaderHeightCSSVar===kc?Math.round(o):o:null}function Th(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var Ch=B(require("react"));function wh(o){return(e,t)=>Ch.createElement(o,{key:e.id,rowInfo:e,cache:t})}var hi=class extends hn{constructor(t,n){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.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=Ia(c,u.concat(u)),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 n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=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,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let y=i!=null,S=a!=null,T=y&&i!==this.rowHeight,b=S&&a!==this.initialColWidth;y&&(this.rowHeight=i),S&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||T||p,w=h||b||d||C;(w||C)&&this.updateRenderCount({horizontal:w,vertical:C})}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=go){let n=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/n);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*n,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(n=>{He(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,n){return t==="vertical"||!this.pageWidth?Math.floor(n):Math.floor(n/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function vn(){return{current:null}}var Rh={};function zc(o){return`.${eo}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Vc(o,e){let t=Uo(o),n=e?new hi(t,{isHeader:!1}):new hn(t),r=`${t}:header`,i=e?new hi(r,{isHeader:!0,masterBrain:n}):new hn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ni(n),{renderer:s,onRenderUpdater:c}=ni(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Ih({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Vc(o,!!e),c=vn(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,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:d=>{if(!c.current)return null;let p=zc(d);return c.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:vn(),editingValueRef:vn(),scrollerDOMRef:vn(),portalDOMRef:vn(),focusDetectDOMRef:vn(),activeCellIndicatorDOMRef:vn(),onColumnMenuClick:Te(),cellContextMenu:Te(),contextMenu:Te(),onFilterOperatorMenuClick:Te(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Te(),onRowHeightCSSVarChange:Te(),onRowDetailHeightCSSVarChange:Te(),onColumnHeaderHeightCSSVarChange:Te(),cellClick:Te(),cellMouseDown:Te(),keyDown:Te(),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 pi,pinnedEndScrollListener:new pi,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var vh=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new pr(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,multiRowSelectionWith:e=>e??"checkbox",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:e===gi?Lc:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Rh,columnGroupVisibility:e=>e??Rh,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 RR(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Ph=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Dh(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var cl=new WeakMap;function xh(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Eh=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?Th(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=RR({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=cl.get(d);h||(h=wh(d),cl.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Mt)&&(c=new Mt(c)),c=c||new Mt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=cl.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&cl.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,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||e.columnHeaderHeight===mi?kc:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=To.get(t.debugId);h&&(g={...g,...h})}return g};function Mh(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Ah(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Ro=B(require("react"));var _h=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var ul=B(require("react"));var Oh="_16lm1iwb _16lm1iw1d _16lm1iwk";var Fh="164.93361431346415 56.97787143782138",Nh={margin:"auto",display:"block",shapeRendering:"auto"},nK=Object.keys({size:1,style:1,className:1,viewBox:1});var Lh=o=>ul.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Nh,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:J(o.className,Oh,Gn.loading,ld,"InfiniteIcon","InfiniteIcon-loading")},ul.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Fh},ul.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function kh(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s=typeof t=="function"?t(o,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function zh(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Gc({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=e==="multi-column"&&u.isGroupRow&&o+1!==u.groupNesting,p=J(Vn.flex,i.align==="end"?_r.rowReverse:_r.row,Yu.center,`${eo}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c||d&&i.field)?Cf({align:a}):null);return d?i.field?Ro.createElement("div",{className:p},c,Ro.createElement("div",{className:Gt},l??null)):c?Ro.createElement("div",{className:p},c):null:(e==="single-column"&&u.isGroupRow,Ro.createElement("div",{className:p},s,c,Ro.createElement("div",{className:Gt},l??null)))}}function Hc({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return _h(u)?f=Ro.createElement(Lh,null):m&&(f=Ro.createElement(dn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=Ro.createElement(It,{render:n,renderParam:r})),f}}function Vh(){return{getGroupColumnRender:Gc,getGroupColumnRenderGroupIcon:Hc}}function Gh(o,e,t){return kh(o,e,t,Vh())}function Hh(o,e,t){return zh(o,e,t,Vh())}function Kh(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let y=Gh({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),S=y.id||`group-by-${m.field||m.groupField}`;f.push(S),p[S]=y});else if(c==="single-column"&&t.length){let m=Hh({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],h=g.pivotTotalColumn&&g.columnGroup,y=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...g};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?nn(d,S.pivotAggregator.field):void 0,...S}),!S.render&&S.renderValue&&(S.render=T=>S.renderValue(T)),p[m]=S}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var Bh=require("react");function Kc(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Fe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,Bh.useCallback)(r=>{let i=o(),a=new Dt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Rt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||bo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=Z.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=zt())}},[])}function IR(o){return(0,Wt.useMemo)(()=>Dh(o),[o])}function Wh(o,e){let{groupBy:t,dataSourceActions:n}=Fe(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Wt.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=IR(t);vR(l,o,e);let{toggleGroupRow:s}=PR();return DR(l,o,e),{toggleGroupRow:s}}function vR(o,e,t){let n=Kc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,p){let f={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],h={},y=u.get(g.field);if(y&&d==="inline"){let{groupIndex:T}=y;h={groupByForColumn:y.groupBy,field:y.groupBy?.field,valueGetter:y.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[T]:b.value,rowspan:({rowInfo:b,dataArray:C})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let w=C[b.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let R=w.indexInParentGroups||[],v=b.indexInParentGroups||[],D=!1;for(let E=0;E<=T;E++){let x=R[E];if(v[E]!==x){D=!0;break}}if(!D)return 1;let I=b.parents[T];return I?I.groupCount-(I.collapsedChildrenCount||0)+(I.collapsedGroupsCount||0):1},renderGroupIcon:Hc({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:Gc({groupIndexForColumn:T,groupRenderStrategy:d})}}let S={...h,...g};f[m]=S}),Object.keys(f).length===0?void 0:f}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function PR(){let{groupBy:o,pivotBy:e,selectionMode:t}=Fe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=kt(),f=Kc();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=Kh({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let y=p().columnOrder;if(h.length&&Array.isArray(y)){let S=new Set(y),T=!1;h.forEach(b=>{S.has(b)||(T=!0,y=[b,...y])}),T&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function DR(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Fe(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Ne(e);(0,Wt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),y=Mh(u,o),S=Ah({computedGroupColumns:y,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});Tt(h.columnVisibility,S)||(m.columnVisibility=S)},[s,f,l,i,o,u,p?n:null,p?a:null,p?r:null,p]),(0,Wt.useEffect)(()=>{let h=i.length>0,y=g(),{columnVisibility:S,columnVisibilityForGrouping:T,hideColumnWhenGrouped:b}=y,C={...S},w={...T},R=!1,v=new Set,D=new Set;Object.keys(u).forEach(I=>{let M=u[I];if(M.defaultHiddenWhenGroupedBy||b!=null)if(M.defaultHiddenWhenGroupedBy==="*"&&h||(M.defaultHiddenWhenGroupedBy===!0||b)&&M.field&&o.get(M.field)||typeof M.defaultHiddenWhenGroupedBy=="string"&&o.get(M.defaultHiddenWhenGroupedBy)||typeof M.defaultHiddenWhenGroupedBy=="object"&&Object.keys(M.defaultHiddenWhenGroupedBy).reduce((x,P)=>x||o.has(P),!1)){if(w[I]!==!1){if(S[I]===!1)return;w[I]=!1,R=!0,v.add(I)}}else w[I]===!1&&(delete w[I],R=!0,D.add(I))}),R&&(m.columnVisibilityForGrouping=w,D.forEach(I=>{delete C[I]}),v.forEach(I=>{C[I]=!1}),m.columnVisibility=C)},[u,c,i,o,d])}var jh=require("react");var Uh=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,draggableColumns:u,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:C,columnDefaultSortable:w,scrollbarWidth:R,columnTypes:v,pinnedEndMaxWidth:D,pinnedStartMaxWidth:I,viewportReservedWidth:M,resizableColumns:E,columnVisibility:x,columnVisibilityAssumeVisible:P,columnSizing:A,groupBy:_})=>{let{computedRemainingSpace:k,computedColumnOrder:O,computedVisibleColumns:H,computedVisibleColumnsMap:W,computedPinnedStartColumns:z,computedPinnedEndColumns:ee,computedUnpinnedColumns:V,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:fe,computedUnpinnedOffset:se,computedPinnedEndOffset:le,computedPinnedEndWidth:pe,computedPinnedStartWidth:ce,renderSelectionCheckBox:Y,computedColumnsMap:q,computedColumnsMapInInitialOrder:j,fieldsToColumn:X}=(0,jh.useMemo)(()=>qd({columns:o,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:c,viewportReservedWidth:M,resizableColumns:E,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:D,pinnedStartMaxWidth:I,draggableColumns:u,columnDefaultDraggable:d,columnOrder:h,columnPinning:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:C,columnDefaultSortable:w,editable:S,columnSizing:A,columnTypes:v,columnVisibility:x,columnVisibilityAssumeVisible:P??!0,groupBy:_}),[o,e,t.width,n,r,i,M,R,l,p,f,m,g,h,x,P,d,u,E,D,I,A,v,y,T,b,C,S,_,1]);return{renderSelectionCheckBox:Y,columns:o,computedColumnsMap:q,computedPinnedEndWidth:pe,computedPinnedStartWidth:ce,computedRemainingSpace:k,computedUnpinnedOffset:se,computedPinnedEndOffset:le,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:fe,computedPinnedStartColumns:z,computedPinnedEndColumns:ee,computedUnpinnedColumns:V,computedVisibleColumns:H,computedVisibleColumnsMap:W,computedColumnOrder:O,computedColumnsMapInInitialOrder:j,fieldsToColumn:X}};var Yh=require("react");var dl=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),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function xR(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function $h(o){let e=new dl;return{computedRowHeight:xR(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function qh(o){return(0,Yh.useMemo)(()=>$h(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var fr=require("react");var ER={vertical:!1,horizontal:!1};function Xh(o){let e=o().brain,{getDataSourceState:t}=oo(),[n,r]=(0,fr.useState)(ER);return(0,fr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,fr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Zh(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:y,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:C,columnTypes:w,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:D,isRowDetailEnabled:I,bodySize:M,showSeparatePivotColumnForSingleAggregation:E,onRowHeightCSSVarChange:x,onFlashingDurationCSSVarChange:P,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:_,computedColumns:F,initialColumns:k,viewportReservedWidth:O,resizableColumns:H,sortable:W,draggableColumns:z}=e,ee=t,{multiSort:V,filterValue:$,filterTypes:ie,groupBy:fe,sortInfo:se,dataSourceActions:le,getDataSourceState:pe,dataSourceApi:ce}=Fe(de=>({dataSourceActions:de.dataSourceActions,getDataSourceState:de.getDataSourceState,dataSourceApi:de.dataSourceApi,sortInfo:de.dataSourceState.sortInfo,multiSort:de.dataSourceState.multiSort,filterValue:de.dataSourceState.filterValue,filterTypes:de.dataSourceState.filterTypes,groupBy:de.dataSourceState.groupBy}));(0,Qo.useState)(()=>{x.onChange(de=>{let Re=Sh(de,n());Re!=null&&(ee.rowHeight=Re)}),P.onChange(de=>{let Re=de?de*1:null;Re!=null&&!isNaN(Re)&&(ee.flashingDurationCSSVarValue=Re)}),A.onChange(de=>{de&&(ee.rowDetailHeight=de)}),_.onChange(de=>{let Re=bh(de,n());Re!=null&&(ee.columnHeaderHeight=Re)})}),(0,Qo.useEffect)(()=>{le.showSeparatePivotColumnForSingleAggregation=E},[E]);let{toggleGroupRow:Y}=Wh(e,t),q=F,{computedColumnOrder:j,computedVisibleColumns:X,computedVisibleColumnsMap:U,computedPinnedStartColumns:Q,computedPinnedEndColumns:ae,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ue,computedPinnedEndColumnsWidth:L,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:me,computedPinnedEndOffset:Ae,computedRemainingSpace:ve,computedPinnedStartWidth:be,computedPinnedEndWidth:Oe,renderSelectionCheckBox:Ke,computedColumnsMap:nt,computedColumnsMapInInitialOrder:Je,fieldsToColumn:it}=Uh({columns:q,userColumns:k,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:M,viewportReservedWidth:O,resizableColumns:H,sortable:W,draggableColumns:z,sortInfo:se??void 0,multiSort:V,groupBy:fe,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:C,filterValue:$,filterTypes:ie,columnSizing:y,columnTypes:w}),et=mh(X),qe=hh(X),K=Xh(n),ne=be?ue>be:!1,ye=Oe?L>Oe:!1,[Ce]=(0,Qo.useState)(()=>new Ya({getRowAt:Re=>pe().dataArray[Re],isNodeSelectable:Re=>{let{isNodeSelectable:Xe}=pe();return Xe?Xe(Re):!0}})),st=Ne(X),[G]=(0,Qo.useState)(()=>new $a({getPrimaryKeyByIndex:ce.getPrimaryKeyByIndex,getColumnIdByIndex:de=>st()[de]?.id||""})),{computedRowHeight:ke,computedRowSizeCacheForDetails:St}=qh({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:D,isRowDetailsEnabled:I,getDataSourceState:pe});return(0,Qo.useMemo)(()=>({multiRowSelector:Ce,multiCellSelector:G,computedRowSizeCacheForDetails:St,computedRowHeight:ke,scrollbars:K,columnSize:qe,rowspan:et,toggleGroupRow:Y,computedColumnsMap:nt,computedColumnsMapInInitialOrder:Je,renderSelectionCheckBox:Ke,computedPinnedStartOverflow:ne,computedPinnedEndOverflow:ye,computedPinnedStartWidth:be,computedPinnedEndWidth:Oe,computedVisibleColumns:X,computedColumnOrder:j,computedRemainingSpace:ve,computedVisibleColumnsMap:U,computedPinnedStartColumns:Q,computedPinnedEndColumns:ae,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ue,computedPinnedEndColumnsWidth:L,computedUnpinnedColumnsWidth:N,computedUnpinnedOffset:me,computedPinnedEndOffset:Ae,fieldsToColumn:it}),[Ce,G,St,ke,K,qe,et,Y,nt,Je,Ke,ne,ye,be,Oe,X,j,ve,U,Q,ae,he,ue,L,N,me,Ae,it])}var ey=require("react");function MR(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function AR(){return 4294967295}function _R(o,e,t){return e=e>>>8^o[t^e&255],e}function OR(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Bc(o,e=3988292384){var t=MR(e),n=0,r;for(n=AR(),r=0;r<o.length;r++)n=_R(t,n,o.charCodeAt(r));return n=OR(n),`${n}`}var FR=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),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")??""}},Qh=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},Jh=(o="",e,t)=>{let n;try{n=NR(o)}catch{return Qh(["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(n.end);return i<r?(Qh([`
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},di=o=>{let{debugId:e,key:t}=o,n=vh[t];if(n&&(NI({...n,debugId:e}),e&&t)){let r=Ct.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Zo(e))}};globalThis.logDevToolsWarning=di;var Zo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ct.get(o);t&&e(o,t)};function Dh(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:S}=n,[y,T]=(0,nt.useState)({vertical:!1,horizontal:!1}),b=(0,nt.useRef)(y);(0,nt.useEffect)(()=>(a.onChange(M=>{M&&(b.current=M,T(M))}),()=>a.destroy()),[a]),(0,nt.useEffect)(()=>{if(!m)return;let M=requestAnimationFrame(()=>{b.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(M)},[g]),(0,nt.useEffect)(()=>{if(!m||g!==void 0)return;let M=requestAnimationFrame(()=>{b.current?.vertical||S!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(M)},[i.length,g]),(0,nt.useEffect)(()=>{let M=e(),{livePaginationCursor:D,livePagination:x,dataArray:A}=M;!y.vertical&&x&&(D?t.cursorId=D:D===void 0&&A.length&&(t.cursorId=A.length))},[y.vertical]);let C=(0,nt.useMemo)(()=>Eg(),[])(p,h,f),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?S:null},w=(0,nt.useRef)(!0),v=(0,nt.useRef)(!1);LI(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?S:null},v);let P=Mi(),E=(0,nt.useRef)([]);vn(()=>{let M=e(),D=P(),{isDetail:x,isDetailReady:A}=Rc(D,e);if(x&&!A)return;let O=Date.now(),F=E.current;F.length>=10&&F.splice(0,1),F.push(O),O-F[0]<200&&F.length>=10&&di({debugId:M.debugId,key:"DS001"}),typeof M.data!="function"&&To(M.data,M,t,void 0,D)},{data:r}),vn(M=>{let D=Object.keys(M),x=!1;if(D.length===1){x=!!M.cursorId;let L=e().data;if(Array.isArray(L)&&M.refetchKey){t.originalDataArray=L;return}}let A=P(),{isDetail:O,isDetailReady:F}=Rc(A,e);if(O&&!F)return;let z=e();if(typeof z.data=="function"){if(v.current&&!x&&Mg(z))return;let L;z.debugId&&(L=st(z.debugId).track.DataSource.label.RemoteDataLoad.start()),To(z.data,z,t,{append:x},A).then(()=>{L?.end()})}},{...I,data:r}),(0,nt.useEffect)(()=>{v.current=!1}),vn(()=>{let M=e();if(w.current){w.current=!1;let D=jt(M,void 0,P());t.dataParams=D}},I)}function LI(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;(0,nt.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new q},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:c,dataArray:u,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,nt.useRef)(null),m=(h,S,y=n().lazyLoadCacheOfLoadedBatches)=>{let T=n();if(h=h||f.current,!h)return;let{renderStartIndex:b,renderEndIndex:R}=h,{lazyLoadBatchSize:C,lazyLoad:I}=T;I&&((!C||C<=0)&&(!T.groupBy||T.groupBy.length===0)||_g({startIndex:b,endIndex:R,lazyLoadBatchSize:C,componentState:T,componentActions:r,dismissLoadedRows:S?.dismissLoadedRows??!1},y))},g=(0,nt.useMemo)(()=>Nt(m,{wait:p}),[p]);vn(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(c.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(c.get()),c.onChange(S=>{f.current=S,Ag(n().lazyLoadCacheOfLoadedBatches),m(S)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),(0,nt.useEffect)(()=>{a&&a>0&&g()},[u])}function fr(o){let e=Mo(),t=Mi(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=Vc(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Le(s),[d]=(0,gt.useState)(()=>hh({getState:u,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},f=Le(i),m=Le(p),g=gc(),h=(0,gt.useCallback)(({children:S})=>{let y=Ba(),[T]=(0,gt.useState)(()=>Ih());typeof S=="function"&&(S=S(u()));let b=m();return T.setSnapshot(b),(0,gt.useLayoutEffect)(()=>{T.notify()}),gt.default.createElement(a.Provider,{key:r,value:f()},gt.default.createElement(g.Provider,{value:b},gt.default.createElement(y.Provider,{value:T},S)))},[a,n,r]);return(0,gt.useLayoutEffect)(()=>{let S=t();S&&S.registerDetail(p)},[]),(0,gt.useLayoutEffect)(()=>()=>{let S=u();S.onCleanup(S)},[]),Dh({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,gt.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,gt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.dataSourceState}}function xh(){return Ne(o=>o.dataSourceApi)}var dl=class dl{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??dl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.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}};dl.DEFAULT_SIZE=10;var ul=dl;var Gc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},pl=class{constructor(e){this.storage=new ul(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)}},Hc=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)}},mr=class{constructor(e){this.cacheStorage=e===!1?new Gc:e===!0?new Hc:typeof e=="number"?new pl(e):new pl(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 Eh=(e=>(e.INIT="INIT",e))(Eh||{});var{useManagedComponent:Vc}=kt({debugName:"DataSource",initSetupState:ih,forwardProps:lh,concludeReducer:Rh,mapPropsToState:ch,onPropChange:uh,cleanup:ah,interceptActions:ph(),mappedCallbacks:dh()});function kI(o){let{DataSource:e}=fr(o);return Mh.createElement(e,null,o.children??null)}function zI(){let{rowInfoReducerResults:o}=Ne(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function _h(o){let{getDataSourceState:e}=Ne(n=>({getDataSourceState:n.getDataSourceState}));return(0,Ah.useMemo)(()=>o.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,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var Oh=require("react");var BH=Lt("useColumnSizeFn");function Fh(o){return(0,Oh.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Ut=require("react");var VI={scrollLeft:0,scrollTop:0},pi=class{constructor(){this.scrollPosition=VI;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 n=0,r=t.length;n<r;n++)t[n](e)}};var fi=o=>`--infinite-${o}`;var Kc=40,mi=fi(pp),Nh=`var(${fi("density-scale")}, 1)`,gi=`calc(var(${fi("row-height")}, ${Kc}px) * ${Nh})`,Bc=`calc(var(${mi}) * ${Nh})`;function Lh(o,e){if(!o)return null;if(e.rowHeightCSSVar!==gi)return o;if(!HI())return null;let t=Math.round(o);return t===e.rowHeight?null:t}var GI=fi("loaded");function HI(){return typeof document>"u"||typeof getComputedStyle!="function"?!1:getComputedStyle(document.documentElement).getPropertyValue(GI).trim()===qi}function kh(o,e){return o?e.columnHeaderHeightCSSVar===Bc?Math.round(o):o:null}function zh(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var Vh=H(require("react"));function Gh(o){return(e,t)=>Vh.createElement(o,{key:e.id,rowInfo:e,cache:t})}var hi=class extends yn{constructor(t,n){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.onScrollOriginChange=t=>this.options?.masterBrain?this.options.masterBrain.onScrollOriginChange(t):super.onScrollOriginChangeForBrain(t);this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=xa(c,u.concat(u)),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 n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=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,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let S=i!=null,y=a!=null,T=S&&i!==this.rowHeight,b=y&&a!==this.initialColWidth;S&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let R=g||T||p,C=h||b||d||R;(C||R)&&this.updateRenderCount({horizontal:C,vertical:R})}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=ho){let n=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/n);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*n,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(n=>{He(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}supportsLargeContent(t){return t==="horizontal"}alignScrollOrigin(t,n){return t==="vertical"||!this.pageWidth?Math.floor(n):Math.floor(n/this.pageWidth)*this.pageWidth}getScrollOriginPageIndex(){let t=this.getPageWidth();return t?Math.round(this.getScrollOrigin().scrollLeft/t):0}getScrollOrigin(){return this.options?.masterBrain?this.options.masterBrain.getScrollOrigin():super.getScrollOrigin()}updateScrollOrigin(){this.options?.masterBrain||super.updateScrollOrigin()}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};function Pn(){return{current:null}}var Wc={};function jc(o){return`.${oo}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Uc(o,e){let t=Uo(o),n=e?new hi(t,{isHeader:!1}):new yn(t),r=`${t}:header`,i=e?new hi(r,{isHeader:!0,masterBrain:n}):new yn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=ni(n),{renderer:s,onRenderUpdater:c}=ni(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Hh({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Uc(o,!!e),c=Pn(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,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:d=>{if(!c.current)return null;let p=jc(d);return c.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Pn(),editingValueRef:Pn(),scrollerDOMRef:Pn(),portalDOMRef:Pn(),focusDetectDOMRef:Pn(),activeCellIndicatorDOMRef:Pn(),onColumnMenuClick:Ce(),cellContextMenu:Ce(),contextMenu:Ce(),onFilterOperatorMenuClick:Ce(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Ce(),onRowHeightCSSVarChange:Ce(),onRowDetailHeightCSSVarChange:Ce(),onColumnHeaderHeightCSSVarChange:Ce(),cellClick:Ce(),cellMouseDown:Ce(),keyDown:Ce(),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 pi,pinnedEndScrollListener:new pi,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Kh=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,menuPortalContainer:1,menuConstrainTo:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,repaintCellsKey:1,rowProps:1,rowClassName:1,rowHoverClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new mr(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,multiRowSelectionWith:e=>e??"checkbox",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:e===gi?Kc:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??Wc,columnGroupVisibility:e=>e??Wc,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 KI(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Bh=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Wh(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var fl=new WeakMap;function jh(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Uh=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups!=n?.pivotColumnGroups?zh(i??Wc,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=KI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=fl.get(d);h||(h=Gh(d),fl.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof At)&&(c=new At(c)),c=c||new At({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=fl.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&fl.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,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||e.columnHeaderHeight===mi?Bc:e.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Co.get(t.debugId);h&&(g={...g,...h})}return g};function $h(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Yh(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wo=H(require("react"));var qh=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var ml=H(require("react"));var Xh="_16lm1iwb _16lm1iw1d _16lm1iwk";var Zh="164.93361431346415 56.97787143782138",Qh={margin:"auto",display:"block",shapeRendering:"auto"},vK=Object.keys({size:1,style:1,className:1,viewBox:1});var Jh=o=>ml.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Qh,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:X(o.className,Xh,Hn.loading,md,"InfiniteIcon","InfiniteIcon-loading")},ml.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Zh},ml.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function ey(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s=typeof t=="function"?t(o,e):t;return{header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,...s,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:s?.renderGroupIcon??l.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})}}function ty(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function $c({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=e==="multi-column"&&u.isGroupRow&&o+1!==u.groupNesting,p=X(Gn.flex,i.align==="end"?Or.rowReverse:Or.row,td.center,`${oo}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c||d&&i.field)?Ef({align:a}):null);return d?i.field?wo.createElement("div",{className:p},c,wo.createElement("div",{className:Ht},l??null)):c?wo.createElement("div",{className:p},c):null:(e==="single-column"&&u.isGroupRow,wo.createElement("div",{className:p},s,c,wo.createElement("div",{className:Ht},l??null)))}}function Yc({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return qh(u)?f=wo.createElement(Jh,null):m&&(f=wo.createElement(pn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=wo.createElement(Pt,{render:n,renderParam:r})),f}}function oy(){return{getGroupColumnRender:$c,getGroupColumnRenderGroupIcon:Yc}}function ny(o,e,t){return ey(o,e,t,oy())}function ry(o,e,t){return ty(o,e,t,oy())}function iy(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let S=ny({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),y=S.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=S});else if(c==="single-column"&&t.length){let m=ry({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],h=g.pivotTotalColumn&&g.columnGroup,S=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||S&&l===!1)return;let y={...g};s&&(typeof s=="function"?y={...y,...s({column:y,pivotBy:n,groupBy:t})}:y={...y,...s}),y.inheritFromColumn!==!1&&(y={...typeof y.inheritFromColumn=="string"?d[y.inheritFromColumn]:y.pivotAggregator?.field?nn(d,y.pivotAggregator.field):void 0,...y}),!y.render&&y.renderValue&&(y.render=T=>y.renderValue(T)),p[m]=y}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var ay=require("react");function qc(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Ne(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,ay.useCallback)(r=>{let i=o(),a=new xt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[vt,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||To(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Vt())}},[])}function BI(o){return(0,Ut.useMemo)(()=>Wh(o),[o])}function ly(o,e){let{groupBy:t,dataSourceActions:n}=Ne(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Ut.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Ut.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Ut.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=BI(t);WI(l,o,e);let{toggleGroupRow:s}=jI();return UI(l,o,e),{toggleGroupRow:s}}function WI(o,e,t){let n=qc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,p){let f={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],h={},S=u.get(g.field);if(S&&d==="inline"){let{groupIndex:T}=S;h={groupByForColumn:S.groupBy,field:S.groupBy?.field,valueGetter:S.groupBy?.valueGetter,valueFormatter:({rowInfo:b})=>b.isGroupRow?b.groupKeys?.[T]:b.value,rowspan:({rowInfo:b,dataArray:R})=>{if(b.isTreeNode||!b.isGroupRow)return 1;let C=R[b.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let I=C.indexInParentGroups||[],w=b.indexInParentGroups||[],v=!1;for(let M=0;M<=T;M++){let D=I[M];if(w[M]!==D){v=!0;break}}if(!v)return 1;let P=b.parents[T];return P?P.groupCount-(P.collapsedChildrenCount||0)+(P.collapsedGroupsCount||0):1},renderGroupIcon:Yc({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:$c({groupIndexForColumn:T,groupRenderStrategy:d})}}let y={...h,...g};f[m]=y}),Object.keys(f).length===0?void 0:f}(0,Ut.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function jI(){let{groupBy:o,pivotBy:e,selectionMode:t}=Ne(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=zt(),f=qc();return(0,Ut.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=iy({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let S=p().columnOrder;if(h.length&&Array.isArray(S)){let y=new Set(S),T=!1;h.forEach(b=>{y.has(b)||(T=!0,S=[b,...S])}),T&&(n.columnOrder=S)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function UI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Ne(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Le(e);(0,Ut.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),S=$h(u,o),y=Yh({computedGroupColumns:S,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});wt(h.columnVisibility,y)||(m.columnVisibility=y)},[s,f,l,i,o,u,p?n:null,p?a:null,p?r:null,p]),(0,Ut.useEffect)(()=>{let h=i.length>0,S=g(),{columnVisibility:y,columnVisibilityForGrouping:T,hideColumnWhenGrouped:b}=S,R={...y},C={...T},I=!1,w=new Set,v=new Set;Object.keys(u).forEach(P=>{let E=u[P];if(E.defaultHiddenWhenGroupedBy||b!=null)if(E.defaultHiddenWhenGroupedBy==="*"&&h||(E.defaultHiddenWhenGroupedBy===!0||b)&&E.field&&o.get(E.field)||typeof E.defaultHiddenWhenGroupedBy=="string"&&o.get(E.defaultHiddenWhenGroupedBy)||typeof E.defaultHiddenWhenGroupedBy=="object"&&Object.keys(E.defaultHiddenWhenGroupedBy).reduce((D,x)=>D||o.has(x),!1)){if(C[P]!==!1){if(y[P]===!1)return;C[P]=!1,I=!0,w.add(P)}}else C[P]===!1&&(delete C[P],I=!0,v.add(P))}),I&&(m.columnVisibilityForGrouping=C,v.forEach(P=>{delete R[P]}),w.forEach(P=>{R[P]=!1}),m.columnVisibility=R)},[u,c,i,o,d])}var sy=require("react");var cy=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:c,draggableColumns:u,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:S,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,viewportReservedWidth:E,resizableColumns:M,columnVisibility:D,columnVisibilityAssumeVisible:x,columnSizing:A,groupBy:O})=>{let{computedRemainingSpace:z,computedColumnOrder:L,computedVisibleColumns:B,computedVisibleColumnsMap:Y,computedPinnedStartColumns:V,computedPinnedEndColumns:W,computedUnpinnedColumns:N,computedPinnedStartColumnsWidth:K,computedPinnedEndColumnsWidth:ae,computedUnpinnedColumnsWidth:re,computedUnpinnedOffset:ue,computedPinnedEndOffset:fe,computedPinnedEndWidth:be,computedPinnedStartWidth:de,renderSelectionCheckBox:U,computedColumnsMap:ie,computedColumnsMapInInitialOrder:ge,fieldsToColumn:Z}=(0,sy.useMemo)(()=>op({columns:o,userColumns:e,scrollbarWidth:I,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:c,viewportReservedWidth:E,resizableColumns:M,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:P,draggableColumns:u,columnDefaultDraggable:d,columnOrder:h,columnPinning:S,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnDefaultSortable:C,editable:y,columnSizing:A,columnTypes:w,columnVisibility:D,columnVisibilityAssumeVisible:x??!0,groupBy:O}),[o,e,t.width,n,r,i,E,I,l,p,f,m,g,h,D,x,d,u,M,v,P,A,w,S,T,b,R,y,O,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:ie,computedPinnedEndWidth:be,computedPinnedStartWidth:de,computedRemainingSpace:z,computedUnpinnedOffset:ue,computedPinnedEndOffset:fe,computedPinnedStartColumnsWidth:K,computedPinnedEndColumnsWidth:ae,computedUnpinnedColumnsWidth:re,computedPinnedStartColumns:V,computedPinnedEndColumns:W,computedUnpinnedColumns:N,computedVisibleColumns:B,computedVisibleColumnsMap:Y,computedColumnOrder:L,computedColumnsMapInInitialOrder:ge,fieldsToColumn:Z}};var dy=require("react");var 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),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function $I(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function uy(o){let e=new gl;return{computedRowHeight:$I(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function py(o){return(0,dy.useMemo)(()=>uy(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var gr=require("react");var YI={vertical:!1,horizontal:!1};function fy(o){let e=o().brain,{getDataSourceState:t}=no(),[n,r]=(0,gr.useState)(YI);return(0,gr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,gr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function my(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:S,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,columnTypes:C,rowHeight:I,rowDetailHeight:w,isRowDetailExpanded:v,isRowDetailEnabled:P,bodySize:E,showSeparatePivotColumnForSingleAggregation:M,onRowHeightCSSVarChange:D,onFlashingDurationCSSVarChange:x,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:O,computedColumns:F,initialColumns:z,viewportReservedWidth:L,resizableColumns:B,sortable:Y,draggableColumns:V}=e,W=t,{multiSort:N,filterValue:K,filterTypes:ae,groupBy:re,sortInfo:ue,dataSourceActions:fe,getDataSourceState:be,dataSourceApi:de}=Ne(ce=>({dataSourceActions:ce.dataSourceActions,getDataSourceState:ce.getDataSourceState,dataSourceApi:ce.dataSourceApi,sortInfo:ce.dataSourceState.sortInfo,multiSort:ce.dataSourceState.multiSort,filterValue:ce.dataSourceState.filterValue,filterTypes:ce.dataSourceState.filterTypes,groupBy:ce.dataSourceState.groupBy}));(0,Qo.useState)(()=>{D.onChange(ce=>{let Ae=Lh(ce,n());Ae!=null&&(W.rowHeight=Ae)}),x.onChange(ce=>{let Ae=ce?ce*1:null;Ae!=null&&!isNaN(Ae)&&(W.flashingDurationCSSVarValue=Ae)}),A.onChange(ce=>{ce&&(W.rowDetailHeight=ce)}),O.onChange(ce=>{let Ae=kh(ce,n());Ae!=null&&(W.columnHeaderHeight=Ae)})}),(0,Qo.useEffect)(()=>{fe.showSeparatePivotColumnForSingleAggregation=M},[M]);let{toggleGroupRow:U}=ly(e,t),ie=F,{computedColumnOrder:ge,computedVisibleColumns:Z,computedVisibleColumnsMap:ee,computedPinnedStartColumns:j,computedPinnedEndColumns:se,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:pe,computedPinnedEndColumnsWidth:k,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:me,computedPinnedEndOffset:Te,computedRemainingSpace:Pe,computedPinnedStartWidth:Re,computedPinnedEndWidth:Me,renderSelectionCheckBox:qe,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,fieldsToColumn:at}=cy({columns:ie,userColumns:z,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:E,viewportReservedWidth:L,resizableColumns:B,sortable:Y,draggableColumns:V,sortInfo:ue??void 0,multiSort:N,groupBy:re,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:y,columnDefaultEditable:T,columnDefaultFilterable:b,columnDefaultGroupable:R,filterValue:K,filterTypes:ae,columnSizing:S,columnTypes:C}),et=_h(Z),Xe=Fh(Z),G=fy(n),te=Re?pe>Re:!1,ye=Me?k>Me:!1,[Ie]=(0,Qo.useState)(()=>new Qa({getRowAt:Ae=>be().dataArray[Ae],isNodeSelectable:Ae=>{let{isNodeSelectable:Ze}=be();return Ze?Ze(Ae):!0}})),ut=Le(Z),[le]=(0,Qo.useState)(()=>new Za({getPrimaryKeyByIndex:de.getPrimaryKeyByIndex,getColumnIdByIndex:ce=>ut()[ce]?.id||""})),{computedRowHeight:$,computedRowSizeCacheForDetails:tt}=py({rowDetailHeight:w,rowHeight:I,isRowDetailsExpanded:v,isRowDetailsEnabled:P,getDataSourceState:be});return(0,Qo.useMemo)(()=>({multiRowSelector:Ie,multiCellSelector:le,computedRowSizeCacheForDetails:tt,computedRowHeight:$,scrollbars:G,columnSize:Xe,rowspan:et,toggleGroupRow:U,computedColumnsMap:We,computedColumnsMapInInitialOrder:it,renderSelectionCheckBox:qe,computedPinnedStartOverflow:te,computedPinnedEndOverflow:ye,computedPinnedStartWidth:Re,computedPinnedEndWidth:Me,computedVisibleColumns:Z,computedColumnOrder:ge,computedRemainingSpace:Pe,computedVisibleColumnsMap:ee,computedPinnedStartColumns:j,computedPinnedEndColumns:se,computedUnpinnedColumns:ne,computedPinnedStartColumnsWidth:pe,computedPinnedEndColumnsWidth:k,computedUnpinnedColumnsWidth:_,computedUnpinnedOffset:me,computedPinnedEndOffset:Te,fieldsToColumn:at}),[Ie,le,tt,$,G,Xe,et,U,We,it,qe,te,ye,Re,Me,Z,ge,Pe,ee,j,se,ne,pe,k,_,me,Te,at])}var Sy=require("react");function qI(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function XI(){return 4294967295}function ZI(o,e,t){return e=e>>>8^o[t^e&255],e}function QI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Xc(o,e=3988292384){var t=qI(e),n=0,r;for(n=XI(),r=0;r<o.length;r++)n=ZI(t,n,o.charCodeAt(r));return n=QI(n),`${n}`}var JI=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),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")??""}},gy=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},hy=(o="",e,t)=>{let n;try{n=ew(o)}catch{return gy(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),"invalid"}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(gy([`
|
|
28
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},NR=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Bc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Bc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),FR(t)};var LR=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,kR=/(https):\/\/\S+(\.csb\.app)/g,ty=typeof window<"u"?window.location.origin:"",zR=()=>{let[o,e,t]=Array.from(LR.exec(ty)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},VR=()=>{let[o,e,t]=Array.from(kR.exec(ty)||[]);return e==="https"&&t===".csb.app"},GR=VR()||zR(),oy=(o="")=>{let t=!!Mo();return(0,ey.useMemo)(()=>{if(t)return!0;let r=Jh(o,{publishedAt:1624970570587,version:"10.1.5"});return!o&&!r&&GR?!0:r},[o,t])};var mr=require("react");var HR=10;function ny(o,e,t){let n=(0,mr.useRef)(!1),r=(0,mr.useRef)(null);(0,mr.useEffect)(()=>{o!=null&&(n.current=!1,Ht(r.current))},[o]),(0,mr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Ht(r.current),r.current=He(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<HR&&a(l)})};var i=a;a()}return()=>{Ht(r.current)}},[o,e])}var gr=require("react"),KR=10;function ry(o,e,t){let n=(0,gr.useRef)(!1),r=(0,gr.useRef)(null);(0,gr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,gr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<KR&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function iy(){return Eo()}var hr=require("react");function ay(o,e){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var BR={Enter:!0," ":!0,a:!0};function ly(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=o,{key:l,ctrlKey:s,metaKey:c}=e;if(!BR[l])return!1;let u=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=u,{selectionMode:h,rowSelection:y,treeSelectionState:S,isTree:T}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let w={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return pa({...o,rowIndex:b},w,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||c)){if(T&&S){let R=a(S);return R.selectAll(),r.treeSelection=R,!0}let w=i(y);return w.selectAll(),r.rowSelection=w,!0}return!1}var sy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),cy=o=>Array.from(o.querySelectorAll(sy)).filter(t=>!!t.offsetParent),pl=o=>o.querySelector(sy);var dy=B(an());async function uy(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var WR=10,jR=(o,e)=>o-e;function fl(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=ht(p.id,e);return p.contentFocusable({column:p,...or({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Wc(o,e,t){let n=t.getState().editingCell;return UR(o,e,t,{isCellFocusable:fl,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function py(o,e,t){let n=(0,dy.default)(t,o+e,jR);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=py;function UR(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,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(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:py(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function fy(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=fl(e,o)?e:Wc(e,-1,o);if(t){await jc([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;pl(n)?.focus()}}async function jc([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=WR,l=null,s=!1;function c(u=0){u++,Ht(l),l=He(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await uy(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var $R=`.${eo}`;function my(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:Lo(n,$R),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:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&fl({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Wc({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=cy(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return jc([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;pl(u)?.focus()}),!0}var gy={control:"ctrl"},hy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},YR={esc:"escape"},Sy={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},by=Object.keys(Sy),Uc=new Set(by),qR=new Set(["shift","alt"]);function ml(o,e){return Array.isArray(e)?e.some(t=>yy(o,t)):yy(o,e)}function yy(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>hy[p]),i=n.map(p=>gy[p]||hy[p]||YR[p]||p),a=i.filter(p=>Uc.has(p)),l=i.filter(p=>!Uc.has(p)),s=by.reduce((p,f)=>(p[f]=Sy[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!qR.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Uc.has(t)||t==="meta"||gy[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Ty(o,e){let t={...o,cloneRowSelection:a=>tr(a,o.getDataSourceState),cloneTreeSelection:a=>er(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&ly(t,e)&&e.preventDefault(),(my(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Sg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!ml(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function XR(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Be(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=oo();return(0,hr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>er(u,i),cloneRowSelection:u=>tr(u,i)}),[o,e,i,a,t,l,n])}function ZR(){let o=XR();(0,hr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{Ty(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=ht(s.id,o);uf({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=ht(u.id,o);ay({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function QR(){let{getState:o}=re(t=>({getState:t.getState}));return{onKeyDown:(0,hr.useCallback)(t=>{o().keyDown(t)},[])}}function Cy(){return ZR(),QR()}var Qc=require("react");var We=B(require("react")),At=require("react"),Dy=require("react-dom");var gl="__is_infinite_menu_component";function $c(o){return!!o.tagName}function Iy(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Pe.from($c(e)?e.getBoundingClientRect():e),a=Pe.from($c(t)?t.getBoundingClientRect():t),l=n?Pe.from($c(n)?n.getBoundingClientRect():n):null;if(!l)return{...wy({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=wy({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function wy(o){let e=Pe.from(o.targetRect),t=Pe.from(o.anchorRect),n=o.constrainRect?Pe.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Ry(e,i),s=Ry(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Ry(o,e){return e==="TopLeft"?je.from({top:o.top,left:o.left}):e==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?je.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function JR(o){return o&&typeof o.then=="function"||o instanceof Promise}function hl(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function vy(o){return typeof o=="function"&&(o=o()),JR(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&hl(o)&&(o=o.getBoundingClientRect()),o?Pe.from(o):null}async function Py(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),hl(n)&&(r=n),r||null}return t(await e)}async function yl(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await vy(t)||void 0,a=n?await vy(n):void 0,l=Pe.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Iy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function eI(o){return We.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function tI(o){let e=We.useRef(null);return(0,At.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&yl(e.current,t)}),[o.realign]),We.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,At.useCallback)(t=>{t&&yl(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function xy(o,e){let[t,n]=(0,At.useState)(null);(0,At.useLayoutEffect)(()=>{async function a(){let l=e?await Py(e):null;l!=null&&n(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=hl(r)?r:t;return e?i?(0,Dy.createPortal)(o,i):We.createElement(We.Fragment,null):e===null||e===!1?o:We.createElement(eI,null,o)}function oI(o){if(We.Children.count(o)===1){let e=We.Children.only(o);if(We.isValidElement(e))return e.props.id||e.key}return null}function nI(o,e,t){if(We.Children.count(o)===1){let n=We.Children.only(o);if(We.isValidElement(n)&&n.type[gl]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),We.cloneElement(n,r)}}return o}function ao(o){let e=o,[t]=(0,At.useState)(()=>new Map),[n,r]=(0,At.useState)(null),[i,a]=(0,At.useState)(0),l=(0,At.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(We.createElement(tI,{...h,key:h.key}));return m},[]),[s,c]=$t(),u=xy(l(),o.portalContainer),d=(0,At.useCallback)((m,g)=>{let y=`${g.id||oI(m)||zt()}`,S=t.get(y),T=w=>()=>{let R=typeof w=="function"?w():w;return nI(R,e.portalContainer,g.constrainTo??e.constrainTo)},b=T(m),C=(w,R)=>{if(!S)return;let v=T(w);Object.assign(S,{children:v}),c(),!!!R?.skipRealign&&(r(S.key),a(Date.now()))};return S?(Object.assign(S,g),C(m),C):(S={key:y,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Te()},t.set(S.key,S),c(),C)},[t,e.portalContainer,c]);We.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return We.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var Zy=B(require("react"));var br=B(require("react"));var Hy=B(require("react"));var Vy=B(require("react"));function Sl(o){return null}Sl.defaultProps={__is_menu_item:!0};var Ey="submenu",rI="-";function My(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:zt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Ay(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Yc=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===rI?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},iI=[{name:"label"}],_y=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:c}=t,u=t.id||n.generatedId;c&&(u=`${c}-${u}`);let d=[...t.columns||iI],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:u},f=[];a?f=a.map(g=>Yc(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==Ey)&&d.push({name:Ey,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:u}};var yr=B(require("react"));var Oy="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Fy=Se({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Ny="db3arf1",Ly="db3arfd";function ky(){return yr.createElement("hr",{className:Ly})}var bl={renderSeparator:()=>yr.createElement(ky,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?yr.createElement("div",{...o},yr.createElement(dn,{expanded:!1})):yr.createElement("div",{...o})};var zy=(o,e)=>Yc(o,e,bl);function Gy(o,e){return Vy.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Sl)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),zy(o,n)}return zy(o,t)})||[]}function Ky(){return{...My(),domRef:Hy.createRef()}}var By=()=>Ay(),Wy=o=>_y(o,{...bl,childrenToRuntimeItems:Gy});var jt=B(require("react")),ft=require("react");function jy(o,e){let t=Uy(o,e);if(!t.length)return null;let n=Pe.from(t[0]?.getBoundingClientRect()),r=Pe.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Uy(o,e){let t=Lo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function $y(o,e){let t=Uy(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var yi=class extends qn{constructor(e){super(e.slice(0,3))}};var aI=250;function lI(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}He(i)};He(()=>{i()})})}var sI=Ee(),Tl=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||aI;this.getPointerMoveTarget=()=>document.documentElement||sI;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 je({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new yi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new yi([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,lI(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.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 Cl=require("react"),qc=(0,Cl.createContext)(null);function Xc(){return(0,Cl.useContext)(qc)}var Sr=require("react");function Yy(){let o=(0,Sr.useRef)(!0);return(0,Sr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,Sr.useCallback)(()=>o.current,[])}function cI(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),jt.createElement(Ut,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function uI({onItemActivate:o}){let{getState:e}=Xc(),[{onItemEnter:t,onItemLeave:n}]=(0,ft.useState)(()=>new Tl({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(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?Pe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ft.useCallback)(t,[]),onItemLeave:(0,ft.useCallback)(n,[])}}function qy(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:y}=Xc(),S=(0,ft.useCallback)(V=>{h.keyboardActiveItemKey=V},[]),T=(0,ft.useCallback)(V=>{h.activeItemKey=V},[]),b=Yy(),[C,w]=(0,ft.useState)(null),R=null;(0,ft.useLayoutEffect)(()=>{let{runtimeItems:V}=y(),$=V.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!$||!$.menu){w(null),M();return}if($){let ie=jy(r,$.key);ie&&D(()=>cI($,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:T,setKeyboardActiveItemKey:S,parentMenuId:r,onHideIntent:H,api:W}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(V,$)=>{S($.key),T($.key),$.originalMenuItem.onClick&&$.originalMenuItem.onClick(V);let ie={key:$.key,item:$.originalMenuItem,hideMenu:H};$.originalMenuItem.onAction&&$.originalMenuItem.onAction(ie),c&&c(ie),$.originalMenuItem.hideMenuOnAction&&H()},{showOverlay:D,portal:I,clearAll:M}=ao({portalContainer:!1}),{onItemEnter:E,onItemLeave:x}=uI({onItemActivate:V=>{if(!b())return;let $=V?V.key:null;T($)}});R=n.map((V,$)=>jt.createElement(dI,{key:V.type==="item"?V.key:$,onItemEnter:(ie,fe)=>{E(ie.key,fe)},onItemLeave:(ie,fe)=>{x(ie.key,fe)},columns:t,active:V.type==="item"&&V.key===i,keyboardActive:V.type==="item"&&V.key===a,item:V,index:$,onClick:v}));let P=t.map(V=>V.width||(typeof V.flex=="number"?`${V.flex}fr`:V.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:P,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(A.whiteSpace="nowrap");function _(V){let{runtimeItems:$,runtimeSelectableItems:ie}=y(),fe=$.findIndex(Y=>Y.type==="item"&&Y.key===a),se=a,le=$[fe],pe={ArrowUp:()=>{let Y=$.slice(0,fe).filter(q=>q.type==="item"&&!q.disabled).pop();Y&&Y.type==="item"&&Y.key&&(se=Y.key)},ArrowDown:()=>{let Y=$.slice(fe+1).filter(q=>q.type==="item"&&!q.disabled)[0];Y&&Y.type==="item"&&Y.key&&(se=Y.key)},Home:()=>{pe.PageUp()},End:()=>{pe.PageDown()},PageUp:()=>{se=ie[0].key},PageDown:()=>{se=ie[ie.length-1].key},ArrowLeft:()=>{T(null),y().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{le&&(T(le.key),He(()=>{b()&&C&&C.getParentMenuId()===y().menuId&&C.focus()}))},Enter:()=>{if(le)if(le.originalMenuItem?.menu){if(le&&le.originalMenuItem.menu&&C){pe.ArrowLeft();return}le&&T(le.key)}else v(V,le)}," ":()=>{if(!le)return;le.originalMenuItem.menu||v(V,le);let Y=$y(r,le.key);Y&&Y.click()},Escape:()=>{pe.ArrowLeft();let Y=y();Y.parentMenuId||Y.onHideIntent?.(Y)}},ce=pe[V.key];ce&&(ce(),V.preventDefault()),se!=a&&S(se)}function F(){h.focused=!1}let k=(0,ft.useCallback)(function(){h.focused=!0,setTimeout(()=>{O.current&&g.current&&g.current===document.activeElement&&y().keyboardActiveItemKey==null&&S(y().runtimeSelectableItems[0]?.key??null)})},[]),O=(0,ft.useRef)(!0),H=(0,ft.useCallback)(()=>{let V=y();V.onHideIntent?.(V)},[y]),[W]=(0,ft.useState)(()=>({hideMenu:H,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),k())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),z=(0,ft.useCallback)(V=>{V?(g.current=V,d?.(y(),W),f&&W.focus()):(p?.(y()),g.current=V)},[]),ee=jt.createElement("div",{className:Vn.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:z,onKeyDown:V=>{e.onKeyDown?.(V),_(V)},onMouseDown:V=>{O.current=!1,e.onMouseDown?.(V)},onMouseUp:V=>{O.current=!0,e.onMouseUp?.(V)},onFocus:k,onBlur:F,className:J(Oy,e.className,"InfiniteMenu"),style:A},R),I);return s?null:ee}function dI(o){let[e,t]=jt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=jt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let S={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"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(Fy({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?jt.createElement($r,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:S}}):jt.createElement("div",{key:`${s}-${m}`,...S},f[m])}).filter(Boolean)}return jt.createElement("div",{className:Ny},c)}var{ManagedComponentContextProvider:pI}=Lt({initSetupState:Ky,forwardProps:By,mapPropsToState:Wy,layoutEffect:!0});function fI(o){let{componentActions:e,componentState:t}=kt(),n=Ne(t);return br.createElement(qc.Provider,{value:{componentActions:e,componentState:t,getState:n}},br.createElement(qy,{domProps:o.domProps}))}function Ut(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:y,...S}=o;return br.createElement(pI,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},br.createElement(fI,{domProps:S}))}Ut[gl]=!0;var Zc=B(require("react"));function Xy(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a,getState:l}=e,s=l().components?.CheckBox||zo,u=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...u,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:Zc.createElement(s,{key:m.id,disabled:m.computedVisible&&i.getVisibleColumnsCount()===1,checked:m.computedVisible,onChange:y=>{let S=!!y;i.setVisibilityForColumn(m.id,S),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}},"-",{key:"group-by",label:"Group by",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{if(m.groupByForColumn)return;let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:Zc.createElement(s,{key:m.id,disabled:!m.computedGroupable,checked:m.computedGroupedBy,onChange:()=>{a.toggleGroupByField(m.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}}].filter(p=>!!p)}function Qy(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Ut,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:ht(s.id,e),...e},u=Xy([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Zy.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}function Jy(o){return typeof o=="function"?o():o}function Pn(o){return Jy(o.menuConstrainTo)??o.domRef.current}function eS(o,e,t){return e?()=>Jy(e)??(t||o().portalDOMRef.current):t||!1}var tS=require("react");function Dn(){let{getState:o,menuPortalContainer:e}=re(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=Ai(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},n=t?.current;return(0,tS.useMemo)(()=>eS(o,e,n),[o,e,n])}var mI=`[${Yr["data-name"]}="${qr["data-name"]}"]`;function gI(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${eg["data-column-id"]}="${e}"] ${mI}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Qy(e,t,c),{constrainTo:Pn(i()),id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function oS(){let o=Be(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=re(s=>({getState:s.getState,actions:s.actions,columnMenuVisibleForColumnId:s.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:s.state.columnMenuVisibleKey})),{showOverlay:i,portal:a,clearAll:l}=ao({portalContainer:Dn()});return(0,Qc.useEffect)(()=>{let s=e();return s.onColumnMenuClick.onChange(c=>{c&&(s.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,Qc.useEffect)(()=>{let{columnMenuVisibleForColumnId:s,columnMenuTargetRef:c}=e();if(s){let d=function(p){p.__insideMenu!==!0&&(l(),t.columnMenuVisibleForColumnId=null)};var u=d;return document.documentElement.addEventListener("mousedown",d),gI({columnId:s,context:o,clearAll:l,showOverlay:i}),()=>{document.documentElement.removeEventListener("mousedown",d)}}else c.current=null,l();return()=>{}},[n,r]),{menuPortal:a}}var nS=B(require("react")),rS=require("react");var hI={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function iS(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Be(),{getDataSourceState:a,getDataSourceMasterContext:l}=oo(),{focusDetectDOMRef:s}=o(),c=(0,rS.useCallback)(async()=>{fy({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return nS.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:hI})}var Tr=require("react");function yI(){let o=Be(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,Tr.useEffect)(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function SI(){let o=Be(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Tr.useEffect)(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function bI(){let o=Be(),{editingCell:e}=re(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Oo(t);(0,Tr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function TI(){let o=Be(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Tr.useEffect)(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ci(o,i);s?r({...s,value:a,initialValue:l}):ui("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function CI(){let o=Be(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,Tr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ci(o,r);if(!s){ui(l,r);return}let c={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...c,error:n}):a?.(c)}},[n])}function aS(){yI(),SI(),TI(),CI(),bI()}var tu=require("react");var Jo=B(require("react"));var Jc=B(require("react"));var wl=o=>Jc.createElement(Ve,{...o,icon:"clear"},Jc.createElement("path",{d:Ge.clear[0]}));var eu=B(require("react"));var lS=o=>eu.createElement(Ve,{...o,icon:"done"},eu.createElement("path",{d:Ge.done[0]}));function sS(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Ut,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},g=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),y=h[f.computedFilterType];if(!y)return null;let S=y.operators.map(R=>{let v=R.name,D=f.computedFilterValue?f.computedFilterValue.filter.operator===v:v===y.defaultOperator,I=R.components?.Icon??Kn;return{key:v,icon:Jo.createElement(I,null),label:Jo.createElement(Jo.Fragment,null,R.label??R.name),onAction:()=>{c.setColumnFilterOperator(o,v)},checked:D?Jo.createElement(lS,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Jo.createElement(wl,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...S],C={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},w=d?d(b,C):b;return Jo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:R=>{g(R),t?.()}})}var Rl=10;function cS(){let o=Be(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=ao({portalContainer:Dn()});return(0,tu.useEffect)(()=>e().onFilterOperatorMenuClick.onChange(l=>{if(!l)return;let{target:s,column:c}=l;function u(){i(),t.filterOperatorMenuVisibleForColumnId=null}let d=s?.parentElement||s,p=Pe.from(d.getBoundingClientRect());p.top-=Rl,p.left-=Rl,p.width+=2*Rl,p.height+=2*Rl,n(()=>sS(c.id,o,u),{constrainTo:Pn(e()),id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.columnMenuVisibleForColumnId=null,t.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,tu.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.filterOperatorMenuVisibleForColumnId=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var bi=require("react");var ru=B(require("react"));var ou=B(require("react"));function Si(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function Il(o){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),o.onHideIntent?.()}}}function nu(o,e,t){if(!o)return null;let n=Te();return o.then(r=>{let{items:i,columns:a}=Si(r);i&&i.length&&n(ou.createElement(t,{...e,items:i||[],columns:a}))}),ou.createElement(jo,{updater:n})}function uS(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Ut,{computedColumnsMap:d}=a(),p=d.get(n),f={...Jt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=Il({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:nu(g,m,u),preventDefault:h};let{items:y,columns:S}=Si(g);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:h,menu:ru.createElement(u,{...m,columns:S,items:y}),cellContext:f}}function dS(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Ut,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...Jt({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=Il({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:nu(p,d,l),preventDefault:f};let{items:m,columns:g}=Si(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ru.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var vl=5,pS=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function fS(){let o=Be(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=ao({portalContainer:Dn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l,getDataSourceState:s}=o;return l().cellContextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){i(),a.cellContextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=uS(u,o,p),h=Pe.fromPoint({top:d.clientY,left:d.clientX});h.width+=vl,h.height+=vl,n(f,{constrainTo:Pn(l()),id:"cell-context-menu",alignTo:h,alignPosition:pS}),g&&d.preventDefault(),a.cellContextMenuVisibleFor={columnId:u.columnId,rowId:u.rowId,rowIndex:u.rowIndex,colIndex:u.colIndex};let{onCellContextMenu:y}=l();y&&y({...m,getState:l,getDataSourceState:s},d)})},[]),(0,bi.useEffect)(()=>{let{cellContextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.cellContextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().cellContextMenuVisibleFor]),{menuPortal:r}}function mS(){let o=Be(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=ao({portalContainer:Dn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l}=o;return l().contextMenu.onChange(c=>{if(!c)return;let{event:u}=c;function d(){i(),a.contextMenuVisibleFor=null}let{menu:p,cellContext:f,preventDefault:m}=dS(c,o,d),g={top:u.clientY,left:u.clientX},h=Pe.fromPoint(g);h.width+=vl,h.height+=vl,n(p,{constrainTo:Pn(l()),id:"table-context-menu",alignTo:h,alignPosition:pS}),m&&u.preventDefault(),a.contextMenuVisibleFor={point:g,...c};let{onContextMenu:y}=l();y&&y({...o,...f},u)})},[]),(0,bi.useEffect)(()=>{let{contextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.contextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().contextMenuVisibleFor]),{menuPortal:r}}var gS=require("react"),hS=B(require("react"));var Pl=require("react");function Dl(o,e){let{brain:t}=re(r=>({brain:r.state.brain})),n=(0,Pl.useCallback)(o,e);(0,Pl.useEffect)(()=>t.onScroll(n),[t,n])}var iu="yzx0vj0";function yS(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,gS.useRef)(null);Dl(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=ge.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ge.runtime.bodyWidth),n==="column"?l.minWidth=ge.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ge.runtime.bodyWidth),t==="column"?l.maxWidth=ge.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ge.runtime.bodyWidth),hS.createElement("div",{ref:a,...i,className:i.className?J(i.className,iu):iu,style:l},i.children)}var wI=te(oe.columnWidthAtIndex),RI=te(oe.columnOffsetAtIndex);function SS(){let{computedVisibleColumns:o}=re(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${wI}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${RI}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var xl="InfiniteTable";var bS=require("react");function TS(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=re(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,bS.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,y=(r&&r.length>0||i)&&h>0?h:null;return f!=y&&(t.rowsPerPage=y,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var xn=require("react");function II(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=te(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...ge,loaded:void 0,runtime:void 0}),o}function CS(o){if(!o)return{};let e=II(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var Ti=Se({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),wS="_143ofgf5",RS="_143ofgf3";var vI=te(ge.loaded),au={source:"infinite-table-page",target:"infinite-table-devtools-background"};function IS(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...au,url:lu(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...au,url:lu(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:CS(l.domRef.current),themeVarOverrides:{...ro.get(n)||{}}}}}var lu=mt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function PI(o){window.postMessage(o)}var DI=mt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){yt.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(IS({type:"update",debugId:e},t))}else sh(e),window.postMessage(IS({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,$e.onLogIntent("IT:*",e=>{PI({...au,url:lu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function vS(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=re(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(vI)!==`${qi}`&&di({debugId:i,key:"CSS001_CSS"}),(0,xn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),MI()}var El=Te(),xI={revertAll:o=>{let e=yt.get(o.debugId);if(e){let t=Xo.get(o.debugId);Xo.delete(o.debugId),To.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=wo.get(o.debugId);wo.delete(o.debugId),Co.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=yt.get(o.debugId);if(e){let t=o.property,n=To.get(o.debugId),r=Xo.get(o.debugId),i=Co.get(o.debugId),a=wo.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=wo.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=yt.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Zo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Zo(o.debugId))}}},discardAllWarnings:o=>{let e=yt.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Zo(o.debugId))},setColumnVisibility:o=>{_c(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{il(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{_c(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{il(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{il(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),ro.set(o.debugId,{...ro.get(o.debugId)||{},[o.name]:o.value}),Zo(o.debugId))},revertCssVar:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...ro.get(o.debugId)||{}};delete n[o.name],ro.set(o.debugId,n),Zo(o.debugId)},revertAllCssVars:o=>{let e=yt.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=ro.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),ro.delete(o.debugId),Zo(o.debugId)},highlight:o=>{let e=yt.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Ti.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ti.classNames.base),r.innerHTML=[`<div class="${RS}"></div>`,`<div class="${wS}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ti.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ti.classNames.variants.active.true)}}}}};function EI(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(DI(),El(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=xI[e];t&&t(o.data.payload)}})}EI();function MI(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=re(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=o().debugId,c=(0,xn.useRef)(s);return c.current=s,(0,xn.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=El.get();if(p){d(p);return}return El.onChange(f=>{f&&d(f)})},[]),(0,xn.useEffect)(()=>{let u=c.current;if(!u)return;let d=El.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,xn.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function PS(){let{masterPortalDOMRef:o}=Ai(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=re(n=>n.state.portalDOMRef);return o?.current??e?.current}var _t=B(require("react")),FS=require("react");var DS="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",xS=Se({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),ES="hs68h81",MS=Se({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});var En=B(require("react"));function AS(o){return En.createElement("div",{...o.domProps})}function _S(o){let{active:e}=o;return En.createElement("div",{className:ES},e?"Drop to group":"Drag columns to group")}function OS(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return En.createElement("div",{...o.domProps},o.label,En.createElement("div",{className:Li[1]}),En.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:DS,onKeyDown:e,onMouseDown:o.onClear},En.createElement(wl,{size:20})))}var AI=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Ee().addEventListener("mousemove",i,{once:!0}),Ee().addEventListener("mouseup",()=>{r||(Ee().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function _I(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=gn(),c=l===Cr,u=Be(),d=(e?rn(e.id,u,"grouping-toolbar"):r)??i,p=e?_t.createElement(Sa,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=_t.createElement(_t.Fragment,null,d,p),m=s===i&&l===Cr,g=J(xS({draggingInProgress:c,active:m}),o.domProps?.className),h=AI(a,o.domProps?.onMouseDown),y={...o.domProps,className:g,onMouseDown:h},S=n?.ToolbarItem??OS;return _t.createElement(S,{active:m,domProps:y,column:e,field:r,label:f,onClear:t})}var Cr="grouping-toolbar";function NS(o){let{groupBy:e}=Fe(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=re(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=po(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===Cr,u=a===Cr,d=o.components?.Placeholder??_S,p=o.components?.Host??AS,f=e.length?_t.createElement(_t.Fragment,null,e.map((T,b)=>{let C=T.field?l.get(T.field):void 0,w=`${T.field??`idx-${b}`}`;return _t.createElement(Wo.DraggableItem,{key:w,id:w},R=>_t.createElement(_I,{id:w,components:o.components,domProps:R,field:T.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(D=>D!==T).filter(Boolean);n.setGroupBy(v)}}))})):_t.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=T=>{let b=T.map(C=>e[C]);n.setGroupBy(b)},g=T=>{let{dragItemId:b}=T,C=b,w=s.get(C);if(!w||!w.field||!w.computedGroupable)return;let R=[...e];R.splice(T.dropIndex,0,{field:w.field}),n.setGroupBy(R)},h=(0,FS.useCallback)(T=>{let{computedColumnsMap:b}=t(),C=T.dragItem.id,w=b.get(C);return!(!w||!w.computedGroupable||e.some(R=>R.field===w.field))},[e]),y=o.orientation??"horizontal",{domProps:S}=o;return _t.createElement(Wo,{orientation:y,dragListId:Cr,acceptDropsFrom:["header",Cr],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:h},(T,{draggingInProgress:b,status:C})=>{let w=J(MS({active:c,orientation:y,draggingInProgress:b,dropRejected:C==="rejected"}),T.className,S?.className),R={...T,...S,className:w,children:f};return _t.createElement(p,{active:c,rejectDrop:C==="rejected",domProps:R,orientation:y})})}var Rr=B(require("react"));var Ml=require("react"),lo=require("react"),Al=B(require("react"));function LS(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return za(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var Io=B(require("react"));var kS=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var su=require("react");function OI(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function FI(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=qg(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(o,l),r.detailDataSourcesStateToRestore=a}function zS(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function VS(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),c={registerDetail:mt(u=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)});return}OI(e.id,{masterState:r(),detailContext:u}),requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)}),u.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&FI(e.id,{detailState:u.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return c.masterRowInfo=e,c.getMasterDataSourceState=r,c.getMasterState=a,c}function GS(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Fe(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=re(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,su.useMemo)(()=>zS(t.id,e),[e,t.id]),s=(0,su.useMemo)(()=>VS({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function HS(){return Eo()}var{rootClassName:NI}=ze,LI=`${NI}RowDetail`;function kI(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=GS({rowDetailsCache:a,rowInfo:r}),c=Ln(),[u]=Io.useState(()=>HS());return u.setSnapshot(l),Io.useLayoutEffect(()=>{u.notify()},[l]),Io.createElement(c.Provider,{value:u},Io.createElement("div",{ref:e,className:J(LI,kS({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${oe.bodyWidth} - ${oe.scrollbarWidthVertical})`,height:n}},t(r,s)))}var KS=Io.memo(kI);var zI=1;function BS(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:y,cellClassName:S,cellStyle:T,repaintCellsKey:b,rowStyle:C,rowDetailCache:w,rowClassName:R,onScrollToTop:v,onScrollToBottom:D,onScrollStop:I,scrollToBottomOffset:M,wrapRowsHorizontally:E,updatedAt:x,ready:P,editingCell:A}=re(L=>({actions:L.actions,getState:L.getState,getComputed:L.getComputed,getDataSourceMasterContext:L.getDataSourceMasterContext,rowHeight:L.state.rowHeight,rowDetailHeight:L.state.rowDetailHeight,onRowMouseEnter:L.state.onRowMouseEnter,onRowMouseLeave:L.state.onRowMouseLeave,groupRenderStrategy:L.state.groupRenderStrategy,brain:L.state.brain,showZebraRows:L.state.showZebraRows,rowDetailRenderer:L.state.rowDetailRenderer,isRowDetailsExpanded:L.state.isRowDetailExpanded,isRowDetailsEnabled:L.state.isRowDetailEnabled,cellClassName:L.state.cellClassName,cellStyle:L.state.cellStyle,repaintCellsKey:L.state.repaintCellsKey,rowStyle:L.state.rowStyle,rowDetailCache:L.state.rowDetailCache,rowClassName:L.state.rowClassName,onScrollToTop:L.state.onScrollToTop,onScrollToBottom:L.state.onScrollToBottom,onScrollStop:L.state.onScrollStop,scrollToBottomOffset:L.state.scrollToBottomOffset,wrapRowsHorizontally:L.state.wrapRowsHorizontally,updatedAt:L.state.updatedAt,ready:L.state.ready,editingCell:L.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:k,computedColumnsMap:O,computedColumnOrder:H,computedRowHeight:W,computedRowSizeCacheForDetails:z,fieldsToColumn:ee,rowspan:V,toggleGroupRow:$,columnSize:ie}=e,fe=(0,Ml.useMemo)(()=>k.map(L=>L.id),[k]),{dataArray:se,rowInfoStore:le,selectionMode:pe,cellSelection:ce,isNodeReadOnly:Y,getDataSourceState:q,dataSourceApi:j,dataSourceActions:X}=Fe(L=>({dataSourceApi:L.dataSourceApi,dataSourceActions:L.dataSourceActions,getDataSourceState:L.getDataSourceState,dataArray:L.dataSourceState.dataArray,rowInfoStore:L.dataSourceState.rowInfoStore,selectionMode:L.dataSourceState.selectionMode,cellSelection:L.dataSourceState.cellSelection,isNodeReadOnly:L.dataSourceState.isNodeReadOnly})),U=Ne(se);LS({columnSize:ie,brain:f,computedPinnedStartColumns:_,computedPinnedEndColumns:F,computedVisibleColumns:k,computedRowHeight:W,dataArray:se,bodySize:t,rowspan:V});let Q=(0,lo.useRef)(0);(0,lo.useEffect)(()=>f.onRenderCountChange(()=>{Q.current=f.scrollTopMax}),[f]),(0,lo.useEffect)(()=>f.onRenderRangeChange(L=>{i().onRenderRangeChange?.(L)}),[f]),(0,lo.useEffect)(()=>f.onScrollStop(L=>{let{scrollTop:N,scrollLeft:me}=L;if(N===0&&v?.(),N+(M??zI)>=Q.current){D?.();let{livePagination:be,livePaginationCursor:Oe,dataArray:Ke}=q();be&&(X.cursorId=Oe!==void 0?Date.now():Ke.length)}if(I){let be=f.getRenderRange();I({scrollTop:N,scrollLeft:me,renderRange:be,viewportSize:i().bodySize,firstVisibleRowIndex:be.start[0],lastVisibleRowIndex:be.end[0],firstVisibleColIndex:be.start[1],lastVisibleColIndex:be.end[1]})}}),[f,v,D,I]),(0,lo.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,lo.useEffect)(()=>{let{onReady:L}=i();L&&L({api:n,dataSourceApi:j})},[P]);let ae=(0,Ml.useMemo)(()=>({isNodeReadOnly:Y,selectionMode:pe,cellSelection:ce}),[Y,pe,ce]),he=(0,lo.useCallback)(L=>{let{rowIndex:N,colIndex:me,heightWithRowspan:Ae,domRef:ve,hidden:be,width:Oe,onMouseLeave:Ke,onMouseEnter:nt}=L,it=U()[N],et=k[me];if(!it||!et)return null;let qe=z?z.getRowHeight(N):Ae,K=!1;!y||typeof y=="function"&&!y(it)?K=!1:h&&(K=h(it)?"expanded":"collapsed");let ne=E?f.getRowIndexInPage(N):null,ye=E?f.getPageIndexForRow(N):null,Ce=n.isEditorVisibleForCell({rowIndex:N,columnId:et.id}),st={getData:U,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ne,horizontalLayoutPageIndex:ye,rowIndex:N,rowInfoStore:le,hidden:be,toggleGroupRow:$,rowHeight:qe,rowDetailState:K,onMouseEnter:nt,onMouseLeave:Ke,onRowMouseEnter:u,onRowMouseLeave:d,domRef:ve,width:Oe,column:et,columnsMap:O,fieldsToColumn:ee,rowStyle:C,rowClassName:R,cellStyle:T,cellClassName:S,repaintCellsKey:et.repaintCellsKey!==void 0?et.repaintCellsKey:b,visibleColumnIds:fe,computedColumnOrder:H,inEditMode:Ce,getDataSourceState:q,dataSourceApi:j,dataSourceActions:X,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:ae};return Al.createElement(Mf,{...st})},[s,c,u,d,z,W,h,U,k,O,ee,p,E,$,m,f,le,C,R,S,T,b,q,j,X,i,n,r,a,l,fe,H,x,A,ae]),ue=(0,Ml.useMemo)(()=>{if(h)return L=>{let{rowIndex:N,domRef:me}=L,ve=U()[N];if(!ve||!h(ve)||!z)return Al.createElement("div",{ref:me,className:nd.hidden});let{rowDetailHeight:be,rowHeight:Oe}=z.getSize(N);return Al.createElement(KS,{rowInfo:ve,rowDetailsCache:w,rowIndex:N,domRef:me,detailOffset:Oe,rowDetailHeight:be,rowDetailRenderer:g})}},[P,he,g,c,h,w]);return{renderCell:he,renderDetailRow:ue}}var WS=require("react");function jS(){let{state:o,getState:e,actions:t}=re(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Oo(n);(0,WS.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Vc(xl,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}var YS=B(require("react"));var US="_16lm1iw1 _16lm1iw1c _16lm1iwe";var $S=J(US,_s);function qS(o){return YS.createElement("div",{...o,className:o.className?J($S,o.className):$S})}var wr=B(require("react"));var XS={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},ZS="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",QS="qy58ya4";var{rootClassName:VI}=ze,cu=`${VI}-LoadMask`;function GI(o){let{visible:e,children:t="Loading"}=o;return wr.createElement("div",{className:`${XS[e?"visible":"hidden"]} ${cu}`},wr.createElement("div",{className:`${ZS} ${cu}-Overlay`}),wr.createElement("div",{className:`${QS} ${cu}-Text`},t))}var _l=wr.memo(GI);var JS=require("react");var HI=[wf,`${eo}--hovered`];function KI(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function Mn(o){let e=Be(),t=Mo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:y,rowDetailRenderer:S,showHoverRows:T,wrapRowsHorizontally:b,domProps:C,domRef:w,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:D}=re(z=>({ready:z.state.ready,columnReorderDragColumnId:z.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:z.state.forceBodyRerenderTimestamp,renderer:z.state.renderer,onRenderUpdater:z.state.onRenderUpdater,debugId:z.state.debugId,keyboardNavigation:z.state.keyboardNavigation,activeRowIndex:z.state.activeRowIndex,loadingText:z.state.loadingText,scrollStopDelay:z.state.scrollStopDelay,brain:z.state.brain,scrollerDOMRef:z.state.scrollerDOMRef,components:z.state.components,bodySize:z.state.bodySize,activeCellIndex:z.state.activeCellIndex,rowDetailRenderer:z.state.rowDetailRenderer,showHoverRows:z.state.showHoverRows,wrapRowsHorizontally:z.state.wrapRowsHorizontally,domProps:z.state.domProps,domRef:z.state.domRef,rowHoverClassName:z.state.rowHoverClassName})),I=g?.LoadMask??_l,M=n(),{computedRowHeight:E,computedRowSizeCacheForDetails:x}=M,P=x?.getRowHeight||E,{loading:A}=Fe(z=>({loading:z.dataSourceState.loading})),_=Rr.useCallback(z=>{let ee=e.getState(),V=z.target;if(!t&&z._from_row_detail)return;t&&(z._from_row_detail=!0);let $=rp(V,zc(),ee.domRef.current),ie,fe,se,le;$&&(fe=Number($.dataset.colIndex),le=Number($.dataset.rowIndex),ie=e.getComputed().computedVisibleColumns[fe].id,se=e.dataSourceApi.getRowInfoArray()[le].id);let pe={columnId:ie,colIndex:fe,rowId:se,rowIndex:le,event:z,target:$??z.target};$&&ee.cellContextMenu(pe),ee.contextMenu(pe)},[]),{renderCell:F,renderDetailRow:k}=BS({imperativeApi:r,getComputed:n,domRef:w,bodySize:h,computed:M}),{autoFocus:O,tabIndex:H}=C??{};jS();let W=(0,JS.useMemo)(()=>{if(!T)return;let z=[];return v&&(z=z.concat(v)),o.rowHoverClassName&&(z=z.concat(o.rowHoverClassName)),Mn.rowHoverClassName&&(z=z.concat(Mn.rowHoverClassName)),KI(z)},[T,v,o.rowHoverClassName,Mn.rowHoverClassName]);return Rr.createElement(qS,{onContextMenu:_},Rr.createElement(km,{forceRerenderTimestamp:R,debugId:l,tabIndex:H??0,autoFocus:O??void 0,activeRowIndex:D&&s==="row"?c:null,activeCellIndex:D&&s==="cell"&&!d?y:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:P,renderCell:F,renderDetailRow:S?k:void 0,cellHoverClassNames:W,scrollerDOMRef:m,scrollVarHostRef:w}),Rr.createElement(I,{visible:A},u))}Mn.rowHoverClassName=HI;function eb(){return re(o=>o.api)}function tb(o){return re(e=>e.api.getColumnApi(o))}var Zt=ze.rootClassName,{ManagedComponentContextProvider:BI}=Lt({initSetupState:Ih,forwardProps:vh,mapPropsToState:Eh,cleanup:Ph,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:xh(),getParentState:()=>Za(o=>o),debugName:o=>Uo(o.debugId,xl)}),ob=xe.memo(function(){let e=Ei(),{componentState:t,api:n,initialChildren:r}=re(O=>({componentState:O.state,api:O.api,initialChildren:O.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Fe(O=>({dataArrayLength:O.dataSourceState.dataArray.length,getDataSourceState:O.getDataSourceState,dataSourceActions:O.dataSourceActions,dataSourceApi:O.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:y,scrollStopDelay:S,brain:T,activeRowIndex:b,activeCellIndex:C}=t,{licenseKey:w}=t;!w&&so.licenseKey&&(w=so.licenseKey),ry(b,i,n),ny(C,i,n);let{onKeyDown:R}=Cy();xe.useEffect(()=>{let O=a(),H=Ft(W=>{O.notifyRenderRangeChange({renderStartIndex:W[0],renderEndIndex:W[1]})},{wait:S});return T.onVerticalRenderRangeChange(H)},[T,S]);let v=oy(w),{autoFocus:D,tabIndex:I,...M}=t.domProps??{},E=Ip(M);xe.useEffect(()=>{T.setScrollStopDelay(S),l.scrollStopDelayUpdatedByTable=S},[S]),Rg(),TS(),aS();let{menuPortal:x}=oS(),{menuPortal:P}=fS(),{menuPortal:A}=mS(),{menuPortal:_}=cS();xe.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(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let F=vS();xe.useEffect(()=>{if(e){let O=e.getSnapshot();u.current=O.getMasterState().portalDOMRef.current}},[]);let k=r??xe.createElement(xe.Fragment,null,xe.createElement(dc,null),xe.createElement(Mn,null));return xe.createElement("div",{"data-debug-id":F,onKeyDown:R,ref:c,...E},k,xe.createElement("div",{ref:u,className:J(`${gt}Portal`,rd[1e7],ki.absolute,td[0],Qu[0])},x,P,A,_),g?xe.createElement(Er,{key:"row-height",varName:g,onChange:d}):null,xe.createElement(Er,{key:"flashing-duration",allowInts:!0,varName:ge.components.Cell.flashingDuration,onChange:p}),h?xe.createElement(Er,{key:"row-detail-height",varName:h,onChange:f}):null,y?xe.createElement(Er,{key:"column-header-height",varName:y,onChange:m}):null,v?null:xe.createElement(ig,null),xe.createElement(iS,null))});function WI({children:o,store:e}){let{componentActions:t,componentState:n}=kt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Ne(n),l=Zh({state:n,actions:t,getState:a}),s=Ne(l),c=Ei(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=oo(),[m]=xe.useState(()=>Cg({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),xe.useLayoutEffect(()=>{e.notify()}),Ii(r,h=>{let y={width:h.width,height:h.height};t.bodySize=y},{earlyAttach:!0,debounce:50}),xe.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),xe.createElement(ob,null)}var so=function(o){let[e]=xe.useState(()=>iy()),t=ji();return xe.createElement(BI,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:gi,columnHeaderHeight:mi,...o},xe.createElement(ta,null,xe.createElement(t.Provider,{value:e},xe.createElement(WI,{children:o.children,store:e}))))};so.Header=dc;so.Body=Mn;so.HScrollSyncContent=yS;so.Footer=()=>xe.createElement(ad,null);so.GroupingToolbar=NS;var nb=B(require("react"));function jI(o){let{DataSource:e}=dr({nodesKey:"children",...o});return nb.createElement(e,null,o.children??null)}var rb=B(require("react"));var uu=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Qe(i,{treePaths:n});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(c)};function ib(o){return rb.createElement(so,{...o})}var Ol=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 n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=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,n(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=$e(`IT:${e}:DataQuery`)}};function An(o){if(Array.isArray(o))return o.map(An);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=An(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var vo=class vo{constructor(e){this.queryCache=new Z;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=An(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ol(`${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:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=An(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=An(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=An(e);this.queryCache.delete(t)};if(this.options=e,vo.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)}vo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=vo.clients.get(e);t&&t.destroy()}static destroyAll(){vo.clients.forEach(e=>{vo.destroy(e.name)})}destroy(){vo.clients.delete(this.options.name)}};vo.clients=new Map;var du=vo;var UI={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},ab={instantEdit:UI};var $I=require("react");function lb(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Nl=class Nl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Nl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Nl.DEFAULT_SIZE=10;var Fl=Nl;var kl=class kl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??kl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};kl.DEFAULT_SIZE=10;var Ll=kl;var _n=require("react"),YI=(o,e)=>o.every((t,n)=>t===e[n]),sb=(o,e)=>{let t=(0,_n.useRef)(e),n=YI(e,t.current),r=(0,_n.useRef)(!0);t.current=e;let i=(0,_n.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,_n.useRef)(o);l.current=o,(0,_n.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var en=require("react"),cb=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),zl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,en.useRef)(t),a=(0,en.useRef)(n),l=cb(t,i.current,r),s=!cb(n,a.current,r),c=(0,en.useRef)(!0);i.current=t,a.current=n;let u=(0,en.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,en.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,en.useEffect)(()=>{if(!c.current)return p.current()},d)};var Ot=B(require("react"));var ub=te(oe.currentFlashingDuration),qI=({children:o})=>Ot.createElement(Ot.Fragment,null,o),db=1e3,pb={up:oa({direction:"up"}).split(" "),down:oa({direction:"down"}).split(" "),neutral:oa({direction:"neutral"}).split(" ")},pu=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=qI}=o;return Ot.forwardRef((i,a)=>{let l=Ur(),{flashingDurationCSSVarValue:s}=re(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??db:e??db,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,y=Ot.useRef(!0),S=Ot.useRef(d),T=y.current?null:S.current;y.current=!1;let b=Ot.useRef(void 0),C=Ot.useRef(void 0),w=Ot.useRef(void 0);return zl(()=>{if(d===S.current)return;let R=()=>{let M=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),C.current&&M){let E=C.current,x=pb[E];M.classList.remove(...t?[t,...x]:x),M.style.removeProperty(ub),C.current=void 0}};S.current=d;let v=m.current;if(!v)return;R();let D=typeof d=="number"?d>T?"up":"down":"neutral",I=pb[D];return v.style.setProperty(ub,`${c}`),v.classList.add(...t?[t,...I]:I),C.current=D,b.current=setTimeout(R,c),R},{same:[h,g],different:[d]}),Ot.createElement("div",{ref:u,...i,className:J(i.className)},n({children:i.children,oldValue:T}))})},fb=pu();var ot=B(require("react")),Ir=require("react");var mb=require("react-dom");function gb(o){let[e,t]=ot.useState(null);return(0,Ir.useEffect)(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?ot.createElement(hb.Provider,{value:{getState:e}},ot.createElement(XI,null)):null}var hb=ot.createContext({getState:()=>null});function XI(){let o=ot.useContext(hb),{getState:e}=o,[,t]=$t(),n=e().renderer.cellManager;(0,Ir.useEffect)(()=>{let s=Ft(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,Ir.useRef)(null),l=(0,Ir.useRef)(null);return ot.createElement("div",{style:{overflow:"auto"}},(0,mb.createPortal)(ot.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),ot.createElement("table",{style:{borderCollapse:"collapse"}},ot.createElement("thead",null,ot.createElement("tr",null,i.map(s=>ot.createElement("th",{key:s,"data-col-index":s},s)))),ot.createElement("tbody",null,r.map(s=>ot.createElement("tr",{key:s,"data-row-index":s},i.map(c=>ot.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},ot.createElement("button",{onClick:()=>{let u=n.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var ZI={CheckBox:zo,LoadMask:_l,MenuIcon:Xr,StringFilterEditor:Un,NumberFilterEditor:$i};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterFunction,defaultFilterTypes,defaultTreeFilterFunction,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
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),"expired"):"valid"};var ew=o=>{let e="",t=o.split("|").map(l=>{let s=l.indexOf("="),c=s===-1?l:l.slice(0,s),u=s===-1?"":l.slice(s+1);return c==="C"&&(e=u),{name:c,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Xc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Xc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),JI(t)};function yy(o="",e){if(e.isDetail)return"valid";let t=hy(o,{publishedAt:1794927345478,version:"10.2.0"});return t==="invalid"&&!o?"missing":t}var by=(o="")=>{let t=!!Mo();return(0,Sy.useMemo)(()=>yy(o,{isDetail:t}),[o,t])};var hr=require("react");var tw=10;function Ty(o,e,t){let n=(0,hr.useRef)(!1),r=(0,hr.useRef)(null);(0,hr.useEffect)(()=>{o!=null&&(n.current=!1,Kt(r.current))},[o]),(0,hr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Kt(r.current),r.current=He(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<tw&&a(l)})};var i=a;a()}return()=>{Kt(r.current)}},[o,e])}var yr=require("react"),ow=10;function Cy(o,e,t){let n=(0,yr.useRef)(!1),r=(0,yr.useRef)(null);(0,yr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,yr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<ow&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function Ry(){return Eo()}var Sr=require("react");function Iy(o,e){o.getComputed().multiRowSelector.lastPointerDown={rowIndex:o.rowIndex,shiftKey:!!e.shiftKey},e.detail!==2&&void 0}var nw={Enter:!0," ":!0,a:!0};function wy(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,cloneRowSelection:i,cloneTreeSelection:a}=o,{key:l,ctrlKey:s,metaKey:c}=e;if(!nw[l])return!1;let u=t(),d=n(),{activeRowIndex:p,activeCellIndex:f,keyboardNavigation:m,keyboardSelection:g}=u,{selectionMode:h,rowSelection:S,treeSelectionState:y,isTree:T}=d;if(g===!1)return!1;let b=m==="row"&&p!=null?p:m==="cell"&&f!=null?f[0]:null;if(!(b!=null?d.dataArray[b]:null)||b==null)return!1;if(l===" "&&(h==="single-row"||h==="multi-row")){let C={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()};return ma({...o,rowIndex:b},C,"keyboard")}if(h!=="multi-row")return!1;if(l==="a"&&(s||c)){if(T&&y){let I=a(y);return I.selectAll(),r.treeSelection=I,!0}let C=i(S);return C.selectAll(),r.rowSelection=C,!0}return!1}var vy=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Py=o=>Array.from(o.querySelectorAll(vy)).filter(t=>!!t.offsetParent),hl=o=>o.querySelector(vy);var xy=H(an());async function Dy(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var rw=10,iw=(o,e)=>o-e;function yl(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=bt(p.id,e);return p.contentFocusable({column:p,...nr({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Zc(o,e,t){let n=t.getState().editingCell;return aw(o,e,t,{isCellFocusable:yl,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Ey(o,e,t){let n=(0,xy.default)(t,o+e,iw);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Ey;function aw(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,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(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Ey(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function My(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=yl(e,o)?e:Zc(e,-1,o);if(t){await Qc([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;hl(n)?.focus()}}async function Qc([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=rw,l=null,s=!1;function c(u=0){u++,Kt(l),l=He(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await Dy(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var lw=`.${oo}`;function Ay(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:Lo(n,lw),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:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&yl({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Zc({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Py(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return Qc([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;hl(u)?.focus()}),!0}var _y={control:"ctrl"},Oy={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},sw={esc:"escape"},Ny={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Ly=Object.keys(Ny),Jc=new Set(Ly),cw=new Set(["shift","alt"]);function Sl(o,e){return Array.isArray(e)?e.some(t=>Fy(o,t)):Fy(o,e)}function Fy(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Oy[p]),i=n.map(p=>_y[p]||Oy[p]||sw[p]||p),a=i.filter(p=>Jc.has(p)),l=i.filter(p=>!Jc.has(p)),s=Ly.reduce((p,f)=>(p[f]=Ny[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!cw.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Jc.has(t)||t==="meta"||_y[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function ky(o,e){let t={...o,cloneRowSelection:a=>or(a,o.getDataSourceState),cloneTreeSelection:a=>tr(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&wy(t,e)&&e.preventDefault(),(Ay(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Lg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!Sl(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function uw(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=no();return(0,Sr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>tr(u,i),cloneRowSelection:u=>or(u,i)}),[o,e,i,a,t,l,n])}function dw(){let o=uw();(0,Sr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{ky(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=bt(s.id,o);Sf({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=bt(u.id,o);Iy({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function pw(){let{getState:o}=oe(t=>({getState:t.getState}));return{onKeyDown:(0,Sr.useCallback)(t=>{o().keyDown(t)},[])}}function zy(){return dw(),pw()}var iu=require("react");var Be=H(require("react")),_t=require("react"),Wy=require("react-dom");var bl="__is_infinite_menu_component";function eu(o){return!!o.tagName}function Hy(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=De.from(eu(e)?e.getBoundingClientRect():e),a=De.from(eu(t)?t.getBoundingClientRect():t),l=n?De.from(eu(n)?n.getBoundingClientRect():n):null;if(!l)return{...Vy({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Vy({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Vy(o){let e=De.from(o.targetRect),t=De.from(o.anchorRect),n=o.constrainRect?De.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Gy(e,i),s=Gy(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Gy(o,e){return e==="TopLeft"?je.from({top:o.top,left:o.left}):e==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?je.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}function fw(o){return o&&typeof o.then=="function"||o instanceof Promise}function Tl(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Ky(o){return typeof o=="function"&&(o=o()),fw(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&Tl(o)&&(o=o.getBoundingClientRect()),o?De.from(o):null}async function By(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),Tl(n)&&(r=n),r||null}return t(await e)}async function Cl(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Ky(t)||void 0,a=n?await Ky(n):void 0,l=De.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Hy({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function mw(o){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function gw(o){let e=Be.useRef(null);return(0,_t.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&Cl(e.current,t)}),[o.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,_t.useCallback)(t=>{t&&Cl(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function jy(o,e){let[t,n]=(0,_t.useState)(null);(0,_t.useLayoutEffect)(()=>{async function a(){let l=e?await By(e):null;l!=null&&n(l)}e&&a()},[e]);let r=typeof e=="function"?e():null,i=Tl(r)?r:t;return e?i?(0,Wy.createPortal)(o,i):Be.createElement(Be.Fragment,null):e===null||e===!1?o:Be.createElement(mw,null,o)}function hw(o){if(Be.Children.count(o)===1){let e=Be.Children.only(o);if(Be.isValidElement(e))return e.props.id||e.key}return null}function yw(o,e,t){if(Be.Children.count(o)===1){let n=Be.Children.only(o);if(Be.isValidElement(n)&&n.type[bl]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(n,r)}}return o}function lo(o){let e=o,[t]=(0,_t.useState)(()=>new Map),[n,r]=(0,_t.useState)(null),[i,a]=(0,_t.useState)(0),l=(0,_t.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(Be.createElement(gw,{...h,key:h.key}));return m},[]),[s,c]=qt(),u=jy(l(),o.portalContainer),d=(0,_t.useCallback)((m,g)=>{let S=`${g.id||hw(m)||Vt()}`,y=t.get(S),T=C=>()=>{let I=typeof C=="function"?C():C;return yw(I,e.portalContainer,g.constrainTo??e.constrainTo)},b=T(m),R=(C,I)=>{if(!y)return;let w=T(C);Object.assign(y,{children:w}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),R(m),R):(y={key:S,children:b,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Ce()},t.set(y.key,y),c(),R)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var mS=H(require("react"));var Cr=H(require("react"));var rS=H(require("react"));var oS=H(require("react"));function Rl(o){return null}Rl.defaultProps={__is_menu_item:!0};var Uy="submenu",Sw="-";function $y(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Vt(),focused:!1,destroyed:!1,domRef:{current:null}}}function Yy(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var tu=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===Sw?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},bw=[{name:"label"}],qy=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:c}=t,u=t.id||n.generatedId;c&&(u=`${c}-${u}`);let d=[...t.columns||bw],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:u},f=[];a?f=a.map(g=>tu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==Uy)&&d.push({name:Uy,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:u}};var br=H(require("react"));var Xy="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Zy=Se({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Qy="db3arf1",Jy="db3arfd";function eS(){return br.createElement("hr",{className:Jy})}var Il={renderSeparator:()=>br.createElement(eS,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?br.createElement("div",{...o},br.createElement(pn,{expanded:!1})):br.createElement("div",{...o})};var tS=(o,e)=>tu(o,e,Il);function nS(o,e){return oS.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Rl)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),tS(o,n)}return tS(o,t)})||[]}function iS(){return{...$y(),domRef:rS.createRef()}}var aS=()=>Yy(),lS=o=>qy(o,{...Il,childrenToRuntimeItems:nS});var $t=H(require("react")),ht=require("react");function sS(o,e){let t=cS(o,e);if(!t.length)return null;let n=De.from(t[0]?.getBoundingClientRect()),r=De.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function cS(o,e){let t=Lo(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function uS(o,e){let t=cS(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}var yi=class extends Xn{constructor(e){super(e.slice(0,3))}};var Tw=250;function Cw(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}He(i)};He(()=>{i()})})}var Rw=Fe(),wl=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||Tw;this.getPointerMoveTarget=()=>document.documentElement||Rw;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 je({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new yi([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new yi([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,Cw(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.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 vl=require("react"),ou=(0,vl.createContext)(null);function nu(){return(0,vl.useContext)(ou)}var Tr=require("react");function dS(){let o=(0,Tr.useRef)(!0);return(0,Tr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,Tr.useCallback)(()=>o.current,[])}function Iw(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),$t.createElement(Yt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function ww({onItemActivate:o}){let{getState:e}=nu(),[{onItemEnter:t,onItemLeave:n}]=(0,ht.useState)(()=>new wl({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(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?De.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ht.useCallback)(t,[]),onItemLeave:(0,ht.useCallback)(n,[])}}function pS(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:S}=nu(),y=(0,ht.useCallback)(N=>{h.keyboardActiveItemKey=N},[]),T=(0,ht.useCallback)(N=>{h.activeItemKey=N},[]),b=dS(),[R,C]=(0,ht.useState)(null),I=null;(0,ht.useLayoutEffect)(()=>{let{runtimeItems:N}=S(),K=N.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!K||!K.menu){C(null),E();return}if(K){let ae=sS(r,K.key);ae&&v(()=>Iw(K,{constrainTo:l,setSubmenuApi:C,setActiveItemKey:T,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:B,api:Y}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(N,K)=>{y(K.key),T(K.key),K.originalMenuItem.onClick&&K.originalMenuItem.onClick(N);let ae={key:K.key,item:K.originalMenuItem,hideMenu:B};K.originalMenuItem.onAction&&K.originalMenuItem.onAction(ae),c&&c(ae),K.originalMenuItem.hideMenuOnAction&&B()},{showOverlay:v,portal:P,clearAll:E}=lo({portalContainer:!1}),{onItemEnter:M,onItemLeave:D}=ww({onItemActivate:N=>{if(!b())return;let K=N?N.key:null;T(K)}});I=n.map((N,K)=>$t.createElement(vw,{key:N.type==="item"?N.key:K,onItemEnter:(ae,re)=>{M(ae.key,re)},onItemLeave:(ae,re)=>{D(ae.key,re)},columns:t,active:N.type==="item"&&N.key===i,keyboardActive:N.type==="item"&&N.key===a,item:N,index:K,onClick:w}));let x=t.map(N=>N.width||(typeof N.flex=="number"?`${N.flex}fr`:N.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:x,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(A.whiteSpace="nowrap");function O(N){let{runtimeItems:K,runtimeSelectableItems:ae}=S(),re=K.findIndex(U=>U.type==="item"&&U.key===a),ue=a,fe=K[re],be={ArrowUp:()=>{let U=K.slice(0,re).filter(ie=>ie.type==="item"&&!ie.disabled).pop();U&&U.type==="item"&&U.key&&(ue=U.key)},ArrowDown:()=>{let U=K.slice(re+1).filter(ie=>ie.type==="item"&&!ie.disabled)[0];U&&U.type==="item"&&U.key&&(ue=U.key)},Home:()=>{be.PageUp()},End:()=>{be.PageDown()},PageUp:()=>{ue=ae[0].key},PageDown:()=>{ue=ae[ae.length-1].key},ArrowLeft:()=>{T(null),S().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{fe&&(T(fe.key),He(()=>{b()&&R&&R.getParentMenuId()===S().menuId&&R.focus()}))},Enter:()=>{if(fe)if(fe.originalMenuItem?.menu){if(fe&&fe.originalMenuItem.menu&&R){be.ArrowLeft();return}fe&&T(fe.key)}else w(N,fe)}," ":()=>{if(!fe)return;fe.originalMenuItem.menu||w(N,fe);let U=uS(r,fe.key);U&&U.click()},Escape:()=>{be.ArrowLeft();let U=S();U.parentMenuId||U.onHideIntent?.(U)}},de=be[N.key];de&&(de(),N.preventDefault()),ue!=a&&y(ue)}function F(){h.focused=!1}let z=(0,ht.useCallback)(function(){h.focused=!0,setTimeout(()=>{L.current&&g.current&&g.current===document.activeElement&&S().keyboardActiveItemKey==null&&y(S().runtimeSelectableItems[0]?.key??null)})},[]),L=(0,ht.useRef)(!0),B=(0,ht.useCallback)(()=>{let N=S();N.onHideIntent?.(N)},[S]),[Y]=(0,ht.useState)(()=>({hideMenu:B,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),z())},getMenuId:()=>S().menuId,getParentMenuId:()=>S().parentMenuId})),V=(0,ht.useCallback)(N=>{N?(g.current=N,d?.(S(),Y),f&&Y.focus()):(p?.(S()),g.current=N)},[]),W=$t.createElement("div",{className:Gn.contents},$t.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:V,onKeyDown:N=>{e.onKeyDown?.(N),O(N)},onMouseDown:N=>{L.current=!1,e.onMouseDown?.(N)},onMouseUp:N=>{L.current=!0,e.onMouseUp?.(N)},onFocus:z,onBlur:F,className:X(Xy,e.className,"InfiniteMenu"),style:A},I),P);return s?null:W}function vw(o){let[e,t]=$t.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=$t.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"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:X(Zy({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?$t.createElement(Yr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:y}}):$t.createElement("div",{key:`${s}-${m}`,...y},f[m])}).filter(Boolean)}return $t.createElement("div",{className:Qy},c)}var{ManagedComponentContextProvider:Pw}=kt({initSetupState:iS,forwardProps:aS,mapPropsToState:lS,layoutEffect:!0});function Dw(o){let{componentActions:e,componentState:t}=zt(),n=Le(t);return Cr.createElement(ou.Provider,{value:{componentActions:e,componentState:t,getState:n}},Cr.createElement(pS,{domProps:o.domProps}))}function Yt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:S,...y}=o;return Cr.createElement(Pw,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Cr.createElement(Dw,{domProps:y}))}Yt[bl]=!0;var ru=H(require("react"));function fS(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a,getState:l}=e,s=l().components?.CheckBox||zo,u=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...u,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:ru.createElement(s,{key:m.id,disabled:m.computedVisible&&i.getVisibleColumnsCount()===1,checked:m.computedVisible,onChange:S=>{let y=!!S;i.setVisibilityForColumn(m.id,y),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}},"-",{key:"group-by",label:"Group by",menu:()=>{let p=[];return r().computedColumnsMapInInitialOrder.forEach((m,g)=>{if(m.groupByForColumn)return;let h=rn(m,e,"column-menu");p.push({key:g,label:h,check:ru.createElement(s,{key:m.id,disabled:!m.computedGroupable,checked:m.computedGroupedBy,onChange:()=>{a.toggleGroupByField(m.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:p}}}].filter(p=>!!p)}function gS(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Yt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:bt(s.id,e),...e},u=fS([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:mS.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}function hS(o){return typeof o=="function"?o():o}function Dn(o){return hS(o.menuConstrainTo)??o.domRef.current}function yS(o,e,t){return e?()=>hS(e)??(t||o().portalDOMRef.current):t||!1}var SS=require("react");function xn(){let{getState:o,menuPortalContainer:e}=oe(r=>({getState:r.getState,menuPortalContainer:r.state.menuPortalContainer})),{portalDOMRef:t}=Ai(r=>({portalDOMRef:r.getMasterState().portalDOMRef}))||{},n=t?.current;return(0,SS.useMemo)(()=>yS(o,e,n),[o,e,n])}var xw=`[${qr["data-name"]}="${Xr["data-name"]}"]`;function Ew(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${mg["data-column-id"]}="${e}"] ${xw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>gS(e,t,c),{constrainTo:Dn(i()),id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function bS(){let o=Ke(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=oe(s=>({getState:s.getState,actions:s.actions,columnMenuVisibleForColumnId:s.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:s.state.columnMenuVisibleKey})),{showOverlay:i,portal:a,clearAll:l}=lo({portalContainer:xn()});return(0,iu.useEffect)(()=>{let s=e();return s.onColumnMenuClick.onChange(c=>{c&&(s.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,iu.useEffect)(()=>{let{columnMenuVisibleForColumnId:s,columnMenuTargetRef:c}=e();if(s){let d=function(p){p.__insideMenu!==!0&&(l(),t.columnMenuVisibleForColumnId=null)};var u=d;return document.documentElement.addEventListener("mousedown",d),Ew({columnId:s,context:o,clearAll:l,showOverlay:i}),()=>{document.documentElement.removeEventListener("mousedown",d)}}else c.current=null,l();return()=>{}},[n,r]),{menuPortal:a}}var TS=H(require("react")),CS=require("react");var Mw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function RS(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=no(),{focusDetectDOMRef:s}=o(),c=(0,CS.useCallback)(async()=>{My({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return TS.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:Mw})}var Rr=require("react");function Aw(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,Rr.useEffect)(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function _w(){let o=Ke(),{getState:e,editingCell:t}=oe(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Rr.useEffect)(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ci(o,i);if(!a){ui("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function Ow(){let o=Ke(),{editingCell:e}=oe(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Oo(t);(0,Rr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function Fw(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Rr.useEffect)(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ci(o,i);s?r({...s,value:a,initialValue:l}):ui("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function Nw(){let o=Ke(),{editingCell:e,getState:t}=oe(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,Rr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ci(o,r);if(!s){ui(l,r);return}let c={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...c,error:n}):a?.(c)}},[n])}function IS(){Aw(),_w(),Fw(),Nw(),Ow()}var su=require("react");var Jo=H(require("react"));var au=H(require("react"));var Pl=o=>au.createElement(Ve,{...o,icon:"clear"},au.createElement("path",{d:Ge.clear[0]}));var lu=H(require("react"));var wS=o=>lu.createElement(Ve,{...o,icon:"done"},lu.createElement("path",{d:Ge.done[0]}));function vS(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Yt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),S=h[f.computedFilterType];if(!S)return null;let y=S.operators.map(I=>{let w=I.name,v=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===S.defaultOperator,P=I.components?.Icon??Bn;return{key:w,icon:Jo.createElement(P,null),label:Jo.createElement(Jo.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(o,w)},checked:v?Jo.createElement(wS,{size:16}):null}}),b=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Jo.createElement(Pl,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],R={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},C=d?d(b,R):b;return Jo.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:C,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Dl=10;function PS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,su.useEffect)(()=>e().onFilterOperatorMenuClick.onChange(l=>{if(!l)return;let{target:s,column:c}=l;function u(){i(),t.filterOperatorMenuVisibleForColumnId=null}let d=s?.parentElement||s,p=De.from(d.getBoundingClientRect());p.top-=Dl,p.left-=Dl,p.width+=2*Dl,p.height+=2*Dl,n(()=>vS(c.id,o,u),{constrainTo:Dn(e()),id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.columnMenuVisibleForColumnId=null,t.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,su.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.filterOperatorMenuVisibleForColumnId=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().filterOperatorMenuVisibleForColumnId]),{menuPortal:r}}var bi=require("react");var du=H(require("react"));var cu=H(require("react"));function Si(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function xl(o){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),o.onHideIntent?.()}}}function uu(o,e,t){if(!o)return null;let n=Ce();return o.then(r=>{let{items:i,columns:a}=Si(r);i&&i.length&&n(cu.createElement(t,{...e,items:i||[],columns:a}))}),cu.createElement(jo,{updater:n})}function DS(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Yt,{computedColumnsMap:d}=a(),p=d.get(n),f={...to({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=xl({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:uu(g,m,u),preventDefault:h};let{items:S,columns:y}=Si(g);return!S||!S.length?{cellContext:f,menu:null,preventDefault:Array.isArray(S)}:{preventDefault:h,menu:du.createElement(u,{...m,columns:y,items:S}),cellContext:f}}function xS(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Yt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...to({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=xl({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:uu(p,d,l),preventDefault:f};let{items:m,columns:g}=Si(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:du.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var El=5,ES=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function MS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l,getDataSourceState:s}=o;return l().cellContextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){i(),a.cellContextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=DS(u,o,p),h=De.fromPoint({top:d.clientY,left:d.clientX});h.width+=El,h.height+=El,n(f,{constrainTo:Dn(l()),id:"cell-context-menu",alignTo:h,alignPosition:ES}),g&&d.preventDefault(),a.cellContextMenuVisibleFor={columnId:u.columnId,rowId:u.rowId,rowIndex:u.rowIndex,colIndex:u.colIndex};let{onCellContextMenu:S}=l();S&&S({...m,getState:l,getDataSourceState:s},d)})},[]),(0,bi.useEffect)(()=>{let{cellContextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.cellContextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().cellContextMenuVisibleFor]),{menuPortal:r}}function AS(){let o=Ke(),{getState:e,actions:t}=o,{showOverlay:n,portal:r,clearAll:i}=lo({portalContainer:xn()});return(0,bi.useEffect)(()=>{let{actions:a,getState:l}=o;return l().contextMenu.onChange(c=>{if(!c)return;let{event:u}=c;function d(){i(),a.contextMenuVisibleFor=null}let{menu:p,cellContext:f,preventDefault:m}=xS(c,o,d),g={top:u.clientY,left:u.clientX},h=De.fromPoint(g);h.width+=El,h.height+=El,n(p,{constrainTo:Dn(l()),id:"table-context-menu",alignTo:h,alignPosition:ES}),m&&u.preventDefault(),a.contextMenuVisibleFor={point:g,...c};let{onContextMenu:S}=l();S&&S({...o,...f},u)})},[]),(0,bi.useEffect)(()=>{let{contextMenuVisibleFor:a}=e();if(a){let s=function(c){c.__insideMenu!==!0&&(i(),t.contextMenuVisibleFor=null)};var l=s;return document.documentElement.addEventListener("mousedown",s),()=>{document.documentElement.removeEventListener("mousedown",s)}}else i();return()=>{}},[e().contextMenuVisibleFor]),{menuPortal:r}}var _S=require("react"),OS=H(require("react"));var Ml=require("react");function Al(o,e){let{brain:t}=oe(r=>({brain:r.state.brain})),n=(0,Ml.useCallback)(o,e);(0,Ml.useEffect)(()=>t.onScroll(n),[t,n])}var pu="yzx0vj0";function FS(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,_S.useRef)(null);Al(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=he.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=he.runtime.bodyWidth),n==="column"?l.minWidth=he.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=he.runtime.bodyWidth),t==="column"?l.maxWidth=he.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=he.runtime.bodyWidth),OS.createElement("div",{ref:a,...i,className:i.className?X(i.className,pu):pu,style:l},i.children)}var Lw=Q(J.columnWidthAtIndex),kw=Q(J.columnOffsetAtIndex);function NS(){let{computedVisibleColumns:o}=oe(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${Lw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${kw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var _l="InfiniteTable";var LS=require("react");function kS(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=oe(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,LS.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,S=(r&&r.length>0||i)&&h>0?h:null;return f!=S&&(t.rowsPerPage=S,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var En=require("react");function zw(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=Q(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...he,loaded:void 0,runtime:void 0}),o}function zS(o){if(!o)return{};let e=zw(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var Ti=Se({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),VS="_143ofgf5",GS="_143ofgf3";var Vw=Q(he.loaded),fu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function HS(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...fu,url:mu(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...fu,url:mu(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:zS(l.domRef.current),themeVarOverrides:{...io.get(n)||{}}}}}var mu=yt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Gw(o){window.postMessage(o)}var Hw=yt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ct.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(HS({type:"update",debugId:e},t))}else Ph(e),window.postMessage(HS({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ye.onLogIntent("IT:*",e=>{Gw({...fu,url:mu(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function KS(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=oe(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Vw)!==`${qi}`&&di({debugId:i,key:"CSS001_CSS"}),(0,En.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),Ww()}var Ol=Ce(),Kw={revertAll:o=>{let e=Ct.get(o.debugId);if(e){let t=Xo.get(o.debugId);Xo.delete(o.debugId),Co.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Io.get(o.debugId);Io.delete(o.debugId),Ro.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ct.get(o.debugId);if(e){let t=o.property,n=Co.get(o.debugId),r=Xo.get(o.debugId),i=Ro.get(o.debugId),a=Io.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ct.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Zo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Zo(o.debugId))}}},discardAllWarnings:o=>{let e=Ct.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Zo(o.debugId))},setColumnVisibility:o=>{zc(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{cl(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{zc(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{cl(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{cl(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),io.set(o.debugId,{...io.get(o.debugId)||{},[o.name]:o.value}),Zo(o.debugId))},revertCssVar:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...io.get(o.debugId)||{}};delete n[o.name],io.set(o.debugId,n),Zo(o.debugId)},revertAllCssVars:o=>{let e=Ct.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=io.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),io.delete(o.debugId),Zo(o.debugId)},highlight:o=>{let e=Ct.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Ti.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ti.classNames.base),r.innerHTML=[`<div class="${GS}"></div>`,`<div class="${VS}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ti.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ti.classNames.variants.active.true)}}}}};function Bw(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Hw(),Ol(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=Kw[e];t&&t(o.data.payload)}})}Bw();function Ww(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=oe(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=o().debugId,c=(0,En.useRef)(s);return c.current=s,(0,En.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Ol.get();if(p){d(p);return}return Ol.onChange(f=>{f&&d(f)})},[]),(0,En.useEffect)(()=>{let u=c.current;if(!u)return;let d=Ol.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,En.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function BS(){let{masterPortalDOMRef:o}=Ai(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=oe(n=>n.state.portalDOMRef);return o?.current??e?.current}var Ot=H(require("react")),Fl=require("react");var WS="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",jS=Se({defaultClassName:"hs68h8e _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),US="hs68h81",$S=Se({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});var Mn=H(require("react"));function YS(o){return Mn.createElement("div",{...o.domProps})}function qS(o){let{active:e}=o;return Mn.createElement("div",{className:US},e?"Drop to group":"Drag columns to group")}function XS(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Mn.createElement("div",{...o.domProps},o.label,Mn.createElement("div",{className:Li[1]}),Mn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:WS,onKeyDown:e,onMouseDown:o.onClear},Mn.createElement(Pl,{size:20})))}var jw=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Fe().addEventListener("mousemove",i,{once:!0}),Fe().addEventListener("mouseup",()=>{r||(Fe().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function Uw(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s,dragListId:c}=hn(),u=l===c,d=Ke(),p=(e?rn(e.id,d,"grouping-toolbar"):r)??i,f=e?Ot.createElement(Ta,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,m=Ot.createElement(Ot.Fragment,null,p,f),g=s===i&&l===c,h=X(jS({draggingInProgress:u,active:g}),o.domProps?.className),S=jw(a,o.domProps?.onMouseDown),y={...o.domProps,className:h,onMouseDown:S},T=n?.ToolbarItem??XS;return Ot.createElement(T,{active:g,domProps:y,column:e,field:r,label:m,onClear:t})}function ZS(o){let{groupBy:e}=Ne(C=>({groupBy:C.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=oe(C=>({getComputed:C.getComputed,dataSourceApi:C.dataSourceApi,api:C.api})),{dropTargetListId:i,dragSourceListId:a}=fo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=cn(na),u=cn(oa),d=(0,Fl.useMemo)(()=>[u,c],[u,c]),p=i===c,f=a===c,m=o.components?.Placeholder??qS,g=o.components?.Host??YS,h=e.length?Ot.createElement(Ot.Fragment,null,e.map((C,I)=>{let w=C.field?l.get(C.field):void 0,v=`${C.field??`idx-${I}`}`;return Ot.createElement(Wo.DraggableItem,{key:v,id:v},P=>Ot.createElement(Uw,{id:v,components:o.components,domProps:P,field:C.field,column:w,toggleSorting:()=>{w&&r.toggleSortingForColumn(w.id)},onClear:()=>{let E=e.filter(M=>M!==C).filter(Boolean);n.setGroupBy(E)}}))})):Ot.createElement(m,{draggingInProgress:f,active:p,groupBy:e}),S=C=>{let I=C.map(w=>e[w]);n.setGroupBy(I)},y=C=>{let{dragItemId:I}=C,w=I,v=s.get(w);if(!v||!v.field||!v.computedGroupable)return;let P=[...e];P.splice(C.dropIndex,0,{field:v.field}),n.setGroupBy(P)},T=(0,Fl.useCallback)(C=>{let{computedColumnsMap:I}=t(),w=C.dragItem.id,v=I.get(w);return!(!v||!v.computedGroupable||e.some(P=>P.field===v.field))},[e]),b=o.orientation??"horizontal",{domProps:R}=o;return Ot.createElement(Wo,{orientation:b,dragListId:c,acceptDropsFrom:d,onDrop:S,dragStrategy:"inline",onAcceptDrop:y,shouldAcceptDrop:T},(C,{draggingInProgress:I,status:w})=>{let v=X($S({active:p,orientation:b,draggingInProgress:I,dropRejected:w==="rejected"}),C.className,R?.className),P={...C,...R,className:v,children:h};return Ot.createElement(g,{active:p,rejectDrop:w==="rejected",domProps:P,orientation:b})})}var wr=H(require("react"));var Nl=require("react"),so=require("react"),Ll=H(require("react"));function QS(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Ka(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var vo=H(require("react"));var JS=Se({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var gu=require("react");function $w(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function Yw(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=fh(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(o,l),r.detailDataSourcesStateToRestore=a}function eb(o,e){let t={current:!1};return{currentRowCache:{getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)},cacheCalledByRowDetailRenderer:t}}function tb(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),c={registerDetail:yt(u=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)});return}$w(e.id,{masterState:r(),detailContext:u}),requestAnimationFrame(()=>{u.dataSourceState.destroyedRef.current||(u.dataSourceActions.stateReadyAsDetails=!0)}),u.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&Yw(e.id,{detailState:u.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return c.masterRowInfo=e,c.getMasterDataSourceState=r,c.getMasterState=a,c}function ob(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Ne(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=oe(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,gu.useMemo)(()=>eb(t.id,e),[e,t.id]),s=(0,gu.useMemo)(()=>tb({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function nb(){return Eo()}var{rootClassName:qw}=ze,Xw=`${qw}RowDetail`;function Zw(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=ob({rowDetailsCache:a,rowInfo:r}),c=kn(),[u]=vo.useState(()=>nb());return u.setSnapshot(l),vo.useLayoutEffect(()=>{u.notify()},[l]),vo.createElement(c.Provider,{value:u},vo.createElement("div",{ref:e,className:X(Xw,JS({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${J.bodyWidth} - ${J.scrollbarWidthVertical})`,height:n}},t(r,s)))}var rb=vo.memo(Zw);var Qw=1;function ib(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:S,cellClassName:y,cellStyle:T,repaintCellsKey:b,rowStyle:R,rowDetailCache:C,rowClassName:I,onScrollToTop:w,onScrollToBottom:v,onScrollStop:P,scrollToBottomOffset:E,wrapRowsHorizontally:M,updatedAt:D,ready:x,editingCell:A}=oe(k=>({actions:k.actions,getState:k.getState,getComputed:k.getComputed,getDataSourceMasterContext:k.getDataSourceMasterContext,rowHeight:k.state.rowHeight,rowDetailHeight:k.state.rowDetailHeight,onRowMouseEnter:k.state.onRowMouseEnter,onRowMouseLeave:k.state.onRowMouseLeave,groupRenderStrategy:k.state.groupRenderStrategy,brain:k.state.brain,showZebraRows:k.state.showZebraRows,rowDetailRenderer:k.state.rowDetailRenderer,isRowDetailsExpanded:k.state.isRowDetailExpanded,isRowDetailsEnabled:k.state.isRowDetailEnabled,cellClassName:k.state.cellClassName,cellStyle:k.state.cellStyle,repaintCellsKey:k.state.repaintCellsKey,rowStyle:k.state.rowStyle,rowDetailCache:k.state.rowDetailCache,rowClassName:k.state.rowClassName,onScrollToTop:k.state.onScrollToTop,onScrollToBottom:k.state.onScrollToBottom,onScrollStop:k.state.onScrollStop,scrollToBottomOffset:k.state.scrollToBottomOffset,wrapRowsHorizontally:k.state.wrapRowsHorizontally,updatedAt:k.state.updatedAt,ready:k.state.ready,editingCell:k.state.editingCell})),{computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedVisibleColumns:z,computedColumnsMap:L,computedColumnOrder:B,computedRowHeight:Y,computedRowSizeCacheForDetails:V,fieldsToColumn:W,rowspan:N,toggleGroupRow:K,columnSize:ae}=e,re=(0,Nl.useMemo)(()=>z.map(k=>k.id),[z]),{dataArray:ue,rowInfoStore:fe,selectionMode:be,cellSelection:de,isNodeReadOnly:U,getDataSourceState:ie,dataSourceApi:ge,dataSourceActions:Z}=Ne(k=>({dataSourceApi:k.dataSourceApi,dataSourceActions:k.dataSourceActions,getDataSourceState:k.getDataSourceState,dataArray:k.dataSourceState.dataArray,rowInfoStore:k.dataSourceState.rowInfoStore,selectionMode:k.dataSourceState.selectionMode,cellSelection:k.dataSourceState.cellSelection,isNodeReadOnly:k.dataSourceState.isNodeReadOnly})),ee=Le(ue);QS({columnSize:ae,brain:f,computedPinnedStartColumns:O,computedPinnedEndColumns:F,computedVisibleColumns:z,computedRowHeight:Y,dataArray:ue,bodySize:t,rowspan:N});let j=(0,so.useRef)(0);(0,so.useEffect)(()=>f.onRenderCountChange(()=>{j.current=f.scrollTopMax}),[f]),(0,so.useEffect)(()=>f.onRenderRangeChange(k=>{i().onRenderRangeChange?.(k)}),[f]),(0,so.useEffect)(()=>f.onScrollStop(k=>{let{scrollTop:_,scrollLeft:me}=k;if(_===0&&w?.(),_+(E??Qw)>=j.current){v?.();let{livePagination:Re,livePaginationCursor:Me,dataArray:qe}=ie();Re&&(Z.cursorId=Me!==void 0?Date.now():qe.length)}if(P){let Re=f.getRenderRange();P({scrollTop:_,scrollLeft:me,renderRange:Re,viewportSize:i().bodySize,firstVisibleRowIndex:Re.start[0],lastVisibleRowIndex:Re.end[0],firstVisibleColIndex:Re.start[1],lastVisibleColIndex:Re.end[1]})}}),[f,w,v,P]),(0,so.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,so.useEffect)(()=>{let{onReady:k}=i();k&&k({api:n,dataSourceApi:ge})},[x]);let se=(0,Nl.useMemo)(()=>({isNodeReadOnly:U,selectionMode:be,cellSelection:de}),[U,be,de]),ne=(0,so.useCallback)(k=>{let{rowIndex:_,colIndex:me,heightWithRowspan:Te,domRef:Pe,hidden:Re,width:Me,onMouseLeave:qe,onMouseEnter:We}=k,at=ee()[_],et=z[me];if(!at||!et)return null;let Xe=V?V.getRowHeight(_):Te,G=!1;!S||typeof S=="function"&&!S(at)?G=!1:h&&(G=h(at)?"expanded":"collapsed");let te=M?f.getRowIndexInPage(_):null,ye=M?f.getPageIndexForRow(_):null,Ie=n.isEditorVisibleForCell({rowIndex:_,columnId:et.id}),ut={getData:ee,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:te,horizontalLayoutPageIndex:ye,rowIndex:_,rowInfoStore:fe,hidden:Re,toggleGroupRow:K,rowHeight:Xe,rowDetailState:G,onMouseEnter:We,onMouseLeave:qe,onRowMouseEnter:u,onRowMouseLeave:d,domRef:Pe,width:Me,column:et,columnsMap:L,fieldsToColumn:W,rowStyle:R,rowClassName:I,cellStyle:T,cellClassName:y,repaintCellsKey:et.repaintCellsKey!==void 0?et.repaintCellsKey:b,visibleColumnIds:re,computedColumnOrder:B,inEditMode:Ie,getDataSourceState:ie,dataSourceApi:ge,dataSourceActions:Z,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:se};return Ll.createElement(zf,{...ut})},[s,c,u,d,V,Y,h,ee,z,L,W,p,M,K,m,f,fe,R,I,y,T,b,ie,ge,Z,i,n,r,a,l,re,B,D,A,se]),pe=(0,Nl.useMemo)(()=>{if(h)return k=>{let{rowIndex:_,domRef:me}=k,Pe=ee()[_];if(!Pe||!h(Pe)||!V)return Ll.createElement("div",{ref:me,className:ud.hidden});let{rowDetailHeight:Re,rowHeight:Me}=V.getSize(_);return Ll.createElement(rb,{rowInfo:Pe,rowDetailsCache:C,rowIndex:_,domRef:me,detailOffset:Me,rowDetailHeight:Re,rowDetailRenderer:g})}},[x,ne,g,c,h,C]);return{renderCell:ne,renderDetailRow:pe}}var ab=require("react");function lb(){let{state:o,getState:e,actions:t}=oe(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Oo(n);(0,ab.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Uc(_l,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}var ub=H(require("react"));var sb="_16lm1iw1 _16lm1iw1c _16lm1iwe";var cb=X(sb,ks);function db(o){return ub.createElement("div",{...o,className:o.className?X(cb,o.className):cb})}var Ir=H(require("react"));var pb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},fb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",mb="qy58ya4";var{rootClassName:Jw}=ze,hu=`${Jw}-LoadMask`;function ev(o){let{visible:e,children:t="Loading"}=o;return Ir.createElement("div",{className:`${pb[e?"visible":"hidden"]} ${hu}`},Ir.createElement("div",{className:`${fb} ${hu}-Overlay`}),Ir.createElement("div",{className:`${mb} ${hu}-Text`},t))}var kl=Ir.memo(ev);var gb=require("react");var tv=[Mf,`${oo}--hovered`];function ov(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function An(o){let e=Ke(),t=Mo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:S,rowDetailRenderer:y,showHoverRows:T,wrapRowsHorizontally:b,domProps:R,domRef:C,forceBodyRerenderTimestamp:I,rowHoverClassName:w,ready:v}=oe(V=>({ready:V.state.ready,columnReorderDragColumnId:V.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:V.state.forceBodyRerenderTimestamp,renderer:V.state.renderer,onRenderUpdater:V.state.onRenderUpdater,debugId:V.state.debugId,keyboardNavigation:V.state.keyboardNavigation,activeRowIndex:V.state.activeRowIndex,loadingText:V.state.loadingText,scrollStopDelay:V.state.scrollStopDelay,brain:V.state.brain,scrollerDOMRef:V.state.scrollerDOMRef,components:V.state.components,bodySize:V.state.bodySize,activeCellIndex:V.state.activeCellIndex,rowDetailRenderer:V.state.rowDetailRenderer,showHoverRows:V.state.showHoverRows,wrapRowsHorizontally:V.state.wrapRowsHorizontally,domProps:V.state.domProps,domRef:V.state.domRef,rowHoverClassName:V.state.rowHoverClassName})),P=g?.LoadMask??kl,E=n(),{computedRowHeight:M,computedRowSizeCacheForDetails:D}=E,x=D?.getRowHeight||M,{loading:A}=Ne(V=>({loading:V.dataSourceState.loading})),O=wr.useCallback(V=>{let W=e.getState(),N=V.target;if(!t&&V._from_row_detail)return;t&&(V._from_row_detail=!0);let K=dp(N,jc(),W.domRef.current),ae,re,ue,fe;K&&(re=Number(K.dataset.colIndex),fe=Number(K.dataset.rowIndex),ae=e.getComputed().computedVisibleColumns[re].id,ue=e.dataSourceApi.getRowInfoArray()[fe].id);let be={columnId:ae,colIndex:re,rowId:ue,rowIndex:fe,event:V,target:K??V.target};K&&W.cellContextMenu(be),W.contextMenu(be)},[]),{renderCell:F,renderDetailRow:z}=ib({imperativeApi:r,getComputed:n,domRef:C,bodySize:h,computed:E}),{autoFocus:L,tabIndex:B}=R??{};lb();let Y=(0,gb.useMemo)(()=>{if(!T)return;let V=[];return w&&(V=V.concat(w)),o.rowHoverClassName&&(V=V.concat(o.rowHoverClassName)),An.rowHoverClassName&&(V=V.concat(An.rowHoverClassName)),ov(V)},[T,w,o.rowHoverClassName,An.rowHoverClassName]);return wr.createElement(db,{onContextMenu:O},wr.createElement(Zm,{forceRerenderTimestamp:I,debugId:l,tabIndex:B??0,autoFocus:L??void 0,activeRowIndex:v&&s==="row"?c:null,activeCellIndex:v&&s==="cell"&&!d?S:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:b,onRenderUpdater:a,brain:f,activeCellRowHeight:x,renderCell:F,renderDetailRow:y?z:void 0,cellHoverClassNames:Y,scrollerDOMRef:m,scrollVarHostRef:C}),wr.createElement(P,{visible:A},u))}An.rowHoverClassName=tv;function hb(){return oe(o=>o.api)}function yb(o){return oe(e=>e.api.getColumnApi(o))}var Jt=ze.rootClassName,{ManagedComponentContextProvider:nv}=kt({initSetupState:Hh,forwardProps:Kh,mapPropsToState:Uh,cleanup:Bh,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:jh(),getParentState:()=>tl(o=>o),debugName:o=>Uo(o.debugId,_l)}),Sb=Ee.memo(function(){let e=Ei(),{componentState:t,api:n,initialChildren:r}=oe(L=>({componentState:L.state,api:L.api,initialChildren:L.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Ne(L=>({dataArrayLength:L.dataSourceState.dataArray.length,getDataSourceState:L.getDataSourceState,dataSourceActions:L.dataSourceActions,dataSourceApi:L.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:S,scrollStopDelay:y,brain:T,activeRowIndex:b,activeCellIndex:R}=t,{licenseKey:C}=t;C===void 0&&co.licenseKey&&(C=co.licenseKey),Cy(b,i,n),Ty(R,i,n);let{onKeyDown:I}=zy();Ee.useEffect(()=>{let L=a(),B=Nt(Y=>{L.notifyRenderRangeChange({renderStartIndex:Y[0],renderEndIndex:Y[1]})},{wait:y});return T.onVerticalRenderRangeChange(B)},[T,y]);let w=by(C),{autoFocus:v,tabIndex:P,...E}=t.domProps??{},M=Ap(E);Ee.useEffect(()=>{T.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Hg(),kS(),IS();let{menuPortal:D}=bS(),{menuPortal:x}=MS(),{menuPortal:A}=AS(),{menuPortal:O}=PS();Ee.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(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let F=KS();Ee.useEffect(()=>{if(e){let L=e.getSnapshot();u.current=L.getMasterState().portalDOMRef.current}},[]);let z=r??Ee.createElement(Ee.Fragment,null,Ee.createElement(hc,null),Ee.createElement(An,null));return Ee.createElement("div",{"data-debug-id":F,onKeyDown:I,ref:c,...M},z,Ee.createElement("div",{ref:u,className:X(`${St}Portal`,dd[1e7],ki.absolute,sd[0],id[0])},D,x,A,O),g?Ee.createElement(Mr,{key:"row-height",varName:g,onChange:d}):null,Ee.createElement(Mr,{key:"flashing-duration",allowInts:!0,varName:he.components.Cell.flashingDuration,onChange:p}),h?Ee.createElement(Mr,{key:"row-detail-height",varName:h,onChange:f}):null,S?Ee.createElement(Mr,{key:"column-header-height",varName:S,onChange:m}):null,w==="valid"?null:Ee.createElement(Ig,{invalid:w==="invalid"}),Ee.createElement(RS,null))});function rv({children:o,store:e}){let{componentActions:t,componentState:n}=zt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Le(n),l=my({state:n,actions:t,getState:a}),s=Le(l),c=Ei(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=no(),[m]=Ee.useState(()=>Vg({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),Ee.useLayoutEffect(()=>{e.notify()}),wi(r,h=>{let S={width:h.width,height:h.height};t.bodySize=S},{earlyAttach:!0,debounce:50}),Ee.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),Ee.createElement(Sb,null)}var co=function(o){let[e]=Ee.useState(()=>Ry()),t=ji();return Ee.createElement(nv,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:gi,columnHeaderHeight:mi,...o},Ee.createElement(ta,null,Ee.createElement(t.Provider,{value:e},Ee.createElement(rv,{children:o.children,store:e}))))};co.Header=hc;co.Body=An;co.HScrollSyncContent=FS;co.Footer=()=>Ee.createElement(fd,null);co.GroupingToolbar=ZS;var bb=H(require("react"));function iv(o){let{DataSource:e}=fr({nodesKey:"children",...o});return bb.createElement(e,null,o.children??null)}var Tb=H(require("react"));var yu=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:n});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(c)};function Cb(o){return Tb.createElement(co,{...o})}var zl=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 n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=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,n(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=Ye(`IT:${e}:DataQuery`)}};function _n(o){if(Array.isArray(o))return o.map(_n);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=_n(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Po=class Po{constructor(e){this.queryCache=new q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=_n(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new zl(`${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:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=_n(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=_n(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=_n(e);this.queryCache.delete(t)};if(this.options=e,Po.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)}Po.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Po.clients.get(e);t&&t.destroy()}static destroyAll(){Po.clients.forEach(e=>{Po.destroy(e.name)})}destroy(){Po.clients.delete(this.options.name)}};Po.clients=new Map;var Su=Po;var av={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},Rb={instantEdit:av};var lv=require("react");function Ib(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Gl=class Gl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Gl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Gl.DEFAULT_SIZE=10;var Vl=Gl;var Kl=class Kl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Kl.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.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[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Kl.DEFAULT_SIZE=10;var Hl=Kl;var On=require("react"),sv=(o,e)=>o.every((t,n)=>t===e[n]),wb=(o,e)=>{let t=(0,On.useRef)(e),n=sv(e,t.current),r=(0,On.useRef)(!0);t.current=e;let i=(0,On.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,On.useRef)(o);l.current=o,(0,On.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var en=require("react"),vb=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Bl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,en.useRef)(t),a=(0,en.useRef)(n),l=vb(t,i.current,r),s=!vb(n,a.current,r),c=(0,en.useRef)(!0);i.current=t,a.current=n;let u=(0,en.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,en.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,en.useEffect)(()=>{if(!c.current)return p.current()},d)};var Ft=H(require("react"));var Pb=Q(J.currentFlashingDuration),cv=({children:o})=>Ft.createElement(Ft.Fragment,null,o),Db=1e3,xb={up:ra({direction:"up"}).split(" "),down:ra({direction:"down"}).split(" "),neutral:ra({direction:"neutral"}).split(" ")},bu=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=cv}=o;return Ft.forwardRef((i,a)=>{let l=$r(),{flashingDurationCSSVarValue:s}=oe(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??Db:e??Db,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,S=Ft.useRef(!0),y=Ft.useRef(d),T=S.current?null:y.current;S.current=!1;let b=Ft.useRef(void 0),R=Ft.useRef(void 0),C=Ft.useRef(void 0);return Bl(()=>{if(d===y.current)return;let I=()=>{let E=m.current;if(b.current&&(clearTimeout(b.current),b.current=void 0),C.current&&(clearTimeout(C.current),C.current=void 0),R.current&&E){let M=R.current,D=xb[M];E.classList.remove(...t?[t,...D]:D),E.style.removeProperty(Pb),R.current=void 0}};y.current=d;let w=m.current;if(!w)return;I();let v=typeof d=="number"?d>T?"up":"down":"neutral",P=xb[v];return w.style.setProperty(Pb,`${c}`),w.classList.add(...t?[t,...P]:P),R.current=v,b.current=setTimeout(I,c),I},{same:[h,g],different:[d]}),Ft.createElement("div",{ref:u,...i,className:X(i.className)},n({children:i.children,oldValue:T}))})},Eb=bu();var rt=H(require("react")),vr=require("react");var Mb=require("react-dom");function Ab(o){let[e,t]=rt.useState(null);return(0,vr.useEffect)(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?rt.createElement(_b.Provider,{value:{getState:e}},rt.createElement(uv,null)):null}var _b=rt.createContext({getState:()=>null});function uv(){let o=rt.useContext(_b),{getState:e}=o,[,t]=qt(),n=e().renderer.cellManager;(0,vr.useEffect)(()=>{let s=Nt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,vr.useRef)(null),l=(0,vr.useRef)(null);return rt.createElement("div",{style:{overflow:"auto"}},(0,Mb.createPortal)(rt.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),rt.createElement("table",{style:{borderCollapse:"collapse"}},rt.createElement("thead",null,rt.createElement("tr",null,i.map(s=>rt.createElement("th",{key:s,"data-col-index":s},s)))),rt.createElement("tbody",null,r.map(s=>rt.createElement("tr",{key:s,"data-row-index":s},i.map(c=>rt.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},rt.createElement("button",{onClick:()=>{let u=n.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var dv={CheckBox:zo,LoadMask:kl,MenuIcon:Zr,StringFilterEditor:$n,NumberFilterEditor:$i};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterFunction,defaultFilterTypes,defaultTreeFilterFunction,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
30
30
|
//!collapsed || lazyLoad;
|